enterprise/server/controller/qyweixin.go

28 lines
570 B
Go
Raw Normal View History

2023-08-13 21:24:54 +08:00
package controller
import (
"enterprise/common/config"
2024-01-22 22:58:56 +08:00
"enterprise/server/service"
2023-08-13 21:24:54 +08:00
"github.com/gin-gonic/gin"
2024-01-22 22:50:20 +08:00
"gitlab.batiao8.com/open/gosdk/qyweixin"
2023-08-13 21:24:54 +08:00
)
type QyWeixin struct {
}
func (q *QyWeixin) Approve(ctx *gin.Context) {
cfg := config.GetConfig()
2024-01-22 22:50:20 +08:00
2024-01-22 22:58:56 +08:00
reply := new(service.Approve).Reply
2024-01-22 22:50:20 +08:00
qyApp := qyweixin.NewApp(&qyweixin.AppConfig{
Corpid: cfg.QyWeixin.Corpid,
2023-08-13 21:24:54 +08:00
Secret: cfg.QyWeixin.ApproveSecret,
Agent: cfg.QyWeixin.ApproveAgent,
2024-01-22 22:50:20 +08:00
Token: config.QyWeixinAgentToken,
AesKey: config.QyWeixinAgentAesKey,
2024-01-22 22:58:56 +08:00
Replay: reply,
2023-08-13 21:24:54 +08:00
})
2024-01-22 22:50:20 +08:00
qyApp.Callback(ctx)
2023-08-13 21:24:54 +08:00
}