Commit 21ffb012 by 李洪

修改用户退出

parent e70a663b
......@@ -110,7 +110,13 @@ func (u *ImUserServer) ImUserLoginOut(ctx context.Context, in *pb.ImUserOutReque
imUserOut := &ImUserQ{
Accid: in.GetAccid(),
}
if res, _ := SaveLoginOut(imUserOut.Accid); res != 1 {
// 参数验证是否合法
if err = helper.Valiator(imUserOut); err != nil {
return
}
m := make(map[string]interface{})
m["login_status"] = 0
if res, _ := UpdateImUser(imUserOut.Accid, m); res != 1 {
err = errors.New("用户更改登录状态信息失败")
return
}
......@@ -136,11 +142,9 @@ func (u *ImUserServer) ImUserForbiddenWords(ctx context.Context, in *pb.ImUserSe
//用户禁音视频
func (u *ImUserServer) ImUserForbiddenAV(ctx context.Context, in *pb.ImUserSetRequest) (reply *pb.ImUserSetReply, err error) {
var mute int64
var mute int64 = 0
if in.GetMute() == true {
mute = 1
} else {
mute = 0
}
m := make(map[string]interface{})
m["mute_audio_video"] = mute
......
......@@ -65,17 +65,6 @@ func SaveUpdatetime(mobile string, platfrom string) (int64, error) {
return res, nil
}
//用户退出
func SaveLoginOut(accid string) (int64, error) {
orm_params := make(orm.Params)
orm_params["login_status"] = 0
res, err := db.MysqlClient.QueryTable(u_table_name).Filter("accid", accid).Update(orm_params)
if err != nil {
return 0, err
}
return res, nil
}
//修改用户信息
func UpdateImUser(accid string, m map[string]interface{}) (int64, error) {
orm_params := make(orm.Params)
......
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