Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
U
utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
library
utils
Commits
0ef78ef3
Verified
Commit
0ef78ef3
authored
Jan 22, 2019
by
Cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update message log
parent
44915748
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
23 deletions
+59
-23
structs.go
sender/structs.go
+59
-23
No files found.
sender/structs.go
View file @
0ef78ef3
...
...
@@ -5,46 +5,82 @@ import (
"github.com/sirupsen/logrus"
)
type
MessageLog
struct
{
MessageType
string
`json:"messageType" bson:"messageType"`
// CUSTOMER-客服消息 TEMPLATE-模板消息 SUBSCRIBE-订阅消息 SMS-短信消息 MASS-高级群发
MessageSubType
string
`json:"messageSubType" bson:"messageSubType"`
// TEXT IMAGE VOICE VIDEO MUSIC NEWS MPNEWS WXCARD MINIPROGRAMPAGE
RemindType
string
`json:"remindType" bson:"remindType"`
// 开课提醒、购买成功通知、上课提醒、打卡失败提醒、复习提醒、结课提醒、到期提醒、获得补卡券提醒、提前获得奖学金提醒、现金券到期提醒、成绩单提醒、提成消息<br/>classBegin,purchaseSuccessNotice,classRemind,PUNCH_FAIL,review,classEnd,Expire,replacementCardGain,previousScholarship,CouponExpire,transcript,profit
JsonId
string
`json:"jsonId"`
// 分组ID
UserOpenid
string
`json:"userOpenid" bson:"userOpenid"`
// 用户openid
UserUnionid
string
`json:"userUnionid" bson:"userUnionid"`
// 用户Unionid
PublicName
string
`json:"publicName" bson:"publicName"`
// 公众号名称
BatchNumber
string
`json:"batchNumber" bson:"batchNumber"`
// 批量发送批次
ChannelName
string
`json:"channelName" bson:"channelName"`
// 频道
ChannelGroupName
string
`json:"channelGroupName" bson:"channelGroupName"`
// 频道组
Tels
string
`json:"tels" bson:"tels"`
// 短信目标用户手机号
TplID
string
`json:"tplID" bson:"tplID"`
// 短信模板ID
Action
string
`json:"action" bson:"action"`
// 推送类型 OneTime_Push,Timing_Push,Delay_Push,Nomal_Push
State
string
`json:"state" bson:"state"`
// succeeded-成功 failed-失败
Date
string
`json:"date" bson:"date"`
// 事件日期
FailedReason
string
`json:"failedReason" bson:"failedReason"`
// 发送失败原因
}
func
(
m
*
MessageLog
)
ToFields
()
(
fields
logrus
.
Fields
)
{
fields
=
make
(
logrus
.
Fields
)
fields
[
"messageType"
]
=
m
.
MessageType
fields
[
"messageSubType"
]
=
m
.
MessageSubType
fields
[
"remindType"
]
=
m
.
RemindType
fields
[
"jsonId"
]
=
m
.
JsonId
fields
[
"userOpenid"
]
=
m
.
UserOpenid
fields
[
"userUnionid"
]
=
m
.
UserUnionid
fields
[
"publicName"
]
=
m
.
PublicName
fields
[
"batchNumber"
]
=
m
.
BatchNumber
fields
[
"channelName"
]
=
m
.
ChannelName
fields
[
"channelGroupName"
]
=
m
.
ChannelGroupName
fields
[
"tels"
]
=
m
.
Tels
fields
[
"tplID"
]
=
m
.
TplID
fields
[
"action"
]
=
m
.
Action
fields
[
"state"
]
=
m
.
State
fields
[
"date"
]
=
m
.
Date
fields
[
"failedReason"
]
=
m
.
FailedReason
return
}
type
MessageStruct
struct
{
AppId
string
`json:"appId" bson:"appId"`
SmsAppId
int
`json:"smsAppId" bson:"smsAppId"`
SmsAppKey
string
`json:"smsAppKey" bson:"smsAppKey"`
Action
string
`json:"action" bson:"action"`
// 推送类型 OneTime_Push,Timing_Push,Delay_Push,Nomal_Push
Retry
int
`json:"retry"`
PushCount
int
`json:"pushCount"`
MsgType
string
`json:"msg_type"`
SendMsgType
string
`json:"_sendMsgType"`
Touser
string
`json:"_touser"`
SendMsgAppName
string
`json:"_sendMsgAppName"`
SendBatchNumber
string
`json:"_sendBatchNumber"`
JsonId
string
`json:"_jsonId"`
Unionid
string
`json:"_unionid"`
MessageLog
MessageType
string
`json:"messageType" bson:"messageType"`
// CUSTOMER TEMPLATE SUBSCRIBE SMS
MessageSubType
string
`json:"messageSubType" bson:"messageSubType"`
// TEXT IMAGE VOICE VIDEO MUSIC NEWS MPNEWS WXCARD MINIPROGRAMPAGE
MessageData
json
.
RawMessage
`json:"messageData" bson:"messageData"`
MessageData
json
.
RawMessage
`json:"messageData" bson:"messageData"`
}
func
(
m
*
MessageStruct
)
ToFields
()
(
fields
logrus
.
Fields
)
{
fields
=
make
(
logrus
.
Fields
)
fields
[
"appId"
]
=
m
.
AppId
fields
[
"action"
]
=
m
.
Action
fields
[
"retry"
]
=
m
.
Retry
fields
[
"pushCount"
]
=
m
.
PushCount
fields
[
"msg_type"
]
=
m
.
MsgType
fields
[
"_sendMsgType"
]
=
m
.
SendMsgType
fields
[
"_touser"
]
=
m
.
Touser
fields
[
"_sendMsgAppName"
]
=
m
.
SendMsgAppName
fields
[
"_sendBatchNumber"
]
=
m
.
SendBatchNumber
fields
[
"_jsonId"
]
=
m
.
JsonId
fields
[
"_unionid"
]
=
m
.
Unionid
fields
[
"messageType"
]
=
m
.
MessageType
fields
[
"messageSubType"
]
=
m
.
MessageSubType
fields
[
"remindType"
]
=
m
.
RemindType
fields
[
"jsonId"
]
=
m
.
JsonId
fields
[
"userOpenid"
]
=
m
.
UserOpenid
fields
[
"userUnionid"
]
=
m
.
UserUnionid
fields
[
"publicName"
]
=
m
.
PublicName
fields
[
"batchNumber"
]
=
m
.
BatchNumber
fields
[
"channelName"
]
=
m
.
ChannelName
fields
[
"channelGroupName"
]
=
m
.
ChannelGroupName
fields
[
"tels"
]
=
m
.
Tels
fields
[
"tplID"
]
=
m
.
TplID
fields
[
"action"
]
=
m
.
Action
fields
[
"state"
]
=
m
.
State
fields
[
"date"
]
=
m
.
Date
fields
[
"failedReason"
]
=
m
.
FailedReason
return
}
...
...
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