This commit is contained in:
2023-04-28 14:23:19 +08:00
parent d911d7eb87
commit bb58879595
8 changed files with 63 additions and 88 deletions

View File

@@ -63,6 +63,7 @@ type Model struct {
ModelPath string `json:"model_path"` // 模型路徑
Status string `json:"status"` // (waiting|running|success|error)
Progress int `json:"progress"` // (0-100)
Image string `json:"image"` // 封面圖片實際地址
Tags string `json:"tags"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
@@ -249,10 +250,12 @@ GET /api/models
Method | URL | Info
-------|--------------------------------|------------------
GET | /api/models | 獲取所有模型
GET | /api/models?user=1234 | 僅取指定用戶的(按用戶ID過濾)
GET | /api/models?tag=xxx | 按標籤分類篩選
GET | /api/models?public=true | 僅取公開的
GET | /api/models?public=false | 僅取私有的
POST | /api/models | 創建一個模型
* 如果未登錄, 返回的結果將過濾掉無權限查看的內容
* 如果已登錄, 返回的結果將包含私有的