註釋
This commit is contained in:
		
							
								
								
									
										58
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										58
									
								
								README.md
									
									
									
									
									
								
							@@ -47,12 +47,11 @@ WS     | /api/{name}/{item_id}          | Websocket 連接對象
 | 
			
		||||
對象模型:
 | 
			
		||||
```go
 | 
			
		||||
type ListView struct {
 | 
			
		||||
	Code     int           `json:"code"`
 | 
			
		||||
	Page     int           `json:"page"`
 | 
			
		||||
	PageSize int           `json:"page_size"`
 | 
			
		||||
	Total    int           `json:"total"`
 | 
			
		||||
	Next     bool          `json:"next"`
 | 
			
		||||
	List     []interface{} `json:"list"`
 | 
			
		||||
	Page     int           `json:"page"`      // 当前页码
 | 
			
		||||
	PageSize int           `json:"page_size"` // 分頁大小
 | 
			
		||||
	Total    int           `json:"total"`     // 數據總量
 | 
			
		||||
	Next     bool          `json:"next"`      // 可否翻頁
 | 
			
		||||
	List     []interface{} `json:"list"`      // 數據列表
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type Model struct {
 | 
			
		||||
@@ -74,8 +73,8 @@ type Task struct {
 | 
			
		||||
	ID        int    `json:"id"`
 | 
			
		||||
	Name      string `json:"name"`
 | 
			
		||||
	Type      string `json:"type"`     // 任務類型(訓練|推理)
 | 
			
		||||
	Status    string `json:"status"`   // (waiting|running|success|error)
 | 
			
		||||
	Progress  int    `json:"progress"` // (0-100)
 | 
			
		||||
	Status    string `json:"status"`   // 任務狀態(waiting|running|success|error)
 | 
			
		||||
	Progress  int    `json:"progress"` // 任務進度(0-100)
 | 
			
		||||
	CreatedAt string `json:"created_at"`
 | 
			
		||||
	UpdatedAt string `json:"updated_at"`
 | 
			
		||||
	UserID    int    `json:"user_id"`
 | 
			
		||||
@@ -86,13 +85,13 @@ type Image struct {
 | 
			
		||||
	Name              string  `json:"name"`
 | 
			
		||||
	Width             int     `json:"width"`
 | 
			
		||||
	Height            int     `json:"height"`
 | 
			
		||||
	Prompt            string  `json:"prompt"`
 | 
			
		||||
	NegativePrompt    string  `json:"negative_prompt"`
 | 
			
		||||
	NumInferenceSteps int     `json:"num_inference_steps"` // Number of inference steps (minimum: 1; maximum: 500)
 | 
			
		||||
	GuidanceScale     float32 `json:"guidance_scale"`      // Scale for classifier-free guidance (minimum: 1; maximum: 20)
 | 
			
		||||
	Prompt            string  `json:"prompt"`              // 描述詞
 | 
			
		||||
	NegativePrompt    string  `json:"negative_prompt"`     // 排除描述詞
 | 
			
		||||
	NumInferenceSteps int     `json:"num_inference_steps"` // (1~500)
 | 
			
		||||
	GuidanceScale     float32 `json:"guidance_scale"`      // (1~20)
 | 
			
		||||
	Scheduler         string  `json:"scheduler"`           // (DDIM|K_EULER|DPMSolverMultistep|K_EULER_ANCESTRAL|PNDM|KLMS)
 | 
			
		||||
	Seed              int     `json:"seed"`                // Random seed (minimum: 0; maximum: 2147483647)
 | 
			
		||||
	FromImage         string  `json:"from_image"`          // Image to start from
 | 
			
		||||
	Seed              int     `json:"seed"`                // 隨機數種子
 | 
			
		||||
	FromImage         string  `json:"from_image"`          // 圖片地址(以圖繪圖)
 | 
			
		||||
	CreatedAt         string  `json:"created_at"`
 | 
			
		||||
	UpdatedAt         string  `json:"updated_at"`
 | 
			
		||||
	UserID            int     `json:"user_id"`
 | 
			
		||||
@@ -114,37 +113,16 @@ type User struct {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type Param struct {
 | 
			
		||||
    // 字段不固定
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
```javascript
 | 
			
		||||
//// TODO
 | 
			
		||||
////训练专属模型模块
 | 
			
		||||
////创建模型=>前端对图片列表进行编辑=>获取右侧操作栏数据=>开始训练接=>我的数据集(模型列表)
 | 
			
		||||
////  創建模型
 | 
			
		||||
////      POST    /api/models
 | 
			
		||||
//        type:缺少创建模型的类型枚举
 | 
			
		||||
////    上传图片
 | 
			
		||||
////        缺少oss接口文档
 | 
			
		||||
////  训练模型
 | 
			
		||||
//        获取右侧操作栏数据(缺少接口)
 | 
			
		||||
////  开始训练接口websocket
 | 
			
		||||
////      会根据任务id一直返回进度=>(缺少接口)
 | 
			
		||||
////  我的数据集列表
 | 
			
		||||
////      缺少小图标统计描述,缺少任务id
 | 
			
		||||
////      GET     /api/models
 | 
			
		||||
////    模型详情
 | 
			
		||||
////        GET     /api/models/12345
 | 
			
		||||
////        缺少任务id,和模型进度
 | 
			
		||||
////  工作状态列表接口
 | 
			
		||||
//        - 需要补充字段描述
 | 
			
		||||
////      GET /api/tasks
 | 
			
		||||
 | 
			
		||||
// ListView 列表分頁
 | 
			
		||||
{
 | 
			
		||||
    page: 1,             // 当前页码
 | 
			
		||||
    pageSize: 20,        // 分页数
 | 
			
		||||
    next: true,          // 是否存在下一页
 | 
			
		||||
    list: []             // 列表數據
 | 
			
		||||
    page: 1,             
 | 
			
		||||
    pageSize: 20,        
 | 
			
		||||
    next: true,          
 | 
			
		||||
    list: []             
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Image 圖片對象
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,6 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type ListView struct {
 | 
			
		||||
	Code     int           `json:"code"`
 | 
			
		||||
	Page     int           `json:"page"`
 | 
			
		||||
	PageSize int           `json:"page_size"`
 | 
			
		||||
	Total    int           `json:"total"`
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user