|
|
@@ -4,6 +4,7 @@ import (
|
|
|
"encoding/json"
|
|
|
"encoding/xml"
|
|
|
"fmt"
|
|
|
+ "github.com/gogf/gf/util/gconv"
|
|
|
"github.com/silenceper/wechat/v2/credential"
|
|
|
"github.com/silenceper/wechat/v2/util"
|
|
|
"github.com/silenceper/wechat/v2/work/config"
|
|
|
@@ -64,6 +65,7 @@ func (work *Work) ApplyOAEvent(applyInfo OAApplyEvent) (string, error) {
|
|
|
if err != nil {
|
|
|
return "", err
|
|
|
}
|
|
|
+ fmt.Println("-------------企业微信审批流对接【提交审批申请】请求---------------", gconv.String(applyInfo))
|
|
|
response, err := util.PostJSON(fmt.Sprintf(applyEventURL, accessToken), applyInfo)
|
|
|
if err != nil {
|
|
|
return "", err
|
|
|
@@ -73,6 +75,7 @@ func (work *Work) ApplyOAEvent(applyInfo OAApplyEvent) (string, error) {
|
|
|
if err != nil {
|
|
|
return "", err
|
|
|
}
|
|
|
+ fmt.Println("-------------企业微信审批流对接【提交审批申请】返回---------------", gconv.String(result))
|
|
|
if result.ErrCode != 0 {
|
|
|
return "", kf.NewSDKErr(result.ErrCode, result.ErrMsg)
|
|
|
}
|
|
|
@@ -112,6 +115,7 @@ func (work *Work) GetOAApprovalDetail(spNo string) (*OAApprovalDetail, error) {
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
+ fmt.Println("-------------企业微信审批流对接【获取审批申请详情】请求---------------", spNo)
|
|
|
response, err := util.PostJSON(fmt.Sprintf(getApprovalDetailURL, accessToken), reqOAGetApprovalDetail{
|
|
|
SpNo: spNo,
|
|
|
})
|
|
|
@@ -123,6 +127,7 @@ func (work *Work) GetOAApprovalDetail(spNo string) (*OAApprovalDetail, error) {
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
+ fmt.Println("-------------企业微信审批流对接【获取审批申请详情】请求---------------", gconv.String(result))
|
|
|
if result.ErrCode != 0 {
|
|
|
return nil, kf.NewSDKErr(result.ErrCode, result.ErrMsg)
|
|
|
}
|