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
5efb81a1
Commit
5efb81a1
authored
Feb 02, 2024
by
brent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify task
parent
e0008b70
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
56 additions
and
20 deletions
+56
-20
.DS_Store
.DS_Store
+0
-0
Dockerfile
Dockerfile
+2
-1
app.conf
conf/app.conf
+2
-0
kong.conf
conf/kong.conf
+1
-1
mysql.conf
conf/mysql.conf
+10
-4
postgres.conf
conf/postgres.conf
+1
-1
redis.conf
conf/redis.conf
+4
-4
task.go
controllers/task.go
+14
-8
user.go
controllers/user.go
+2
-0
go.mod
go.mod
+3
-0
go.sum
go.sum
+7
-0
.DS_Store
libs/.DS_Store
+0
-0
main.go
main.go
+10
-1
No files found.
.DS_Store
View file @
5efb81a1
No preview for this file type
Dockerfile
View file @
5efb81a1
...
...
@@ -9,7 +9,8 @@ RUN go env -w CGO_ENABLED="1"
WORKDIR
/build
RUN
git clone https://code.wuban.net.cn/odysseus/admin-backend
RUN
git clone https://code.wuban.net.cn/odysseus/admin-backend
&&
\
git clone https://code.wuban.net.cn/odysseus/payment
RUN
cd
/build/admin-backend
&&
go build
-o
/admin-backend
...
...
conf/app.conf
View file @
5efb81a1
...
...
@@ -4,6 +4,8 @@ runmode = dev
copyrequestbody
=
true
sessionon
=
true
sessiongcmaxlifetime
=
127800
logLevel
=
7
logfile
=
"admin_backend.log"
;
SessionProvider
=
"redis"
;
SessionProviderConfig
=
"192.168.1.10:6379,1000"
web3ClientId
=
"BHciicCbodMasHsyVfcdPYCaCokJMK5wGs2H4IRCaseqNJlcb1Li4kExaf5gF5DoUx-m_77epCrRPq4XmQzzdRk"
...
...
conf/kong.conf
View file @
5efb81a1
...
...
@@ -2,4 +2,4 @@
kongadminurl
=
"http://192.168.1.10:8001"
[
prod
]
kongadminurl
=
"http://192.168.1.10:8001"
\ No newline at end of file
kongadminurl
=
"http://172.31.12.187:8001"
\ No newline at end of file
conf/mysql.conf
View file @
5efb81a1
...
...
@@ -5,9 +5,15 @@ mysqlhost = "192.168.1.211"
mysqlport
=
3306
mysqldb
=
"liuxuzhong"
;
mysqluser
=
"ai"
;
mysqlpass
=
"RFnnKHRar5xk7TEF"
;
mysqlhost
=
"43.198.252.255"
;
mysqlport
=
3306
;
mysqldb
=
"ai"
[
prod
]
mysqluser
=
"
root
"
mysqlpass
=
"
12345678
"
mysqlhost
=
"1
92.168.1.211
"
mysqluser
=
"
ai
"
mysqlpass
=
"
RFnnKHRar5xk7TEF
"
mysqlhost
=
"1
72.31.12.187
"
mysqlport
=
3306
mysqldb
=
"liuxuzhong"
\ No newline at end of file
mysqldb
=
"ai"
\ No newline at end of file
conf/postgres.conf
View file @
5efb81a1
...
...
@@ -8,6 +8,6 @@ postgresdb = "qdb"
[
prod
]
postgresuser
=
"admin"
postgrespass
=
"quest"
postgreshost
=
"1
92.168.1.10
"
postgreshost
=
"1
72.31.12.187
"
postgresport
=
8812
postgresdb
=
"qdb"
\ No newline at end of file
conf/redis.conf
View file @
5efb81a1
...
...
@@ -9,12 +9,12 @@ balancepass = ""
[
prod
]
tokenhost
=
"1
92.168.1.10
:6379"
tokenhost
=
"1
72.31.12.187
:6379"
tokendb
=
0
tokenpass
=
""
tokenpass
=
"
iH0g2CqzjI6SfercGwsT
"
balancehost
=
"1
92.168.1.10
:6379"
balancehost
=
"1
72.31.12.187
:6379"
balancedb
=
0
balancepass
=
""
balancepass
=
"
iH0g2CqzjI6SfercGwsT
"
controllers/task.go
View file @
5efb81a1
...
...
@@ -662,14 +662,14 @@ func (server *TaskController) UserTaskTypeFeePercentage() {
}
func
(
server
*
TaskController
)
AddTasktype
()
{
_
,
err
:=
server
.
Check
()
if
err
!=
nil
{
server
.
respond
(
http
.
StatusUnauthorized
,
err
.
Error
())
return
}
//
_, err := server.Check()
//
if err != nil {
//
server.respond(http.StatusUnauthorized, err.Error())
//
return
//
}
body
:=
server
.
Ctx
.
Input
.
RequestBody
appRequest
:=
models
.
AddTaskType
{}
err
=
json
.
Unmarshal
(
body
,
&
appRequest
)
//解析body中数据
err
:
=
json
.
Unmarshal
(
body
,
&
appRequest
)
//解析body中数据
logs
.
Debug
(
"appRequest"
,
appRequest
)
if
err
!=
nil
{
server
.
respond
(
models
.
NoRequestBody
,
err
.
Error
())
...
...
@@ -773,9 +773,15 @@ func (server *TaskController) GetTaskTypes() {
func
(
server
*
TaskController
)
TaskHeat
()
{
data
,
err
:=
redis
.
GetDataToString
(
"task:heat"
)
var
response
[]
models
.
TaskHeat
if
err
!=
nil
{
server
.
respond
(
models
.
BusinessFailed
,
err
.
Error
())
server
.
respond
(
http
.
StatusOK
,
""
,
response
)
return
}
err
=
json
.
Unmarshal
([]
byte
(
data
),
&
response
)
if
err
!=
nil
{
server
.
respond
(
http
.
StatusOK
,
""
,
response
)
return
}
server
.
respond
(
http
.
StatusOK
,
""
,
data
)
server
.
respond
(
http
.
StatusOK
,
""
,
response
)
}
controllers/user.go
View file @
5efb81a1
...
...
@@ -214,9 +214,11 @@ func regisgerUser(user models.User) (*models.User, error) {
data
,
err
:=
kong
.
CreateUser
(
checkUser
)
if
err
!=
nil
{
mysql
.
GetMysqlInstace
()
.
Ormer
.
Delete
(
checkUser
)
return
nil
,
err
}
if
data
.
Id
==
""
{
mysql
.
GetMysqlInstace
()
.
Ormer
.
Delete
(
checkUser
)
return
nil
,
errors
.
New
(
data
.
Message
)
}
...
...
go.mod
View file @
5efb81a1
...
...
@@ -29,6 +29,8 @@ require (
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
github.com/lestrrat-go/strftime v1.0.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
...
...
@@ -37,6 +39,7 @@ require (
github.com/prometheus/common v0.10.0 // indirect
github.com/prometheus/procfs v0.1.3 // indirect
github.com/redis/go-redis/v9 v9.4.0 // indirect
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
...
...
go.sum
View file @
5efb81a1
...
...
@@ -119,6 +119,11 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is=
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4=
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA=
github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ=
github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw=
github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
...
...
@@ -170,6 +175,8 @@ github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFB
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/redis/go-redis/v9 v9.4.0 h1:Yzoz33UZw9I/mFhx4MNrB6Fk+XHO1VukNcCa1+lwyKk=
github.com/redis/go-redis/v9 v9.4.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 h1:mZHayPoR0lNmnHyvtYjDeq0zlVHn9K/ZXoy17ylucdo=
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5/go.mod h1:GEXHk5HgEKCvEIIrSpFI3ozzG5xOKA2DVlEX/gGnewM=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
...
...
libs/.DS_Store
View file @
5efb81a1
No preview for this file type
main.go
View file @
5efb81a1
...
...
@@ -24,8 +24,17 @@ func main() {
//temp := fmt.Sprintf(t.Format("2006-01-02T15:04:05.000000Z"))
//logs.Debug("temp = ", temp)
cronjob
.
Start
()
//log.InitLog(log.LogConfig{Path: "logs", Level: "debug", Save: 3})
//level, _ := beego.AppConfig.Int("logLevel")
//logs.SetLevel(level)
//fileName, _ := beego.AppConfig.String("logfile")
//if fileName != "" {
// config := fmt.Sprintf("{\"filename\":\"%s\"}", fileName)
// logs.SetLogger(logs.AdapterFile, config)
//}
cronjob
.
Start
()
mysql
.
GetMysqlInstace
()
//postgres.Query("")
beego
.
Run
()
...
...
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