@@ -21,7 +21,7 @@ import ( | |||
// @Param req body md.LoginReq true "用户名密码" | |||
// @Success 200 {object} md.LoginResponse "token" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /admin/login [post] | |||
// @Router /api/login [post] | |||
func Login(c *gin.Context) { | |||
var req md.LoginReq | |||
err := c.ShouldBindJSON(&req) | |||
@@ -24,7 +24,7 @@ import ( | |||
// @param adm_id query string true "管理员id" | |||
// @Success 200 {string} "具体看返回内容" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/permissionGroupList [GET] | |||
// @Router /api/role/permissionGroupList [GET] | |||
func PermissionGroupList(c *gin.Context) { | |||
roleId := c.DefaultQuery("role_id", "") | |||
engine := db.Db | |||
@@ -108,7 +108,7 @@ func PermissionGroupList(c *gin.Context) { | |||
// @Produce json | |||
// @Success 200 {string} "具体看返回内容" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/roleList [GET] | |||
// @Router /api/role/roleList [GET] | |||
func RoleList(c *gin.Context) { | |||
engine := db.Db | |||
roleDb := implement.NewRoleDb(engine, 0) | |||
@@ -169,7 +169,7 @@ func RoleList(c *gin.Context) { | |||
// @Param args body md.AddRoleReq true "请求参数" | |||
// @Success 200 {string} "success" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/addRole [POST] | |||
// @Router /api/role/addRole [POST] | |||
func AddRole(c *gin.Context) { | |||
var req md.AddRoleReq | |||
err := c.ShouldBindJSON(&req) | |||
@@ -208,7 +208,7 @@ func AddRole(c *gin.Context) { | |||
// @Param args body md.UpdateRoleReq true "请求参数" | |||
// @Success 200 {string} "success" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/updateRole [POST] | |||
// @Router /api/role/updateRole [POST] | |||
func UpdateRole(c *gin.Context) { | |||
var req md.UpdateRoleReq | |||
err := c.ShouldBindJSON(&req) | |||
@@ -250,7 +250,7 @@ func UpdateRole(c *gin.Context) { | |||
// @Param args body md.RoleBindPermissionGroupReq true "请求参数" | |||
// @Success 200 {string} "success" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/roleBindPermissionGroup [POST] | |||
// @Router /api/role/roleBindPermissionGroup [POST] | |||
func RoleBindPermissionGroup(c *gin.Context) { | |||
var req md.RoleBindPermissionGroupReq | |||
err := c.ShouldBindJSON(&req) | |||
@@ -280,7 +280,7 @@ func RoleBindPermissionGroup(c *gin.Context) { | |||
// @Param args body md.UpdateRoleStateReq true "请求参数" | |||
// @Success 200 {string} "success" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/updateRole [POST] | |||
// @Router /api/role/updateRole [POST] | |||
func UpdateRoleState(c *gin.Context) { | |||
var req md.UpdateRoleStateReq | |||
err := c.ShouldBindJSON(&req) | |||
@@ -321,7 +321,7 @@ func UpdateRoleState(c *gin.Context) { | |||
// @Param args body md.UpdateRoleStateReq true "请求参数" | |||
// @Success 200 {string} "success" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/deleteRole/{$id} [DELETE] | |||
// @Router /api/role/deleteRole/{$id} [DELETE] | |||
func DeleteRole(c *gin.Context) { | |||
id := c.Param("id") | |||
engine := db.Db | |||
@@ -356,7 +356,7 @@ func DeleteRole(c *gin.Context) { | |||
// @Param args body md.AdminListReq true "请求参数" | |||
// @Success 200 {string} "具体看返回内容" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/adminList [POST] | |||
// @Router /api/role/adminList [POST] | |||
func AdminList(c *gin.Context) { | |||
var req md.AdminListReq | |||
err := c.ShouldBindJSON(&req) | |||
@@ -430,7 +430,7 @@ func AdminList(c *gin.Context) { | |||
// @Param args body md.UpdateAdminStateReq true "请求参数" | |||
// @Success 200 {string} "success" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/updateAdminState [POST] | |||
// @Router /api/role/updateAdminState [POST] | |||
func UpdateAdminState(c *gin.Context) { | |||
var req md.UpdateAdminStateReq | |||
err := c.ShouldBindJSON(&req) | |||
@@ -472,7 +472,7 @@ func UpdateAdminState(c *gin.Context) { | |||
// @Param args body md.UpdateAdminReq true "请求参数" | |||
// @Success 200 {string} "success" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/updateAdmin [POST] | |||
// @Router /api/role/updateAdmin [POST] | |||
func UpdateAdmin(c *gin.Context) { | |||
var req md.UpdateAdminReq | |||
err := c.ShouldBindJSON(&req) | |||
@@ -515,7 +515,7 @@ func UpdateAdmin(c *gin.Context) { | |||
// @Param args body md.AddAdminReq true "请求参数" | |||
// @Success 200 {string} "success" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/addAdmin [POST] | |||
// @Router /api/role/addAdmin [POST] | |||
func AddAdmin(c *gin.Context) { | |||
var req md.AddAdminReq | |||
err := c.ShouldBindJSON(&req) | |||
@@ -570,7 +570,7 @@ func AddAdmin(c *gin.Context) { | |||
// @Produce json | |||
// @Success 200 {string} "success" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/deleteAdmin/{$adm_id} [DELETE] | |||
// @Router /api/role/deleteAdmin/{$adm_id} [DELETE] | |||
func DeleteAdmin(c *gin.Context) { | |||
admId := c.Param("adm_id") | |||
err := svc.AdminDelete(c, []int{utils.StrToInt(admId)}) | |||
@@ -592,7 +592,7 @@ func DeleteAdmin(c *gin.Context) { | |||
// @Param args body md.BindAdminRoleReq true "请求参数" | |||
// @Success 200 {string} "success" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/bindAdminRole/ [POST] | |||
// @Router /api/role/bindAdminRole/ [POST] | |||
func BindAdminRole(c *gin.Context) { | |||
var req md.BindAdminRoleReq | |||
err := c.ShouldBindJSON(&req) | |||
@@ -621,7 +621,7 @@ func BindAdminRole(c *gin.Context) { | |||
// @param adm_id query string true "管理员id" | |||
// @Success 200 {string} "具体看返回内容" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /role/adminInfo [GET] | |||
// @Router /api/role/adminInfo [GET] | |||
func AdminInfo(c *gin.Context) { | |||
admId := c.DefaultQuery("adm_id", "") | |||
engine := db.Db | |||
@@ -25,7 +25,7 @@ const docTemplate = `{ | |||
"host": "{{.Host}}", | |||
"basePath": "{{.BasePath}}", | |||
"paths": { | |||
"/admin/login": { | |||
"/api/login": { | |||
"post": { | |||
"description": "登入", | |||
"consumes": [ | |||
@@ -65,7 +65,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/addAdmin": { | |||
"/api/role/addAdmin": { | |||
"post": { | |||
"description": "权限管理-新增管理员", | |||
"consumes": [ | |||
@@ -112,7 +112,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/addRole": { | |||
"/api/role/addRole": { | |||
"post": { | |||
"description": "权限管理-添加角色", | |||
"consumes": [ | |||
@@ -159,7 +159,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/adminInfo": { | |||
"/api/role/adminInfo": { | |||
"get": { | |||
"description": "权限管理-管理员信息", | |||
"consumes": [ | |||
@@ -204,7 +204,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/adminList": { | |||
"/api/role/adminList": { | |||
"post": { | |||
"description": "权限管理-管理员列表", | |||
"consumes": [ | |||
@@ -251,7 +251,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/bindAdminRole/": { | |||
"/api/role/bindAdminRole/": { | |||
"post": { | |||
"description": "权限管理-管理员绑定角色", | |||
"consumes": [ | |||
@@ -298,7 +298,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/deleteAdmin/{$adm_id}": { | |||
"/api/role/deleteAdmin/{$adm_id}": { | |||
"delete": { | |||
"description": "权限管理-删除管理员", | |||
"consumes": [ | |||
@@ -336,7 +336,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/deleteRole/{$id}": { | |||
"/api/role/deleteRole/{$id}": { | |||
"delete": { | |||
"description": "权限管理-删除角色", | |||
"consumes": [ | |||
@@ -383,7 +383,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/permissionGroupList": { | |||
"/api/role/permissionGroupList": { | |||
"get": { | |||
"description": "权限管理-权限组列表", | |||
"consumes": [ | |||
@@ -428,7 +428,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/roleBindPermissionGroup": { | |||
"/api/role/roleBindPermissionGroup": { | |||
"post": { | |||
"description": "权限管理-角色绑定权限组", | |||
"consumes": [ | |||
@@ -475,7 +475,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/roleList": { | |||
"/api/role/roleList": { | |||
"get": { | |||
"description": "权限管理-角色列表", | |||
"consumes": [ | |||
@@ -513,7 +513,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/updateAdmin": { | |||
"/api/role/updateAdmin": { | |||
"post": { | |||
"description": "权限管理-修改管理员信息", | |||
"consumes": [ | |||
@@ -560,7 +560,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/updateAdminState": { | |||
"/api/role/updateAdminState": { | |||
"post": { | |||
"description": "权限管理-修改管理员状态", | |||
"consumes": [ | |||
@@ -607,7 +607,7 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/role/updateRole": { | |||
"/api/role/updateRole": { | |||
"post": { | |||
"description": "权限管理-修改角色状态", | |||
"consumes": [ | |||
@@ -17,7 +17,7 @@ | |||
}, | |||
"host": "localhost:1001 or advertisement.dengbiao.top", | |||
"paths": { | |||
"/admin/login": { | |||
"/api/login": { | |||
"post": { | |||
"description": "登入", | |||
"consumes": [ | |||
@@ -57,7 +57,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/addAdmin": { | |||
"/api/role/addAdmin": { | |||
"post": { | |||
"description": "权限管理-新增管理员", | |||
"consumes": [ | |||
@@ -104,7 +104,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/addRole": { | |||
"/api/role/addRole": { | |||
"post": { | |||
"description": "权限管理-添加角色", | |||
"consumes": [ | |||
@@ -151,7 +151,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/adminInfo": { | |||
"/api/role/adminInfo": { | |||
"get": { | |||
"description": "权限管理-管理员信息", | |||
"consumes": [ | |||
@@ -196,7 +196,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/adminList": { | |||
"/api/role/adminList": { | |||
"post": { | |||
"description": "权限管理-管理员列表", | |||
"consumes": [ | |||
@@ -243,7 +243,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/bindAdminRole/": { | |||
"/api/role/bindAdminRole/": { | |||
"post": { | |||
"description": "权限管理-管理员绑定角色", | |||
"consumes": [ | |||
@@ -290,7 +290,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/deleteAdmin/{$adm_id}": { | |||
"/api/role/deleteAdmin/{$adm_id}": { | |||
"delete": { | |||
"description": "权限管理-删除管理员", | |||
"consumes": [ | |||
@@ -328,7 +328,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/deleteRole/{$id}": { | |||
"/api/role/deleteRole/{$id}": { | |||
"delete": { | |||
"description": "权限管理-删除角色", | |||
"consumes": [ | |||
@@ -375,7 +375,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/permissionGroupList": { | |||
"/api/role/permissionGroupList": { | |||
"get": { | |||
"description": "权限管理-权限组列表", | |||
"consumes": [ | |||
@@ -420,7 +420,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/roleBindPermissionGroup": { | |||
"/api/role/roleBindPermissionGroup": { | |||
"post": { | |||
"description": "权限管理-角色绑定权限组", | |||
"consumes": [ | |||
@@ -467,7 +467,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/roleList": { | |||
"/api/role/roleList": { | |||
"get": { | |||
"description": "权限管理-角色列表", | |||
"consumes": [ | |||
@@ -505,7 +505,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/updateAdmin": { | |||
"/api/role/updateAdmin": { | |||
"post": { | |||
"description": "权限管理-修改管理员信息", | |||
"consumes": [ | |||
@@ -552,7 +552,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/updateAdminState": { | |||
"/api/role/updateAdminState": { | |||
"post": { | |||
"description": "权限管理-修改管理员状态", | |||
"consumes": [ | |||
@@ -599,7 +599,7 @@ | |||
} | |||
} | |||
}, | |||
"/role/updateRole": { | |||
"/api/role/updateRole": { | |||
"post": { | |||
"description": "权限管理-修改角色状态", | |||
"consumes": [ | |||
@@ -147,7 +147,7 @@ info: | |||
title: 广告联盟-总站长平台 | |||
version: "1.0" | |||
paths: | |||
/admin/login: | |||
/api/login: | |||
post: | |||
consumes: | |||
- application/json | |||
@@ -173,7 +173,7 @@ paths: | |||
summary: 登陆 | |||
tags: | |||
- 登录注册 | |||
/role/addAdmin: | |||
/api/role/addAdmin: | |||
post: | |||
consumes: | |||
- application/json | |||
@@ -204,7 +204,7 @@ paths: | |||
summary: 新增管理员 | |||
tags: | |||
- 权限管理 | |||
/role/addRole: | |||
/api/role/addRole: | |||
post: | |||
consumes: | |||
- application/json | |||
@@ -235,7 +235,7 @@ paths: | |||
summary: 添加角色 | |||
tags: | |||
- 权限管理 | |||
/role/adminInfo: | |||
/api/role/adminInfo: | |||
get: | |||
consumes: | |||
- application/json | |||
@@ -265,7 +265,7 @@ paths: | |||
summary: 管理员信息 | |||
tags: | |||
- 权限管理 | |||
/role/adminList: | |||
/api/role/adminList: | |||
post: | |||
consumes: | |||
- application/json | |||
@@ -296,7 +296,7 @@ paths: | |||
summary: 管理员列表 | |||
tags: | |||
- 权限管理 | |||
/role/bindAdminRole/: | |||
/api/role/bindAdminRole/: | |||
post: | |||
consumes: | |||
- application/json | |||
@@ -327,7 +327,7 @@ paths: | |||
summary: 管理员绑定角色 | |||
tags: | |||
- 权限管理 | |||
/role/deleteAdmin/{$adm_id}: | |||
/api/role/deleteAdmin/{$adm_id}: | |||
delete: | |||
consumes: | |||
- application/json | |||
@@ -352,7 +352,7 @@ paths: | |||
summary: 删除管理员 | |||
tags: | |||
- 权限管理 | |||
/role/deleteRole/{$id}: | |||
/api/role/deleteRole/{$id}: | |||
delete: | |||
consumes: | |||
- application/json | |||
@@ -383,7 +383,7 @@ paths: | |||
summary: 删除角色 | |||
tags: | |||
- 权限管理 | |||
/role/permissionGroupList: | |||
/api/role/permissionGroupList: | |||
get: | |||
consumes: | |||
- application/json | |||
@@ -413,7 +413,7 @@ paths: | |||
summary: 权限组列表 | |||
tags: | |||
- 权限管理 | |||
/role/roleBindPermissionGroup: | |||
/api/role/roleBindPermissionGroup: | |||
post: | |||
consumes: | |||
- application/json | |||
@@ -444,7 +444,7 @@ paths: | |||
summary: 角色绑定权限组 | |||
tags: | |||
- 权限管理 | |||
/role/roleList: | |||
/api/role/roleList: | |||
get: | |||
consumes: | |||
- application/json | |||
@@ -469,7 +469,7 @@ paths: | |||
summary: 角色列表 | |||
tags: | |||
- 权限管理 | |||
/role/updateAdmin: | |||
/api/role/updateAdmin: | |||
post: | |||
consumes: | |||
- application/json | |||
@@ -500,7 +500,7 @@ paths: | |||
summary: 修改管理员信息 | |||
tags: | |||
- 权限管理 | |||
/role/updateAdminState: | |||
/api/role/updateAdminState: | |||
post: | |||
consumes: | |||
- application/json | |||
@@ -531,7 +531,7 @@ paths: | |||
summary: 修改管理员状态 | |||
tags: | |||
- 权限管理 | |||
/role/updateRole: | |||
/api/role/updateRole: | |||
post: | |||
consumes: | |||
- application/json | |||