Browse Source

Merge branch 'feature/dashboard'

* feature/dashboard:
  优化错误提示
boweniac 3 months ago
parent
commit
ce3a0ca55b
1 changed files with 4 additions and 2 deletions
  1. 4 2
      internal/logic/dashboard/get_wxs_logic.go

+ 4 - 2
internal/logic/dashboard/get_wxs_logic.go

@@ -112,8 +112,9 @@ func (l *GetWxsLogic) GetWxs(req *types.WxReq) (resp *types.WxResp, err error) {
 			Where(predicatesH...).
 			Order(ent.Desc(usagestatistichour.FieldAddtime)).
 			First(l.ctx)
+		l.Infof("----------------l.svcCtx.DB.UsageStatisticHour 1--------------: %+v", err)
 		if err != nil {
-			return nil, err
+			return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
 		}
 		if lastHourData == nil {
 			return nil, err
@@ -126,8 +127,9 @@ func (l *GetWxsLogic) GetWxs(req *types.WxReq) (resp *types.WxResp, err error) {
 		predicatesHour = append(predicatesHour, usagestatistichour.BotIDIn(wxIds...))
 		predicatesHour = append(predicatesHour, usagestatistichour.Addtime(lastHourData.Addtime))
 		usageStatisticHour, err := l.svcCtx.DB.UsageStatisticHour.Query().Where(predicatesHour...).Page(l.ctx, req.Page, req.PageSize)
+		l.Infof("----------------l.svcCtx.DB.UsageStatisticHour 2--------------: %+v", err)
 		if err != nil {
-			return nil, err
+			return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
 		}
 		if usageStatisticHour != nil && usageStatisticHour.List != nil {
 			resp.Data.Total = usageStatisticHour.PageDetails.Total