From 09bdaf36cc64307f4d61e67eb45dd0f8b31d47a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=8C?= <259278618@qq.com> Date: Mon, 31 Aug 2026 16:22:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(server):=20=E6=A8=A1=E5=9E=8B=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=20models[]=20=E5=A2=9E=E5=8A=A0=20coverUrl=EF=BC=88?= =?UTF-8?q?=E5=B0=81=E9=9D=A2=E7=BC=A9=E7=95=A5=E5=9B=BE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/biz/model/dto/training.go | 1 + server/biz/service/model_version.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/server/biz/model/dto/training.go b/server/biz/model/dto/training.go index 83f50d3..851a098 100644 --- a/server/biz/model/dto/training.go +++ b/server/biz/model/dto/training.go @@ -457,6 +457,7 @@ type ModelCatalogItem struct { Notes string `json:"notes"` PublishedAt *gtime.Time `json:"publishedAt"` DownloadUrl string `json:"downloadUrl"` // /download/trainings/<文件名前缀>.tflite(前缀空回退数据集名) + CoverUrl string `json:"coverUrl"` // /api/v1/app/cover?namePrefix=<前缀>(App 模型清单缩略图) } type ModelCatalogRes struct { diff --git a/server/biz/service/model_version.go b/server/biz/service/model_version.go index 3bd078e..54d0469 100644 --- a/server/biz/service/model_version.go +++ b/server/biz/service/model_version.go @@ -3,6 +3,7 @@ package service import ( "context" "encoding/json" + "net/url" "observer-server/biz/dao" "observer-server/biz/model/dto" @@ -39,6 +40,7 @@ func (s *modelVersionService) ClientCatalog(ctx context.Context) (*dto.ModelCata Notes: v.Notes, PublishedAt: v.CreatedAt, DownloadUrl: "/download/trainings/" + modelNames[v.DatasetId] + ".tflite", + CoverUrl: "/api/v1/app/cover?namePrefix=" + url.PathEscape(modelNames[v.DatasetId]), }) } return &dto.ModelCatalogRes{List: items}, nil