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
11e92e6c
Commit
11e92e6c
authored
Apr 29, 2024
by
brent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add client and explorer
parent
10a396d2
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
709 additions
and
28 deletions
+709
-28
app.conf
conf/app.conf
+2
-1
kong.conf
conf/kong.conf
+1
-1
mysql.conf
conf/mysql.conf
+4
-4
postgres.conf
conf/postgres.conf
+1
-1
redis.conf
conf/redis.conf
+2
-2
weixin.conf
conf/weixin.conf
+18
-0
client.go
controllers/client.go
+344
-0
explorer.go
controllers/explorer.go
+214
-0
funds.go
controllers/funds.go
+54
-0
task.go
controllers/task.go
+9
-1
user.go
controllers/user.go
+7
-2
go.mod
go.mod
+10
-2
go.sum
go.sum
+18
-2
cronjob.go
libs/cronjob/cronjob.go
+1
-0
app.go
models/app.go
+3
-0
task.go
models/task.go
+19
-12
router.go
routers/router.go
+2
-0
No files found.
conf/app.conf
View file @
11e92e6c
...
...
@@ -21,4 +21,5 @@ web3ClientId = "BHFvULiKBqRN0Em-14M-bDO2eAvHL4F19hLxR4s7dkksiIx8cIk5VlZvJeJbf8Ww
include
"mysql.conf"
include
"kong.conf"
include
"redis.conf"
include
"postgres.conf"
\ No newline at end of file
include
"postgres.conf"
include
"weixin.conf"
\ No newline at end of file
conf/kong.conf
View file @
11e92e6c
[
dev
]
kongadminurl
=
"http://
192.168.1.10
:8001"
kongadminurl
=
"http://
43.198.252.255
:8001"
[
test
]
kongadminurl
=
"http://18.167.203.17:8001"
...
...
conf/mysql.conf
View file @
11e92e6c
[
dev
]
mysqluser
=
"
root
"
mysqlpass
=
"
12345678
"
mysqlhost
=
"
192.168.1.211
"
mysqluser
=
"
ai
"
mysqlpass
=
"
RFnnKHRar5xk7TEF
"
mysqlhost
=
"
43.198.252.255
"
mysqlport
=
3306
mysqldb
=
"
liuxuzhong
"
mysqldb
=
"
ai
"
[
test
]
mysqluser
=
"ai"
...
...
conf/postgres.conf
View file @
11e92e6c
[
dev
]
postgresuser
=
"admin"
postgrespass
=
"quest"
postgreshost
=
"
192.168.1.10
"
postgreshost
=
"
43.198.252.255
"
postgresport
=
8812
postgresdb
=
"qdb"
senderport
=
9009
...
...
conf/redis.conf
View file @
11e92e6c
[
dev
]
tokenhost
=
"
192.168.1.10
:6379"
tokenhost
=
"
43.198.252.255
:6379"
tokendb
=
0
tokenpass
=
""
balancehost
=
"
192.168.1.10
:6379"
balancehost
=
"
43.198.252.255
:6379"
balancedb
=
0
balancepass
=
""
...
...
conf/weixin.conf
0 → 100644
View file @
11e92e6c
[
dev
]
merchantid
=
""
serialNo
=
""
apiKey
=
""
privateKey
=
""
[
test
]
merchantid
=
""
serialNo
=
""
apiKey
=
""
privateKey
=
""
[
prod
]
merchantid
=
""
serialNo
=
""
apiKey
=
""
privateKey
=
""
\ No newline at end of file
controllers/client.go
0 → 100644
View file @
11e92e6c
This diff is collapsed.
Click to expand it.
controllers/explorer.go
0 → 100644
View file @
11e92e6c
package
controllers
import
(
"ai_developer_admin/libs/odysseus"
"ai_developer_admin/libs/postgres"
"ai_developer_admin/libs/registry"
"ai_developer_admin/models"
"encoding/json"
"fmt"
"github.com/beego/beego/orm"
"github.com/beego/beego/v2/core/logs"
"net/http"
"strconv"
)
type
ExplorerController
struct
{
MainController
}
func
(
server
*
ExplorerController
)
Statistics
()
{
body
:=
server
.
Ctx
.
Input
.
RequestBody
appRequest
:=
models
.
AppRequest
{}
err
:=
json
.
Unmarshal
(
body
,
&
appRequest
)
//解析body中数据
logs
.
Debug
(
"appRequest"
,
appRequest
)
if
err
!=
nil
{
server
.
respond
(
models
.
NoRequestBody
,
err
.
Error
())
return
}
//if appRequest.WorkerAcc == "" {
// server.respond(models.MissingParameter, "Missing worker_acc parameter")
// return
//}
countQB
,
_
:=
orm
.
NewQueryBuilder
(
"mysql"
)
countQB
.
Select
(
"count(*),sum(workload) AS workload"
)
.
From
(
"bills"
)
sql
:=
countQB
.
String
()
taskCount
,
err
:=
postgres
.
QueryBills
(
sql
)
if
err
!=
nil
{
server
.
respond
(
models
.
BusinessFailed
,
err
.
Error
())
return
}
count
:=
int64
(
0
)
workload
:=
int64
(
0
)
if
len
(
taskCount
)
>
0
{
task
:=
taskCount
[
0
]
count
,
_
=
strconv
.
ParseInt
(
task
.
Count
,
10
,
64
)
workload
,
_
=
strconv
.
ParseInt
(
task
.
Workload
,
10
,
64
)
}
_
,
total
,
_
:=
registry
.
NodeManagersByPage
(
0
,
10
)
responseData
:=
struct
{
TotalWorkload
int64
`json:"total_workload"`
TotalTask
int64
`json:"total_task"`
TotalCalls
int64
`json:"total_calls"`
NodeNums
int
`json:"node_nums"`
}{
TotalWorkload
:
workload
,
TotalTask
:
count
,
TotalCalls
:
count
,
NodeNums
:
total
,
}
server
.
respond
(
http
.
StatusOK
,
""
,
responseData
)
}
func
(
server
*
ExplorerController
)
AddressByIP
()
{
body
:=
server
.
Ctx
.
Input
.
RequestBody
appRequest
:=
models
.
AppRequest
{}
_
=
json
.
Unmarshal
(
body
,
&
appRequest
)
//解析body中数据
logs
.
Debug
(
"appRequest"
,
appRequest
,
string
(
body
))
if
appRequest
.
Ips
==
nil
||
(
appRequest
.
Ips
!=
nil
&&
len
(
appRequest
.
Ips
)
<=
0
)
{
server
.
respond
(
models
.
MissingParameter
,
"Missing ips parameter"
)
return
}
}
func
(
server
*
ExplorerController
)
AllNode
()
{
data
,
err
:=
registry
.
NodeManagers
()
if
err
!=
nil
{
server
.
respond
(
models
.
BusinessFailed
,
err
.
Error
())
return
}
server
.
respond
(
http
.
StatusOK
,
""
,
data
)
}
func
(
server
*
ExplorerController
)
NodeByPage
()
{
body
:=
server
.
Ctx
.
Input
.
RequestBody
appRequest
:=
models
.
AppRequest
{}
err
:=
json
.
Unmarshal
(
body
,
&
appRequest
)
//解析body中数据
logs
.
Debug
(
"appRequest"
,
appRequest
,
string
(
body
))
if
appRequest
.
Page
>
0
{
appRequest
.
Page
=
appRequest
.
Page
-
1
}
if
appRequest
.
Size
==
0
{
appRequest
.
Size
=
10
}
data
,
total
,
err
:=
registry
.
NodeManagersByPage
(
int
(
appRequest
.
Size
),
int
(
appRequest
.
Page
))
if
err
!=
nil
{
server
.
respond
(
models
.
BusinessFailed
,
err
.
Error
())
return
}
responseData
:=
struct
{
Total
int64
`json:"total"`
Data
interface
{}
`json:"data,omitempty"`
}{
Total
:
int64
(
total
),
Data
:
data
,
}
server
.
respond
(
http
.
StatusOK
,
""
,
responseData
)
}
func
(
server
*
ExplorerController
)
Tasks
()
{
body
:=
server
.
Ctx
.
Input
.
RequestBody
appRequest
:=
models
.
AppRequest
{}
err
:=
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
if
appRequest
.
WorkerAcc
==
""
{
server
.
respond
(
models
.
MissingParameter
,
"Missing worker_acc parameter"
)
return
}
countQB
,
_
:=
orm
.
NewQueryBuilder
(
"mysql"
)
countQB
.
Select
(
"count(*)"
)
.
From
(
"bills"
)
.
Where
(
fmt
.
Sprintf
(
"worker_acc = '%s'"
,
appRequest
.
WorkerAcc
))
queryQB
,
_
:=
orm
.
NewQueryBuilder
(
"mysql"
)
queryQB
.
Select
(
"id"
,
"fee"
,
"type"
,
"time"
,
"exec_duration"
,
"workload"
,
"profit_acc"
,
"worker_acc"
,
"result"
)
.
From
(
"bills"
)
.
Where
(
fmt
.
Sprintf
(
"worker_acc = '%s'"
,
appRequest
.
WorkerAcc
))
sql
:=
countQB
.
String
()
total
,
err
:=
postgres
.
QueryTotal
(
sql
)
if
err
!=
nil
{
server
.
respond
(
models
.
BusinessFailed
,
err
.
Error
())
return
}
logs
.
Debug
(
"total = %d"
,
total
)
var
responseTasks
[]
models
.
Bills
if
total
==
0
{
responseData
:=
struct
{
Total
int64
`json:"total"`
Data
interface
{}
`json:"data,omitempty"`
}{
Total
:
total
,
Data
:
responseTasks
,
}
server
.
respond
(
http
.
StatusOK
,
""
,
responseData
)
return
}
queryQB
.
OrderBy
(
"time"
)
.
Desc
()
sql
=
fmt
.
Sprintf
(
"%s LIMIT %d,%d;"
,
queryQB
.
String
(),
offset
,
size
)
data
,
err
:=
postgres
.
QueryBills
(
sql
)
if
err
!=
nil
{
server
.
respond
(
models
.
BusinessFailed
,
err
.
Error
())
return
}
for
_
,
task
:=
range
data
{
//apiPath := ""
//model := ""
baseModel
:=
""
//kind := 1
typeDe
:=
1
taskId
,
err
:=
strconv
.
Atoi
(
task
.
Type
)
if
err
==
nil
{
taskType
,
_
:=
odysseus
.
GetTaskType
(
int64
(
taskId
))
if
taskType
!=
nil
{
//apiPath = taskType.ApiPath
//model = taskType.Model
baseModel
=
taskType
.
BaseModel
//kind = taskType.Kind
typeDe
=
taskType
.
Type
}
}
reTask
:=
models
.
Bills
{
Id
:
task
.
Id
,
Type
:
models
.
ModelType
(
typeDe
)
.
String
(),
Time
:
task
.
Time
,
Result
:
task
.
Result
,
//ApiPath: apiPath,
//Model: model,
BaseModel
:
baseModel
,
//Kind: models.TaskKind(kind).EnString(),
//Desc: desc,
Workload
:
task
.
Workload
,
ProfitAcc
:
task
.
ProfitAcc
,
//WorkerAcc: task.WorkerAcc,
}
responseTasks
=
append
(
responseTasks
,
reTask
)
}
responseData
:=
struct
{
Total
int64
`json:"total"`
Data
interface
{}
`json:"data,omitempty"`
}{
Total
:
total
,
Data
:
responseTasks
,
}
server
.
respond
(
http
.
StatusOK
,
""
,
responseData
)
}
controllers/funds.go
View file @
11e92e6c
...
...
@@ -11,6 +11,9 @@ import (
"fmt"
"github.com/beego/beego/orm"
"github.com/beego/beego/v2/core/logs"
beego
"github.com/beego/beego/v2/server/web"
"github.com/go-pay/gopay"
"github.com/go-pay/gopay/wechat/v3"
"net/http"
"strconv"
"time"
...
...
@@ -20,6 +23,37 @@ type FundsController struct {
MainController
}
func
createWinxinPay
()
(
*
wechat
.
ClientV3
,
error
)
{
merchantid
,
_
:=
beego
.
AppConfig
.
String
(
"merchantid"
)
serialNo
,
_
:=
beego
.
AppConfig
.
String
(
"serialNo"
)
apiKey
,
_
:=
beego
.
AppConfig
.
String
(
"apiKey"
)
privateKey
,
_
:=
beego
.
AppConfig
.
String
(
"privateKey"
)
client
,
err
:=
wechat
.
NewClientV3
(
merchantid
,
serialNo
,
apiKey
,
privateKey
)
if
err
!=
nil
{
logs
.
Debug
(
"weixinRecharge"
,
err
)
return
nil
,
err
}
err
=
client
.
AutoVerifySign
()
if
err
!=
nil
{
logs
.
Debug
(
"weixinRecharge"
,
err
)
return
nil
,
err
}
client
.
DebugSwitch
=
gopay
.
DebugOn
return
client
,
nil
}
func
weixinRecharge
(
chargeRequest
*
models
.
ChargeRequest
)
error
{
//client, err := createWinxinPay()
//if err != nil {
// logs.Debug("weixinRecharge", err)
// return err
//}
return
nil
}
func
(
server
*
FundsController
)
Recharge
()
{
info
,
err
:=
server
.
Check
()
if
err
!=
nil
{
...
...
@@ -41,6 +75,26 @@ func (server *FundsController) Recharge() {
return
}
if
chargeRequest
.
PaymentMethod
==
models
.
WeixinPay
{
server
.
respond
(
models
.
BusinessFailed
,
"This payment method is not open yet"
)
return
}
else
if
chargeRequest
.
PaymentMethod
==
models
.
AliPay
{
server
.
respond
(
models
.
BusinessFailed
,
"This payment method is not open yet"
)
return
}
else
if
chargeRequest
.
PaymentMethod
==
models
.
UnionPay
{
server
.
respond
(
models
.
BusinessFailed
,
"This payment method is not open yet"
)
return
}
else
if
chargeRequest
.
PaymentMethod
==
models
.
PayPal
{
server
.
respond
(
models
.
BusinessFailed
,
"This payment method is not open yet"
)
return
}
else
if
chargeRequest
.
PaymentMethod
==
models
.
ApplePay
{
server
.
respond
(
models
.
BusinessFailed
,
"This payment method is not open yet"
)
return
}
else
{
server
.
respond
(
models
.
BusinessFailed
,
"Unknown payment method"
)
return
}
checkUser
:=
&
models
.
User
{
Id
:
info
.
UserID
}
cond
:=
"id"
if
chargeRequest
.
Mail
!=
""
{
...
...
controllers/task.go
View file @
11e92e6c
...
...
@@ -1526,6 +1526,7 @@ func (server *TaskController) AddTasktype() {
AccessStatus
:
appRequest
.
TaskTypeIn
.
AccessStatus
,
MaxExecTime
:
appRequest
.
TaskTypeIn
.
MaxExecTime
,
EstimatExeTime
:
appRequest
.
TaskTypeIn
.
EstimatExeTime
,
RunningMem
:
appRequest
.
TaskTypeIn
.
RunningMem
,
CreatedTime
:
timestamp
,
UpdatedTime
:
timestamp
,
}
...
...
@@ -1560,6 +1561,7 @@ func (server *TaskController) AddTasktype() {
FileExpiresTime
:
strconv
.
Itoa
(
dbType
.
ResultFileExpires
),
AccessStatus
:
dbType
.
AccessStatus
,
PublishStatus
:
dbType
.
PublishStatus
,
RunningMem
:
dbType
.
RunningMem
,
}
response
=
append
(
response
,
retask
)
data
,
err
:=
json
.
Marshal
(
response
)
...
...
@@ -1707,6 +1709,7 @@ func (server *TaskController) UpdateTaskType() {
AccessStatus
:
appRequest
.
TaskTypeIn
.
AccessStatus
,
MaxExecTime
:
appRequest
.
TaskTypeIn
.
MaxExecTime
,
EstimatExeTime
:
appRequest
.
TaskTypeIn
.
EstimatExeTime
,
RunningMem
:
appRequest
.
TaskTypeIn
.
RunningMem
,
UpdatedTime
:
timestamp
,
}
...
...
@@ -1736,7 +1739,8 @@ func (server *TaskController) UpdateTaskType() {
"publish_status"
,
"access_status"
,
"estimat_exe_time"
,
"max_exec_time"
)
"max_exec_time"
,
"running_mem"
)
if
err
!=
nil
{
//ormer.Rollback()
server
.
respond
(
models
.
BusinessFailed
,
"failed"
)
...
...
@@ -1774,6 +1778,7 @@ func (server *TaskController) UpdateTaskType() {
task
.
OutPutJson
=
output
task
.
AccessStatus
=
dbType
.
AccessStatus
task
.
PublishStatus
=
dbType
.
PublishStatus
task
.
RunningMem
=
dbType
.
RunningMem
}
}
data
,
err
:=
json
.
Marshal
(
response
)
...
...
@@ -1923,6 +1928,7 @@ func (server *TaskController) GetTaskTypes() {
PublishStatus
:
data
.
PublishStatus
,
AccessStatus
:
data
.
AccessStatus
,
ResultFileExpires
:
data
.
ResultFileExpires
,
RunningMem
:
data
.
RunningMem
,
}
remodels
=
append
(
remodels
,
&
remodel
)
}
...
...
@@ -2159,6 +2165,7 @@ func (server *TaskController) Lists() {
PublishStatus
:
data
.
PublishStatus
,
AccessStatus
:
data
.
AccessStatus
,
ResultFileExpires
:
data
.
ResultFileExpires
,
RunningMem
:
data
.
RunningMem
,
}
remodels
=
append
(
remodels
,
&
remodel
)
}
...
...
@@ -2924,6 +2931,7 @@ func initTypeInRedis() []models.TaskHeat {
PublishStatus
:
dbType
.
PublishStatus
,
EstimatExeTime
:
dbType
.
EstimatExeTime
,
StartUpTime
:
dbType
.
StartUpTime
,
RunningMem
:
dbType
.
RunningMem
,
}
response
=
append
(
response
,
retask
)
}
...
...
controllers/user.go
View file @
11e92e6c
...
...
@@ -166,10 +166,15 @@ func (server *UserController) Regisger() {
server
.
respond
(
models
.
NoRequestBody
,
err
.
Error
())
return
}
//if len(user.Username) == 0 {
// server.respond(models.MissingParameter, "Missing username parameter")
// return
//}
//}
if
len
(
user
.
Username
)
==
0
{
server
.
respond
(
models
.
MissingParameter
,
"Missing username parameter"
)
return
user
.
Username
=
"ai_"
+
generatorMD5
(
user
.
Mail
)[
0
:
8
]
}
user
.
VerifierId
=
user
.
Username
_
,
err
=
regisgerUser
(
user
)
if
err
!=
nil
{
...
...
go.mod
View file @
11e92e6c
...
...
@@ -7,6 +7,7 @@ require github.com/beego/beego/v2 v2.0.1
require (
github.com/beego/beego v1.12.12
github.com/go-jose/go-jose/v3 v3.0.1
github.com/go-pay/gopay v1.5.100
github.com/go-sql-driver/mysql v1.7.1
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/google/uuid v1.5.0
...
...
@@ -16,7 +17,8 @@ require (
github.com/questdb/go-questdb-client/v2 v2.0.0
github.com/robfig/cron/v3 v3.0.1
github.com/smartystreets/goconvey v1.6.4
golang.org/x/crypto v0.17.0
github.com/sony/sonyflake v1.2.0
golang.org/x/crypto v0.18.0
gopkg.in/redis.v5 v5.2.9
)
...
...
@@ -25,6 +27,13 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/go-pay/bm v0.0.1 // indirect
github.com/go-pay/crypto v0.0.1 // indirect
github.com/go-pay/errgroup v0.0.2 // indirect
github.com/go-pay/util v0.0.2 // indirect
github.com/go-pay/xhttp v0.0.2 // indirect
github.com/go-pay/xlog v0.0.2 // indirect
github.com/go-pay/xtime v0.0.2 // indirect
github.com/go-redis/redis/v7 v7.4.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/gomodule/redigo v2.0.0+incompatible // indirect
...
...
@@ -42,7 +51,6 @@ require (
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
github.com/sony/sonyflake v1.2.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.16.0 // indirect
golang.org/x/sys v0.16.0 // indirect
...
...
go.sum
View file @
11e92e6c
...
...
@@ -72,6 +72,22 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-pay/bm v0.0.1 h1:F2d1KhrupJr7yGPCQTVeYjeOJwN35WhoofopSm6undY=
github.com/go-pay/bm v0.0.1/go.mod h1:/6bIb0yBj8JbATmE+ib41me4RikMGN3f/XSDF5FjsPQ=
github.com/go-pay/crypto v0.0.1 h1:B6InT8CLfSLc6nGRVx9VMJRBBazFMjr293+jl0lLXUY=
github.com/go-pay/crypto v0.0.1/go.mod h1:41oEIvHMKbNcYlWUlRWtsnC6+ASgh7u29z0gJXe5bes=
github.com/go-pay/errgroup v0.0.2 h1:5mZMdm0TDClDm2S3G0/sm0f8AuQRtz0dOrTHDR9R8Cc=
github.com/go-pay/errgroup v0.0.2/go.mod h1:0+4b8mvFMS71MIzsaC+gVvB4x37I93lRb2dqrwuU8x8=
github.com/go-pay/gopay v1.5.100 h1:jFpyLA/flrSigY0WFpNaSuQcMFn0yjFpObBnlTzqO9Y=
github.com/go-pay/gopay v1.5.100/go.mod h1:3z9xfh7w3x5rJzH9qFb3oxPOeaBrFP4kB3LNVXbziHM=
github.com/go-pay/util v0.0.2 h1:goJ4f6kNY5zzdtg1Cj8oWC+Cw7bfg/qq2rJangMAb9U=
github.com/go-pay/util v0.0.2/go.mod h1:qM8VbyF1n7YAPZBSJONSPMPsPedhUTktewUAdf1AjPg=
github.com/go-pay/xhttp v0.0.2 h1:O8rnd/d03WsboFtUthwFMg61ikHRfYHyD1m0JiUx60g=
github.com/go-pay/xhttp v0.0.2/go.mod h1:BnuvXpLKkXTFMOBc5MTb0hxdrstwunbzQPJUZOsNbt4=
github.com/go-pay/xlog v0.0.2 h1:kUg5X8/5VZAPDg1J5eGjA3MG0/H5kK6Ew0dW/Bycsws=
github.com/go-pay/xlog v0.0.2/go.mod h1:DbjMADPK4+Sjxj28ekK9goqn4zmyY4hql/zRiab+S9E=
github.com/go-pay/xtime v0.0.2 h1:7YR4/iuELsEHpJ6LUO0SVK80hQxDO9MLCfuVYIiTCRM=
github.com/go-pay/xtime v0.0.2/go.mod h1:W1yRbJaSt4CSBcdAtLBQ8xajiN/Pl5hquGczUcUE9xE=
github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-redis/redis/v7 v7.4.0 h1:7obg6wUoj05T0EpY0o8B59S9w5yeMWql7sw2kwNW1x4=
github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
...
...
@@ -251,8 +267,8 @@ golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.1
7.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k
=
golang.org/x/crypto v0.1
7.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4
=
golang.org/x/crypto v0.1
8.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc
=
golang.org/x/crypto v0.1
8.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg
=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20231005195138-3e424a577f31 h1:9k5exFQKQglLo+RoP+4zMjOFE14P6+vyR0baDAi0Rcs=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
...
...
libs/cronjob/cronjob.go
View file @
11e92e6c
...
...
@@ -107,6 +107,7 @@ func startHeatKey() {
PublishStatus
:
dbType
.
PublishStatus
,
EstimatExeTime
:
dbType
.
EstimatExeTime
,
StartUpTime
:
dbType
.
StartUpTime
,
RunningMem
:
dbType
.
RunningMem
,
}
response
=
append
(
response
,
&
retask
)
}
...
...
models/app.go
View file @
11e92e6c
...
...
@@ -67,6 +67,9 @@ type AppRequest struct {
//任务柱状图
Period
int
`json:"period,omitempty"`
//浏览器
Ips
[]
string
`json:"ips,omitempty"`
}
type
EnumType
struct
{
...
...
models/task.go
View file @
11e92e6c
...
...
@@ -106,6 +106,7 @@ type TaskType struct {
EstimatExeTime
int
`json:"estimat_exe_time";orm:"column(estimat_exe_time)"`
StartUpTime
int
`json:"start_up_time";orm:"column(start_up_time)"`
MaxExecTime
int
`json:"max_exec_time";orm:"column(max_exec_time)"`
RunningMem
int
`json:"running_mem";orm:"column(running_mem)"`
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)"`
...
...
@@ -151,6 +152,7 @@ type NewTaskType struct {
StartUpTime
int
`json:"start_up_time";orm:"column(start_up_time)"`
EstimatExeTime
int
`json:"estimat_exe_time";orm:"column(estimat_exe_time)"`
MaxExecTime
int
`json:"max_exec_time";orm:"column(max_exec_time)"`
RunningMem
int
`json:"running_mem";orm:"column(running_mem)"`
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)"`
...
...
@@ -180,6 +182,7 @@ type Model struct {
Sort
int
`json:"sort";orm:"column(sort)"`
EstimatExeTime
int
`json:"estimat_exe_time";orm:"column(estimat_exe_time)"`
StartUpTime
int
`json:"start_up_time";orm:"column(start_up_time)"`
RunningMem
int
`json:"running_mem";orm:"column(running_mem)"`
IsFavorite
int
`json:"is_favorite"`
}
...
...
@@ -207,31 +210,34 @@ type ResonseModel struct {
Sort
int
`json:"sort";orm:"column(sort)"`
EstimatExeTime
int
`json:"estimat_exe_time";orm:"column(estimat_exe_time)"`
StartUpTime
int
`json:"start_up_time";orm:"column(start_up_time)"`
RunningMem
int
`json:"running_mem";orm:"column(running_mem)"`
IsFavorite
int
`json:"is_favorite"`
}
type
Bills
struct
{
//Key int `orm:"column(key);auto"`
Id
string
`json:"id";orm:"column(id)"`
Type
string
`json:"type";orm:"column(type)"`
Id
string
`json:"id
,omitempty
";orm:"column(id)"`
Type
string
`json:"type
,omitempty
";orm:"column(type)"`
Kind
string
`json:"kind,omitempty"`
Uid
string
`json:"uid";orm:"column(uid)"`
ProfitAcc
string
`json:"profit_acc";orm:"column(profit_acc)"`
Fee
string
`json:"fee";orm:"column(fee)"`
WorkerAcc
string
`json:"worker_acc";orm:"column(worker_acc)"`
Result
string
`json:"result";orm:"column(result)"`
Workload
string
`json:"workload";orm:"column(workload)"`
Uid
string
`json:"uid
,omitempty
";orm:"column(uid)"`
ProfitAcc
string
`json:"profit_acc
,omitempty
";orm:"column(profit_acc)"`
Fee
string
`json:"fee
,omitempty
";orm:"column(fee)"`
WorkerAcc
string
`json:"worker_acc
,omitempty
";orm:"column(worker_acc)"`
Result
string
`json:"result
,omitempty
";orm:"column(result)"`
Workload
string
`json:"workload
,omitempty
";orm:"column(workload)"`
//ApiPath string `json:"api_path";orm:"column(api_path)"`
Time
time
.
Time
`json:"time";orm:"column(time);type(datetime)"`
TaskDuration
string
`json:"task_duration";orm:"column(task_duration)"`
OutLen
string
`json:"out_len";orm:"column(out_len)"`
InLen
string
`json:"in_len";orm:"column(in_len)"`
Time
time
.
Time
`json:"time,omitempty";orm:"column(time);type(datetime)"`
TaskDuration
string
`json:"task_duration,omitempty";orm:"column(task_duration)"`
ExecDuration
string
`json:"exec_duration,omitempty";orm:"column(exec_duration)"`
OutLen
string
`json:"out_len,omitempty";orm:"column(out_len)"`
InLen
string
`json:"in_len,omitempty";orm:"column(in_len)"`
ApiPath
string
`json:"api_path,omitempty"`
Desc
string
`json:"desc,omitempty"`
TaskType
string
`json:"task_type,omitempty"`
Balance
int64
`json:"balance,omitempty"`
BaseModel
string
`json:"base_model,omitempty"`
Model
string
`json:"model,omitempty"`
Count
string
`json:"count,omitempty"`
}
type
TotalType
struct
{
...
...
@@ -273,6 +279,7 @@ type TaskHeat struct {
PublishStatus
int
`json:"publish_status,omitempty"`
EstimatExeTime
int
`json:"estimat_exe_time"`
StartUpTime
int
`json:"start_up_time"`
RunningMem
int
`json:"running_mem";orm:"column(running_mem)"`
}
type
AddTaskType
struct
{
...
...
routers/router.go
View file @
11e92e6c
...
...
@@ -17,4 +17,6 @@ func init() {
beego
.
AutoPrefix
(
"admin/api"
,
&
controllers
.
FileController
{})
beego
.
AutoPrefix
(
"admin/api"
,
&
controllers
.
FavoriteController
{})
beego
.
AutoPrefix
(
"admin/api/task"
,
&
controllers
.
VersionController
{})
beego
.
AutoPrefix
(
"public/api"
,
&
controllers
.
ClientController
{})
beego
.
AutoPrefix
(
"public/api"
,
&
controllers
.
ExplorerController
{})
}
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