department.go 922 B

123456789101112131415161718192021222324252627
  1. package admin
  2. import (
  3. "github.com/gin-gonic/gin"
  4. v1 "server/api/v1"
  5. "server/middleware"
  6. )
  7. type DepartmentRouter struct{}
  8. func (s *DepartmentRouter) InitDepartmentRouter(Router *gin.RouterGroup) {
  9. departmentRouter := Router.Group("department").Use(middleware.OperationRecord())
  10. departmentRouterWithoutRecord := Router.Group("department")
  11. departmentApi := v1.ApiGroupApp.AdminApiGroup.DepartmentApi
  12. {
  13. departmentRouter.POST("createDep", departmentApi.CreateDep)
  14. departmentRouter.PUT("updateDep", departmentApi.UpdateDep)
  15. departmentRouter.PUT("updateDepStatus", departmentApi.UpdateDepStatus)
  16. departmentRouter.PUT("updateUserDep", departmentApi.UpdateUserDep)
  17. departmentRouter.DELETE("deleteDep/:depId", departmentApi.DeleteDep)
  18. }
  19. {
  20. departmentRouterWithoutRecord.GET("queryAllDep", departmentApi.QueryAllDep)
  21. departmentRouterWithoutRecord.GET("queryDepByStart", departmentApi.QueryDepByStart)
  22. }
  23. }