企业微信回调
This commit is contained in:
30
platformapi/enterprise_wechat/enterprise_callback.go
Normal file
30
platformapi/enterprise_wechat/enterprise_callback.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user