This commit is contained in:
wangchuxiao
2022-02-21 18:50:11 +08:00
parent a3fb32dfc6
commit 139ef08af3
4 changed files with 41 additions and 33 deletions
+6 -4
View File
@@ -32,8 +32,8 @@ func GetMessagesStatistics(c *gin.Context) {
client := pb.NewUserClient(etcdConn)
respPb, err := client.GetMessageStatistics(context.Background(), &reqPb)
if err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetMessageStatistics failed", err.Error())
openIMHttp.RespHttp200(c, err, resp)
log.NewError("0", utils.GetSelfFuncName(), err.Error())
return
}
// utils.CopyStructFields(&resp, respPb)
@@ -77,7 +77,7 @@ func GetUserStatistics(c *gin.Context) {
client := pb.NewUserClient(etcdConn)
respPb, err := client.GetUserStatistics(context.Background(), &reqPb)
if err != nil {
log.NewError("0", utils.GetSelfFuncName(), err.Error())
log.NewError("0", utils.GetSelfFuncName(), "GetUserStatistics failed", err.Error())
openIMHttp.RespHttp200(c, err, nil)
return
}
@@ -132,6 +132,7 @@ func GetGroupStatistics(c *gin.Context) {
client := pb.NewUserClient(etcdConn)
respPb, err := client.GetGroupStatistics(context.Background(), &reqPb)
if err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroupStatistics failed", err.Error())
openIMHttp.RespHttp200(c, err, nil)
return
}
@@ -179,6 +180,7 @@ func GetActiveUser(c *gin.Context) {
client := pb.NewUserClient(etcdConn)
respPb, err := client.GetActiveUser(context.Background(), &reqPb)
if err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetActiveUser failed ", err.Error())
openIMHttp.RespHttp200(c, err, nil)
return
}
@@ -194,7 +196,7 @@ func GetActiveGroup(c *gin.Context) {
)
reqPb.StatisticsReq = &pb.StatisticsReq{}
if err := c.ShouldBindQuery(&req); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
return
}
@@ -203,7 +205,7 @@ func GetActiveGroup(c *gin.Context) {
client := pb.NewUserClient(etcdConn)
respPb, err := client.GetActiveGroup(context.Background(), &reqPb)
if err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
log.NewError("0", utils.GetSelfFuncName(), "GetActiveGroup failed ", err.Error())
openIMHttp.RespHttp200(c, err, nil)
return
}