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
......@@ -112,7 +112,7 @@ type NewTaskType struct {
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)"`
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)"`
......@@ -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