Commit 25816068 by 李洪

删除common

parent 2e1b7f2f
...@@ -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())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment