|
@@ -1,9 +1,9 @@
|
|
|
package main
|
|
|
|
|
|
import (
|
|
|
+ "cicv-data-closedloop/amd64/report-server/handler"
|
|
|
"cicv-data-closedloop/common/config/c_db"
|
|
|
"cicv-data-closedloop/common/config/c_log"
|
|
|
- "cicv-data-closedloop/common/gin/handler"
|
|
|
"cicv-data-closedloop/common/gin/middleware"
|
|
|
_ "embed"
|
|
|
"github.com/gin-gonic/gin"
|
|
@@ -56,23 +56,20 @@ func init() {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-// @title yuexin-pay系统接口文档
|
|
|
-// @description 该后端主要用于对接支付接口
|
|
|
-// @host localhost:12345
|
|
|
-// @BasePath /yuexin-pay
|
|
|
-// @version v20240226
|
|
|
func main() {
|
|
|
c_log.GlobalLogger.Info("配置文件为:", ApplicationYaml)
|
|
|
// 创建 gin 实例
|
|
|
router := gin.Default()
|
|
|
// 使用中间件
|
|
|
+ //router.Use(cors.Default())
|
|
|
+ router.Use(middleware.Cors())
|
|
|
router.Use(middleware.LogRequest()) // 请求日志打印
|
|
|
router.Use(middleware.ValidateHeaders(ApplicationYaml.Web.WhiteList, ApplicationYaml.Web.Token)) // 全局请求头校验
|
|
|
// 通过路由组设置全局前缀
|
|
|
projectPrefix := router.Group(ApplicationYaml.Web.RoutePrefix)
|
|
|
// 接口
|
|
|
- projectPrefix.POST("/page", handler.Hello) // 分页查询
|
|
|
- projectPrefix.POST("/pdf", handler.Hello) // pdf下载
|
|
|
+ projectPrefix.POST("/page", handler.Page) // 分页查询
|
|
|
+ //projectPrefix.POST("/pdf", handler.Hello) // pdf下载
|
|
|
// 端口
|
|
|
err := router.Run(":" + ApplicationYaml.Web.Port)
|
|
|
if err != nil {
|