Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
golang-queue-server
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
1f137d17
authored
May 15, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
9d592f1a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
12 deletions
erp/main.go
go.mod
go.sum
erp/main.go
View file @
1f137d17
...
@@ -3,7 +3,7 @@ package main
...
@@ -3,7 +3,7 @@ package main
import
(
import
(
"flag"
"flag"
"fmt"
"fmt"
"github.com/ichunt2019/go
-rabbitmq
/utils/rabbitmq"
"github.com/ichunt2019/go
lang-rbmq-sl
/utils/rabbitmq"
"github.com/ichunt2019/logger"
"github.com/ichunt2019/logger"
"go-queue-server/dal/db"
"go-queue-server/dal/db"
"go-queue-server/erp/label"
"go-queue-server/erp/label"
...
@@ -25,25 +25,19 @@ type RecvPro struct {
...
@@ -25,25 +25,19 @@ type RecvPro struct {
func
(
t
*
RecvPro
)
Consumer
(
dataByte
[]
byte
)
error
{
func
(
t
*
RecvPro
)
Consumer
(
dataByte
[]
byte
)
error
{
logger
.
Info
(
string
(
dataByte
))
logger
.
Info
(
string
(
dataByte
))
error
:=
label
.
AddTemplateRelations
(
dataByte
)
error
:=
label
.
AddTemplateRelations
(
dataByte
)
if
error
!=
nil
{
ding
.
Send
(
util
.
Configs
.
Ding_msg
.
ErpLabelWebhook
,
"标签库系统告警:@all"
,
fmt
.
Sprintf
(
"erp推送销售单据到平台数据处理失败:%s"
,
error
)
+
string
(
dataByte
)
,
make
([]
string
,
0
),
false
,
)
}
return
error
return
error
}
}
//消息已经消费3次 失败了 请进行处理
//消息已经消费3次 失败了 请进行处理
func
(
t
*
RecvPro
)
FailAction
(
dataByte
[]
byte
)
error
{
func
(
t
*
RecvPro
)
FailAction
(
err
error
,
dataByte
[]
byte
)
error
{
logger
.
Error
(
"任务处理失败了,我要进入db日志库了"
)
logger
.
Error
(
"任务处理失败了,我要进入db日志库了"
)
logger
.
Error
(
"任务处理失败了,发送钉钉消息通知主人"
)
logger
.
Error
(
"任务处理失败了,发送钉钉消息通知主人"
)
logger
.
Error
(
string
(
dataByte
))
logger
.
Error
(
string
(
dataByte
))
logger
.
Error
(
"错误原因:%s"
,
err
)
ding
.
Send
(
ding
.
Send
(
util
.
Configs
.
Ding_msg
.
ErpLabelWebhook
,
util
.
Configs
.
Ding_msg
.
ErpLabelWebhook
,
"标签库系统告警:@all"
,
fmt
.
Sprintf
(
"erp推送销售单据到平台数据处理失败"
)
+
string
(
dataByte
)
,
"@所有人 标签库系统告警:
\n
"
,
fmt
.
Sprintf
(
"失败原因:%s
\n
%s"
,
err
,
string
(
dataByte
))
,
make
([]
string
,
0
),
make
([]
string
,
0
),
false
,
false
,
)
)
...
...
go.mod
View file @
1f137d17
...
@@ -9,7 +9,7 @@ require (
...
@@ -9,7 +9,7 @@ require (
github.com/go-sql-driver/mysql v1.4.1
github.com/go-sql-driver/mysql v1.4.1
github.com/gomodule/redigo v2.0.0+incompatible
github.com/gomodule/redigo v2.0.0+incompatible
github.com/ichunt2019/go-msgserver v1.0.4
github.com/ichunt2019/go-msgserver v1.0.4
github.com/ichunt2019/go
-rabbitmq v1.0.1
// indirect
github.com/ichunt2019/go
lang-rbmq-sl v0.0.0-20200515075131-59a37ab77d7d
// indirect
github.com/ichunt2019/logger v1.0.5
github.com/ichunt2019/logger v1.0.5
github.com/jmoiron/sqlx v1.2.0
github.com/jmoiron/sqlx v1.2.0
github.com/prometheus/common v0.7.0 // indirect
github.com/prometheus/common v0.7.0 // indirect
...
...
go.sum
View file @
1f137d17
...
@@ -37,6 +37,8 @@ github.com/ichunt2019/go-msgserver v1.0.4/go.mod h1:fWAvbry0W9nhmkqgT2agwRqYCWlg
...
@@ -37,6 +37,8 @@ github.com/ichunt2019/go-msgserver v1.0.4/go.mod h1:fWAvbry0W9nhmkqgT2agwRqYCWlg
github.com/ichunt2019/go-msgserver v1.0.5 h1:yanQ95Ld0etJzVhyZql0jhXXE18qGFX48qFgTCim5hg=
github.com/ichunt2019/go-msgserver v1.0.5 h1:yanQ95Ld0etJzVhyZql0jhXXE18qGFX48qFgTCim5hg=
github.com/ichunt2019/go-rabbitmq v1.0.1 h1:qHhpGm9v7jnhSBo3f3viX+BSky9yugp9lCSV03eYsF4=
github.com/ichunt2019/go-rabbitmq v1.0.1 h1:qHhpGm9v7jnhSBo3f3viX+BSky9yugp9lCSV03eYsF4=
github.com/ichunt2019/go-rabbitmq v1.0.1/go.mod h1:TQsZ1XWULyvm4UwpYHwNPtOXYbuVvLLI0GM7g/BRy68=
github.com/ichunt2019/go-rabbitmq v1.0.1/go.mod h1:TQsZ1XWULyvm4UwpYHwNPtOXYbuVvLLI0GM7g/BRy68=
github.com/ichunt2019/golang-rbmq-sl v0.0.0-20200515075131-59a37ab77d7d h1:wN4ay65hYnXyqn1BWc/WgCpPf+IYwYDRbLASYZyQrPw=
github.com/ichunt2019/golang-rbmq-sl v0.0.0-20200515075131-59a37ab77d7d/go.mod h1:sUQJFISXhgUd5EjkbKphSoxHiGL5BMkTQ/9rfT0lVCw=
github.com/ichunt2019/logger v1.0.3 h1:sH4HfpzYIP9jGGx2AGqN1vRMaph299jB5/L7mwfUMwY=
github.com/ichunt2019/logger v1.0.3 h1:sH4HfpzYIP9jGGx2AGqN1vRMaph299jB5/L7mwfUMwY=
github.com/ichunt2019/logger v1.0.3/go.mod h1:5IWMrrqJIWwOIGav9ACWOI+KOuYeteUvOei4zubclwg=
github.com/ichunt2019/logger v1.0.3/go.mod h1:5IWMrrqJIWwOIGav9ACWOI+KOuYeteUvOei4zubclwg=
github.com/ichunt2019/logger v1.0.4 h1:y8xfaOLk/5Q++YBoq3x+NCf5Z4WpsQe4juCD2n/ul14=
github.com/ichunt2019/logger v1.0.4 h1:y8xfaOLk/5Q++YBoq3x+NCf5Z4WpsQe4juCD2n/ul14=
...
...
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