diff --git a/app/hdl/hdl_login.go b/app/hdl/hdl_login.go index 107f0f7..f823304 100644 --- a/app/hdl/hdl_login.go +++ b/app/hdl/hdl_login.go @@ -72,7 +72,7 @@ func Login(c *gin.Context) { // @Param req body md.LoginPhoneReq true "用户名、验证码" // @Success 200 {object} md.LoginResponse "token" // @Failure 400 {object} md.Response "具体错误" -// @Router /api/login [post] +// @Router /api/login/phone [post] func LoginPhone(c *gin.Context) { var req md.LoginPhoneReq err := c.ShouldBindJSON(&req) @@ -120,7 +120,7 @@ func LoginPhone(c *gin.Context) { // @Param req body md.LoginReq true "用户名、验证码" // @Success 200 {object} md.LoginResponse "token" // @Failure 400 {object} md.Response "具体错误" -// @Router /api/login [post] +// @Router /api/login/register [post] func Register(c *gin.Context) { var req md.RegisterReq err := c.ShouldBindJSON(&req) diff --git a/app/hdl/hdl_role.go b/app/hdl/hdl_role.go index 4726ad3..38adc5c 100644 --- a/app/hdl/hdl_role.go +++ b/app/hdl/hdl_role.go @@ -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 /api/role/updateRole [POST] +// @Router /api/role/UpdateRoleState [POST] func UpdateRoleState(c *gin.Context) { var req md.UpdateRoleStateReq err := c.ShouldBindJSON(&req) diff --git a/docs/docs.go b/docs/docs.go index 879d1f4..414bbe1 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -25,9 +25,9 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { - "/api/login": { - "post": { - "description": "登入", + "/api/account/base": { + "get": { + "description": "账号信息", "consumes": [ "application/json" ], @@ -35,25 +35,23 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN" + "账号中心------嘉俊" ], - "summary": "登陆", + "summary": "账号信息", "parameters": [ { - "description": "用户名密码", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/md.LoginReq" - } + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true } ], "responses": { "200": { - "description": "token", + "description": "具体看返回内容", "schema": { - "$ref": "#/definitions/md.LoginResponse" + "$ref": "#/definitions/md.AccountBase" } }, "400": { @@ -65,7 +63,7 @@ const docTemplate = `{ } } }, - "/api/qualification/bank/save": { + "/api/account/qualification/bank/save": { "post": { "description": "资质认证-银行资质保存", "consumes": [ @@ -112,7 +110,7 @@ const docTemplate = `{ } } }, - "/api/qualification/contact/save": { + "/api/account/qualification/contact/save": { "post": { "description": "资质认证-联系方式保存", "consumes": [ @@ -159,7 +157,7 @@ const docTemplate = `{ } } }, - "/api/qualification/enterprise/save": { + "/api/account/qualification/enterprise/save": { "post": { "description": "资质认证-企业认证保存", "consumes": [ @@ -206,7 +204,7 @@ const docTemplate = `{ } } }, - "/api/qualification/info": { + "/api/account/qualification/info": { "get": { "description": "资质认证-基本信息", "consumes": [ @@ -244,7 +242,7 @@ const docTemplate = `{ } } }, - "/api/qualification/select/base": { + "/api/account/qualification/select/base": { "get": { "description": "资质认证-认证下拉框选择内容", "consumes": [ @@ -282,6 +280,304 @@ const docTemplate = `{ } } }, + "/api/account/update/password": { + "post": { + "description": "资质认证-企业认证保存", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "账号中心------嘉俊" + ], + "summary": "企业认证保存", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AccountUpdatePasswordReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/login": { + "post": { + "description": "登入", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN" + ], + "summary": "登陆", + "parameters": [ + { + "description": "用户名密码", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.LoginReq" + } + } + ], + "responses": { + "200": { + "description": "token", + "schema": { + "$ref": "#/definitions/md.LoginResponse" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/login/phone": { + "post": { + "description": "手机号登入", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN" + ], + "summary": "手机号登陆", + "parameters": [ + { + "description": "用户名、验证码", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.LoginPhoneReq" + } + } + ], + "responses": { + "200": { + "description": "token", + "schema": { + "$ref": "#/definitions/md.LoginResponse" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/login/register": { + "post": { + "description": "手机号注册", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN" + ], + "summary": "手机号注册", + "parameters": [ + { + "description": "用户名、验证码", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.LoginReq" + } + } + ], + "responses": { + "200": { + "description": "token", + "schema": { + "$ref": "#/definitions/md.LoginResponse" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/medium/list": { + "post": { + "description": "媒体中心-媒体列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容 data里面的数据", + "schema": { + "$ref": "#/definitions/md.MediumListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/qiniuyun/upload": { + "post": { + "description": "七牛云-七牛云上传", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "七牛云" + ], + "summary": "七牛云上传", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header" + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.ImgReqUpload" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/UpdateRoleState": { + "post": { + "description": "修改角色状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "修改角色状态", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateRoleStateReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/role/addAdmin": { "post": { "description": "新增管理员", @@ -826,7 +1122,7 @@ const docTemplate = `{ }, "/api/role/updateRole": { "post": { - "description": "修改角色状态", + "description": "修改角色", "consumes": [ "application/json" ], @@ -836,7 +1132,7 @@ const docTemplate = `{ "tags": [ "ADMIN-权限管理" ], - "summary": "修改角色状态", + "summary": "修改角色", "parameters": [ { "type": "string", @@ -851,7 +1147,53 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.UpdateRoleStateReq" + "$ref": "#/definitions/md.UpdateRoleReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/sms": { + "post": { + "description": "短信-短信发送", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "短信" + ], + "summary": "短信发送", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header" + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.SmsReq" } } ], @@ -873,6 +1215,68 @@ const docTemplate = `{ } }, "definitions": { + "md.AccountBase": { + "type": "object", + "properties": { + "admin_phone": { + "type": "string", + "example": "管理员手机号" + }, + "agent_id": { + "type": "string", + "example": "账户ID" + }, + "company_abbreviation": { + "type": "string", + "example": "公司简称" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "contact_address": { + "type": "string", + "example": "联系地址" + }, + "contact_email": { + "type": "string", + "example": "邮箱" + }, + "contact_name": { + "type": "string", + "example": "联系人" + }, + "contact_phone": { + "type": "string", + "example": "联系电话" + }, + "country_region": { + "type": "string", + "example": "国家地区" + }, + "currency_conf": { + "type": "string", + "example": "结算币种" + }, + "nickname": { + "type": "string", + "example": "昵称" + } + } + }, + "md.AccountUpdatePasswordReq": { + "type": "object", + "properties": { + "captcha": { + "type": "string", + "example": "验证码" + }, + "password": { + "type": "string", + "example": "登录密码" + } + } + }, "md.AddAdminReq": { "type": "object", "required": [ @@ -1078,6 +1482,38 @@ const docTemplate = `{ } } }, + "md.ImgReqUpload": { + "type": "object", + "properties": { + "dir": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "file_size": { + "description": "文件大小, 单位byte", + "type": "integer" + } + } + }, + "md.LoginPhoneReq": { + "type": "object", + "required": [ + "captcha", + "username" + ], + "properties": { + "captcha": { + "type": "string", + "example": "验证码" + }, + "username": { + "type": "string", + "example": "登录账号" + } + } + }, "md.LoginReq": { "type": "object", "required": [ @@ -1107,6 +1543,67 @@ const docTemplate = `{ } } }, + "md.MediumListData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "business_license_address": { + "type": "string", + "example": "营业执照地址" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "id": { + "type": "string", + "example": "id" + }, + "legal_representative": { + "type": "string", + "example": "法定代表人" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "memo": { + "type": "string", + "example": "备注 审核时填写的" + }, + "state": { + "type": "string", + "example": "状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)" + }, + "unified_social_credit_code": { + "type": "string", + "example": "统一社会信用代码" + } + } + }, + "md.MediumListRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.MediumListData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, "md.Response": { "type": "object", "properties": { @@ -1140,6 +1637,31 @@ const docTemplate = `{ } } }, + "md.SelectData": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "名称" + }, + "value": { + "type": "string", + "example": "值" + } + } + }, + "md.SmsReq": { + "type": "object", + "properties": { + "phone": { + "type": "string" + }, + "type": { + "type": "string", + "example": "手机号登陆:fast_login 注册:register 修改密码:update_password" + } + } + }, "md.UpdateAdminReq": { "type": "object", "required": [ diff --git a/docs/swagger.json b/docs/swagger.json index d3d4576..f3c0a8b 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -17,9 +17,9 @@ }, "host": "localhost:1003 or advertisement.dengbiao.top", "paths": { - "/api/login": { - "post": { - "description": "登入", + "/api/account/base": { + "get": { + "description": "账号信息", "consumes": [ "application/json" ], @@ -27,25 +27,23 @@ "application/json" ], "tags": [ - "ADMIN" + "账号中心------嘉俊" ], - "summary": "登陆", + "summary": "账号信息", "parameters": [ { - "description": "用户名密码", - "name": "req", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/md.LoginReq" - } + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true } ], "responses": { "200": { - "description": "token", + "description": "具体看返回内容", "schema": { - "$ref": "#/definitions/md.LoginResponse" + "$ref": "#/definitions/md.AccountBase" } }, "400": { @@ -57,7 +55,7 @@ } } }, - "/api/qualification/bank/save": { + "/api/account/qualification/bank/save": { "post": { "description": "资质认证-银行资质保存", "consumes": [ @@ -104,7 +102,7 @@ } } }, - "/api/qualification/contact/save": { + "/api/account/qualification/contact/save": { "post": { "description": "资质认证-联系方式保存", "consumes": [ @@ -151,7 +149,7 @@ } } }, - "/api/qualification/enterprise/save": { + "/api/account/qualification/enterprise/save": { "post": { "description": "资质认证-企业认证保存", "consumes": [ @@ -198,7 +196,7 @@ } } }, - "/api/qualification/info": { + "/api/account/qualification/info": { "get": { "description": "资质认证-基本信息", "consumes": [ @@ -236,7 +234,7 @@ } } }, - "/api/qualification/select/base": { + "/api/account/qualification/select/base": { "get": { "description": "资质认证-认证下拉框选择内容", "consumes": [ @@ -274,6 +272,304 @@ } } }, + "/api/account/update/password": { + "post": { + "description": "资质认证-企业认证保存", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "账号中心------嘉俊" + ], + "summary": "企业认证保存", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.AccountUpdatePasswordReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/login": { + "post": { + "description": "登入", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN" + ], + "summary": "登陆", + "parameters": [ + { + "description": "用户名密码", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.LoginReq" + } + } + ], + "responses": { + "200": { + "description": "token", + "schema": { + "$ref": "#/definitions/md.LoginResponse" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/login/phone": { + "post": { + "description": "手机号登入", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN" + ], + "summary": "手机号登陆", + "parameters": [ + { + "description": "用户名、验证码", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.LoginPhoneReq" + } + } + ], + "responses": { + "200": { + "description": "token", + "schema": { + "$ref": "#/definitions/md.LoginResponse" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/login/register": { + "post": { + "description": "手机号注册", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN" + ], + "summary": "手机号注册", + "parameters": [ + { + "description": "用户名、验证码", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.LoginReq" + } + } + ], + "responses": { + "200": { + "description": "token", + "schema": { + "$ref": "#/definitions/md.LoginResponse" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/medium/list": { + "post": { + "description": "媒体中心-媒体列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "媒体中心------嘉俊" + ], + "summary": "媒体列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容 data里面的数据", + "schema": { + "$ref": "#/definitions/md.MediumListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/qiniuyun/upload": { + "post": { + "description": "七牛云-七牛云上传", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "七牛云" + ], + "summary": "七牛云上传", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header" + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.ImgReqUpload" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/UpdateRoleState": { + "post": { + "description": "修改角色状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "修改角色状态", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateRoleStateReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/role/addAdmin": { "post": { "description": "新增管理员", @@ -818,7 +1114,7 @@ }, "/api/role/updateRole": { "post": { - "description": "修改角色状态", + "description": "修改角色", "consumes": [ "application/json" ], @@ -828,7 +1124,7 @@ "tags": [ "ADMIN-权限管理" ], - "summary": "修改角色状态", + "summary": "修改角色", "parameters": [ { "type": "string", @@ -843,7 +1139,53 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.UpdateRoleStateReq" + "$ref": "#/definitions/md.UpdateRoleReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/sms": { + "post": { + "description": "短信-短信发送", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "短信" + ], + "summary": "短信发送", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header" + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.SmsReq" } } ], @@ -865,6 +1207,68 @@ } }, "definitions": { + "md.AccountBase": { + "type": "object", + "properties": { + "admin_phone": { + "type": "string", + "example": "管理员手机号" + }, + "agent_id": { + "type": "string", + "example": "账户ID" + }, + "company_abbreviation": { + "type": "string", + "example": "公司简称" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "contact_address": { + "type": "string", + "example": "联系地址" + }, + "contact_email": { + "type": "string", + "example": "邮箱" + }, + "contact_name": { + "type": "string", + "example": "联系人" + }, + "contact_phone": { + "type": "string", + "example": "联系电话" + }, + "country_region": { + "type": "string", + "example": "国家地区" + }, + "currency_conf": { + "type": "string", + "example": "结算币种" + }, + "nickname": { + "type": "string", + "example": "昵称" + } + } + }, + "md.AccountUpdatePasswordReq": { + "type": "object", + "properties": { + "captcha": { + "type": "string", + "example": "验证码" + }, + "password": { + "type": "string", + "example": "登录密码" + } + } + }, "md.AddAdminReq": { "type": "object", "required": [ @@ -1070,6 +1474,38 @@ } } }, + "md.ImgReqUpload": { + "type": "object", + "properties": { + "dir": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "file_size": { + "description": "文件大小, 单位byte", + "type": "integer" + } + } + }, + "md.LoginPhoneReq": { + "type": "object", + "required": [ + "captcha", + "username" + ], + "properties": { + "captcha": { + "type": "string", + "example": "验证码" + }, + "username": { + "type": "string", + "example": "登录账号" + } + } + }, "md.LoginReq": { "type": "object", "required": [ @@ -1099,6 +1535,67 @@ } } }, + "md.MediumListData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "business_license_address": { + "type": "string", + "example": "营业执照地址" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "id": { + "type": "string", + "example": "id" + }, + "legal_representative": { + "type": "string", + "example": "法定代表人" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "memo": { + "type": "string", + "example": "备注 审核时填写的" + }, + "state": { + "type": "string", + "example": "状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)" + }, + "unified_social_credit_code": { + "type": "string", + "example": "统一社会信用代码" + } + } + }, + "md.MediumListRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.MediumListData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, "md.Response": { "type": "object", "properties": { @@ -1132,6 +1629,31 @@ } } }, + "md.SelectData": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "名称" + }, + "value": { + "type": "string", + "example": "值" + } + } + }, + "md.SmsReq": { + "type": "object", + "properties": { + "phone": { + "type": "string" + }, + "type": { + "type": "string", + "example": "手机号登陆:fast_login 注册:register 修改密码:update_password" + } + } + }, "md.UpdateAdminReq": { "type": "object", "required": [ diff --git a/docs/swagger.yaml b/docs/swagger.yaml index a38fec7..138d118 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,4 +1,49 @@ definitions: + md.AccountBase: + properties: + admin_phone: + example: 管理员手机号 + type: string + agent_id: + example: 账户ID + type: string + company_abbreviation: + example: 公司简称 + type: string + company_name: + example: 公司名称 + type: string + contact_address: + example: 联系地址 + type: string + contact_email: + example: 邮箱 + type: string + contact_name: + example: 联系人 + type: string + contact_phone: + example: 联系电话 + type: string + country_region: + example: 国家地区 + type: string + currency_conf: + example: 结算币种 + type: string + nickname: + example: 昵称 + type: string + type: object + md.AccountUpdatePasswordReq: + properties: + captcha: + example: 验证码 + type: string + password: + example: 登录密码 + type: string + type: object md.AddAdminReq: properties: memo: @@ -134,6 +179,28 @@ definitions: required: - id type: object + md.ImgReqUpload: + properties: + dir: + type: string + file_name: + type: string + file_size: + description: 文件大小, 单位byte + type: integer + type: object + md.LoginPhoneReq: + properties: + captcha: + example: 验证码 + type: string + username: + example: 登录账号 + type: string + required: + - captcha + - username + type: object md.LoginReq: properties: code: @@ -154,6 +221,49 @@ definitions: token: type: string type: object + md.MediumListData: + properties: + account: + example: 媒体账号 + type: string + business_license_address: + example: 营业执照地址 + type: string + company_name: + example: 公司名称 + type: string + id: + example: id + type: string + legal_representative: + example: 法定代表人 + type: string + medium_id: + example: 媒体id + type: string + memo: + example: 备注 审核时填写的 + type: string + state: + example: 状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝) + type: string + unified_social_credit_code: + example: 统一社会信用代码 + type: string + type: object + md.MediumListRes: + properties: + list: + items: + $ref: '#/definitions/md.MediumListData' + type: array + state: + items: + $ref: '#/definitions/md.SelectData' + type: array + total: + type: integer + type: object md.Response: properties: code: @@ -176,6 +286,23 @@ definitions: required: - role_id type: object + md.SelectData: + properties: + name: + example: 名称 + type: string + value: + example: 值 + type: string + type: object + md.SmsReq: + properties: + phone: + type: string + type: + example: 手机号登陆:fast_login 注册:register 修改密码:update_password + type: string + type: object md.UpdateAdminReq: properties: id: @@ -238,33 +365,32 @@ info: title: 广告联盟-渠道代理平台 version: "1.0" paths: - /api/login: - post: + /api/account/base: + get: consumes: - application/json - description: 登入 + description: 账号信息 parameters: - - description: 用户名密码 - in: body - name: req + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization required: true - schema: - $ref: '#/definitions/md.LoginReq' + type: string produces: - application/json responses: "200": - description: token + description: 具体看返回内容 schema: - $ref: '#/definitions/md.LoginResponse' + $ref: '#/definitions/md.AccountBase' "400": description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: 登陆 + summary: 账号信息 tags: - - ADMIN - /api/qualification/bank/save: + - 账号中心------嘉俊 + /api/account/qualification/bank/save: post: consumes: - application/json @@ -295,7 +421,7 @@ paths: summary: 银行资质保存 tags: - 资质认证------嘉俊 - /api/qualification/contact/save: + /api/account/qualification/contact/save: post: consumes: - application/json @@ -326,7 +452,7 @@ paths: summary: 联系方式保存 tags: - 资质认证------嘉俊 - /api/qualification/enterprise/save: + /api/account/qualification/enterprise/save: post: consumes: - application/json @@ -357,7 +483,7 @@ paths: summary: 企业认证保存 tags: - 资质认证------嘉俊 - /api/qualification/info: + /api/account/qualification/info: get: consumes: - application/json @@ -382,7 +508,7 @@ paths: summary: 基本信息 tags: - 资质认证------嘉俊 - /api/qualification/select/base: + /api/account/qualification/select/base: get: consumes: - application/json @@ -407,6 +533,201 @@ paths: summary: 认证下拉框选择内容 tags: - 资质认证------嘉俊 + /api/account/update/password: + 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.AccountUpdatePasswordReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 企业认证保存 + tags: + - 账号中心------嘉俊 + /api/login: + post: + consumes: + - application/json + description: 登入 + parameters: + - description: 用户名密码 + in: body + name: req + required: true + schema: + $ref: '#/definitions/md.LoginReq' + produces: + - application/json + responses: + "200": + description: token + schema: + $ref: '#/definitions/md.LoginResponse' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 登陆 + tags: + - ADMIN + /api/login/phone: + post: + consumes: + - application/json + description: 手机号登入 + parameters: + - description: 用户名、验证码 + in: body + name: req + required: true + schema: + $ref: '#/definitions/md.LoginPhoneReq' + produces: + - application/json + responses: + "200": + description: token + schema: + $ref: '#/definitions/md.LoginResponse' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 手机号登陆 + tags: + - ADMIN + /api/login/register: + post: + consumes: + - application/json + description: 手机号注册 + parameters: + - description: 用户名、验证码 + in: body + name: req + required: true + schema: + $ref: '#/definitions/md.LoginReq' + produces: + - application/json + responses: + "200": + description: token + schema: + $ref: '#/definitions/md.LoginResponse' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 手机号注册 + tags: + - ADMIN + /api/medium/list: + post: + consumes: + - application/json + description: 媒体中心-媒体列表 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "200": + description: 具体看返回内容 data里面的数据 + schema: + $ref: '#/definitions/md.MediumListRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 媒体列表 + tags: + - 媒体中心------嘉俊 + /api/qiniuyun/upload: + post: + consumes: + - application/json + description: 七牛云-七牛云上传 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.ImgReqUpload' + produces: + - application/json + responses: + "200": + description: success + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 七牛云上传 + tags: + - 七牛云 + /api/role/UpdateRoleState: + 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.UpdateRoleStateReq' + produces: + - application/json + responses: + "200": + description: success + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 修改角色状态 + tags: + - ADMIN-权限管理 /api/role/addAdmin: post: consumes: @@ -769,7 +1090,7 @@ paths: post: consumes: - application/json - description: 修改角色状态 + description: 修改角色 parameters: - description: 验证参数Bearer和token空格拼接 in: header @@ -781,7 +1102,7 @@ paths: name: args required: true schema: - $ref: '#/definitions/md.UpdateRoleStateReq' + $ref: '#/definitions/md.UpdateRoleReq' produces: - application/json responses: @@ -793,9 +1114,39 @@ paths: description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: 修改角色状态 + summary: 修改角色 tags: - ADMIN-权限管理 + /api/sms: + post: + consumes: + - application/json + description: 短信-短信发送 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.SmsReq' + produces: + - application/json + responses: + "200": + description: success + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 短信发送 + tags: + - 短信 securityDefinitions: MasterID: in: header