sys_dict.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package router
  2. import (
  3. "Medical_OAuth/common/middleware"
  4. "github.com/gin-gonic/gin"
  5. "Medical_OAuth/app/admin/controller"
  6. jwt "gogs.baozhida.cn/zoie/OAuth-core/pkg/jwtauth"
  7. )
  8. func init() {
  9. routerCheckRole = append(routerCheckRole, registerDictRouter)
  10. }
  11. func registerDictRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  12. dictCont := controller.SysDictTypeController{}
  13. dataCont := controller.SysDictDataController{}
  14. dicts := v1.Group("/dict").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
  15. {
  16. dicts.GET("/data", dataCont.GetPage)
  17. dicts.GET("/data/:dictCode", dataCont.Get)
  18. dicts.POST("/data", dataCont.Insert)
  19. dicts.PUT("/data/:dictCode", dataCont.Update)
  20. dicts.DELETE("/data", dataCont.Delete)
  21. dicts.GET("/type-option-select", dictCont.GetAll)
  22. dicts.GET("/type", dictCont.GetPage)
  23. dicts.GET("/type/:id", dictCont.Get)
  24. dicts.POST("/type", dictCont.Insert)
  25. dicts.PUT("/type/:id", dictCont.Update)
  26. dicts.DELETE("/type", dictCont.Delete)
  27. }
  28. opSelect := v1.Group("/dict-data").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
  29. {
  30. opSelect.GET("/option-select", dataCont.GetAll)
  31. }
  32. }