feat: add implements for stable diffusion service

This commit is contained in:
RockYang
2023-09-26 18:16:51 +08:00
parent c1143d7a6d
commit d51a724ade
8 changed files with 569 additions and 62 deletions

20
api/store/model/sd_job.go Normal file
View File

@@ -0,0 +1,20 @@
package model
import "time"
type SdJob struct {
Id uint `gorm:"primarykey;column:id"`
Type string
UserId int
TaskId string
ImgURL string
Progress int
Prompt string
Params string
Started bool
CreatedAt time.Time
}
func (SdJob) TableName() string {
return "chatgpt_sd_jobs"
}

19
api/store/vo/sd_job.go Normal file
View File

@@ -0,0 +1,19 @@
package vo
import (
"chatplus/core/types"
"time"
)
type SdJob struct {
Id uint `json:"id"`
Type string `json:"type"`
UserId int `json:"user_id"`
TaskId string `json:"task_id"`
ImgURL string `json:"img_url"`
Params types.SdParams `json:"params"`
Progress int `json:"progress"`
Prompt string `json:"prompt"`
CreatedAt time.Time `json:"created_at"`
Started bool `json:"started"`
}