Verified Commit 052db71c authored by Cui's avatar Cui

add to logger

parent f5cfc22f
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment