dengbiao pirms 2 mēnešiem
vecāks
revīzija
b8a3dfed0c
5 mainītis faili ar 57 papildinājumiem un 57 dzēšanām
  1. +1
    -1
      app/hdl/hdl_login.go
  2. +14
    -14
      app/hdl/hdl_role.go
  3. +14
    -14
      docs/docs.go
  4. +14
    -14
      docs/swagger.json
  5. +14
    -14
      docs/swagger.yaml

+ 1
- 1
app/hdl/hdl_login.go Parādīt failu

@@ -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)


+ 14
- 14
app/hdl/hdl_role.go Parādīt failu

@@ -24,7 +24,7 @@ import (
// @param adm_id query string true "管理员id"
// @Success 200 {string} "具体看返回内容"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/role/permissionGroupList [GET]
// @Router /api/role/permissionGroupList [GET]
func PermissionGroupList(c *gin.Context) {
roleId := c.DefaultQuery("role_id", "")
engine := db.DBs[svc.GetMasterId(c)]
@@ -108,7 +108,7 @@ func PermissionGroupList(c *gin.Context) {
// @Produce json
// @Success 200 {string} "具体看返回内容"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/role/roleList [GET]
// @Router /api/role/roleList [GET]
func RoleList(c *gin.Context) {
engine := db.DBs[svc.GetMasterId(c)]
roleDb := implement.NewMediumRoleDb(engine)
@@ -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 /admin/role/addRole [POST]
// @Router /api/role/addRole [POST]
func AddRole(c *gin.Context) {
var req md.AddRoleReq
err := c.ShouldBindJSON(&req)
@@ -209,7 +209,7 @@ func AddRole(c *gin.Context) {
// @Param args body md.UpdateRoleReq true "请求参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/role/updateRole [POST]
// @Router /api/role/updateRole [POST]
func UpdateRole(c *gin.Context) {
var req md.UpdateRoleReq
err := c.ShouldBindJSON(&req)
@@ -251,7 +251,7 @@ func UpdateRole(c *gin.Context) {
// @Param args body md.RoleBindPermissionGroupReq true "请求参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/role/roleBindPermissionGroup [POST]
// @Router /api/role/roleBindPermissionGroup [POST]
func RoleBindPermissionGroup(c *gin.Context) {
var req md.RoleBindPermissionGroupReq
err := c.ShouldBindJSON(&req)
@@ -281,7 +281,7 @@ func RoleBindPermissionGroup(c *gin.Context) {
// @Param args body md.UpdateRoleStateReq true "请求参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/role/updateRole [POST]
// @Router /api/role/updateRole [POST]
func UpdateRoleState(c *gin.Context) {
var req md.UpdateRoleStateReq
err := c.ShouldBindJSON(&req)
@@ -322,7 +322,7 @@ func UpdateRoleState(c *gin.Context) {
// @Param args body md.UpdateRoleStateReq true "请求参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/role/deleteRole/{$id} [DELETE]
// @Router /api/role/deleteRole/{$id} [DELETE]
func DeleteRole(c *gin.Context) {
id := c.Param("id")
engine := db.DBs[svc.GetMasterId(c)]
@@ -357,7 +357,7 @@ func DeleteRole(c *gin.Context) {
// @Param args body md.AdminListReq true "请求参数"
// @Success 200 {string} "具体看返回内容"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/role/adminList [POST]
// @Router /api/role/adminList [POST]
func AdminList(c *gin.Context) {
var req md.AdminListReq
err := c.ShouldBindJSON(&req)
@@ -431,7 +431,7 @@ func AdminList(c *gin.Context) {
// @Param args body md.UpdateAdminStateReq true "请求参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/role/updateAdminState [POST]
// @Router /api/role/updateAdminState [POST]
func UpdateAdminState(c *gin.Context) {
var req md.UpdateAdminStateReq
err := c.ShouldBindJSON(&req)
@@ -473,7 +473,7 @@ func UpdateAdminState(c *gin.Context) {
// @Param args body md.UpdateAdminReq true "请求参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/role/updateAdmin [POST]
// @Router /api/role/updateAdmin [POST]
func UpdateAdmin(c *gin.Context) {
var req md.UpdateAdminReq
err := c.ShouldBindJSON(&req)
@@ -516,7 +516,7 @@ func UpdateAdmin(c *gin.Context) {
// @Param args body md.AddAdminReq true "请求参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/role/addAdmin [POST]
// @Router /api/role/addAdmin [POST]
func AddAdmin(c *gin.Context) {
var req md.AddAdminReq
err := c.ShouldBindJSON(&req)
@@ -571,7 +571,7 @@ func AddAdmin(c *gin.Context) {
// @Produce json
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/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)})
@@ -593,7 +593,7 @@ func DeleteAdmin(c *gin.Context) {
// @Param args body md.BindAdminRoleReq true "请求参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/role/bindAdminRole/ [POST]
// @Router /api/role/bindAdminRole/ [POST]
func BindAdminRole(c *gin.Context) {
var req md.BindAdminRoleReq
err := c.ShouldBindJSON(&req)
@@ -622,7 +622,7 @@ func BindAdminRole(c *gin.Context) {
// @param adm_id query string true "管理员id"
// @Success 200 {string} "具体看返回内容"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/role/adminInfo [GET]
// @Router /api/role/adminInfo [GET]
func AdminInfo(c *gin.Context) {
admId := c.DefaultQuery("adm_id", "")
engine := db.DBs[svc.GetMasterId(c)]


+ 14
- 14
docs/docs.go Parādīt failu

@@ -25,7 +25,7 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/admin/login": {
"/api/login": {
"post": {
"description": "登入",
"consumes": [
@@ -65,7 +65,7 @@ const docTemplate = `{
}
}
},
"/admin/role/addAdmin": {
"/api/role/addAdmin": {
"post": {
"description": "新增管理员",
"consumes": [
@@ -112,7 +112,7 @@ const docTemplate = `{
}
}
},
"/admin/role/addRole": {
"/api/role/addRole": {
"post": {
"description": "添加角色",
"consumes": [
@@ -159,7 +159,7 @@ const docTemplate = `{
}
}
},
"/admin/role/adminInfo": {
"/api/role/adminInfo": {
"get": {
"description": "管理员信息",
"consumes": [
@@ -204,7 +204,7 @@ const docTemplate = `{
}
}
},
"/admin/role/adminList": {
"/api/role/adminList": {
"post": {
"description": "管理员列表",
"consumes": [
@@ -251,7 +251,7 @@ const docTemplate = `{
}
}
},
"/admin/role/bindAdminRole/": {
"/api/role/bindAdminRole/": {
"post": {
"description": "管理员绑定角色",
"consumes": [
@@ -298,7 +298,7 @@ const docTemplate = `{
}
}
},
"/admin/role/deleteAdmin/{$adm_id}": {
"/api/role/deleteAdmin/{$adm_id}": {
"delete": {
"description": "删除管理员",
"consumes": [
@@ -336,7 +336,7 @@ const docTemplate = `{
}
}
},
"/admin/role/deleteRole/{$id}": {
"/api/role/deleteRole/{$id}": {
"delete": {
"description": "删除角色",
"consumes": [
@@ -383,7 +383,7 @@ const docTemplate = `{
}
}
},
"/admin/role/permissionGroupList": {
"/api/role/permissionGroupList": {
"get": {
"description": "权限组列表",
"consumes": [
@@ -428,7 +428,7 @@ const docTemplate = `{
}
}
},
"/admin/role/roleBindPermissionGroup": {
"/api/role/roleBindPermissionGroup": {
"post": {
"description": "角色绑定权限组",
"consumes": [
@@ -475,7 +475,7 @@ const docTemplate = `{
}
}
},
"/admin/role/roleList": {
"/api/role/roleList": {
"get": {
"description": "角色列表",
"consumes": [
@@ -513,7 +513,7 @@ const docTemplate = `{
}
}
},
"/admin/role/updateAdmin": {
"/api/role/updateAdmin": {
"post": {
"description": "修改管理员信息",
"consumes": [
@@ -560,7 +560,7 @@ const docTemplate = `{
}
}
},
"/admin/role/updateAdminState": {
"/api/role/updateAdminState": {
"post": {
"description": "修改管理员状态",
"consumes": [
@@ -607,7 +607,7 @@ const docTemplate = `{
}
}
},
"/admin/role/updateRole": {
"/api/role/updateRole": {
"post": {
"description": "修改角色状态",
"consumes": [


+ 14
- 14
docs/swagger.json Parādīt failu

@@ -17,7 +17,7 @@
},
"host": "localhost:1004 or xxxxx.medium.dengbiao.top",
"paths": {
"/admin/login": {
"/api/login": {
"post": {
"description": "登入",
"consumes": [
@@ -57,7 +57,7 @@
}
}
},
"/admin/role/addAdmin": {
"/api/role/addAdmin": {
"post": {
"description": "新增管理员",
"consumes": [
@@ -104,7 +104,7 @@
}
}
},
"/admin/role/addRole": {
"/api/role/addRole": {
"post": {
"description": "添加角色",
"consumes": [
@@ -151,7 +151,7 @@
}
}
},
"/admin/role/adminInfo": {
"/api/role/adminInfo": {
"get": {
"description": "管理员信息",
"consumes": [
@@ -196,7 +196,7 @@
}
}
},
"/admin/role/adminList": {
"/api/role/adminList": {
"post": {
"description": "管理员列表",
"consumes": [
@@ -243,7 +243,7 @@
}
}
},
"/admin/role/bindAdminRole/": {
"/api/role/bindAdminRole/": {
"post": {
"description": "管理员绑定角色",
"consumes": [
@@ -290,7 +290,7 @@
}
}
},
"/admin/role/deleteAdmin/{$adm_id}": {
"/api/role/deleteAdmin/{$adm_id}": {
"delete": {
"description": "删除管理员",
"consumes": [
@@ -328,7 +328,7 @@
}
}
},
"/admin/role/deleteRole/{$id}": {
"/api/role/deleteRole/{$id}": {
"delete": {
"description": "删除角色",
"consumes": [
@@ -375,7 +375,7 @@
}
}
},
"/admin/role/permissionGroupList": {
"/api/role/permissionGroupList": {
"get": {
"description": "权限组列表",
"consumes": [
@@ -420,7 +420,7 @@
}
}
},
"/admin/role/roleBindPermissionGroup": {
"/api/role/roleBindPermissionGroup": {
"post": {
"description": "角色绑定权限组",
"consumes": [
@@ -467,7 +467,7 @@
}
}
},
"/admin/role/roleList": {
"/api/role/roleList": {
"get": {
"description": "角色列表",
"consumes": [
@@ -505,7 +505,7 @@
}
}
},
"/admin/role/updateAdmin": {
"/api/role/updateAdmin": {
"post": {
"description": "修改管理员信息",
"consumes": [
@@ -552,7 +552,7 @@
}
}
},
"/admin/role/updateAdminState": {
"/api/role/updateAdminState": {
"post": {
"description": "修改管理员状态",
"consumes": [
@@ -599,7 +599,7 @@
}
}
},
"/admin/role/updateRole": {
"/api/role/updateRole": {
"post": {
"description": "修改角色状态",
"consumes": [


+ 14
- 14
docs/swagger.yaml Parādīt failu

@@ -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:
- ADMIN
/admin/role/addAdmin:
/api/role/addAdmin:
post:
consumes:
- application/json
@@ -204,7 +204,7 @@ paths:
summary: 新增管理员
tags:
- ADMIN-权限管理
/admin/role/addRole:
/api/role/addRole:
post:
consumes:
- application/json
@@ -235,7 +235,7 @@ paths:
summary: 添加角色
tags:
- ADMIN-权限管理
/admin/role/adminInfo:
/api/role/adminInfo:
get:
consumes:
- application/json
@@ -265,7 +265,7 @@ paths:
summary: 管理员信息
tags:
- ADMIN-权限管理
/admin/role/adminList:
/api/role/adminList:
post:
consumes:
- application/json
@@ -296,7 +296,7 @@ paths:
summary: 管理员列表
tags:
- ADMIN-权限管理
/admin/role/bindAdminRole/:
/api/role/bindAdminRole/:
post:
consumes:
- application/json
@@ -327,7 +327,7 @@ paths:
summary: 管理员绑定角色
tags:
- ADMIN-权限管理
/admin/role/deleteAdmin/{$adm_id}:
/api/role/deleteAdmin/{$adm_id}:
delete:
consumes:
- application/json
@@ -352,7 +352,7 @@ paths:
summary: 删除管理员
tags:
- ADMIN-权限管理
/admin/role/deleteRole/{$id}:
/api/role/deleteRole/{$id}:
delete:
consumes:
- application/json
@@ -383,7 +383,7 @@ paths:
summary: 删除角色
tags:
- ADMIN-权限管理
/admin/role/permissionGroupList:
/api/role/permissionGroupList:
get:
consumes:
- application/json
@@ -413,7 +413,7 @@ paths:
summary: 权限组列表
tags:
- ADMIN-权限管理
/admin/role/roleBindPermissionGroup:
/api/role/roleBindPermissionGroup:
post:
consumes:
- application/json
@@ -444,7 +444,7 @@ paths:
summary: 角色绑定权限组
tags:
- ADMIN-权限管理
/admin/role/roleList:
/api/role/roleList:
get:
consumes:
- application/json
@@ -469,7 +469,7 @@ paths:
summary: 角色列表
tags:
- ADMIN-权限管理
/admin/role/updateAdmin:
/api/role/updateAdmin:
post:
consumes:
- application/json
@@ -500,7 +500,7 @@ paths:
summary: 修改管理员信息
tags:
- ADMIN-权限管理
/admin/role/updateAdminState:
/api/role/updateAdminState:
post:
consumes:
- application/json
@@ -531,7 +531,7 @@ paths:
summary: 修改管理员状态
tags:
- ADMIN-权限管理
/admin/role/updateRole:
/api/role/updateRole:
post:
consumes:
- application/json


Notiek ielāde…
Atcelt
Saglabāt