聲明大與約定
This commit is contained in:
		@@ -18,8 +18,8 @@ type Image struct {
 | 
				
			|||||||
	Seed              int       `json:"seed"`                // Random seed (minimum: 0; maximum: 2147483647)
 | 
						Seed              int       `json:"seed"`                // Random seed (minimum: 0; maximum: 2147483647)
 | 
				
			||||||
	FromImage         string    `json:"from_image"`          // Image to start from
 | 
						FromImage         string    `json:"from_image"`          // Image to start from
 | 
				
			||||||
	UserID            int       `json:"user_id"`
 | 
						UserID            int       `json:"user_id"`
 | 
				
			||||||
	CreatedAt         time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"`
 | 
						CreatedAt         time.Time `json:"created_at" gorm:"autoCreateTime"`
 | 
				
			||||||
	UpdatedAt         time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"`
 | 
						UpdatedAt         time.Time `json:"updated_at" gorm:"autoUpdateTime"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,8 +18,8 @@ type Model struct {
 | 
				
			|||||||
	Image        string    `json:"image"`                    // 封面圖片實際地址
 | 
						Image        string    `json:"image"`                    // 封面圖片實際地址
 | 
				
			||||||
	Tags         string    `json:"tags"`
 | 
						Tags         string    `json:"tags"`
 | 
				
			||||||
	UserID       int       `json:"user_id"`
 | 
						UserID       int       `json:"user_id"`
 | 
				
			||||||
	CreatedAt    time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"`
 | 
						CreatedAt    time.Time `json:"created_at" gorm:"autoCreateTime"`
 | 
				
			||||||
	UpdatedAt    time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"`
 | 
						UpdatedAt    time.Time `json:"updated_at" gorm:"autoUpdateTime"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,8 +13,8 @@ type Server struct {
 | 
				
			|||||||
	Port      int       `json:"port"`
 | 
						Port      int       `json:"port"`
 | 
				
			||||||
	Username  string    `json:"username"`
 | 
						Username  string    `json:"username"`
 | 
				
			||||||
	Password  string    `json:"password"`
 | 
						Password  string    `json:"password"`
 | 
				
			||||||
	CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"`
 | 
						CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
 | 
				
			||||||
	UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"`
 | 
						UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,8 +8,8 @@ import (
 | 
				
			|||||||
type Tag struct {
 | 
					type Tag struct {
 | 
				
			||||||
	ID        int       `json:"id" gorm:"primary_key"`
 | 
						ID        int       `json:"id" gorm:"primary_key"`
 | 
				
			||||||
	Name      string    `json:"name"`
 | 
						Name      string    `json:"name"`
 | 
				
			||||||
	CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"`
 | 
						CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
 | 
				
			||||||
	UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"`
 | 
						UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,8 +9,8 @@ type Task struct {
 | 
				
			|||||||
	Status    string    `json:"status"`   // (initial|ready|waiting|running|success|error)
 | 
						Status    string    `json:"status"`   // (initial|ready|waiting|running|success|error)
 | 
				
			||||||
	Progress  int       `json:"progress"` // (0-100)
 | 
						Progress  int       `json:"progress"` // (0-100)
 | 
				
			||||||
	UserID    int       `json:"user_id"`
 | 
						UserID    int       `json:"user_id"`
 | 
				
			||||||
	CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"`
 | 
						CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
 | 
				
			||||||
	UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"`
 | 
						UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//// 推理任務
 | 
					//// 推理任務
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,8 +10,8 @@ type Session struct {
 | 
				
			|||||||
	IP        string    `json:"ip"`
 | 
						IP        string    `json:"ip"`
 | 
				
			||||||
	UserID    int       `json:"user_id"`
 | 
						UserID    int       `json:"user_id"`
 | 
				
			||||||
	UserAgent string    `json:"user_agent"`
 | 
						UserAgent string    `json:"user_agent"`
 | 
				
			||||||
	CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"`
 | 
						CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
 | 
				
			||||||
	UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"`
 | 
						UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user