企业微信回调

This commit is contained in:
邹宗楠
2022-06-21 10:41:08 +08:00
parent b8d3580cd1
commit 6bc4428dfd
3 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
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
}