Browse Source

upodate

master
dengbiao 3 months ago
parent
commit
fcb342aec4
5 changed files with 380 additions and 378 deletions
  1. +17
    -32
      app/svc/svc_master.go
  2. +131
    -125
      docs/docs.go
  3. +131
    -125
      docs/swagger.json
  4. +99
    -94
      docs/swagger.yaml
  5. +2
    -2
      go.mod

+ 17
- 32
app/svc/svc_master.go View File

@@ -1,6 +1,10 @@
package svc package svc


import ( import (
"applet/app/e"
"applet/app/utils"
db "code.fnuoos.com/zhimeng/model.git/src"
"code.fnuoos.com/zhimeng/model.git/src/super/implement"
"fmt" "fmt"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"strconv" "strconv"
@@ -15,38 +19,19 @@ func GetMasterId(c *gin.Context) (masterId string) {
masterId = c.GetString("master_id") masterId = c.GetString("master_id")
if masterId == "" { if masterId == "" {
//TODO::通过域名查找masterId //TODO::通过域名查找masterId
//host := c.Request.Host

//fmt.Println("not found master_id found MasterId start")
//masterId = c.GetHeader("MasterId")
//if masterId == "" && c.GetHeader("Platform") == md.PLATFORM_WAP { // H5 要根据域名去获取mid
// hostList := strings.Split(c.Request.Host, ".")
// if isNumeric(hostList[0]) {
// masterId = hostList[0]
// } else if isNumeric(hostList[1]) {
// masterId = hostList[1]
// } else {
// // 自定义域名
// masterId = svc.GetWebSiteDomainMasterId(baseDb, md.PLATFORM_WAP, c.Request.Host)
// }
//}
//if masterId == "" && c.GetHeader("Platform") == md.PLATFORM_PC { // H5 要根据域名去获取mid
// hostList := strings.Split(c.Request.Host, ".")
// if isNumeric(hostList[0]) {
// masterId = hostList[0]
// } else if isNumeric(hostList[1]) {
// masterId = hostList[1]
// } else {
// // 自定义域名
// masterId = svc.GetWebSiteDomainMasterId(baseDb, md.PLATFORM_PC, c.Request.Host)
// }
//}
//if masterId == "" && c.GetHeader("Platform") == "" { // 无平台访问
// hostList := strings.Split(c.Request.Host, ".")
// if isNumeric(hostList[0]) {
// masterId = hostList[0]
// }
//}
host := c.Request.Host
userAppDomainDb := implement.NewUserAppDomainDb(db.Db)
userAppDomain, err := userAppDomainDb.GetMediumAppDomainByHost(host)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err)
return
}
if userAppDomain == nil {
e.OutErr(c, e.ERR_NOT_FAN, "域名不存在")
return
}
masterId = utils.IntToStr(userAppDomain.Uuid)
c.Set("master_id", masterId)
} }
fmt.Println("master_id:::::::", masterId) fmt.Println("master_id:::::::", masterId)
return return


+ 131
- 125
docs/docs.go View File

@@ -25,9 +25,9 @@ const docTemplate = `{
"host": "{{.Host}}", "host": "{{.Host}}",
"basePath": "{{.BasePath}}", "basePath": "{{.BasePath}}",
"paths": { "paths": {
"/admin/role/addAdmin": {
"/login": {
"post": { "post": {
"description": "权限管理-新增管理员",
"description": "登入",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -35,32 +35,25 @@ const docTemplate = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"权限管理"
"登录"
], ],
"summary": "新增管理员",
"summary": "登陆",
"parameters": [ "parameters": [
{ {
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "请求参数",
"name": "args",
"description": "用户名密码",
"name": "req",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.AddAdminReq"
"$ref": "#/definitions/md.LoginReq"
} }
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "success",
"description": "token",
"schema": { "schema": {
"type": "string"
"$ref": "#/definitions/md.LoginResponse"
} }
}, },
"400": { "400": {
@@ -72,9 +65,9 @@ const docTemplate = `{
} }
} }
}, },
"/admin/role/permissionGroupList": {
"get": {
"description": "权限管理-权限组列表",
"/registerForAgent": {
"post": {
"description": "注册模块-渠道代理注册",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -82,28 +75,23 @@ const docTemplate = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"权限管理"
"注册模块"
], ],
"summary": "权限组列表",
"summary": "渠道代理注册",
"parameters": [ "parameters": [
{ {
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"type": "string",
"description": "管理员id",
"name": "adm_id",
"in": "query",
"required": true
"description": "用户名密码",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.RegisterForAgentReq"
}
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "具体看返回内容",
"description": "success",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -117,9 +105,9 @@ const docTemplate = `{
} }
} }
}, },
"/admin/role/roleBindPermissionGroup": {
"/registerForMedium": {
"post": { "post": {
"description": "权限管理-角色绑定权限组",
"description": "注册模块-媒体注册",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -127,24 +115,17 @@ const docTemplate = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"权限管理"
"注册模块"
], ],
"summary": "角色绑定权限组",
"summary": "媒体注册",
"parameters": [ "parameters": [
{ {
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "请求参数",
"name": "args",
"description": "用户名密码",
"name": "req",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.RoleBindPermissionGroupReq"
"$ref": "#/definitions/md.RegisterForMediumReq"
} }
} }
], ],
@@ -164,9 +145,9 @@ const docTemplate = `{
} }
} }
}, },
"/login": {
"/role/addAdmin": {
"post": { "post": {
"description": "登入",
"description": "权限管理-新增管理员",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -174,25 +155,32 @@ const docTemplate = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"登录"
"权限管理"
], ],
"summary": "登陆",
"summary": "新增管理员",
"parameters": [ "parameters": [
{ {
"description": "用户名密码",
"name": "req",
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "请求参数",
"name": "args",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.LoginReq"
"$ref": "#/definitions/md.AddAdminReq"
} }
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "token",
"description": "success",
"schema": { "schema": {
"$ref": "#/definitions/md.LoginResponse"
"type": "string"
} }
}, },
"400": { "400": {
@@ -204,9 +192,9 @@ const docTemplate = `{
} }
} }
}, },
"/registerForAgent": {
"/role/addRole": {
"post": { "post": {
"description": "注册模块-渠道代理注册",
"description": "权限管理-添加角色",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -214,17 +202,24 @@ const docTemplate = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"注册模块"
"权限管理"
], ],
"summary": "渠道代理注册",
"summary": "添加角色",
"parameters": [ "parameters": [
{ {
"description": "用户名密码",
"name": "req",
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "请求参数",
"name": "args",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.RegisterForAgentReq"
"$ref": "#/definitions/md.AddRoleReq"
} }
} }
], ],
@@ -244,9 +239,9 @@ const docTemplate = `{
} }
} }
}, },
"/registerForMedium": {
"post": {
"description": "注册模块-媒体注册",
"/role/adminInfo": {
"get": {
"description": "权限管理-管理员信息",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -254,23 +249,28 @@ const docTemplate = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"注册模块"
"权限管理"
], ],
"summary": "媒体注册",
"summary": "管理员信息",
"parameters": [ "parameters": [
{ {
"description": "用户名密码",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.RegisterForMediumReq"
}
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"type": "string",
"description": "管理员id",
"name": "adm_id",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "success",
"description": "具体看返回内容",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -284,9 +284,9 @@ const docTemplate = `{
} }
} }
}, },
"/role/addRole": {
"/role/adminList": {
"post": { "post": {
"description": "权限管理-添加角色",
"description": "权限管理-管理员列表",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -296,7 +296,7 @@ const docTemplate = `{
"tags": [ "tags": [
"权限管理" "权限管理"
], ],
"summary": "添加角色",
"summary": "管理员列表",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@@ -311,13 +311,13 @@ const docTemplate = `{
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.AddRoleReq"
"$ref": "#/definitions/md.AdminListReq"
} }
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "success",
"description": "具体看返回内容",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -331,9 +331,9 @@ const docTemplate = `{
} }
} }
}, },
"/role/adminInfo": {
"get": {
"description": "权限管理-管理员信息",
"/role/bindAdminRole/": {
"post": {
"description": "权限管理-管理员绑定角色",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -343,7 +343,7 @@ const docTemplate = `{
"tags": [ "tags": [
"权限管理" "权限管理"
], ],
"summary": "管理员信息",
"summary": "管理员绑定角色",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@@ -353,16 +353,18 @@ const docTemplate = `{
"required": true "required": true
}, },
{ {
"type": "string",
"description": "管理员id",
"name": "adm_id",
"in": "query",
"required": true
"description": "请求参数",
"name": "args",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.BindAdminRoleReq"
}
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "具体看返回内容",
"description": "success",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -376,9 +378,9 @@ const docTemplate = `{
} }
} }
}, },
"/role/adminList": {
"post": {
"description": "权限管理-管理员列表",
"/role/deleteAdmin/{$adm_id}": {
"delete": {
"description": "权限管理-删除管理员",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -388,7 +390,7 @@ const docTemplate = `{
"tags": [ "tags": [
"权限管理" "权限管理"
], ],
"summary": "管理员列表",
"summary": "删除管理员",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@@ -396,20 +398,11 @@ const docTemplate = `{
"name": "Authorization", "name": "Authorization",
"in": "header", "in": "header",
"required": true "required": true
},
{
"description": "请求参数",
"name": "args",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.AdminListReq"
}
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "具体看返回内容",
"description": "success",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -423,9 +416,9 @@ const docTemplate = `{
} }
} }
}, },
"/role/bindAdminRole/": {
"post": {
"description": "权限管理-管理员绑定角色",
"/role/deleteRole/{$id}": {
"delete": {
"description": "权限管理-删除角色",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -435,7 +428,7 @@ const docTemplate = `{
"tags": [ "tags": [
"权限管理" "权限管理"
], ],
"summary": "管理员绑定角色",
"summary": "删除角色",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@@ -450,7 +443,7 @@ const docTemplate = `{
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.BindAdminRoleReq"
"$ref": "#/definitions/md.UpdateRoleStateReq"
} }
} }
], ],
@@ -470,9 +463,9 @@ const docTemplate = `{
} }
} }
}, },
"/role/deleteAdmin/{$adm_id}": {
"delete": {
"description": "权限管理-删除管理员",
"/role/permissionGroupList": {
"get": {
"description": "权限管理-权限组列表",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -482,7 +475,7 @@ const docTemplate = `{
"tags": [ "tags": [
"权限管理" "权限管理"
], ],
"summary": "删除管理员",
"summary": "权限组列表",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@@ -490,11 +483,18 @@ const docTemplate = `{
"name": "Authorization", "name": "Authorization",
"in": "header", "in": "header",
"required": true "required": true
},
{
"type": "string",
"description": "管理员id",
"name": "adm_id",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "success",
"description": "具体看返回内容",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -508,9 +508,9 @@ const docTemplate = `{
} }
} }
}, },
"/role/deleteRole/{$id}": {
"delete": {
"description": "权限管理-删除角色",
"/role/roleBindPermissionGroup": {
"post": {
"description": "权限管理-角色绑定权限组",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -520,7 +520,7 @@ const docTemplate = `{
"tags": [ "tags": [
"权限管理" "权限管理"
], ],
"summary": "删除角色",
"summary": "角色绑定权限组",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@@ -535,7 +535,7 @@ const docTemplate = `{
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.UpdateRoleStateReq"
"$ref": "#/definitions/md.RoleBindPermissionGroupReq"
} }
} }
], ],
@@ -810,11 +810,17 @@ const docTemplate = `{
"username" "username"
], ],
"properties": { "properties": {
"code": {
"type": "string",
"example": "验证码"
},
"password": { "password": {
"type": "string"
"type": "string",
"example": "登录密码"
}, },
"username": { "username": {
"type": "string"
"type": "string",
"example": "登录账号"
} }
} }
}, },
@@ -985,11 +991,11 @@ const docTemplate = `{
// SwaggerInfo holds exported Swagger Info so clients can modify it // SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{ var SwaggerInfo = &swag.Spec{
Version: "1.0", Version: "1.0",
Host: "localhost:1001 / xxxx.advertisement.dengbiao.top",
Host: "localhost:1002 or xxxx.advertisement.dengbiao.top",
BasePath: "", BasePath: "",
Schemes: []string{}, Schemes: []string{},
Title: "广告联盟-站长平台", Title: "广告联盟-站长平台",
Description: "后台接口",
Description: "站长后台接口",
InfoInstanceName: "swagger", InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate, SwaggerTemplate: docTemplate,
} }


