Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
3d9e78d0
提交
3d9e78d0
authored
2月 24, 2022
作者:
gukai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
消息增加选品库类型
上级
79ef27e3
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
46 行增加
和
16 行删除
+46
-16
message.go
notify/message.go
+44
-15
model.go
notify/model.go
+2
-1
没有找到文件。
notify/message.go
浏览文件 @
3d9e78d0
...
@@ -23,25 +23,36 @@ const (
...
@@ -23,25 +23,36 @@ const (
NotifyTopic
=
"notifyMessage"
NotifyTopic
=
"notifyMessage"
//消息类型
//消息类型
ProductExpire
=
101
ProductModify
=
102
//商品消息
ProductPrice
=
103
ProductExpire
=
101
//商品下架
ProductRepost
=
104
ProductModify
=
102
//商品修改
OrderSendgoods
=
201
ProductPrice
=
103
//价格变更
OrderComfirmReceiveGoods
=
202
ProductRepost
=
104
//商品商家
OrderSuccess
=
203
OrderCancel
=
204
//订单消息
RefundApply
=
300
OrderSendgoods
=
201
//订单发货
RefundAgree
=
301
OrderComfirmReceiveGoods
=
202
//确认收货
RefundRefuse
=
302
OrderSuccess
=
203
//交易成功
RefundSuccess
=
303
OrderCancel
=
204
//订单取消
RefundApply
=
300
//申请售后
ImportTags
=
401
RefundAgree
=
301
//商家同意售后
RefundRefuse
=
302
//商家拒绝售后
RefundSuccess
=
303
//售后成功
//标签消息
TagsImport
=
401
//导入标签
//选品消息
GoodsStorageAdd
=
501
//添加选品库
GoodsStorageRemove
=
502
//移除选品库
ErrMsgParamEmpty
=
"该类型消息对应字段不能为空"
ErrMsgParamEmpty
=
"该类型消息对应字段不能为空"
ErrMsgAppIDEmpty
=
"该类型消息appid字段不能为空"
ErrMsgAppIDEmpty
=
"该类型消息appid字段不能为空"
ErrMsgTpye
=
"错误的消息类型"
)
)
//推送下游对应字段
var
(
var
(
SendMsgType
=
g
.
MapIntStr
{
SendMsgType
=
g
.
MapIntStr
{
ProductExpire
:
"goods.undercarriage"
,
ProductExpire
:
"goods.undercarriage"
,
...
@@ -54,6 +65,10 @@ var (
...
@@ -54,6 +65,10 @@ var (
OrderSuccess
:
"order.success"
,
OrderSuccess
:
"order.success"
,
OrderCancel
:
"order.cancel"
,
OrderCancel
:
"order.cancel"
,
GoodsStorageAdd
:
"goods.storage.add"
,
GoodsStorageRemove
:
"goods.storage.remove"
,
TagsImport
:
"tags.import"
,
RefundAgree
:
"afterSale.agree"
,
RefundAgree
:
"afterSale.agree"
,
RefundRefuse
:
"afterSale.refuse"
,
RefundRefuse
:
"afterSale.refuse"
,
RefundSuccess
:
"afterSale.success"
,
RefundSuccess
:
"afterSale.success"
,
...
@@ -113,8 +128,22 @@ func (p *NsqProducer) msgValidator(notifyMessage *NotifyMessage) (err error) {
...
@@ -113,8 +128,22 @@ func (p *NsqProducer) msgValidator(notifyMessage *NotifyMessage) (err error) {
err
=
errors
.
New
(
ErrMsgAppIDEmpty
)
err
=
errors
.
New
(
ErrMsgAppIDEmpty
)
return
return
}
}
case
5
:
var
msgData
*
GoodsMsgData
if
err
=
gconv
.
Struct
(
notifyMessage
.
Data
,
&
msgData
);
err
!=
nil
{
return
}
if
len
(
msgData
.
GoodsIDs
)
==
0
{
err
=
errors
.
New
(
ErrMsgParamEmpty
)
return
}
if
notifyMessage
.
AppID
==
0
{
err
=
errors
.
New
(
ErrMsgAppIDEmpty
)
return
}
default
:
default
:
err
=
errors
.
New
(
ErrMsg
AppIDEmpty
)
err
=
errors
.
New
(
ErrMsg
Tpye
)
}
}
return
return
}
}
...
...
notify/model.go
浏览文件 @
3d9e78d0
...
@@ -49,5 +49,6 @@ type RefundMsgData struct {
...
@@ -49,5 +49,6 @@ type RefundMsgData struct {
}
}
type
TagsMsgData
struct
{
type
TagsMsgData
struct
{
Tags
string
`json:"tags"`
Tags
string
`json:"tags"`
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论