enterprise/server/controller/qyweixin.go

23 lines
478 B
Go
Raw Normal View History

2023-08-13 21:24:54 +08:00
package controller
import (
"enterprise/common/config"
"enterprise/common/weixin"
"enterprise/server/service"
"github.com/gin-gonic/gin"
)
type QyWeixin struct {
}
func (q *QyWeixin) Approve(ctx *gin.Context) {
cfg := config.GetConfig()
agent := weixin.NewQyWeixinAgent(&weixin.QyWeixinAgentConfig{
CorpId: cfg.QyWeixin.Corpid,
Secret: cfg.QyWeixin.ApproveSecret,
Agent: cfg.QyWeixin.ApproveAgent,
Replay: (&service.Approve{}).Reply,
})
agent.Request(ctx)
}