mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
feat:clear no used file go
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"go-admin/app/admin/apis/scol"
|
||||
"go-admin/app/admin/middleware"
|
||||
jwt "go-admin/pkg/jwtauth"
|
||||
)
|
||||
|
||||
func init() {
|
||||
routerCheckRole = append(routerCheckRole, registerScolRouter)
|
||||
}
|
||||
|
||||
// 需认证的路由代码
|
||||
func registerScolRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
|
||||
api := &scol.Scol{}
|
||||
r := v1.Group("/scol").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
|
||||
{
|
||||
r.GET("", api.GetScolList)
|
||||
r.GET("/:id", api.GetScol)
|
||||
r.POST("", api.InsertScol)
|
||||
r.PUT("/:id", api.UpdateScol)
|
||||
r.DELETE("", api.DeleteScol)
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"go-admin/app/admin/apis/student"
|
||||
"go-admin/app/admin/middleware"
|
||||
jwt "go-admin/pkg/jwtauth"
|
||||
)
|
||||
|
||||
func init() {
|
||||
routerCheckRole = append(routerCheckRole, registerStudentRouter)
|
||||
}
|
||||
|
||||
// 需认证的路由代码
|
||||
func registerStudentRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
|
||||
stu := &student.Student{}
|
||||
r := v1.Group("/student").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
|
||||
{
|
||||
r.GET("", stu.GetStudentList)
|
||||
r.GET("/:id", stu.GetStudent)
|
||||
r.POST("", stu.InsertStudent)
|
||||
r.PUT("/:id", stu.UpdateStudent)
|
||||
r.DELETE("", stu.DeleteStudent)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user