enterprise/server/controller/qyweixin.go

28 lines
570 B
Go

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