+ 131
- 125
docs/swagger.json View File

@@ -1,7 +1,7 @@
{ {
"swagger": "2.0", "swagger": "2.0",
"info": { "info": {
"description": "后台接口",
"description": "站长后台接口",
"title": "广告联盟-站长平台", "title": "广告联盟-站长平台",
"termsOfService": "http://swagger.io/terms/", "termsOfService": "http://swagger.io/terms/",
"contact": { "contact": {
@@ -15,11 +15,11 @@
}, },
"version": "1.0" "version": "1.0"
}, },
"host": "localhost:1001 / xxxx.advertisement.dengbiao.top",
"host": "localhost:1002 or xxxx.advertisement.dengbiao.top",
"paths": { "paths": {
"/admin/role/addAdmin": {
"/login": {
"post": { "post": {
"description": "权限管理-新增管理员",
"description": "登入",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -27,32 +27,25 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"权限管理"
"登录"
], ],
"summary": "新增管理员",
"summary": "登陆",
"parameters": [ "parameters": [
{ {
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "请求参数",
"name": "args",
"description": "用户名密码",
"name": "req",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.AddAdminReq"
"$ref": "#/definitions/md.LoginReq"
} }
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "success",
"description": "token",
"schema": { "schema": {
"type": "string"
"$ref": "#/definitions/md.LoginResponse"
} }
}, },
"400": { "400": {
@@ -64,9 +57,9 @@
} }
} }
}, },
"/admin/role/permissionGroupList": {
"get": {
"description": "权限管理-权限组列表",
"/registerForAgent": {
"post": {
"description": "注册模块-渠道代理注册",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -74,28 +67,23 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"权限管理"
"注册模块"
], ],
"summary": "权限组列表",
"summary": "渠道代理注册",
"parameters": [ "parameters": [
{ {
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"type": "string",
"description": "管理员id",
"name": "adm_id",
"in": "query",
"required": true
"description": "用户名密码",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.RegisterForAgentReq"
}
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "具体看返回内容",
"description": "success",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -109,9 +97,9 @@
} }
} }
}, },
"/admin/role/roleBindPermissionGroup": {
"/registerForMedium": {
"post": { "post": {
"description": "权限管理-角色绑定权限组",
"description": "注册模块-媒体注册",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -119,24 +107,17 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"权限管理"
"注册模块"
], ],
"summary": "角色绑定权限组",
"summary": "媒体注册",
"parameters": [ "parameters": [
{ {
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "请求参数",
"name": "args",
"description": "用户名密码",
"name": "req",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.RoleBindPermissionGroupReq"
"$ref": "#/definitions/md.RegisterForMediumReq"
} }
} }
], ],
@@ -156,9 +137,9 @@
} }
} }
}, },
"/login": {
"/role/addAdmin": {
"post": { "post": {
"description": "登入",
"description": "权限管理-新增管理员",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -166,25 +147,32 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"登录"
"权限管理"
], ],
"summary": "登陆",
"summary": "新增管理员",
"parameters": [ "parameters": [
{ {
"description": "用户名密码",
"name": "req",
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "请求参数",
"name": "args",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.LoginReq"
"$ref": "#/definitions/md.AddAdminReq"
} }
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "token",
"description": "success",
"schema": { "schema": {
"$ref": "#/definitions/md.LoginResponse"
"type": "string"
} }
}, },
"400": { "400": {
@@ -196,9 +184,9 @@
} }
} }
}, },
"/registerForAgent": {
"/role/addRole": {
"post": { "post": {
"description": "注册模块-渠道代理注册",
"description": "权限管理-添加角色",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -206,17 +194,24 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"注册模块"
"权限管理"
], ],
"summary": "渠道代理注册",
"summary": "添加角色",
"parameters": [ "parameters": [
{ {
"description": "用户名密码",
"name": "req",
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "请求参数",
"name": "args",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.RegisterForAgentReq"
"$ref": "#/definitions/md.AddRoleReq"
} }
} }
], ],
@@ -236,9 +231,9 @@
} }
} }
}, },
"/registerForMedium": {
"post": {
"description": "注册模块-媒体注册",
"/role/adminInfo": {
"get": {
"description": "权限管理-管理员信息",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -246,23 +241,28 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"注册模块"
"权限管理"
], ],
"summary": "媒体注册",
"summary": "管理员信息",
"parameters": [ "parameters": [
{ {
"description": "用户名密码",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.RegisterForMediumReq"
}
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"type": "string",
"description": "管理员id",
"name": "adm_id",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "success",
"description": "具体看返回内容",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -276,9 +276,9 @@
} }
} }
}, },
"/role/addRole": {
"/role/adminList": {
"post": { "post": {
"description": "权限管理-添加角色",
"description": "权限管理-管理员列表",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -288,7 +288,7 @@
"tags": [ "tags": [
"权限管理" "权限管理"
], ],
"summary": "添加角色",
"summary": "管理员列表",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@@ -303,13 +303,13 @@
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.AddRoleReq"
"$ref": "#/definitions/md.AdminListReq"
} }
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "success",
"description": "具体看返回内容",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -323,9 +323,9 @@
} }
} }
}, },
"/role/adminInfo": {
"get": {
"description": "权限管理-管理员信息",
"/role/bindAdminRole/": {
"post": {
"description": "权限管理-管理员绑定角色",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -335,7 +335,7 @@
"tags": [ "tags": [
"权限管理" "权限管理"
], ],
"summary": "管理员信息",
"summary": "管理员绑定角色",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@@ -345,16 +345,18 @@
"required": true "required": true
}, },
{ {
"type": "string",
"description": "管理员id",
"name": "adm_id",
"in": "query",
"required": true
"description": "请求参数",
"name": "args",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.BindAdminRoleReq"
}
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "具体看返回内容",
"description": "success",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -368,9 +370,9 @@
} }
} }
}, },
"/role/adminList": {
"post": {
"description": "权限管理-管理员列表",
"/role/deleteAdmin/{$adm_id}": {
"delete": {
"description": "权限管理-删除管理员",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -380,7 +382,7 @@
"tags": [ "tags": [
"权限管理" "权限管理"
], ],
"summary": "管理员列表",
"summary": "删除管理员",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@@ -388,20 +390,11 @@
"name": "Authorization", "name": "Authorization",
"in": "header", "in": "header",
"required": true "required": true
},
{
"description": "请求参数",
"name": "args",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.AdminListReq"
}
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "具体看返回内容",
"description": "success",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -415,9 +408,9 @@
} }
} }
}, },
"/role/bindAdminRole/": {
"post": {
"description": "权限管理-管理员绑定角色",
"/role/deleteRole/{$id}": {
"delete": {
"description": "权限管理-删除角色",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -427,7 +420,7 @@
"tags": [ "tags": [
"权限管理" "权限管理"
], ],
"summary": "管理员绑定角色",
"summary": "删除角色",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@@ -442,7 +435,7 @@
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.BindAdminRoleReq"
"$ref": "#/definitions/md.UpdateRoleStateReq"
} }
} }
], ],
@@ -462,9 +455,9 @@
} }
} }
}, },
"/role/deleteAdmin/{$adm_id}": {
"delete": {
"description": "权限管理-删除管理员",
"/role/permissionGroupList": {
"get": {
"description": "权限管理-权限组列表",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -474,7 +467,7 @@
"tags": [ "tags": [
"权限管理" "权限管理"
], ],
"summary": "删除管理员",
"summary": "权限组列表",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@@ -482,11 +475,18 @@
"name": "Authorization", "name": "Authorization",
"in": "header", "in": "header",
"required": true "required": true
},
{
"type": "string",
"description": "管理员id",
"name": "adm_id",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "success",
"description": "具体看返回内容",
"schema": { "schema": {
"type": "string" "type": "string"
} }
@@ -500,9 +500,9 @@
} }
} }
}, },
"/role/deleteRole/{$id}": {
"delete": {
"description": "权限管理-删除角色",
"/role/roleBindPermissionGroup": {
"post": {
"description": "权限管理-角色绑定权限组",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -512,7 +512,7 @@
"tags": [ "tags": [
"权限管理" "权限管理"
], ],
"summary": "删除角色",
"summary": "角色绑定权限组",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@@ -527,7 +527,7 @@
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/md.UpdateRoleStateReq"
"$ref": "#/definitions/md.RoleBindPermissionGroupReq"
} }
} }
], ],
@@ -802,11 +802,17 @@
"username" "username"
], ],
"properties": { "properties": {
"code": {
"type": "string",
"example": "验证码"
},
"password": { "password": {
"type": "string"
"type": "string",
"example": "登录密码"
}, },
"username": { "username": {
"type": "string"
"type": "string",
"example": "登录账号"
} }
} }
}, },


