Commit a2fb3851 authored by brent's avatar brent

modify task type enum

parent 8f7aadb9
......@@ -1920,7 +1920,7 @@ func (server *TaskController) Examples() {
mysql.GetMysqlInstace().Ormer.Raw(sql).QueryRows(&types)
var remodels []*models.ResonseModel
for _, data := range types {
var examples []models.ExampleType
var examples interface{}
eer := json.Unmarshal([]byte(data.Examples), &examples)
if eer != nil {
......@@ -2020,7 +2020,7 @@ func (server *TaskController) Enumeration() {
}
var types []*models.EnumType
for _, value := range [...]models.ModelType{models.TXTTOIMG, models.TXTTOTXT, models.TXTTOVIDEO, models.IMGTOTXT} {
for _, value := range [...]models.ModelType{models.TXTTOIMG, models.TXTTOTXT, models.TXTTOVIDEO, models.IMGTOTXT, models.IMGTOVIDEO, models.IMGTOIMG, models.IMGTXTTOTXT, models.IMGTXTTOIMG, models.IMGTXTTOVIDEO} {
typeData := models.EnumType{
Id: int(value),
Desc: value.String(),
......
{"/Users/brent/Documents/wubanWork/ai_developer_admin/controllers":1709622374686462499}
\ No newline at end of file
{"/Users/brent/Documents/wubanWork/ai_developer_admin/controllers":1709633018662460210}
\ No newline at end of file
......@@ -89,38 +89,38 @@ type TaskType struct {
}
type NewTaskType struct {
Id int `orm:"column(id);auto"`
Name string `json:"name";orm:"column(desc)"`
BaseModel string `json:"base_model";orm:"column(desc)"`
Model string `json:"model";orm:"column(model)"`
Version string `json:"version";orm:"column(desc)"`
Desc string `json:"desc";orm:"column(desc);size(20)"`
Price float64 `json:"price";orm:"column(price)"`
PublicKey string `json:"public_key";orm:"column(public_key)"`
Complexity int `json:"complexity";orm:"column(complexity)"`
Type ModelType `json:"type,omitempty";orm:"column(type)"`
Kind int `json:"kind";orm:"column(kind)"`
TypeDesc string `json:"type_desc"`
KindDesc string `json:"kind_desc"`
HardwareRequire interface{} `json:"hardware_require";orm:"column(hardware_require)"`
ImageId string `json:"image_id";orm:"column(image_id)"`
ImageUrl string `json:"image_url";orm:"column(image_url)"`
Cmd interface{} `json:"cmd";orm:"column(cmd)"`
Workload int `json:"workload";orm:"column(workload)"`
ApiPath string `json:"api_path";orm:"column(api_path)"`
ImageName string `json:"image_name";orm:"column(image_name)"`
SignUrl string `json:"sign_url";orm:"column(sign_url)"`
Username string `json:"username";orm:"column(username)"`
Password string `json:"password";orm:"column(password)"`
Examples []ExampleType `json:"examples,omitempty";orm:"column(examples)"`
ApiDocUrl string `json:"api_doc_url,omitempty";orm:"column(api_doc_url)"`
ApiDocContent string `json:"api_doc_content,omitempty";orm:"column(api_doc_content)"`
Codes interface{} `json:"codes,omitempty";orm:"column(codes)"`
Tags []string `json:"tags,omitempty";orm:"column(tags)"`
Category int `json:"category";orm:"column(category)"`
CreatedTime time.Time `json:"created_time";orm:"column(created_time);type(datetime)"`
UpdatedTime time.Time `json:"updated_time";orm:"column(updated_time);type(datetime)"`
Deleted int `json:"deleted";orm:"column(deleted);size(1)"`
Id int `orm:"column(id);auto"`
Name string `json:"name";orm:"column(desc)"`
BaseModel string `json:"base_model";orm:"column(desc)"`
Model string `json:"model";orm:"column(model)"`
Version string `json:"version";orm:"column(desc)"`
Desc string `json:"desc";orm:"column(desc);size(20)"`
Price float64 `json:"price";orm:"column(price)"`
PublicKey string `json:"public_key";orm:"column(public_key)"`
Complexity int `json:"complexity";orm:"column(complexity)"`
Type ModelType `json:"type,omitempty";orm:"column(type)"`
Kind int `json:"kind";orm:"column(kind)"`
TypeDesc string `json:"type_desc"`
KindDesc string `json:"kind_desc"`
HardwareRequire interface{} `json:"hardware_require";orm:"column(hardware_require)"`
ImageId string `json:"image_id";orm:"column(image_id)"`
ImageUrl string `json:"image_url";orm:"column(image_url)"`
Cmd interface{} `json:"cmd";orm:"column(cmd)"`
Workload int `json:"workload";orm:"column(workload)"`
ApiPath string `json:"api_path";orm:"column(api_path)"`
ImageName string `json:"image_name";orm:"column(image_name)"`
SignUrl string `json:"sign_url";orm:"column(sign_url)"`
Username string `json:"username";orm:"column(username)"`
Password string `json:"password";orm:"column(password)"`
Examples interface{} `json:"examples,omitempty";orm:"column(examples)"`
ApiDocUrl string `json:"api_doc_url,omitempty";orm:"column(api_doc_url)"`
ApiDocContent string `json:"api_doc_content,omitempty";orm:"column(api_doc_content)"`
Codes interface{} `json:"codes,omitempty";orm:"column(codes)"`
Tags []string `json:"tags,omitempty";orm:"column(tags)"`
Category int `json:"category";orm:"column(category)"`
CreatedTime time.Time `json:"created_time";orm:"column(created_time);type(datetime)"`
UpdatedTime time.Time `json:"updated_time";orm:"column(updated_time);type(datetime)"`
Deleted int `json:"deleted";orm:"column(deleted);size(1)"`
}
type Model struct {
......@@ -228,6 +228,11 @@ const (
TXTTOTXT
TXTTOVIDEO
IMGTOTXT
IMGTOVIDEO
IMGTOIMG
IMGTXTTOTXT
IMGTXTTOIMG
IMGTXTTOVIDEO
)
func (m ModelType) String() string {
......@@ -239,7 +244,17 @@ func (m ModelType) String() string {
case TXTTOVIDEO:
return "txt2video"
case IMGTOTXT:
return "txt2video"
return "img2txt"
case IMGTOVIDEO:
return "img2video"
case IMGTOIMG:
return "img2img"
case IMGTXTTOTXT:
return "imgtxt2txt"
case IMGTXTTOIMG:
return "imgtxt2img"
case IMGTXTTOVIDEO:
return "imgtxt2video"
default:
return "未知类型"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment