mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 09:36:00 +08:00
nil return modify
This commit is contained in:
@@ -39,8 +39,10 @@ func GetAllConversationMessageOpt(c *gin.Context) {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()})
|
||||
return
|
||||
}
|
||||
resp := api.GetAllConversationMessageOptResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}}
|
||||
resp.ConversationOptResultList = RpcResp.ConversationOptResultList
|
||||
resp := api.GetAllConversationMessageOptResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, ConversationOptResultList: RpcResp.ConversationOptResultList}
|
||||
if len(RpcResp.ConversationOptResultList) == 0 {
|
||||
resp.ConversationOptResultList = []*user.OptResult{}
|
||||
}
|
||||
log.NewInfo(req.OperationID, "GetAllConversationMsgOpt api return: ", resp)
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
@@ -69,8 +71,10 @@ func GetReceiveMessageOpt(c *gin.Context) {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetReceiveMessageOpt rpc failed, " + err.Error()})
|
||||
return
|
||||
}
|
||||
resp := api.GetReceiveMessageOptResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}}
|
||||
resp.ConversationOptResultList = RpcResp.ConversationOptResultList
|
||||
resp := api.GetReceiveMessageOptResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, ConversationOptResultList: RpcResp.ConversationOptResultList}
|
||||
if len(RpcResp.ConversationOptResultList) == 0 {
|
||||
resp.ConversationOptResultList = []*user.OptResult{}
|
||||
}
|
||||
log.NewInfo(req.OperationID, "GetReceiveMessageOpt api return: ", resp)
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
@@ -99,8 +103,10 @@ func SetReceiveMessageOpt(c *gin.Context) {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "SetReceiveMessageOpt rpc failed, " + err.Error()})
|
||||
return
|
||||
}
|
||||
resp := api.SetReceiveMessageOptResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}}
|
||||
resp.OptResultList = RpcResp.OptResultList
|
||||
resp := api.SetReceiveMessageOptResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, OptResultList: RpcResp.OptResultList}
|
||||
if len(RpcResp.OptResultList) == 0 {
|
||||
resp.OptResultList = []*user.OptResult{}
|
||||
}
|
||||
log.NewInfo(req.OperationID, "SetReceiveMessageOpt api return: ", resp)
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user