feat(server): 模型目录 models[] 增加 coverUrl(封面缩略图)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user