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 (
NotifyTopic
=
"notifyMessage"
//消息类型
ProductExpire
=
101
ProductModify
=
102
ProductPrice
=
103
ProductRepost
=
104
OrderSendgoods
=
201
OrderComfirmReceiveGoods
=
202
OrderSuccess
=
203
OrderCancel
=
204
RefundApply
=
300
RefundAgree
=
301
RefundRefuse
=
302
RefundSuccess
=
303
ImportTags
=
401
//商品消息
ProductExpire
=
101
//商品下架
ProductModify
=
102
//商品修改
ProductPrice
=
103
//价格变更
ProductRepost
=
104
//商品商家
//订单消息
OrderSendgoods
=
201
//订单发货
OrderComfirmReceiveGoods
=
202
//确认收货
OrderSuccess
=
203
//交易成功
OrderCancel
=
204
//订单取消
RefundApply
=
300
//申请售后
RefundAgree
=
301
//商家同意售后
RefundRefuse
=
302
//商家拒绝售后
RefundSuccess
=
303
//售后成功
//标签消息
TagsImport
=
401
//导入标签
//选品消息
GoodsStorageAdd
=
501
//添加选品库
GoodsStorageRemove
=
502
//移除选品库
ErrMsgParamEmpty
=
"该类型消息对应字段不能为空"
ErrMsgAppIDEmpty
=
"该类型消息appid字段不能为空"
ErrMsgTpye
=
"错误的消息类型"
)
//推送下游对应字段
var
(
SendMsgType
=
g
.
MapIntStr
{
ProductExpire
:
"goods.undercarriage"
,
...
...
@@ -54,6 +65,10 @@ var (
OrderSuccess
:
"order.success"
,
OrderCancel
:
"order.cancel"
,
GoodsStorageAdd
:
"goods.storage.add"
,
GoodsStorageRemove
:
"goods.storage.remove"
,
TagsImport
:
"tags.import"
,
RefundAgree
:
"afterSale.agree"
,
RefundRefuse
:
"afterSale.refuse"
,
RefundSuccess
:
"afterSale.success"
,
...
...
@@ -113,8 +128,22 @@ func (p *NsqProducer) msgValidator(notifyMessage *NotifyMessage) (err error) {
err
=
errors
.
New
(
ErrMsgAppIDEmpty
)
return
}
default
:
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
:
err
=
errors
.
New
(
ErrMsgTpye
)
}
return
}
...
...
notify/model.go
浏览文件 @
3d9e78d0
...
...
@@ -51,3 +51,4 @@ type RefundMsgData struct {
type
TagsMsgData
struct
{
Tags
string
`json:"tags"`
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论