Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
im-microservice
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Li Feifei
im-microservice
Commits
25816068
Commit
25816068
authored
Jul 15, 2020
by
李洪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除common
parent
2e1b7f2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
db.go
sevice/im_user_relationship/db.go
+6
-4
No files found.
sevice/im_user_relationship/db.go
View file @
25816068
...
@@ -4,11 +4,12 @@ import (
...
@@ -4,11 +4,12 @@ import (
"errors"
"errors"
"im-microservice/pb"
"im-microservice/pb"
"im-microservice/db"
"im-microservice/helper"
"github.com/astaxie/beego/orm"
"github.com/astaxie/beego/orm"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/grpc/status"
"im-microservice/db"
"im-microservice/helper"
)
)
var
(
var
(
...
@@ -32,7 +33,7 @@ func IsUserRelationship(accid, faccid, key string) bool {
...
@@ -32,7 +33,7 @@ func IsUserRelationship(accid, faccid, key string) bool {
Filter
(
db_field_faccid
,
faccid
)
.
Filter
(
"appkey"
,
key
)
.
Exist
()
Filter
(
db_field_faccid
,
faccid
)
.
Filter
(
"appkey"
,
key
)
.
Exist
()
}
}
func
GetUserRelationshipOne
(
accid
,
faccid
,
key
string
)
(
db
.
ImUserRelationship
,
error
)
{
func
GetUserRelationshipOne
(
accid
,
faccid
,
key
string
)
(
db
.
ImUserRelationship
,
error
)
{
var
one
db
.
ImUserRelationship
var
one
db
.
ImUserRelationship
err
:=
db
.
MysqlClient
.
QueryTable
(
db_tabel
)
.
Filter
(
db_field_accid
,
accid
)
.
err
:=
db
.
MysqlClient
.
QueryTable
(
db_tabel
)
.
Filter
(
db_field_accid
,
accid
)
.
Filter
(
db_field_faccid
,
faccid
)
.
Filter
(
"appkey"
,
key
)
.
One
(
&
one
)
Filter
(
db_field_faccid
,
faccid
)
.
Filter
(
"appkey"
,
key
)
.
One
(
&
one
)
...
@@ -40,6 +41,7 @@ func GetUserRelationshipOne (accid, faccid, key string) (db.ImUserRelationship,
...
@@ -40,6 +41,7 @@ func GetUserRelationshipOne (accid, faccid, key string) (db.ImUserRelationship,
return
one
,
err
return
one
,
err
}
}
//是否是对方黑名单
//是否是对方黑名单
func
IsBlack
(
accid
,
faccid
,
key
string
)
bool
{
func
IsBlack
(
accid
,
faccid
,
key
string
)
bool
{
return
db
.
MysqlClient
.
QueryTable
(
db_tabel
)
.
Filter
(
db_field_accid
,
faccid
)
.
return
db
.
MysqlClient
.
QueryTable
(
db_tabel
)
.
Filter
(
db_field_accid
,
faccid
)
.
...
@@ -76,7 +78,7 @@ func AddUserRelationship(in *pb.UserRelationshipAddRequest) error {
...
@@ -76,7 +78,7 @@ func AddUserRelationship(in *pb.UserRelationshipAddRequest) error {
ts
.
Blacklist
=
open
ts
.
Blacklist
=
open
ts
.
Mute
=
open
ts
.
Mute
=
open
ts
.
Createtime
=
now
ts
.
Createtime
=
now
ts
.
Appkey
=
in
.
Common
.
Appkey
ts
.
Appkey
=
in
.
Appkey
_
,
err1
:=
db
.
MysqlClient
.
Insert
(
&
ts
)
_
,
err1
:=
db
.
MysqlClient
.
Insert
(
&
ts
)
if
err1
!=
nil
{
if
err1
!=
nil
{
return
status
.
Error
(
codes
.
Internal
,
err
.
Error
())
return
status
.
Error
(
codes
.
Internal
,
err
.
Error
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment