feat:完善项目信息

This commit is contained in:
henry
2022-01-05 18:40:08 +08:00
parent 53c1f3912b
commit 7488e9526b
15 changed files with 317 additions and 313 deletions

View File

@ -28,6 +28,17 @@ func registerAPI(app *gin.Engine) {
{
_api := new(api2.Index)
indexV1.GET("", _api.Instance)
indexV1.GET("/distribution/expert", _api.DistributionExpert)
indexV1.GET("/distribution/laboratory", _api.DistributionLaboratory)
indexV1.GET("/distribution/demand", _api.DistributionDemand)
indexV1.GET("/distribution/patent", _api.DistributionPatent)
indexV1.GET("/distribution/achievement", _api.DistributionAchievement)
}
// Config 首页信息管理
configV1 := v1.Group("/config")
{
_api := new(api2.Config)
configV1.POST("area", _api.Area)
}
// User 用户信息管理
userV1 := v1.Group("/user")
@ -121,11 +132,13 @@ func registerAdminAPI(app *gin.Engine) {
apiPrefix := "/admin"
g := app.Group(apiPrefix)
v1 := g.Group("/v1")
// 登录验证
g.Use(NeedLogin(config.RedisKeyForAccountAdmin, session.NewAdmin(), AddSkipperURL([]string{
apiPrefix + "/captcha",
apiPrefix + "/account/login",
apiPrefix + "/account/logout",
apiPrefix + "/v1/captcha",
apiPrefix + "/v1/account/login",
apiPrefix + "/v1/account/logout",
}...)))
// 权限验证
//g.Use(NeedPermission(AddSkipperURL([]string{
@ -134,18 +147,18 @@ func registerAdminAPI(app *gin.Engine) {
// apiPrefix + "/account/logout",
//}...)))
// Captcha 验证码
g.GET("/captcha", new(api1.Captcha).Captcha)
v1.GET("/captcha", new(api1.Captcha).Captcha)
// Upload 上传管理
g.POST("/upload", new(api.Upload).Upload)
v1.POST("/upload", new(api.Upload).Upload)
// Account 账户管理
account := g.Group("/account")
account := v1.Group("/account")
{
_api := new(api1.Account)
account.POST("/login", _api.Login)
account.POST("/logout", _api.Logout)
}
// User 用户管理
user := g.Group("/user")
user := v1.Group("/user")
{
_api := new(api1.User)
user.GET("/info", _api.Info)
@ -154,13 +167,13 @@ func registerAdminAPI(app *gin.Engine) {
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("/password", _api.Password)
user.POST("/password/edit", _api.PasswordEdit)
user.POST("/role", _api.Role)
user.POST("/role/bind", _api.RoleBind)
}
// Tenant 租户管理
tenant := g.Group("/tenant")
tenant := v1.Group("/tenant")
{
_api := new(api1.Tenant)
tenant.POST("/", _api.Instance)
@ -174,7 +187,7 @@ func registerAdminAPI(app *gin.Engine) {
tenant.POST("/auth/bind", _api.AuthBind)
}
// Menu 菜单管理
menu := g.Group("/menu")
menu := v1.Group("/menu")
{
_api := new(api1.Menu)
menu.GET("/list", _api.List)
@ -184,13 +197,13 @@ func registerAdminAPI(app *gin.Engine) {
menu.POST("/delete", _api.Delete)
}
// Auth 权限管理
auth := g.Group("/auth")
auth := v1.Group("/auth")
{
_api := new(api1.Auth)
auth.POST("/list", _api.List)
}
// Department 部门管理
department := g.Group("/department")
department := v1.Group("/department")
{
_api := new(api1.Department)
department.GET("/list", _api.List)
@ -200,7 +213,7 @@ func registerAdminAPI(app *gin.Engine) {
department.POST("/delete", _api.Delete)
}
// Role 角色管理
role := g.Group("/role")
role := v1.Group("/role")
{
_api := new(api1.Role)
role.POST("/list", _api.List)
@ -215,7 +228,7 @@ func registerAdminAPI(app *gin.Engine) {
role.POST("/auth/bind", _api.AuthBind)
}
// Logs 日志管理
log := g.Group("/log")
log := v1.Group("/log")
{
_api := new(api1.Log)
log.POST("/login", _api.Login)