customer.go 761 B

12345678910111213141516171819202122232425262728293031
  1. package router
  2. import (
  3. "cold-logistics/common/actions"
  4. "github.com/gin-gonic/gin"
  5. "cold-logistics/app/admin/controller"
  6. jwt "gogs.baozhida.cn/zoie/OAuth-core/pkg/jwtauth"
  7. )
  8. func init() {
  9. routerCheckRole = append(routerCheckRole, registerCustomerRouter)
  10. }
  11. // 需认证的路由代码
  12. func registerCustomerRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  13. cont := controller.Customer{}
  14. r := v1.Group("/customer").Use(authMiddleware.MiddlewareFunc()).Use(actions.PermissionAction())
  15. {
  16. r.GET("", cont.GetPage)
  17. r.GET("/:id", cont.Get)
  18. r.POST("", cont.Insert)
  19. r.PUT("", cont.Update)
  20. r.DELETE("", cont.Delete)
  21. r.PUT("/pwd/reset", cont.ResetPwd)
  22. r.GET("/profile", cont.GetProfile)
  23. r.PUT("/pwd/set", cont.UpdatePwd)
  24. }
  25. }