This commit is contained in:
jiangyong27 2024-01-22 22:58:56 +08:00
parent 367f92f55d
commit c8634d17f9
2 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package controller
import ( import (
"enterprise/common/config" "enterprise/common/config"
"enterprise/server/service"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"gitlab.batiao8.com/open/gosdk/qyweixin" "gitlab.batiao8.com/open/gosdk/qyweixin"
) )
@ -12,12 +13,14 @@ type QyWeixin struct {
func (q *QyWeixin) Approve(ctx *gin.Context) { func (q *QyWeixin) Approve(ctx *gin.Context) {
cfg := config.GetConfig() cfg := config.GetConfig()
reply := new(service.Approve).Reply
qyApp := qyweixin.NewApp(&qyweixin.AppConfig{ qyApp := qyweixin.NewApp(&qyweixin.AppConfig{
Corpid: cfg.QyWeixin.Corpid, Corpid: cfg.QyWeixin.Corpid,
Secret: cfg.QyWeixin.ApproveSecret, Secret: cfg.QyWeixin.ApproveSecret,
Agent: cfg.QyWeixin.ApproveAgent, Agent: cfg.QyWeixin.ApproveAgent,
Token: config.QyWeixinAgentToken, Token: config.QyWeixinAgentToken,
AesKey: config.QyWeixinAgentAesKey, AesKey: config.QyWeixinAgentAesKey,
Replay: reply,
}) })
qyApp.Callback(ctx) qyApp.Callback(ctx)

View File

@ -2,7 +2,6 @@ package service
import ( import (
butil "enterprise/base/util" butil "enterprise/base/util"
"enterprise/base/wechat/message"
"enterprise/common/config" "enterprise/common/config"
"enterprise/common/dao" "enterprise/common/dao"
"enterprise/common/global" "enterprise/common/global"
@ -12,6 +11,7 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/smbrave/goutil" "github.com/smbrave/goutil"
"gitlab.batiao8.com/open/gosdk/qyweixin" "gitlab.batiao8.com/open/gosdk/qyweixin"
"gitlab.batiao8.com/open/gosdk/wechat/message"
"strings" "strings"
) )