+ 99
- 94
docs/swagger.yaml View File

@@ -45,9 +45,14 @@ definitions:
type: object type: object
md.LoginReq: md.LoginReq:
properties: properties:
code:
example: 验证码
type: string
password: password:
example: 登录密码
type: string type: string
username: username:
example: 登录账号
type: string type: string
required: required:
- password - password
@@ -158,13 +163,13 @@ definitions:
- role_id - role_id
- state - state
type: object type: object
host: localhost:1001 / xxxx.advertisement.dengbiao.top
host: localhost:1002 or xxxx.advertisement.dengbiao.top
info: info:
contact: contact:
email: 1239118001@qq.com email: 1239118001@qq.com
name: dengbiao name: dengbiao
url: http://www.swagger.io/support url: http://www.swagger.io/support
description: 后台接口
description: 站长后台接口
license: license:
name: Apache 2.0 name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html url: http://www.apache.org/licenses/LICENSE-2.0.html
@@ -172,98 +177,6 @@ info:
title: 广告联盟-站长平台 title: 广告联盟-站长平台
version: "1.0" version: "1.0"
paths: paths:
/admin/role/addAdmin:
post:
consumes:
- application/json
description: 权限管理-新增管理员
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 请求参数
in: body
name: args
required: true
schema:
$ref: '#/definitions/md.AddAdminReq'
produces:
- application/json
responses:
"200":
description: success
schema:
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 新增管理员
tags:
- 权限管理
/admin/role/permissionGroupList:
get:
consumes:
- application/json
description: 权限管理-权限组列表
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 管理员id
in: query
name: adm_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: 具体看返回内容
schema:
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 权限组列表
tags:
- 权限管理
/admin/role/roleBindPermissionGroup:
post:
consumes:
- application/json
description: 权限管理-角色绑定权限组
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 请求参数
in: body
name: args
required: true
schema:
$ref: '#/definitions/md.RoleBindPermissionGroupReq'
produces:
- application/json
responses:
"200":
description: success
schema:
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 角色绑定权限组
tags:
- 权限管理
/login: /login:
post: post:
consumes: consumes:
@@ -342,6 +255,37 @@ paths:
summary: 媒体注册 summary: 媒体注册
tags: tags:
- 注册模块 - 注册模块
/role/addAdmin:
post:
consumes:
- application/json
description: 权限管理-新增管理员
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 请求参数
in: body
name: args
required: true
schema:
$ref: '#/definitions/md.AddAdminReq'
produces:
- application/json
responses:
"200":
description: success
schema:
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 新增管理员
tags:
- 权限管理
/role/addRole: /role/addRole:
post: post:
consumes: consumes:
@@ -521,6 +465,67 @@ paths:
summary: 删除角色 summary: 删除角色
tags: tags:
- 权限管理 - 权限管理
/role/permissionGroupList:
get:
consumes:
- application/json
description: 权限管理-权限组列表
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 管理员id
in: query
name: adm_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: 具体看返回内容
schema:
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 权限组列表
tags:
- 权限管理
/role/roleBindPermissionGroup:
post:
consumes:
- application/json
description: 权限管理-角色绑定权限组
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 请求参数
in: body
name: args
required: true
schema:
$ref: '#/definitions/md.RoleBindPermissionGroupReq'
produces:
- application/json
responses:
"200":
description: success
schema:
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 角色绑定权限组
tags:
- 权限管理
/role/roleList: /role/roleList:
get: get:
consumes: consumes:


+ 2
- 2
go.mod View File

@@ -2,10 +2,10 @@ module applet


go 1.18 go 1.18


//replace code.fnuoos.com/zhimeng/model.git => E:/company/ad/models
replace code.fnuoos.com/zhimeng/model.git => E:/company/ad/models


require ( require (
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240816151818-a491f294f782
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240817100708-dde162209cee
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
github.com/boombuler/barcode v1.0.1 github.com/boombuler/barcode v1.0.1
github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5 github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5


Loading…
Cancel
Save