|
|
@ -104,7 +104,7 @@ func (s *userServer) SetReceiveMessageOpt(ctx context.Context, req *pbUser.SetRe
|
|
|
|
resp := pbUser.SetReceiveMessageOptResp{CommonResp: &pbUser.CommonResp{}}
|
|
|
|
resp := pbUser.SetReceiveMessageOptResp{CommonResp: &pbUser.CommonResp{}}
|
|
|
|
|
|
|
|
|
|
|
|
for _, v := range req.ConversationIDList {
|
|
|
|
for _, v := range req.ConversationIDList {
|
|
|
|
resp.OptResultList = append(resp.OptResultList, &pbUser.OptResult{ConversationId: v, Result: 0})
|
|
|
|
resp.ConversationOptResultList = append(resp.ConversationOptResultList, &pbUser.OptResult{ConversationID: v, Result: 0})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.NewInfo(req.OperationID, "SetReceiveMessageOpt rpc return ", resp.String())
|
|
|
|
log.NewInfo(req.OperationID, "SetReceiveMessageOpt rpc return ", resp.String())
|
|
|
|
return &resp, nil
|
|
|
|
return &resp, nil
|
|
|
@ -112,14 +112,14 @@ func (s *userServer) SetReceiveMessageOpt(ctx context.Context, req *pbUser.SetRe
|
|
|
|
|
|
|
|
|
|
|
|
func (s *userServer) GetReceiveMessageOpt(ctx context.Context, req *pbUser.GetReceiveMessageOptReq) (*pbUser.GetReceiveMessageOptResp, error) {
|
|
|
|
func (s *userServer) GetReceiveMessageOpt(ctx context.Context, req *pbUser.GetReceiveMessageOptReq) (*pbUser.GetReceiveMessageOptResp, error) {
|
|
|
|
log.NewInfo(req.OperationID, "GetReceiveMessageOpt args ", req.String())
|
|
|
|
log.NewInfo(req.OperationID, "GetReceiveMessageOpt args ", req.String())
|
|
|
|
m, err := db.DB.GetMultiConversationMsgOpt(req.FromUserID, req.ConversationIdList)
|
|
|
|
m, err := db.DB.GetMultiConversationMsgOpt(req.FromUserID, req.ConversationIDList)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.NewError(req.OperationID, "GetMultiConversationMsgOpt failed ", err.Error(), req.FromUserID, req.ConversationIdList)
|
|
|
|
log.NewError(req.OperationID, "GetMultiConversationMsgOpt failed ", err.Error(), req.FromUserID, req.ConversationIDList)
|
|
|
|
return &pbUser.GetReceiveMessageOptResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
|
|
|
return &pbUser.GetReceiveMessageOptResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
resp := pbUser.GetReceiveMessageOptResp{CommonResp: &pbUser.CommonResp{}}
|
|
|
|
resp := pbUser.GetReceiveMessageOptResp{CommonResp: &pbUser.CommonResp{}}
|
|
|
|
for k, v := range m {
|
|
|
|
for k, v := range m {
|
|
|
|
resp.ConversationOptResultList = append(resp.ConversationOptResultList, &pbUser.OptResult{ConversationId: k, Result: int32(v)})
|
|
|
|
resp.ConversationOptResultList = append(resp.ConversationOptResultList, &pbUser.OptResult{ConversationID: k, Result: int32(v)})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.NewInfo(req.OperationID, "GetReceiveMessageOpt rpc return ", resp.String())
|
|
|
|
log.NewInfo(req.OperationID, "GetReceiveMessageOpt rpc return ", resp.String())
|
|
|
|
return &resp, nil
|
|
|
|
return &resp, nil
|
|
|
@ -134,7 +134,7 @@ func (s *userServer) GetAllConversationMsgOpt(ctx context.Context, req *pbUser.G
|
|
|
|
}
|
|
|
|
}
|
|
|
|
resp := pbUser.GetAllConversationMsgOptResp{CommonResp: &pbUser.CommonResp{}}
|
|
|
|
resp := pbUser.GetAllConversationMsgOptResp{CommonResp: &pbUser.CommonResp{}}
|
|
|
|
for k, v := range m {
|
|
|
|
for k, v := range m {
|
|
|
|
resp.ConversationOptResultList = append(resp.ConversationOptResultList, &pbUser.OptResult{ConversationId: k, Result: int32(v)})
|
|
|
|
resp.ConversationOptResultList = append(resp.ConversationOptResultList, &pbUser.OptResult{ConversationID: k, Result: int32(v)})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.NewInfo(req.OperationID, "GetAllConversationMsgOpt rpc return ", resp.String())
|
|
|
|
log.NewInfo(req.OperationID, "GetAllConversationMsgOpt rpc return ", resp.String())
|
|
|
|
return &resp, nil
|
|
|
|
return &resp, nil
|
|
|
|