Explorar o código

Merge branch 'fixbug/534-huaguo-updatedAt' into debug

jimmyyem hai 3 días
pai
achega
632843dc82

+ 1 - 0
desc/wechat/agent.api

@@ -267,6 +267,7 @@ type (
 
 		// The API list data | BatchMsg列表数据
 		Data  []DataSimpleInfo  `json:"data"`
+		UpdatedAt int64     `json:"updatedAt,optional"`
 	}
 
 	// Data create request | 信息请求体

+ 11 - 0
internal/logic/agent_base/get_agent_base_list_logic.go

@@ -2,6 +2,7 @@ package agent_base
 
 import (
 	"context"
+	"fmt"
 	"github.com/zeromicro/go-zero/core/errorx"
 	"wechat-api/hook/fastgpt"
 
@@ -36,8 +37,18 @@ func (l *GetAgentBaseListLogic) GetAgentBaseList(req *types.DataListReq) (*types
 		return nil, errorx.NewInvalidArgumentError("fastgpt get data list failed " + err.Error())
 	}
 
+	resp2, err := fastgpt.GetCollectionDetail(*req.CollectionId)
+	fmt.Printf("resp2=%v  resp2.Data=%v resp2.Data.UpdateTime=%v\n", resp2, resp2.Data, resp2.Data.UpdateTime)
+	fmt.Println(resp2.Data.UpdateTime.UnixMilli(), resp2.Code)
+	if err != nil {
+		return nil, errorx.NewInvalidArgumentError("fastgpt get collection detail failed " + err.Error())
+	}
+
 	dataResp.Data = types.BatchSimpleInfo{}
 	dataResp.Data.Total = uint64(resp.Data.Total)
+	if resp2.Code == 200 {
+		dataResp.Data.UpdatedAt = resp2.Data.UpdateTime.UnixMilli()
+	}
 	if resp.Code == 200 && resp.Data.Total > 0 {
 		for _, val := range resp.Data.Data {
 			dataResp.Data.Data = append(dataResp.Data.Data, types.DataSimpleInfo{

+ 2 - 1
internal/types/types.go

@@ -720,7 +720,8 @@ type DataListResp struct {
 type BatchSimpleInfo struct {
 	BaseListInfo
 	// The API list data | BatchMsg列表数据
-	Data []DataSimpleInfo `json:"data"`
+	Data      []DataSimpleInfo `json:"data"`
+	UpdatedAt int64            `json:"updatedAt,optional"`
 }
 
 // Data create request | 信息请求体