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
e3edd5eb
Commit
e3edd5eb
authored
Mar 25, 2024
by
brent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add favorite interface and modify task type interface
parent
7f6d87a6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
359 additions
and
26 deletions
+359
-26
favorite.go
controllers/favorite.go
+55
-23
task.go
controllers/task.go
+298
-1
app.go
models/app.go
+1
-0
task.go
models/task.go
+4
-2
router.go
routers/router.go
+1
-0
No files found.
controllers/favorite.go
View file @
e3edd5eb
...
@@ -4,6 +4,8 @@ import (
...
@@ -4,6 +4,8 @@ import (
"ai_developer_admin/libs/mysql"
"ai_developer_admin/libs/mysql"
"ai_developer_admin/models"
"ai_developer_admin/models"
"encoding/json"
"encoding/json"
"fmt"
"github.com/beego/beego/orm"
"github.com/beego/beego/v2/core/logs"
"github.com/beego/beego/v2/core/logs"
"net/http"
"net/http"
"time"
"time"
...
@@ -76,7 +78,10 @@ func (server *FavoriteController) Cancel() {
...
@@ -76,7 +78,10 @@ func (server *FavoriteController) Cancel() {
server
.
respond
(
models
.
BusinessFailed
,
"You have not followed this model"
)
server
.
respond
(
models
.
BusinessFailed
,
"You have not followed this model"
)
return
return
}
}
_
,
err
=
mysql
.
GetMysqlInstace
()
.
Ormer
.
Delete
(
checkFavorite
)
checkFavorite
.
UpdatedTime
=
time
.
Now
()
checkFavorite
.
Deleted
=
1
_
,
err
=
mysql
.
GetMysqlInstace
()
.
Ormer
.
Update
(
checkFavorite
)
if
err
!=
nil
{
if
err
!=
nil
{
server
.
respond
(
models
.
BusinessFailed
,
"failed"
)
server
.
respond
(
models
.
BusinessFailed
,
"failed"
)
return
return
...
@@ -117,15 +122,15 @@ func (server *FavoriteController) IsFavorite() {
...
@@ -117,15 +122,15 @@ func (server *FavoriteController) IsFavorite() {
server
.
respond
(
http
.
StatusOK
,
""
,
responseData
)
server
.
respond
(
http
.
StatusOK
,
""
,
responseData
)
}
}
func
(
server
*
FavoriteController
)
Favorite
s
()
{
func
(
server
*
FavoriteController
)
List
s
()
{
info
,
err
:=
server
.
Check
()
//
info, err := server.Check()
if
err
!=
nil
{
//
if err != nil {
server
.
respond
(
http
.
StatusUnauthorized
,
err
.
Error
())
//
server.respond(http.StatusUnauthorized, err.Error())
return
//
return
}
//
}
body
:=
server
.
Ctx
.
Input
.
RequestBody
body
:=
server
.
Ctx
.
Input
.
RequestBody
appRequest
:=
models
.
AppRequest
{}
appRequest
:=
models
.
AppRequest
{}
err
=
json
.
Unmarshal
(
body
,
&
appRequest
)
//解析body中数据
_
=
json
.
Unmarshal
(
body
,
&
appRequest
)
//解析body中数据
logs
.
Debug
(
"appRequest"
,
appRequest
,
string
(
body
))
logs
.
Debug
(
"appRequest"
,
appRequest
,
string
(
body
))
if
appRequest
.
Page
==
0
{
if
appRequest
.
Page
==
0
{
...
@@ -137,21 +142,48 @@ func (server *FavoriteController) Favorites() {
...
@@ -137,21 +142,48 @@ func (server *FavoriteController) Favorites() {
}
}
offset
:=
(
appRequest
.
Page
-
1
)
*
appRequest
.
Size
offset
:=
(
appRequest
.
Page
-
1
)
*
appRequest
.
Size
qs
:=
mysql
.
GetMysqlInstace
()
.
Ormer
.
QueryTable
(
"favorite"
)
.
Filter
(
"deleted"
,
0
)
type
ResponseType
struct
{
if
!
(
info
.
Role
==
1
||
info
.
Role
==
2
)
{
Id
int
`json:"id"`
qs
.
Filter
(
"user_id"
,
info
.
UserID
)
TaskTypeId
int
`json:"task_type_id,omitempty"`
}
UserId
int
`json:"user_id"`
infoQs
:=
qs
.
Offset
(
offset
)
.
Limit
(
appRequest
.
Size
)
Name
string
`json:"name"`
count
,
err
:=
infoQs
.
Count
()
CreatedTime
time
.
Time
`json:"created_time"`
logs
.
Debug
(
"Levels = "
,
count
)
}
var
favorites
[]
*
models
.
Favorite
var
favorites
[]
*
ResponseType
if
count
>
0
{
infoQs
.
All
(
&
favorites
)
countQB
,
_
:=
orm
.
NewQueryBuilder
(
"mysql"
)
//for _,value := favorites {
queryQB
,
_
:=
orm
.
NewQueryBuilder
(
"mysql"
)
//
countQB
.
Select
(
"count(*) AS total"
)
.
From
(
"favorite"
)
.
InnerJoin
(
"task_type"
)
.
On
(
"favorite.task_type_id = task_type.id"
)
queryQB
.
Select
(
"favorite.id"
,
"favorite.task_type_id"
,
"favorite.user_id"
,
"favorite.created_time"
,
"task_type.name"
)
.
From
(
"favorite"
)
.
InnerJoin
(
"task_type"
)
.
On
(
"favorite.task_type_id = task_type.id"
)
countQB
.
Where
(
"favorite.deleted = 0"
)
queryQB
.
Where
(
"favorite.deleted = 0"
)
//if !(info.Role == 1 || info.Role == 2) {
// countQB.And(fmt.Sprintf("user_id = '%d'", info.UserID))
// queryQB.And(fmt.Sprintf("user_id = '%d'", info.UserID))
//}
//}
if
appRequest
.
Keyword
!=
""
{
keyword
:=
"%"
+
appRequest
.
Keyword
+
"%"
countQB
.
And
(
fmt
.
Sprintf
(
"name like '%s'"
,
keyword
))
queryQB
.
And
(
fmt
.
Sprintf
(
"name like '%s'"
,
keyword
))
}
}
total
,
err
:=
qs
.
Count
()
queryQB
.
OrderBy
(
"created_time"
)
.
Desc
()
.
Limit
(
int
(
appRequest
.
Size
))
.
Offset
(
int
(
offset
))
sql
:=
countQB
.
String
()
var
total
int64
_
=
mysql
.
GetMysqlInstace
()
.
Ormer
.
Raw
(
sql
)
.
QueryRow
(
&
total
)
// 导出 SQL 语句
sql
=
queryQB
.
String
()
mysql
.
GetMysqlInstace
()
.
Ormer
.
Raw
(
sql
)
.
QueryRows
(
&
favorites
)
responseData
:=
struct
{
responseData
:=
struct
{
Total
int64
`json:"total"`
Total
int64
`json:"total"`
Data
interface
{}
`json:"data,omitempty"`
Data
interface
{}
`json:"data,omitempty"`
...
...
controllers/task.go
View file @
e3edd5eb
...
@@ -1394,7 +1394,7 @@ func (server *TaskController) Computility() {
...
@@ -1394,7 +1394,7 @@ func (server *TaskController) Computility() {
if
appRequest
.
Keyword
!=
""
{
if
appRequest
.
Keyword
!=
""
{
cond
:=
orm
.
NewCondition
()
cond
:=
orm
.
NewCondition
()
cond1
:=
cond
.
Or
(
"model__contains"
,
appRequest
.
Keyword
)
.
Or
(
"series__contains"
,
appRequest
.
Keyword
)
.
Or
(
"brand__contains"
,
appRequest
.
Keyword
)
cond1
:=
cond
.
Or
(
"model__contains"
,
appRequest
.
Keyword
)
.
Or
(
"series__contains"
,
appRequest
.
Keyword
)
.
Or
(
"brand__contains"
,
appRequest
.
Keyword
)
cond2
:=
cond
.
And
Not
Cond
(
cond1
)
cond2
:=
cond
.
AndCond
(
cond1
)
qs
=
qs
.
SetCond
(
cond2
)
qs
=
qs
.
SetCond
(
cond2
)
}
}
infoQs
:=
qs
.
Offset
(
offset
)
.
Limit
(
appRequest
.
Size
)
infoQs
:=
qs
.
Offset
(
offset
)
.
Limit
(
appRequest
.
Size
)
...
@@ -2033,6 +2033,144 @@ func (server *TaskController) GetTaskTypes() {
...
@@ -2033,6 +2033,144 @@ func (server *TaskController) GetTaskTypes() {
//server.respond(http.StatusOK, "", types)
//server.respond(http.StatusOK, "", types)
}
}
func
(
server
*
TaskController
)
Lists
()
{
_
,
err
:=
server
.
Check
()
if
err
!=
nil
{
server
.
respond
(
http
.
StatusUnauthorized
,
err
.
Error
())
return
}
body
:=
server
.
Ctx
.
Input
.
RequestBody
type
RequestType
struct
{
Page
int64
`json:"page,omitempty"`
Size
int64
`json:"size,omitempty"`
Filter
*
models
.
TaskType
`json:"filter,omitempty"`
Keyword
string
`json:"keyword,omitempty"`
}
appRequest
:=
RequestType
{}
_
=
json
.
Unmarshal
(
body
,
&
appRequest
)
//解析body中数据
logs
.
Debug
(
"appRequest"
,
appRequest
,
string
(
body
))
if
appRequest
.
Page
==
0
{
appRequest
.
Page
=
1
}
if
appRequest
.
Size
==
0
{
appRequest
.
Size
=
10
}
offset
:=
(
appRequest
.
Page
-
1
)
*
appRequest
.
Size
qs
:=
mysql
.
GetMysqlInstace
()
.
Ormer
.
QueryTable
(
"task_type"
)
.
Filter
(
"deleted"
,
0
)
if
appRequest
.
Filter
!=
nil
{
if
appRequest
.
Filter
.
Type
!=
0
{
qs
=
qs
.
Filter
(
"type"
,
appRequest
.
Filter
.
Type
)
}
if
appRequest
.
Filter
.
Kind
!=
0
{
qs
=
qs
.
Filter
(
"kind"
,
appRequest
.
Filter
.
Kind
)
}
if
appRequest
.
Filter
.
Category
!=
0
{
qs
=
qs
.
Filter
(
"category"
,
appRequest
.
Filter
.
Category
)
}
if
appRequest
.
Filter
.
AccessStatus
!=
0
{
qs
=
qs
.
Filter
(
"access_status"
,
appRequest
.
Filter
.
AccessStatus
)
}
if
appRequest
.
Filter
.
PublishStatus
!=
0
{
qs
=
qs
.
Filter
(
"publish_status"
,
appRequest
.
Filter
.
PublishStatus
)
}
if
appRequest
.
Filter
.
Workload
!=
0
{
qs
=
qs
.
Filter
(
"workload"
,
appRequest
.
Filter
.
Workload
)
}
}
if
appRequest
.
Keyword
!=
""
{
cond
:=
orm
.
NewCondition
()
cond1
:=
cond
.
Or
(
"name__contains"
,
appRequest
.
Keyword
)
.
Or
(
"image_name__contains"
,
appRequest
.
Keyword
)
.
Or
(
"api_path__contains"
,
appRequest
.
Keyword
)
.
Or
(
"model__contains"
,
appRequest
.
Keyword
)
.
Or
(
"base_model__contains"
,
appRequest
.
Keyword
)
cond2
:=
cond
.
AndCond
(
cond1
)
qs
=
qs
.
SetCond
(
cond2
)
}
infoQs
:=
qs
.
Offset
(
offset
)
.
Limit
(
appRequest
.
Size
)
count
,
_
:=
infoQs
.
Count
()
logs
.
Debug
(
"Levels = "
,
count
)
var
types
[]
*
models
.
TaskType
if
count
>
0
{
infoQs
.
All
(
&
types
)
}
var
remodels
[]
*
models
.
NewTaskType
for
_
,
data
:=
range
types
{
var
hardwareRequire
interface
{}
eer
:=
json
.
Unmarshal
([]
byte
(
data
.
HardwareRequire
),
&
hardwareRequire
)
if
eer
!=
nil
{
}
var
cmd
interface
{}
eer
=
json
.
Unmarshal
([]
byte
(
data
.
Cmd
),
&
cmd
)
if
eer
!=
nil
{
}
var
examples
interface
{}
eer
=
json
.
Unmarshal
([]
byte
(
data
.
Examples
),
&
examples
)
if
eer
!=
nil
{
}
var
codes
interface
{}
eer
=
json
.
Unmarshal
([]
byte
(
data
.
Codes
),
&
codes
)
if
eer
!=
nil
{
}
var
tags
[]
string
eer
=
json
.
Unmarshal
([]
byte
(
data
.
Tags
),
&
tags
)
if
eer
!=
nil
{
}
remodel
:=
models
.
NewTaskType
{
Id
:
data
.
Id
,
Name
:
data
.
Name
,
BaseModel
:
data
.
BaseModel
,
Model
:
data
.
Model
,
Version
:
data
.
Version
,
Desc
:
data
.
Desc
,
Price
:
float64
(
data
.
Price
)
/
1000000
,
PublicKey
:
data
.
PublicKey
,
Complexity
:
data
.
Complexity
,
Type
:
models
.
ModelType
(
data
.
Type
),
TypeDesc
:
models
.
ModelType
(
data
.
Type
)
.
String
(),
Kind
:
data
.
Kind
,
KindDesc
:
models
.
TaskKind
(
data
.
Kind
)
.
String
(),
KindDescEn
:
models
.
TaskKind
(
data
.
Kind
)
.
EnString
(),
Category
:
data
.
Category
,
HardwareRequire
:
hardwareRequire
,
ImageId
:
data
.
ImageId
,
ImageUrl
:
data
.
ImageUrl
,
Cmd
:
cmd
,
Workload
:
data
.
Workload
,
ApiPath
:
data
.
ApiPath
,
ImageName
:
data
.
ImageName
,
SignUrl
:
data
.
SignUrl
,
Username
:
data
.
Username
,
Password
:
data
.
Password
,
Examples
:
examples
,
Codes
:
codes
,
Tags
:
tags
,
PublishStatus
:
data
.
PublishStatus
,
AccessStatus
:
data
.
AccessStatus
,
ResultFileExpires
:
data
.
ResultFileExpires
,
}
remodels
=
append
(
remodels
,
&
remodel
)
}
total
,
_
:=
qs
.
Count
()
responseData
:=
struct
{
Total
int64
`json:"total"`
Data
interface
{}
`json:"data,omitempty"`
}{
Total
:
total
,
Data
:
remodels
,
}
server
.
respond
(
http
.
StatusOK
,
""
,
responseData
)
}
func
(
server
*
TaskController
)
DelTaskType
()
{
func
(
server
*
TaskController
)
DelTaskType
()
{
_
,
err
:=
server
.
Check
()
_
,
err
:=
server
.
Check
()
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -2235,6 +2373,165 @@ func (server *TaskController) Examples() {
...
@@ -2235,6 +2373,165 @@ func (server *TaskController) Examples() {
server
.
respond
(
http
.
StatusOK
,
""
,
responseData
)
server
.
respond
(
http
.
StatusOK
,
""
,
responseData
)
}
}
func
(
server
*
TaskController
)
Models
()
{
body
:=
server
.
Ctx
.
Input
.
RequestBody
appRequest
:=
models
.
AppRequest
{}
_
=
json
.
Unmarshal
(
body
,
&
appRequest
)
//解析body中数据
logs
.
Debug
(
"appRequest"
,
appRequest
,
string
(
body
))
if
appRequest
.
Page
==
0
{
appRequest
.
Page
=
1
}
if
appRequest
.
Size
==
0
{
appRequest
.
Size
=
10
}
offset
:=
(
appRequest
.
Page
-
1
)
*
appRequest
.
Size
//size := appRequest.Page * appRequest.Size
countQB
,
_
:=
orm
.
NewQueryBuilder
(
"mysql"
)
queryQB
,
_
:=
orm
.
NewQueryBuilder
(
"mysql"
)
countQB
.
Select
(
"count(*) AS total"
)
.
From
(
"task_type"
)
.
Where
(
"deleted = 0"
)
queryQB
.
Select
(
"task_type.id"
,
"task_type.name AS tit"
,
"task_type.type"
,
"task_type.desc AS content"
,
"task_type.sort"
,
"task_type.tags"
,
"task_type.estimat_exe_time"
,
"task_type.price"
,
"task_type.unit"
,
"task_type.examples"
,
"task_type.codes"
,
"task_type.base_model"
,
"task_type.model"
,
"task_type.api_path"
,
"task_type.api_doc_url"
,
"task_type.api_doc_content"
,
"task_type.version"
,
"task_type.category"
,
"task_type.form"
,
"task_type.access_status"
,
"task_type.publish_status"
,
"favorite.id AS is_favorite"
)
.
From
(
"task_type"
)
.
LeftJoin
(
"favorite"
)
.
On
(
"favorite.task_type_id = task_type.id and favorite.deleted = 0"
)
queryQB
.
Where
(
"task_type.deleted = 0"
)
if
appRequest
.
Id
!=
0
{
countQB
.
And
(
fmt
.
Sprintf
(
"id = '%d'"
,
appRequest
.
Id
))
queryQB
.
And
(
fmt
.
Sprintf
(
"id = '%d'"
,
appRequest
.
Id
))
}
else
{
if
appRequest
.
Keyword
!=
""
{
keyword
:=
"%"
+
appRequest
.
Keyword
+
"%"
where
:=
fmt
.
Sprintf
(
"(task_type.`name` LIKE '%s' OR task_type.`desc` LIKE '%s' OR task_type.tags LIKE '%s')"
,
keyword
,
keyword
,
keyword
)
countQB
.
And
(
where
)
queryQB
.
And
(
where
)
}
if
appRequest
.
Category
!=
0
{
countQB
.
And
(
fmt
.
Sprintf
(
"category = %d"
,
appRequest
.
Category
))
queryQB
.
And
(
fmt
.
Sprintf
(
"category = %d"
,
appRequest
.
Category
))
}
}
queryQB
.
OrderBy
(
"sort"
)
.
Limit
(
int
(
appRequest
.
Size
))
.
Offset
(
int
(
offset
))
var
types
[]
*
models
.
Model
sql
:=
countQB
.
String
()
var
total
int64
mysql
.
GetMysqlInstace
()
.
Ormer
.
Raw
(
sql
)
.
QueryRow
(
&
total
)
logs
.
Debug
(
"total = %d"
,
total
)
sql
=
queryQB
.
String
()
mysql
.
GetMysqlInstace
()
.
Ormer
.
Raw
(
sql
)
.
QueryRows
(
&
types
)
type
ResponseType
struct
{
Id
int
`json:"id"`
Tit
string
`json:"tit"`
Version
string
`json:"version,omitempty"`
Content
string
`json:"content"`
Type
int
`json:"type"`
ApiPath
string
`json:"api_path"`
BaseModel
string
`json:"base_model"`
Model
string
`json:"model""`
Examples
interface
{}
`json:"examples"`
ApiDocUrl
string
`json:"api_doc_url"`
ApiDocContent
string
`json:"api_doc_content"`
Codes
interface
{}
`json:"codes"`
Tags
interface
{}
`json:"tags"`
Form
interface
{}
`json:"form"`
Category
int
`json:"category"`
ResultFileExpires
int
`json:"result_file_expires"`
AccessStatus
int
`json:"access_status,omitempty"`
PublishStatus
int
`json:"publish_status,omitempty"`
Price
float64
`json:"price"`
Unit
string
`json:"unit"`
Sort
int
`json:"sort"`
EstimatExeTime
int
`json:"estimat_exe_time"`
IsFavorite
int
`json:"is_favorite"`
}
var
remodels
[]
*
ResponseType
for
_
,
data
:=
range
types
{
var
examples
interface
{}
eer
:=
json
.
Unmarshal
([]
byte
(
data
.
Examples
),
&
examples
)
if
eer
!=
nil
{
}
var
codes
interface
{}
eer
=
json
.
Unmarshal
([]
byte
(
data
.
Codes
),
&
codes
)
if
eer
!=
nil
{
}
var
tags
interface
{}
eer
=
json
.
Unmarshal
([]
byte
(
data
.
Tags
),
&
tags
)
if
eer
!=
nil
{
}
var
form
interface
{}
eer
=
json
.
Unmarshal
([]
byte
(
data
.
Form
),
&
form
)
if
eer
!=
nil
{
}
remodel
:=
ResponseType
{
Id
:
data
.
Id
,
Tit
:
data
.
Tit
,
Version
:
data
.
Version
,
Content
:
data
.
Content
,
Type
:
data
.
Type
,
ApiPath
:
data
.
ApiPath
,
BaseModel
:
data
.
BaseModel
,
Model
:
data
.
Model
,
Examples
:
examples
,
ApiDocUrl
:
data
.
ApiDocUrl
,
ApiDocContent
:
data
.
ApiDocContent
,
Codes
:
codes
,
Tags
:
tags
,
Category
:
data
.
Category
,
Form
:
form
,
ResultFileExpires
:
data
.
ResultFileExpires
,
AccessStatus
:
data
.
AccessStatus
,
PublishStatus
:
data
.
PublishStatus
,
Price
:
float64
(
data
.
Price
)
/
1000000
,
Unit
:
data
.
Unit
,
Sort
:
data
.
Sort
,
EstimatExeTime
:
data
.
EstimatExeTime
,
IsFavorite
:
data
.
IsFavorite
,
}
remodels
=
append
(
remodels
,
&
remodel
)
}
responseData
:=
struct
{
Total
int64
`json:"total"`
Data
interface
{}
`json:"data,omitempty"`
}{
Total
:
total
,
Data
:
remodels
,
}
server
.
respond
(
http
.
StatusOK
,
""
,
responseData
)
}
func
(
server
*
TaskController
)
RunCount
()
{
func
(
server
*
TaskController
)
RunCount
()
{
//_, err := server.Check()
//_, err := server.Check()
//if err != nil {
//if err != nil {
...
...
models/app.go
View file @
e3edd5eb
...
@@ -60,6 +60,7 @@ type AppRequest struct {
...
@@ -60,6 +60,7 @@ type AppRequest struct {
// 模型模糊查询
// 模型模糊查询
Keyword
string
`json:"keyword,omitempty"`
Keyword
string
`json:"keyword,omitempty"`
Category
int
`json:"category,omitempty"`
Category
int
`json:"category,omitempty"`
Kind
int
`json:"kind,omitempty"`
//显卡列表
//显卡列表
Type
int
`json:"type,omitempty"`
Type
int
`json:"type,omitempty"`
...
...
models/task.go
View file @
e3edd5eb
...
@@ -86,8 +86,8 @@ type TaskType struct {
...
@@ -86,8 +86,8 @@ type TaskType struct {
Category
int
`json:"category";orm:"column(category)"`
Category
int
`json:"category";orm:"column(category)"`
Form
string
`json:"form";orm:"column(form)"`
Form
string
`json:"form";orm:"column(form)"`
ResultFileExpires
int
`json:"result_file_expires";orm:"column(result_file_expires)"`
ResultFileExpires
int
`json:"result_file_expires";orm:"column(result_file_expires)"`
AccessStatus
int
`json:"access_status,omitempty"`
AccessStatus
int
`json:"access_status,omitempty"
;orm:"column(access_status)"
`
PublishStatus
int
`json:"publish_status,omitempty"`
PublishStatus
int
`json:"publish_status,omitempty"
;orm:"column(publish_status)"
`
Unit
string
`json:"unit";orm:"column(unit)"`
Unit
string
`json:"unit";orm:"column(unit)"`
Sort
int
`json:"sort";orm:"column(sort)"`
Sort
int
`json:"sort";orm:"column(sort)"`
EstimatExeTime
int
`json:"estimat_exe_time";orm:"column(estimat_exe_time)"`
EstimatExeTime
int
`json:"estimat_exe_time";orm:"column(estimat_exe_time)"`
...
@@ -164,6 +164,7 @@ type Model struct {
...
@@ -164,6 +164,7 @@ type Model struct {
Unit
string
`json:"unit";orm:"column(unit)"`
Unit
string
`json:"unit";orm:"column(unit)"`
Sort
int
`json:"sort";orm:"column(sort)"`
Sort
int
`json:"sort";orm:"column(sort)"`
EstimatExeTime
int
`json:"estimat_exe_time";orm:"column(estimat_exe_time)"`
EstimatExeTime
int
`json:"estimat_exe_time";orm:"column(estimat_exe_time)"`
IsFavorite
int
`json:"is_favorite"`
}
}
type
ResonseModel
struct
{
type
ResonseModel
struct
{
...
@@ -189,6 +190,7 @@ type ResonseModel struct {
...
@@ -189,6 +190,7 @@ type ResonseModel struct {
Unit
string
`json:"unit";orm:"column(unit)"`
Unit
string
`json:"unit";orm:"column(unit)"`
Sort
int
`json:"sort";orm:"column(sort)"`
Sort
int
`json:"sort";orm:"column(sort)"`
EstimatExeTime
int
`json:"estimat_exe_time";orm:"column(estimat_exe_time)"`
EstimatExeTime
int
`json:"estimat_exe_time";orm:"column(estimat_exe_time)"`
IsFavorite
int
`json:"is_favorite"`
}
}
type
Bills
struct
{
type
Bills
struct
{
...
...
routers/router.go
View file @
e3edd5eb
...
@@ -15,4 +15,5 @@ func init() {
...
@@ -15,4 +15,5 @@ func init() {
beego
.
AutoPrefix
(
"admin/api"
,
&
controllers
.
MonitorController
{})
beego
.
AutoPrefix
(
"admin/api"
,
&
controllers
.
MonitorController
{})
beego
.
AutoPrefix
(
"admin/api"
,
&
controllers
.
WhitelistController
{})
beego
.
AutoPrefix
(
"admin/api"
,
&
controllers
.
WhitelistController
{})
beego
.
AutoPrefix
(
"admin/api"
,
&
controllers
.
FileController
{})
beego
.
AutoPrefix
(
"admin/api"
,
&
controllers
.
FileController
{})
beego
.
AutoPrefix
(
"admin/api"
,
&
controllers
.
FavoriteController
{})
}
}
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