enterprise/server/controller/qyweixin.go

23 lines
478 B
Go

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)
}