Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
golang-callback
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
07294145
authored
Aug 20, 2021
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
c77aa319
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
app/service/http/service.go
cmd/http/main.go
app/service/http/service.go
View file @
07294145
...
...
@@ -93,7 +93,9 @@ func Callback(ctx *gin.Context) (err error){
sql
:=
" insert into lie_async_task (callback_domain,callback_uri,request_type,data,method,service_type,create_time,is_http_json,header,remark,callback_func) values (?,?,?,?,?,?,?,?,?,?,?) "
//fmt.Println(sql)
session
:=
http
.
Dao
.
GetDb
(
"async_task"
)
.
NewSession
()
defer
session
.
Close
()
defer
func
()
{
_
=
session
.
Close
()
}()
err
=
session
.
Begin
()
if
err
!=
nil
{
return
...
...
@@ -113,7 +115,7 @@ func Callback(ctx *gin.Context) (err error){
if
msg
,
err
:=
json
.
Marshal
(
req
);
err
==
nil
{
//插入队列
addMsg
(
string
(
msg
))
_
=
addMsg
(
string
(
msg
))
err
=
session
.
Commit
()
}
else
{
err
=
session
.
Rollback
()
...
...
cmd/http/main.go
View file @
07294145
...
...
@@ -19,7 +19,7 @@ func main(){
flag
.
StringVar
(
&
configPath
,
"config"
,
"./config/dev/"
,
"配置文件"
)
flag
.
StringVar
(
&
logPath
,
"logdir"
,
"./logs/"
,
"日志文件存储目录"
)
flag
.
Parse
()
http
.
Init
(
configPath
,
logPath
)
_
=
http
.
Init
(
configPath
,
logPath
)
go
func
()
{
router
.
HttpServerRun
()
}()
...
...
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