31 lines
695 B
Go
31 lines
695 B
Go
package enterprise_wechat
|
||
|
||
import (
|
||
"encoding/json"
|
||
"git.rosy.net.cn/jx-callback/globals"
|
||
"io/ioutil"
|
||
"net/http"
|
||
)
|
||
|
||
// 回调参数
|
||
type SuiteTicketInfo struct {
|
||
SuiteId string // 第三方应用的SuiteId
|
||
InfoType string // suite_ticket
|
||
TimeStamp int64 // 时间戳
|
||
SuiteTicket string // Ticket内容,最长为512字节
|
||
}
|
||
|
||
func (a *API) GetEnterpriseMsg(request *http.Request) (*SuiteTicketInfo, error) {
|
||
data, err := ioutil.ReadAll(request.Body)
|
||
if err != nil {
|
||
return nil, err
|
||
}
|
||
globals.SugarLogger.Debug("data============enterprise", data)
|
||
|
||
suite := &SuiteTicketInfo{}
|
||
if err := json.Unmarshal(data, suite); err != nil {
|
||
return nil, err
|
||
}
|
||
return suite, err
|
||
}
|