Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
admin-backend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odysseus
admin-backend
Commits
a2fb3851
Commit
a2fb3851
authored
Mar 05, 2024
by
brent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify task type enum
parent
8f7aadb9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
36 deletions
+51
-36
task.go
controllers/task.go
+2
-2
lastupdate.tmp
lastupdate.tmp
+1
-1
task.go
models/task.go
+48
-33
No files found.
controllers/task.go
View file @
a2fb3851
...
@@ -1920,7 +1920,7 @@ func (server *TaskController) Examples() {
...
@@ -1920,7 +1920,7 @@ func (server *TaskController) Examples() {
mysql
.
GetMysqlInstace
()
.
Ormer
.
Raw
(
sql
)
.
QueryRows
(
&
types
)
mysql
.
GetMysqlInstace
()
.
Ormer
.
Raw
(
sql
)
.
QueryRows
(
&
types
)
var
remodels
[]
*
models
.
ResonseModel
var
remodels
[]
*
models
.
ResonseModel
for
_
,
data
:=
range
types
{
for
_
,
data
:=
range
types
{
var
examples
[]
models
.
ExampleType
var
examples
interface
{}
eer
:=
json
.
Unmarshal
([]
byte
(
data
.
Examples
),
&
examples
)
eer
:=
json
.
Unmarshal
([]
byte
(
data
.
Examples
),
&
examples
)
if
eer
!=
nil
{
if
eer
!=
nil
{
...
@@ -2020,7 +2020,7 @@ func (server *TaskController) Enumeration() {
...
@@ -2020,7 +2020,7 @@ func (server *TaskController) Enumeration() {
}
}
var
types
[]
*
models
.
EnumType
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
{
typeData
:=
models
.
EnumType
{
Id
:
int
(
value
),
Id
:
int
(
value
),
Desc
:
value
.
String
(),
Desc
:
value
.
String
(),
...
...
lastupdate.tmp
View file @
a2fb3851
{"/Users/brent/Documents/wubanWork/ai_developer_admin/controllers":1709622374686462499}
{"/Users/brent/Documents/wubanWork/ai_developer_admin/controllers":1709633018662460210}
\ No newline at end of file
\ No newline at end of file
models/task.go
View file @
a2fb3851
...
@@ -89,38 +89,38 @@ type TaskType struct {
...
@@ -89,38 +89,38 @@ type TaskType struct {
}
}
type
NewTaskType
struct
{
type
NewTaskType
struct
{
Id
int
`orm:"column(id);auto"`
Id
int
`orm:"column(id);auto"`
Name
string
`json:"name";orm:"column(desc)"`
Name
string
`json:"name";orm:"column(desc)"`
BaseModel
string
`json:"base_model";orm:"column(desc)"`
BaseModel
string
`json:"base_model";orm:"column(desc)"`
Model
string
`json:"model";orm:"column(model)"`
Model
string
`json:"model";orm:"column(model)"`
Version
string
`json:"version";orm:"column(desc)"`
Version
string
`json:"version";orm:"column(desc)"`
Desc
string
`json:"desc";orm:"column(desc);size(20)"`
Desc
string
`json:"desc";orm:"column(desc);size(20)"`
Price
float64
`json:"price";orm:"column(price)"`
Price
float64
`json:"price";orm:"column(price)"`
PublicKey
string
`json:"public_key";orm:"column(public_key)"`
PublicKey
string
`json:"public_key";orm:"column(public_key)"`
Complexity
int
`json:"complexity";orm:"column(complexity)"`
Complexity
int
`json:"complexity";orm:"column(complexity)"`
Type
ModelType
`json:"type,omitempty";orm:"column(type)"`
Type
ModelType
`json:"type,omitempty";orm:"column(type)"`
Kind
int
`json:"kind";orm:"column(kind)"`
Kind
int
`json:"kind";orm:"column(kind)"`
TypeDesc
string
`json:"type_desc"`
TypeDesc
string
`json:"type_desc"`
KindDesc
string
`json:"kind_desc"`
KindDesc
string
`json:"kind_desc"`
HardwareRequire
interface
{}
`json:"hardware_require";orm:"column(hardware_require)"`
HardwareRequire
interface
{}
`json:"hardware_require";orm:"column(hardware_require)"`
ImageId
string
`json:"image_id";orm:"column(image_id)"`
ImageId
string
`json:"image_id";orm:"column(image_id)"`
ImageUrl
string
`json:"image_url";orm:"column(image_url)"`
ImageUrl
string
`json:"image_url";orm:"column(image_url)"`
Cmd
interface
{}
`json:"cmd";orm:"column(cmd)"`
Cmd
interface
{}
`json:"cmd";orm:"column(cmd)"`
Workload
int
`json:"workload";orm:"column(workload)"`
Workload
int
`json:"workload";orm:"column(workload)"`
ApiPath
string
`json:"api_path";orm:"column(api_path)"`
ApiPath
string
`json:"api_path";orm:"column(api_path)"`
ImageName
string
`json:"image_name";orm:"column(image_name)"`
ImageName
string
`json:"image_name";orm:"column(image_name)"`
SignUrl
string
`json:"sign_url";orm:"column(sign_url)"`
SignUrl
string
`json:"sign_url";orm:"column(sign_url)"`
Username
string
`json:"username";orm:"column(username)"`
Username
string
`json:"username";orm:"column(username)"`
Password
string
`json:"password";orm:"column(password)"`
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)"`
ApiDocUrl
string
`json:"api_doc_url,omitempty";orm:"column(api_doc_url)"`
ApiDocContent
string
`json:"api_doc_content,omitempty";orm:"column(api_doc_content)"`
ApiDocContent
string
`json:"api_doc_content,omitempty";orm:"column(api_doc_content)"`
Codes
interface
{}
`json:"codes,omitempty";orm:"column(codes)"`
Codes
interface
{}
`json:"codes,omitempty";orm:"column(codes)"`
Tags
[]
string
`json:"tags,omitempty";orm:"column(tags)"`
Tags
[]
string
`json:"tags,omitempty";orm:"column(tags)"`
Category
int
`json:"category";orm:"column(category)"`
Category
int
`json:"category";orm:"column(category)"`
CreatedTime
time
.
Time
`json:"created_time";orm:"column(created_time);type(datetime)"`
CreatedTime
time
.
Time
`json:"created_time";orm:"column(created_time);type(datetime)"`
UpdatedTime
time
.
Time
`json:"updated_time";orm:"column(updated_time);type(datetime)"`
UpdatedTime
time
.
Time
`json:"updated_time";orm:"column(updated_time);type(datetime)"`
Deleted
int
`json:"deleted";orm:"column(deleted);size(1)"`
Deleted
int
`json:"deleted";orm:"column(deleted);size(1)"`
}
}
type
Model
struct
{
type
Model
struct
{
...
@@ -228,6 +228,11 @@ const (
...
@@ -228,6 +228,11 @@ const (
TXTTOTXT
TXTTOTXT
TXTTOVIDEO
TXTTOVIDEO
IMGTOTXT
IMGTOTXT
IMGTOVIDEO
IMGTOIMG
IMGTXTTOTXT
IMGTXTTOIMG
IMGTXTTOVIDEO
)
)
func
(
m
ModelType
)
String
()
string
{
func
(
m
ModelType
)
String
()
string
{
...
@@ -239,7 +244,17 @@ func (m ModelType) String() string {
...
@@ -239,7 +244,17 @@ func (m ModelType) String() string {
case
TXTTOVIDEO
:
case
TXTTOVIDEO
:
return
"txt2video"
return
"txt2video"
case
IMGTOTXT
:
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
:
default
:
return
"未知类型"
return
"未知类型"
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment