Files
baseapi/platformapi/enterprise_wechat/enterprise_callback.go
2022-06-21 10:41:08 +08:00

31 lines
695 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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
}