enterprise/server/server.go

23 lines
471 B
Go

package server
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)
}
func Start() error {
cfg := config.GetConfig()
engine := gin.New()
initRoutge(engine)
return engine.Run(cfg.Server.Address)
}