12345678910111213141516171819202122232425262728293031323334 |
- package server
- type Request struct {
- Version string `json:"version"`
- Source string `json:"source"`
- Token string `json:"token"`
- ClientId string `json:"clientid"`
- Payload interface{} `json:"payload"`
- Extra map[string]interface{} `json:"extra"`
- UserId int
- Mobile string
- }
- func (r Request) IsZFB() bool {
- if cv, ok := r.Extra["zfb"]; ok && cv.(string) == "1" {
- return true
- }
- return false
- }
- type Response struct {
- Errno int `json:"errno"`
- Errmsg string `json:"error"`
- Payload interface{} `json:"body"`
- }
- func (r Request) IsHistory() bool {
- if cv, ok := r.Extra["history"]; ok && cv.(string) == "1" {
- return true
- }
- return false
- }
|