company.go 760 B

12345678910111213141516171819202122232425262728293031
  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, registerCompanyRouter)
  10. }
  11. // 需认证的路由代码
  12. func registerCompanyRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  13. cont := controller.CompanyController{}
  14. r := v1.Group("/company").Use(authMiddleware.MiddlewareFunc()).Use(actions.PermissionAction())
  15. {
  16. r.GET("", cont.GetPage)
  17. r.GET("/dept", cont.GetCurrentCompany)
  18. r.GET("/user", cont.GetUserPage)
  19. r.GET("/all", cont.GetAll)
  20. r.GET("/:id", cont.Get)
  21. r.POST("", cont.Insert)
  22. r.PUT("", cont.Update)
  23. r.DELETE("", cont.Delete)
  24. }
  25. }