Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
da03a699
提交
da03a699
authored
8月 21, 2026
作者:
张立波
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wpc
上级
ca029862
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
65 行增加
和
0 行删除
+65
-0
wpc_msg.go
upstream/wpc/wpc_msg.go
+65
-0
没有找到文件。
upstream/wpc/wpc_msg.go
0 → 100644
浏览文件 @
da03a699
package
wpc
import
(
"context"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
)
type
msgWpc
struct
{
}
var
Msg
=
msgWpc
{}
// MsgGetReq 应用级请求参数
type
MsgGetReq
struct
{
AreaId
string
`json:"areaId,omitempty"`
//地区ID
Timestamp
string
`json:"timestamp,omitempty"`
//时间戳(秒级)
ChannelId
string
`json:"vopChannelId"`
//开放平台appKey
UserNumber
string
`json:"userNumber"`
//代购编号
Page
int
`json:"page"`
//当前页码,从1开始
PageSize
int
`json:"pageSize"`
//每页条数,最多20条数据
TypeList
[]
int
`json:"typeList,omitempty"`
//消息类型:0-价格变动
ConsumerType
int
`json:"consumerType,omitempty"`
//消费类型:0-自动消费(默认),1-主动消费(调用消费接口,推荐)
H5ChannelId
string
`json:"h5ChannelId,omitempty"`
//h5渠道id, h5接入模式必传(由唯代购分配)
}
// MsgDataVo 消息内容 消息类型=0该字段才有值
type
MsgDataVo
struct
{
GoodId
string
`json:"goodId,omitempty"`
//商品id
GoodFullId
string
`json:"goodFullId,omitempty"`
//商品全id
OldPrice
string
`json:"oldPrice,omitempty"`
//原价格
NewPrice
string
`json:"newPrice,omitempty"`
//新价格
SizeId
int64
`json:"sizeId,omitempty"`
//尺码id
VipShopPrice
string
`json:"vipshopPrice,omitempty"`
//唯品价
MarketPrice
string
`json:"marketPrice,omitempty"`
//市场价
}
// MsgGetItem 变更消息条目
type
MsgGetItem
struct
{
MsgId
string
`json:"msgId"`
//消息id
Type
int
`json:"type"`
//消息类型: 0-价格变动, 5-多渠道h5-取消订单退款通知, 6-多渠道h5-售后单退款通知
CreateTime
string
`json:"createTime"`
//消息创建时间
Data
MsgDataVo
`json:"data"`
//消息内容,消息类型=0该字段才有值
JsonData
string
`json:"jsonData"`
//消息内容 json格式: 5多渠道h5-取消订单退款通知 格式: {"orderSn":"25042444747438"};6多渠道h5-售后单退款通知 格式: {"afterSalesSn":"20250421059662618411","orderSn":"25041506528067"}
}
type
MsgGetRes
struct
{
ReturnCode
string
`json:"returnCode"`
ReturnMessage
string
`json:"returnMessage"`
Success
[]
MsgGetItem
`json:"success"`
}
// Get 拉取变更消息
func
(
*
msgWpc
)
Get
(
ctx
context
.
Context
,
req
MsgGetReq
)
(
res
*
MsgGetRes
,
err
error
)
{
method
:=
"getChangeMsg"
req
.
ChannelId
=
server
.
AppKey
req
.
UserNumber
=
server
.
UserNumber
result
,
err
:=
post
(
ctx
,
method
,
g
.
Map
{
"request"
:
req
,
})
_
=
gjson
.
NewWithOptions
(
result
,
gjson
.
Options
{
StrNumber
:
true
,
})
.
Scan
(
&
res
)
return
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论