nil return modify

pull/131/head
Gordon 3 years ago
parent 65456d331b
commit 1ce2a86f37

@ -59,7 +59,7 @@ type SeqListData struct {
func (ws *WServer) argsValidate(m *Req, r int32) (isPass bool, errCode int32, errMsg string, returnData interface{}) {
switch r {
case constant.WSSendMsg:
data := open_im_sdk.UserSendMsgReq{}
data := open_im_sdk.MsgData{}
if err := proto.Unmarshal(m.Data, &data); err != nil {
log.ErrorByKv("Decode Data struct err", "", "err", err.Error(), "reqIdentifier", r)
return false, 203, err.Error(), nil

@ -104,7 +104,7 @@ func (s *userServer) SetReceiveMessageOpt(ctx context.Context, req *pbUser.SetRe
resp := pbUser.SetReceiveMessageOptResp{CommonResp: &pbUser.CommonResp{}}
for _, v := range req.ConversationIDList {
resp.ConversationOptResultList = append(resp.ConversationOptResultList, &pbUser.OptResult{ConversationID: v, Result: 0})
resp.ConversationOptResultList = append(resp.ConversationOptResultList, &pbUser.OptResult{ConversationID: v, Result: req.Opt})
}
log.NewInfo(req.OperationID, "SetReceiveMessageOpt rpc return ", resp.String())
return &resp, nil

@ -100,7 +100,7 @@ func SelectAllUserID() ([]string, error) {
return nil, err
}
var resultArr []string
err = dbConn.Table("user").Select([]string{"user_id"}).Scan(&resultArr).Error
err = dbConn.Table("user").Select("user_id").Scan(&resultArr).Error
if err != nil {
return nil, err
}

Loading…
Cancel
Save