소스 검색

fix:增加数据集合修改时间

jimmyyem 1 일 전
부모
커밋
8ae9bafa04
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 2
      internal/logic/agent/get_agent_list_logic.go

+ 9 - 2
internal/logic/agent/get_agent_list_logic.go

@@ -2,9 +2,9 @@ package agent
 
 import (
 	"context"
-
 	"wechat-api/ent/agent"
 	"wechat-api/ent/predicate"
+	"wechat-api/hook/fastgpt"
 	"wechat-api/internal/svc"
 	"wechat-api/internal/types"
 	"wechat-api/internal/utils/dberrorhandler"
@@ -65,12 +65,19 @@ func (l *GetAgentListLogic) GetAgentList(req *types.AgentListReq) (*types.AgentL
 	resp.Data.Total = data.PageDetails.Total
 
 	for _, v := range data.List {
+
+		// 这里是获得数据集合的修改时间
+		var updatedAt int64
+		info, err := fastgpt.GetCollectionDetail(v.CollectionID)
+		if err == nil {
+			updatedAt = info.Data.UpdateTime.UnixMilli()
+		}
 		resp.Data.Data = append(resp.Data.Data,
 			types.AgentInfo{
 				BaseIDInfo: types.BaseIDInfo{
 					Id:        &v.ID,
 					CreatedAt: pointy.GetPointer(v.CreatedAt.UnixMilli()),
-					UpdatedAt: pointy.GetPointer(v.UpdatedAt.UnixMilli()),
+					UpdatedAt: pointy.GetPointer(updatedAt),
 				},
 				Name:         &v.Name,
 				Role:         &v.Role,