Commit 25816068 by 李洪

删除common

parent 2e1b7f2f
......@@ -4,11 +4,12 @@ import (
"errors"
"im-microservice/pb"
"im-microservice/db"
"im-microservice/helper"
"github.com/astaxie/beego/orm"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"im-microservice/db"
"im-microservice/helper"
)
var (
......@@ -32,7 +33,7 @@ func IsUserRelationship(accid, faccid, key string) bool {
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
err := db.MysqlClient.QueryTable(db_tabel).Filter(db_field_accid, accid).
Filter(db_field_faccid, faccid).Filter("appkey", key).One(&one)
......@@ -40,6 +41,7 @@ func GetUserRelationshipOne (accid, faccid, key string) (db.ImUserRelationship,
return one, err
}
//是否是对方黑名单
func IsBlack(accid, faccid, key string) bool {
return db.MysqlClient.QueryTable(db_tabel).Filter(db_field_accid, faccid).
......@@ -76,7 +78,7 @@ func AddUserRelationship(in *pb.UserRelationshipAddRequest) error {
ts.Blacklist = open
ts.Mute = open
ts.Createtime = now
ts.Appkey = in.Common.Appkey
ts.Appkey = in.Appkey
_, err1 := db.MysqlClient.Insert(&ts)
if err1 != nil {
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