企业微信回调
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
|
||||
}
|
||||
@@ -16,6 +16,8 @@ const (
|
||||
CreateBoosToJxStaff = "cgi-bin/user/create" // 将京西老板创建为企业员工
|
||||
GetDepartmentUserDetail = "cgi-bin/user/list" // 获取部门用户详细情况
|
||||
GetUserByMobileUrl = "cgi-bin/user/getuserid" // 通过手机号获取用户id
|
||||
|
||||
EnterpriseTicketInfo = "/suite/receive" // 企业微信服务器会定时(每十分钟)推送ticket
|
||||
)
|
||||
|
||||
// 注册请求api
|
||||
|
||||
12
platformapi/enterprise_wechat/wechat_suiteId.go
Normal file
12
platformapi/enterprise_wechat/wechat_suiteId.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package enterprise_wechat
|
||||
|
||||
//
|
||||
//func (a *API) EnterpriseTicket() {
|
||||
// url := EnterpriseTicketInfo + "?" + "msg_signature"
|
||||
// a.CheckAccessTokenExpiresIn()
|
||||
// result, err := a.AccessAPI(WeChatBaseApi, EnterpriseTicketInfo, http.MethodPost, utils.Struct2FlatMap(param))
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
//
|
||||
//}
|
||||
Reference in New Issue
Block a user