From fcb342aec45c926d0d3eee989e18ddf303591bf6 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Sat, 17 Aug 2024 18:09:39 +0800 Subject: [PATCH] upodate --- app/svc/svc_master.go | 49 +++----- docs/docs.go | 256 +++++++++++++++++++++--------------------- docs/swagger.json | 256 +++++++++++++++++++++--------------------- docs/swagger.yaml | 193 +++++++++++++++---------------- go.mod | 4 +- 5 files changed, 380 insertions(+), 378 deletions(-) diff --git a/app/svc/svc_master.go b/app/svc/svc_master.go index ccd792a..c9f5c49 100644 --- a/app/svc/svc_master.go +++ b/app/svc/svc_master.go @@ -1,6 +1,10 @@ package svc 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" "github.com/gin-gonic/gin" "strconv" @@ -15,38 +19,19 @@ func GetMasterId(c *gin.Context) (masterId string) { masterId = c.GetString("master_id") if 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) return diff --git a/docs/docs.go b/docs/docs.go index 59d684d..30a2d79 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -25,9 +25,9 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { - "/admin/role/addAdmin": { + "/login": { "post": { - "description": "权限管理-新增管理员", + "description": "登入", "consumes": [ "application/json" ], @@ -35,32 +35,25 @@ const docTemplate = `{ "application/json" ], "tags": [ - "权限管理" + "登录" ], - "summary": "新增管理员", + "summary": "登陆", "parameters": [ { - "type": "string", - "description": "验证参数Bearer和token空格拼接", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "description": "请求参数", - "name": "args", + "description": "用户名密码", + "name": "req", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.AddAdminReq" + "$ref": "#/definitions/md.LoginReq" } } ], "responses": { "200": { - "description": "success", + "description": "token", "schema": { - "type": "string" + "$ref": "#/definitions/md.LoginResponse" } }, "400": { @@ -72,9 +65,9 @@ const docTemplate = `{ } } }, - "/admin/role/permissionGroupList": { - "get": { - "description": "权限管理-权限组列表", + "/registerForAgent": { + "post": { + "description": "注册模块-渠道代理注册", "consumes": [ "application/json" ], @@ -82,28 +75,23 @@ const docTemplate = `{ "application/json" ], "tags": [ - "权限管理" + "注册模块" ], - "summary": "权限组列表", + "summary": "渠道代理注册", "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": { "200": { - "description": "具体看返回内容", + "description": "success", "schema": { "type": "string" } @@ -117,9 +105,9 @@ const docTemplate = `{ } } }, - "/admin/role/roleBindPermissionGroup": { + "/registerForMedium": { "post": { - "description": "权限管理-角色绑定权限组", + "description": "注册模块-媒体注册", "consumes": [ "application/json" ], @@ -127,24 +115,17 @@ const docTemplate = `{ "application/json" ], "tags": [ - "权限管理" + "注册模块" ], - "summary": "角色绑定权限组", + "summary": "媒体注册", "parameters": [ { - "type": "string", - "description": "验证参数Bearer和token空格拼接", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "description": "请求参数", - "name": "args", + "description": "用户名密码", + "name": "req", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.RoleBindPermissionGroupReq" + "$ref": "#/definitions/md.RegisterForMediumReq" } } ], @@ -164,9 +145,9 @@ const docTemplate = `{ } } }, - "/login": { + "/role/addAdmin": { "post": { - "description": "登入", + "description": "权限管理-新增管理员", "consumes": [ "application/json" ], @@ -174,25 +155,32 @@ const docTemplate = `{ "application/json" ], "tags": [ - "登录" + "权限管理" ], - "summary": "登陆", + "summary": "新增管理员", "parameters": [ { - "description": "用户名密码", - "name": "req", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.LoginReq" + "$ref": "#/definitions/md.AddAdminReq" } } ], "responses": { "200": { - "description": "token", + "description": "success", "schema": { - "$ref": "#/definitions/md.LoginResponse" + "type": "string" } }, "400": { @@ -204,9 +192,9 @@ const docTemplate = `{ } } }, - "/registerForAgent": { + "/role/addRole": { "post": { - "description": "注册模块-渠道代理注册", + "description": "权限管理-添加角色", "consumes": [ "application/json" ], @@ -214,17 +202,24 @@ const docTemplate = `{ "application/json" ], "tags": [ - "注册模块" + "权限管理" ], - "summary": "渠道代理注册", + "summary": "添加角色", "parameters": [ { - "description": "用户名密码", - "name": "req", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.RegisterForAgentReq" + "$ref": "#/definitions/md.AddRoleReq" } } ], @@ -244,9 +239,9 @@ const docTemplate = `{ } } }, - "/registerForMedium": { - "post": { - "description": "注册模块-媒体注册", + "/role/adminInfo": { + "get": { + "description": "权限管理-管理员信息", "consumes": [ "application/json" ], @@ -254,23 +249,28 @@ const docTemplate = `{ "application/json" ], "tags": [ - "注册模块" + "权限管理" ], - "summary": "媒体注册", + "summary": "管理员信息", "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": { "200": { - "description": "success", + "description": "具体看返回内容", "schema": { "type": "string" } @@ -284,9 +284,9 @@ const docTemplate = `{ } } }, - "/role/addRole": { + "/role/adminList": { "post": { - "description": "权限管理-添加角色", + "description": "权限管理-管理员列表", "consumes": [ "application/json" ], @@ -296,7 +296,7 @@ const docTemplate = `{ "tags": [ "权限管理" ], - "summary": "添加角色", + "summary": "管理员列表", "parameters": [ { "type": "string", @@ -311,13 +311,13 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.AddRoleReq" + "$ref": "#/definitions/md.AdminListReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容", "schema": { "type": "string" } @@ -331,9 +331,9 @@ const docTemplate = `{ } } }, - "/role/adminInfo": { - "get": { - "description": "权限管理-管理员信息", + "/role/bindAdminRole/": { + "post": { + "description": "权限管理-管理员绑定角色", "consumes": [ "application/json" ], @@ -343,7 +343,7 @@ const docTemplate = `{ "tags": [ "权限管理" ], - "summary": "管理员信息", + "summary": "管理员绑定角色", "parameters": [ { "type": "string", @@ -353,16 +353,18 @@ const docTemplate = `{ "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": { "200": { - "description": "具体看返回内容", + "description": "success", "schema": { "type": "string" } @@ -376,9 +378,9 @@ const docTemplate = `{ } } }, - "/role/adminList": { - "post": { - "description": "权限管理-管理员列表", + "/role/deleteAdmin/{$adm_id}": { + "delete": { + "description": "权限管理-删除管理员", "consumes": [ "application/json" ], @@ -388,7 +390,7 @@ const docTemplate = `{ "tags": [ "权限管理" ], - "summary": "管理员列表", + "summary": "删除管理员", "parameters": [ { "type": "string", @@ -396,20 +398,11 @@ const docTemplate = `{ "name": "Authorization", "in": "header", "required": true - }, - { - "description": "请求参数", - "name": "args", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/md.AdminListReq" - } } ], "responses": { "200": { - "description": "具体看返回内容", + "description": "success", "schema": { "type": "string" } @@ -423,9 +416,9 @@ const docTemplate = `{ } } }, - "/role/bindAdminRole/": { - "post": { - "description": "权限管理-管理员绑定角色", + "/role/deleteRole/{$id}": { + "delete": { + "description": "权限管理-删除角色", "consumes": [ "application/json" ], @@ -435,7 +428,7 @@ const docTemplate = `{ "tags": [ "权限管理" ], - "summary": "管理员绑定角色", + "summary": "删除角色", "parameters": [ { "type": "string", @@ -450,7 +443,7 @@ const docTemplate = `{ "in": "body", "required": true, "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": [ "application/json" ], @@ -482,7 +475,7 @@ const docTemplate = `{ "tags": [ "权限管理" ], - "summary": "删除管理员", + "summary": "权限组列表", "parameters": [ { "type": "string", @@ -490,11 +483,18 @@ const docTemplate = `{ "name": "Authorization", "in": "header", "required": true + }, + { + "type": "string", + "description": "管理员id", + "name": "adm_id", + "in": "query", + "required": true } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容", "schema": { "type": "string" } @@ -508,9 +508,9 @@ const docTemplate = `{ } } }, - "/role/deleteRole/{$id}": { - "delete": { - "description": "权限管理-删除角色", + "/role/roleBindPermissionGroup": { + "post": { + "description": "权限管理-角色绑定权限组", "consumes": [ "application/json" ], @@ -520,7 +520,7 @@ const docTemplate = `{ "tags": [ "权限管理" ], - "summary": "删除角色", + "summary": "角色绑定权限组", "parameters": [ { "type": "string", @@ -535,7 +535,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.UpdateRoleStateReq" + "$ref": "#/definitions/md.RoleBindPermissionGroupReq" } } ], @@ -810,11 +810,17 @@ const docTemplate = `{ "username" ], "properties": { + "code": { + "type": "string", + "example": "验证码" + }, "password": { - "type": "string" + "type": "string", + "example": "登录密码" }, "username": { - "type": "string" + "type": "string", + "example": "登录账号" } } }, @@ -985,11 +991,11 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "1.0", - Host: "localhost:1001 / xxxx.advertisement.dengbiao.top", + Host: "localhost:1002 or xxxx.advertisement.dengbiao.top", BasePath: "", Schemes: []string{}, Title: "广告联盟-站长平台", - Description: "后台接口", + Description: "站长后台接口", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, } diff --git a/docs/swagger.json b/docs/swagger.json index e2a159c..230c72e 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "description": "后台接口", + "description": "站长后台接口", "title": "广告联盟-站长平台", "termsOfService": "http://swagger.io/terms/", "contact": { @@ -15,11 +15,11 @@ }, "version": "1.0" }, - "host": "localhost:1001 / xxxx.advertisement.dengbiao.top", + "host": "localhost:1002 or xxxx.advertisement.dengbiao.top", "paths": { - "/admin/role/addAdmin": { + "/login": { "post": { - "description": "权限管理-新增管理员", + "description": "登入", "consumes": [ "application/json" ], @@ -27,32 +27,25 @@ "application/json" ], "tags": [ - "权限管理" + "登录" ], - "summary": "新增管理员", + "summary": "登陆", "parameters": [ { - "type": "string", - "description": "验证参数Bearer和token空格拼接", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "description": "请求参数", - "name": "args", + "description": "用户名密码", + "name": "req", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.AddAdminReq" + "$ref": "#/definitions/md.LoginReq" } } ], "responses": { "200": { - "description": "success", + "description": "token", "schema": { - "type": "string" + "$ref": "#/definitions/md.LoginResponse" } }, "400": { @@ -64,9 +57,9 @@ } } }, - "/admin/role/permissionGroupList": { - "get": { - "description": "权限管理-权限组列表", + "/registerForAgent": { + "post": { + "description": "注册模块-渠道代理注册", "consumes": [ "application/json" ], @@ -74,28 +67,23 @@ "application/json" ], "tags": [ - "权限管理" + "注册模块" ], - "summary": "权限组列表", + "summary": "渠道代理注册", "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": { "200": { - "description": "具体看返回内容", + "description": "success", "schema": { "type": "string" } @@ -109,9 +97,9 @@ } } }, - "/admin/role/roleBindPermissionGroup": { + "/registerForMedium": { "post": { - "description": "权限管理-角色绑定权限组", + "description": "注册模块-媒体注册", "consumes": [ "application/json" ], @@ -119,24 +107,17 @@ "application/json" ], "tags": [ - "权限管理" + "注册模块" ], - "summary": "角色绑定权限组", + "summary": "媒体注册", "parameters": [ { - "type": "string", - "description": "验证参数Bearer和token空格拼接", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "description": "请求参数", - "name": "args", + "description": "用户名密码", + "name": "req", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.RoleBindPermissionGroupReq" + "$ref": "#/definitions/md.RegisterForMediumReq" } } ], @@ -156,9 +137,9 @@ } } }, - "/login": { + "/role/addAdmin": { "post": { - "description": "登入", + "description": "权限管理-新增管理员", "consumes": [ "application/json" ], @@ -166,25 +147,32 @@ "application/json" ], "tags": [ - "登录" + "权限管理" ], - "summary": "登陆", + "summary": "新增管理员", "parameters": [ { - "description": "用户名密码", - "name": "req", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.LoginReq" + "$ref": "#/definitions/md.AddAdminReq" } } ], "responses": { "200": { - "description": "token", + "description": "success", "schema": { - "$ref": "#/definitions/md.LoginResponse" + "type": "string" } }, "400": { @@ -196,9 +184,9 @@ } } }, - "/registerForAgent": { + "/role/addRole": { "post": { - "description": "注册模块-渠道代理注册", + "description": "权限管理-添加角色", "consumes": [ "application/json" ], @@ -206,17 +194,24 @@ "application/json" ], "tags": [ - "注册模块" + "权限管理" ], - "summary": "渠道代理注册", + "summary": "添加角色", "parameters": [ { - "description": "用户名密码", - "name": "req", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.RegisterForAgentReq" + "$ref": "#/definitions/md.AddRoleReq" } } ], @@ -236,9 +231,9 @@ } } }, - "/registerForMedium": { - "post": { - "description": "注册模块-媒体注册", + "/role/adminInfo": { + "get": { + "description": "权限管理-管理员信息", "consumes": [ "application/json" ], @@ -246,23 +241,28 @@ "application/json" ], "tags": [ - "注册模块" + "权限管理" ], - "summary": "媒体注册", + "summary": "管理员信息", "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": { "200": { - "description": "success", + "description": "具体看返回内容", "schema": { "type": "string" } @@ -276,9 +276,9 @@ } } }, - "/role/addRole": { + "/role/adminList": { "post": { - "description": "权限管理-添加角色", + "description": "权限管理-管理员列表", "consumes": [ "application/json" ], @@ -288,7 +288,7 @@ "tags": [ "权限管理" ], - "summary": "添加角色", + "summary": "管理员列表", "parameters": [ { "type": "string", @@ -303,13 +303,13 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.AddRoleReq" + "$ref": "#/definitions/md.AdminListReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容", "schema": { "type": "string" } @@ -323,9 +323,9 @@ } } }, - "/role/adminInfo": { - "get": { - "description": "权限管理-管理员信息", + "/role/bindAdminRole/": { + "post": { + "description": "权限管理-管理员绑定角色", "consumes": [ "application/json" ], @@ -335,7 +335,7 @@ "tags": [ "权限管理" ], - "summary": "管理员信息", + "summary": "管理员绑定角色", "parameters": [ { "type": "string", @@ -345,16 +345,18 @@ "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": { "200": { - "description": "具体看返回内容", + "description": "success", "schema": { "type": "string" } @@ -368,9 +370,9 @@ } } }, - "/role/adminList": { - "post": { - "description": "权限管理-管理员列表", + "/role/deleteAdmin/{$adm_id}": { + "delete": { + "description": "权限管理-删除管理员", "consumes": [ "application/json" ], @@ -380,7 +382,7 @@ "tags": [ "权限管理" ], - "summary": "管理员列表", + "summary": "删除管理员", "parameters": [ { "type": "string", @@ -388,20 +390,11 @@ "name": "Authorization", "in": "header", "required": true - }, - { - "description": "请求参数", - "name": "args", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/md.AdminListReq" - } } ], "responses": { "200": { - "description": "具体看返回内容", + "description": "success", "schema": { "type": "string" } @@ -415,9 +408,9 @@ } } }, - "/role/bindAdminRole/": { - "post": { - "description": "权限管理-管理员绑定角色", + "/role/deleteRole/{$id}": { + "delete": { + "description": "权限管理-删除角色", "consumes": [ "application/json" ], @@ -427,7 +420,7 @@ "tags": [ "权限管理" ], - "summary": "管理员绑定角色", + "summary": "删除角色", "parameters": [ { "type": "string", @@ -442,7 +435,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.BindAdminRoleReq" + "$ref": "#/definitions/md.UpdateRoleStateReq" } } ], @@ -462,9 +455,9 @@ } } }, - "/role/deleteAdmin/{$adm_id}": { - "delete": { - "description": "权限管理-删除管理员", + "/role/permissionGroupList": { + "get": { + "description": "权限管理-权限组列表", "consumes": [ "application/json" ], @@ -474,7 +467,7 @@ "tags": [ "权限管理" ], - "summary": "删除管理员", + "summary": "权限组列表", "parameters": [ { "type": "string", @@ -482,11 +475,18 @@ "name": "Authorization", "in": "header", "required": true + }, + { + "type": "string", + "description": "管理员id", + "name": "adm_id", + "in": "query", + "required": true } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容", "schema": { "type": "string" } @@ -500,9 +500,9 @@ } } }, - "/role/deleteRole/{$id}": { - "delete": { - "description": "权限管理-删除角色", + "/role/roleBindPermissionGroup": { + "post": { + "description": "权限管理-角色绑定权限组", "consumes": [ "application/json" ], @@ -512,7 +512,7 @@ "tags": [ "权限管理" ], - "summary": "删除角色", + "summary": "角色绑定权限组", "parameters": [ { "type": "string", @@ -527,7 +527,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.UpdateRoleStateReq" + "$ref": "#/definitions/md.RoleBindPermissionGroupReq" } } ], @@ -802,11 +802,17 @@ "username" ], "properties": { + "code": { + "type": "string", + "example": "验证码" + }, "password": { - "type": "string" + "type": "string", + "example": "登录密码" }, "username": { - "type": "string" + "type": "string", + "example": "登录账号" } } }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index d27ce2d..7619ace 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -45,9 +45,14 @@ definitions: type: object md.LoginReq: properties: + code: + example: 验证码 + type: string password: + example: 登录密码 type: string username: + example: 登录账号 type: string required: - password @@ -158,13 +163,13 @@ definitions: - role_id - state type: object -host: localhost:1001 / xxxx.advertisement.dengbiao.top +host: localhost:1002 or xxxx.advertisement.dengbiao.top info: contact: email: 1239118001@qq.com name: dengbiao url: http://www.swagger.io/support - description: 后台接口 + description: 站长后台接口 license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html @@ -172,98 +177,6 @@ info: title: 广告联盟-站长平台 version: "1.0" 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: post: consumes: @@ -342,6 +255,37 @@ paths: summary: 媒体注册 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: post: consumes: @@ -521,6 +465,67 @@ paths: summary: 删除角色 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: get: consumes: diff --git a/go.mod b/go.mod index 4d4b464..5316751 100644 --- a/go.mod +++ b/go.mod @@ -2,10 +2,10 @@ module applet 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 ( - 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/boombuler/barcode v1.0.1 github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5