weian.go 935 B

123456789101112131415161718192021222324252627282930313233
  1. package router
  2. import (
  3. "cold-delivery/app/admin/controller"
  4. "cold-delivery/common/actions"
  5. "github.com/gin-gonic/gin"
  6. jwt "gogs.baozhida.cn/zoie/OAuth-core/pkg/jwtauth"
  7. )
  8. func init() {
  9. routerCheckRole = append(routerCheckRole, registerWeianRouter)
  10. routerOpenapi = append(routerOpenapi, registerOpenApiRouter)
  11. }
  12. // 派费管理
  13. // 需认证的路由代码
  14. func registerWeianRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  15. cont := controller.WeianController{}
  16. r := v1.Group("/weian").Use(authMiddleware.MiddlewareFunc()).Use(actions.PermissionAction())
  17. {
  18. r.GET("/orderInfo", cont.GetOrderInfo)
  19. }
  20. }
  21. func registerOpenApiRouter(v1 *gin.RouterGroup, openapiMiddleware gin.HandlerFunc) {
  22. cont := controller.WeianController{}
  23. r := v1.Group("/waybill").Use(openapiMiddleware)
  24. {
  25. r.GET("/waybillNoByOrderId", cont.GetWaybillNo)
  26. r.GET("/data", cont.GetWaybillData)
  27. r.GET("/locus", cont.GetLocus)
  28. }
  29. }