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
8f7aadb9
Commit
8f7aadb9
authored
Mar 05, 2024
by
brent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
task type add type enum
parent
2feca4dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
task.go
controllers/task.go
+1
-1
task.go
models/task.go
+5
-1
No files found.
controllers/task.go
View file @
8f7aadb9
...
@@ -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
}
{
for
_
,
value
:=
range
[
...
]
models
.
ModelType
{
models
.
TXTTOIMG
,
models
.
TXTTOTXT
,
models
.
TXTTOVIDEO
,
models
.
IMGTOTXT
}
{
typeData
:=
models
.
EnumType
{
typeData
:=
models
.
EnumType
{
Id
:
int
(
value
),
Id
:
int
(
value
),
Desc
:
value
.
String
(),
Desc
:
value
.
String
(),
...
...
models/task.go
View file @
8f7aadb9
...
@@ -22,7 +22,8 @@ type ExampleType struct {
...
@@ -22,7 +22,8 @@ type ExampleType struct {
Title
string
`json:"title"`
Title
string
`json:"title"`
Input
struct
{
Input
struct
{
Prompt
string
`json:"prompt,omitempty"`
Prompt
string
`json:"prompt,omitempty"`
Image
string
`json:"image,omitempty"`
Url
string
`json:"url,omitempty"`
//Mask string `json:"mask,omitempty"`
}
`json:"input"`
}
`json:"input"`
Output
struct
{
Output
struct
{
Text
string
`json:"text,omitempty"`
Text
string
`json:"text,omitempty"`
...
@@ -226,6 +227,7 @@ const (
...
@@ -226,6 +227,7 @@ const (
TXTTOIMG
ModelType
=
iota
+
1
TXTTOIMG
ModelType
=
iota
+
1
TXTTOTXT
TXTTOTXT
TXTTOVIDEO
TXTTOVIDEO
IMGTOTXT
)
)
func
(
m
ModelType
)
String
()
string
{
func
(
m
ModelType
)
String
()
string
{
...
@@ -236,6 +238,8 @@ func (m ModelType) String() string {
...
@@ -236,6 +238,8 @@ func (m ModelType) String() string {
return
"txt2txt"
return
"txt2txt"
case
TXTTOVIDEO
:
case
TXTTOVIDEO
:
return
"txt2video"
return
"txt2video"
case
IMGTOTXT
:
return
"txt2video"
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