Documentation ¶
Index ¶
- func AddSignInTask(openid, textOpenid string) error
- func AddUserCoordinate(openid, tag string, coordinate Coordinate) error
- func EventClick(msg EventMsg) (interface{}, error)
- func EventLocation(msg EventMsg) (interface{}, error)
- func EventScan(msg EventMsg) (interface{}, error)
- func EventSubscribe(msg EventMsg) (interface{}, error)
- func EventUnSubscribe(msg EventMsg) (interface{}, error)
- func EventView(msg EventMsg) (interface{}, error)
- func GetRedisUserStatus(openid string) (int, error)
- func GetSign(token, timestamp, nonce string) (signature string)
- func GetSignature(timestamp, nonce string) string
- func GetUserCoordinates(openid string) (map[string]Coordinate, error)
- func MsgEvent(msg EventMsg) (interface{}, error)
- func SetRedisUserStatus(openid string, status int) error
- func SetUserCurCourse(openid, courseName string, courseID int) error
- func SetUserEmail(openid, email string) error
- func StartStuSignTask() error
- func UpdateAccessToken() error
- type Coordinate
- type EventFunc
- type EventMsg
- type MsgHeader
- type User
- type WZJCourse
- type WechatTextRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSignInTask ¶
func AddUserCoordinate ¶
func AddUserCoordinate(openid, tag string, coordinate Coordinate) error
func EventClick ¶
func EventLocation ¶
func EventSubscribe ¶
func EventUnSubscribe ¶
func GetRedisUserStatus ¶
func GetSignature ¶
func GetUserCoordinates ¶
func GetUserCoordinates(openid string) (map[string]Coordinate, error)
func SetRedisUserStatus ¶
func SetUserCurCourse ¶
func SetUserEmail ¶
func StartStuSignTask ¶
func StartStuSignTask() error
func UpdateAccessToken ¶
func UpdateAccessToken() error
Types ¶
type Coordinate ¶
func SetUserCurCoordinateByTag ¶
func SetUserCurCoordinateByTag(openid, tag string) (Coordinate, error)
type EventMsg ¶
type EventMsg struct { XMLName struct{} `xml:"xml" json:"-"` MsgHeader EventType string `xml:"Event" json:"Event"` MsgId int64 `xml:"MsgId" json:"MsgId"` Content string `xml:"Content" json:"Content"` MediaId string `xml:"MediaId" json:"MediaId"` PicURL string `xml:"PicUrl" json:"PicUrl"` Format string `xml:"Format" json:"Format"` Recognition string `xml:"Recognition" json:"Recognition"` ThumbMediaId string `xml:"ThumbMediaId" json:"ThumbMediaId"` LocationX float64 `xml:"Location_X" json:"Location_X"` LocationY float64 `xml:"Location_Y" json:"Location_Y"` Scale int `xml:"Scale" json:"Scale"` Label string `xml:"Label" json:"Label"` Title string `xml:"Title" json:"Title"` Description string `xml:"Description" json:"Description"` URL string `xml:"Url" json:"Url"` EventKey string `xml:"EventKey" json:"EventKey"` Ticket string `xml:"Ticket" json:"Ticket"` Latitude float64 `xml:"Latitude" json:"Latitude"` Longitude float64 `xml:"Longitude" json:"Longitude"` Precision float64 `xml:"Precision" json:"Precision"` // menu MenuId int64 `xml:"MenuId" json:"MenuId"` ScanCodeInfo *struct { ScanType string `xml:"ScanType" json:"ScanType"` ScanResult string `xml:"ScanResult" json:"ScanResult"` } `xml:"ScanCodeInfo,omitempty" json:"ScanCodeInfo,omitempty"` SendPicsInfo *struct { Count int `xml:"Count" json:"Count"` PicList []struct { PicMd5Sum string `xml:"PicMd5Sum" json:"PicMd5Sum"` } `xml:"PicList>item,omitempty" json:"PicList,omitempty"` } `xml:"SendPicsInfo,omitempty" json:"SendPicsInfo,omitempty"` SendLocationInfo *struct { LocationX float64 `xml:"Location_X" json:"Location_X"` LocationY float64 `xml:"Location_Y" json:"Location_Y"` Scale int `xml:"Scale" json:"Scale"` Label string `xml:"Label" json:"Label"` PoiName string `xml:"Poiname" json:"Poiname"` } `xml:"SendLocationInfo,omitempty" json:"SendLocationInfo,omitempty"` MsgID int64 `xml:"MsgID" json:"MsgID"` // template, mass Status string `xml:"Status" json:"Status"` // template, mass }
微信服务器推送过来的消息(事件)的合集.
type MsgHeader ¶
type MsgHeader struct { ToUserName string `xml:"ToUserName" json:"ToUserName"` FromUserName string `xml:"FromUserName" json:"FromUserName"` CreateTime int64 `xml:"CreateTime" json:"CreateTime"` MsgType string `xml:"MsgType" json:"MsgType"` }
微信服务器推送过来的消息(事件)的通用消息头.
type User ¶
type User struct { ID bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty"` Openid string `bson:"openid" json:"openid"` Email string `bson:"email" json:"email"` // redis 中存储当前选中坐标 Coordinates map[string]Coordinate `bson:"coordinates" json:"coordinates"` // 标签 -> 坐标 }
redis 中暂存用户状态
type WZJCourse ¶
type WZJCourse struct { ID int `json:"id"` Name string `json:"name"` Topic string `json:"topic"` Code string `json:"code"` College string `json:"college"` Department string `json:"department"` DiscussionID int `json:"discussionId"` Selected bool `json:"selected"` }
func ListWZJDiscussCourses ¶
type WechatTextRes ¶
type WechatTextRes struct { XMLName xml.Name `xml:"xml" json:"-"` ToUserName string `xml:"ToUserName" json:"ToUserName"` FromUserName string `xml:"FromUserName" json:"FromUserName"` CreateTime int64 `xml:"CreateTime" json:"CreateTime"` MsgType string `xml:"MsgType" json:"MsgType"` Content string `xml:"Content" json:"Content"` }
func GetDefaultTextMsg ¶
func GetDefaultTextMsg(msg EventMsg) WechatTextRes
func GetWelcomeTextMsg ¶
func GetWelcomeTextMsg(msg EventMsg) WechatTextRes
func NewResTextMsg ¶
func NewResTextMsg(msg EventMsg) WechatTextRes
Click to show internal directories.
Click to hide internal directories.