1234567891011121314151617181920212223242526272829303132333435363738 |
- package router
- import (
- "Medical_OAuth/common/middleware"
- "github.com/gin-gonic/gin"
- "Medical_OAuth/app/admin/controller"
- jwt "gogs.baozhida.cn/zoie/OAuth-core/pkg/jwtauth"
- )
- func init() {
- routerCheckRole = append(routerCheckRole, registerDictRouter)
- }
- func registerDictRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
- dictCont := controller.SysDictTypeController{}
- dataCont := controller.SysDictDataController{}
- dicts := v1.Group("/dict").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
- {
- dicts.GET("/data", dataCont.GetPage)
- dicts.GET("/data/:dictCode", dataCont.Get)
- dicts.POST("/data", dataCont.Insert)
- dicts.PUT("/data/:dictCode", dataCont.Update)
- dicts.DELETE("/data", dataCont.Delete)
- dicts.GET("/type-option-select", dictCont.GetAll)
- dicts.GET("/type", dictCont.GetPage)
- dicts.GET("/type/:id", dictCont.Get)
- dicts.POST("/type", dictCont.Insert)
- dicts.PUT("/type/:id", dictCont.Update)
- dicts.DELETE("/type", dictCont.Delete)
- }
- opSelect := v1.Group("/dict-data").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
- {
- opSelect.GET("/option-select", dataCont.GetAll)
- }
- }
|