Przeglądaj źródła

Merge branch 'yhg_20250327' into debug

jimmyyem 1 tydzień temu
rodzic
commit
11e65ef939

+ 1 - 2
desc/wechat/usage_detail.api

@@ -70,8 +70,7 @@ type (
 		Type *int `json:"type,optional"`
         BotId  *string `json:"botId,optional"`
 		ReceiverId  *string `json:"receiverId,optional"`
-		StartDate *string `json:"startDate,optional"`
-		EndDate *string `json:"endDate,optional"`
+		SearchDate []string `json:"searchDate,optional"`
     }
 
 	UsageDetailResp {

+ 4 - 5
internal/logic/UsageDetail/get_usage_detail_list_logic.go

@@ -52,16 +52,15 @@ func (l *GetUsageDetailListLogic) GetUsageDetailList(req *types.UsageDetailListR
 		predicates = append(predicates, usagedetail.ReceiverID(*req.ReceiverId))
 	}
 	// 这里是为限制时间段
-	if req.StartDate != nil && *req.StartDate != "" {
-		startDate, err := time.Parse("2006-01-02 15:04:05", *req.StartDate)
+	if req.SearchDate != nil && len(req.SearchDate) == 2 {
+		startDate, err := time.Parse("2006-01-02 15:04:05", req.SearchDate[0])
 		if err != nil {
 			l.Logger.Errorf("时间字符串startDate转换错误: %v", err)
 		} else {
 			predicates = append(predicates, usagedetail.CreatedAtGTE(startDate))
 		}
-	}
-	if req.EndDate != nil && *req.EndDate != "" {
-		endDate, err := time.Parse("2006-01-02 15:04:05", *req.EndDate)
+
+		endDate, err := time.Parse("2006-01-02 15:04:05", req.SearchDate[1])
 		if err != nil {
 			l.Logger.Errorf("时间字符串endDate转换错误: %v", err)
 		} else {

+ 5 - 6
internal/types/types.go

@@ -3414,12 +3414,11 @@ type UsageDetailListInfo struct {
 type UsageDetailListReq struct {
 	PageInfo
 	// 租户id
-	OrganizationId *uint64 `json:"organizationId,optional"`
-	Type           *int    `json:"type,optional"`
-	BotId          *string `json:"botId,optional"`
-	ReceiverId     *string `json:"receiverId,optional"`
-	StartDate      *string `json:"startDate,optional"`
-	EndDate        *string `json:"endDate,optional"`
+	OrganizationId *uint64  `json:"organizationId,optional"`
+	Type           *int     `json:"type,optional"`
+	BotId          *string  `json:"botId,optional"`
+	ReceiverId     *string  `json:"receiverId,optional"`
+	SearchDate     []string `json:"searchDate,optional"`
 }
 
 // swagger:model UsageDetailResp