feat:完善项目
This commit is contained in:
114
router/address.go
Normal file
114
router/address.go
Normal file
@ -0,0 +1,114 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"SciencesServer/app/api"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func register(app *gin.Engine) {
|
||||
apiPrefix := "/api"
|
||||
g := app.Group(apiPrefix)
|
||||
// 登录验证
|
||||
g.Use(NeedLogin(AddSkipperURL([]string{
|
||||
apiPrefix + "/captcha",
|
||||
apiPrefix + "/account/login",
|
||||
apiPrefix + "/account/logout",
|
||||
}...)))
|
||||
// 权限验证
|
||||
//g.Use(NeedPermission(AddSkipperURL([]string{
|
||||
// apiPrefix + "/captcha",
|
||||
// apiPrefix + "/account/login",
|
||||
// apiPrefix + "/account/logout",
|
||||
//}...)))
|
||||
// Captcha 验证码
|
||||
g.GET("/captcha", new(api.Captcha).Captcha)
|
||||
// Upload 上传管理
|
||||
g.POST("/upload", new(api.Upload).Upload)
|
||||
// Account 账户管理
|
||||
account := g.Group("/account")
|
||||
{
|
||||
_api := new(api.Account)
|
||||
account.POST("/login", _api.Login)
|
||||
account.POST("/logout", _api.Logout)
|
||||
}
|
||||
// User 用户管理
|
||||
user := g.Group("/user")
|
||||
{
|
||||
_api := new(api.User)
|
||||
user.GET("/info", _api.Info)
|
||||
user.GET("/menu", _api.Menu)
|
||||
user.POST("/list", _api.List)
|
||||
user.POST("/add", _api.Add)
|
||||
user.POST("/edit", _api.Edit)
|
||||
user.POST("/delete", _api.Delete)
|
||||
user.POST("/edit/password", _api.EditPassword)
|
||||
user.POST("/password/quick", _api.QuickPassword)
|
||||
user.POST("/role", _api.Role)
|
||||
user.POST("/role/bind", _api.RoleBind)
|
||||
}
|
||||
// Tenant 租户管理
|
||||
tenant := g.Group("/tenant")
|
||||
{
|
||||
_api := new(api.Tenant)
|
||||
tenant.POST("/list", _api.List)
|
||||
tenant.POST("/add", _api.Add)
|
||||
tenant.POST("/edit", _api.Edit)
|
||||
tenant.POST("/edit/password", _api.EditPassword)
|
||||
tenant.POST("/detail", _api.Detail)
|
||||
tenant.POST("/renewal", _api.Renewal)
|
||||
tenant.POST("/start_up", _api.StartUp)
|
||||
tenant.POST("/disable", _api.Disable)
|
||||
tenant.POST("/member/bind", _api.MemberBind)
|
||||
tenant.POST("/menu", _api.Menu)
|
||||
tenant.POST("/menu/bind", _api.MenuBind)
|
||||
tenant.POST("/auth/bind", _api.AuthBind)
|
||||
}
|
||||
// Menu 菜单管理
|
||||
menu := g.Group("/menu")
|
||||
{
|
||||
_api := new(api.Menu)
|
||||
menu.GET("/list", _api.List)
|
||||
menu.POST("/add", _api.Add)
|
||||
menu.POST("/edit", _api.Edit)
|
||||
menu.POST("/status", _api.Status)
|
||||
menu.POST("/delete", _api.Delete)
|
||||
}
|
||||
// Auth 权限管理
|
||||
auth := g.Group("/auth")
|
||||
{
|
||||
_api := new(api.Auth)
|
||||
auth.POST("/list", _api.List)
|
||||
}
|
||||
// Department 部门管理
|
||||
department := g.Group("/department")
|
||||
{
|
||||
_api := new(api.Department)
|
||||
department.GET("/list", _api.List)
|
||||
department.GET("/select", _api.Select)
|
||||
department.POST("/add", _api.Add)
|
||||
department.POST("/edit", _api.Edit)
|
||||
department.POST("/delete", _api.Delete)
|
||||
}
|
||||
// Role 角色管理
|
||||
role := g.Group("/role")
|
||||
{
|
||||
_api := new(api.Role)
|
||||
role.POST("/list", _api.List)
|
||||
role.POST("/select", _api.Select)
|
||||
role.POST("/add", _api.Add)
|
||||
role.POST("/edit", _api.Edit)
|
||||
role.POST("/status", _api.Status)
|
||||
role.POST("/delete", _api.Delete)
|
||||
role.POST("/menu", _api.Menu)
|
||||
role.POST("/menu/bind", _api.MenuBind)
|
||||
role.POST("/auth", _api.Auth)
|
||||
role.POST("/auth/bind", _api.AuthBind)
|
||||
}
|
||||
// Logs 日志管理
|
||||
log := g.Group("/log")
|
||||
{
|
||||
_api := new(api.Log)
|
||||
log.POST("/login", _api.Login)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user