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
052db71c
Verified
Commit
052db71c
authored
Jan 21, 2019
by
Cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add to logger
parent
f5cfc22f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
3 deletions
+37
-3
structs.go
sender/structs.go
+37
-3
No files found.
sender/structs.go
View file @
052db71c
...
...
@@ -6,14 +6,48 @@ import (
)
type
MessageStruct
struct
{
AppId
string
`json:"appId" bson:"appId"`
SmsAppId
int
`json:"smsAppId" bson:"smsAppId"`
SmsAppKey
string
`json:"smsAppKey" bson:"smsAppKey"`
AppId
string
`json:"appId" bson:"appId"`
SmsAppId
int
`json:"smsAppId" bson:"smsAppId"`
SmsAppKey
string
`json:"smsAppKey" bson:"smsAppKey"`
Action
string
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"`
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"`
}
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
return
}
type
TemplateMessage
struct
{
Touser
string
`json:"touser" bson:"touser"`
// 接收者openid
TemplateId
string
`json:"template_id" bson:"template_id"`
// 模板ID
...
...
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