2023-08-04 11:13:41 +08:00
|
|
|
package server
|
|
|
|
|
2023-08-13 21:24:54 +08:00
|
|
|
import (
|
|
|
|
"enterprise/common/config"
|
|
|
|
"enterprise/server/controller"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
func initRoutge(engine *gin.Engine) {
|
|
|
|
qyweixin := new(controller.QyWeixin)
|
|
|
|
base := new(controller.Base)
|
|
|
|
apiGroup := engine.Group("/api")
|
|
|
|
apiGroup.Use(base.Recovery)
|
|
|
|
apiGroup.Any("/qyweixin/approve", qyweixin.Approve)
|
|
|
|
}
|
|
|
|
|
2023-08-04 11:13:41 +08:00
|
|
|
func Start() error {
|
2023-08-13 21:24:54 +08:00
|
|
|
cfg := config.GetConfig()
|
|
|
|
engine := gin.New()
|
|
|
|
initRoutge(engine)
|
|
|
|
return engine.Run(cfg.Server.Address)
|
2023-08-04 11:13:41 +08:00
|
|
|
}
|