From 0d066ec97a7742beb591409c485dddd2620b0a5d Mon Sep 17 00:00:00 2001 From: dengbiao Date: Fri, 16 Aug 2024 23:20:22 +0800 Subject: [PATCH] update --- app/hdl/hdl_login.go | 6 +- docs/docs.go | 1663 +++++++++++------------------------------- docs/swagger.json | 1609 +++++++++++----------------------------- docs/swagger.yaml | 1128 ++++++++-------------------- go.mod | 2 +- 5 files changed, 1141 insertions(+), 3267 deletions(-) diff --git a/app/hdl/hdl_login.go b/app/hdl/hdl_login.go index 2768897..9fa9099 100644 --- a/app/hdl/hdl_login.go +++ b/app/hdl/hdl_login.go @@ -18,9 +18,9 @@ import ( // @Description 登入 // @Accept json // @Produce json -// @Param req body md2.LoginReq true "用户名密码" -// @Success 200 {object} md2.LoginResponse "token" -// @Failure 400 {object} md2.Response "具体错误" +// @Param req body md.LoginReq true "用户名密码" +// @Success 200 {object} md.LoginResponse "token" +// @Failure 400 {object} md.Response "具体错误" // @Router /admin/login [post] func Login(c *gin.Context) { var req md.LoginReq diff --git a/docs/docs.go b/docs/docs.go index 3e7d945..2520bb0 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,35 +1,33 @@ -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// This file was generated by swaggo/swag +// Code generated by swaggo/swag. DO NOT EDIT. package docs -import ( - "bytes" - "encoding/json" - "strings" +import "github.com/swaggo/swag" - "github.com/alecthomas/template" - "github.com/swaggo/swag" -) - -var doc = `{ +const docTemplate = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { - "description": "{{.Description}}", + "description": "{{escape .Description}}", "title": "{{.Title}}", - "termsOfService": "智莺生活后端组", + "termsOfService": "http://swagger.io/terms/", "contact": { - "name": "sherlockwhite" + "name": "dengbiao", + "url": "http://www.swagger.io/support", + "email": "1239118001@qq.com" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { - "/api/v1/acq/fix": { - "get": { - "description": "拉新活动--fix", + "/admin/login": { + "post": { + "description": "登入", "consumes": [ "application/json" ], @@ -37,68 +35,39 @@ var doc = `{ "application/json" ], "tags": [ - "拉新活动" + "ADMIN" ], - "summary": "拉新活动--fix", - "responses": { - "200": { - "description": "ok", + "summary": "登陆", + "parameters": [ + { + "description": "用户名密码", + "name": "req", + "in": "body", + "required": true, "schema": { - "type": "string" + "$ref": "#/definitions/md.LoginReq" } } - } - } - }, - "/api/v1/acquisition/home": { - "post": { - "description": "本期榜单/上期榜单/我的邀请人数和奖励/任务列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "拉新活动" ], - "summary": "拉新--首页数据", "responses": { "200": { - "description": "ok", + "description": "token", "schema": { - "type": "string" + "$ref": "#/definitions/md.LoginResponse" } - } - } - } - }, - "/api/v1/acquisition/qrcode": { - "get": { - "description": "二维码", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "拉新活动" - ], - "summary": "拉新--邀请二维码", - "responses": { - "200": { - "description": "ok", + }, + "400": { + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } } }, - "/api/v1/acquisition/reward/detail": { + "/admin/role/addAdmin": { "post": { - "description": "拉新活动--我的奖励明细", + "description": "新增管理员", "consumes": [ "application/json" ], @@ -106,33 +75,46 @@ var doc = `{ "application/json" ], "tags": [ - "拉新活动" + "ADMIN-权限管理" ], - "summary": "拉新活动--我的奖励明细", + "summary": "新增管理员", "parameters": [ { - "description": "1为以发放,2为待发放,3为失效", - "name": "state", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "type": "string" + "$ref": "#/definitions/md.AddAdminReq" } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } }, - "/api/v1/acquisition/reward_receive": { + "/admin/role/addRole": { "post": { - "description": "拉新活动--领取奖励", + "description": "添加角色", "consumes": [ "application/json" ], @@ -140,33 +122,46 @@ var doc = `{ "application/json" ], "tags": [ - "拉新活动" + "ADMIN-权限管理" ], - "summary": "拉新活动--领取奖励", + "summary": "添加角色", "parameters": [ { - "description": "任务ID", - "name": "job_id", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "type": "string" + "$ref": "#/definitions/md.AddRoleReq" } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } }, - "/api/v1/credit/card/config": { + "/admin/role/adminInfo": { "get": { - "description": "获取信用卡配置", + "description": "管理员信息", "consumes": [ "application/json" ], @@ -174,22 +169,44 @@ var doc = `{ "application/json" ], "tags": [ - "信用卡" + "ADMIN-权限管理" + ], + "summary": "管理员信息", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "管理员id", + "name": "adm_id", + "in": "query", + "required": true + } ], - "summary": "获取信用卡配置", "responses": { "200": { - "description": "ok", + "description": "具体看返回内容", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } }, - "/api/v1/duomai/mall/detail": { + "/admin/role/adminList": { "post": { - "description": "多麦商城--商城详情", + "description": "管理员列表", "consumes": [ "application/json" ], @@ -197,56 +214,46 @@ var doc = `{ "application/json" ], "tags": [ - "多麦商城" + "ADMIN-权限管理" ], - "summary": "多麦商城--商城详情", + "summary": "管理员列表", "parameters": [ { - "description": "商城id", - "name": "brand_id", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "type": "string" + "$ref": "#/definitions/md.AdminListReq" } } ], "responses": { "200": { - "description": "ok", + "description": "具体看返回内容", "schema": { "type": "string" } - } - } - } - }, - "/api/v1/duomai/mall/home": { - "get": { - "description": "多麦商城--首页数据", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "多麦商城" - ], - "summary": "多麦商城--首页数据", - "responses": { - "200": { - "description": "ok", + }, + "400": { + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } } }, - "/api/v1/duomai/mall/search": { + "/admin/role/bindAdminRole/": { "post": { - "description": "多麦商城--搜索", + "description": "管理员绑定角色", "consumes": [ "application/json" ], @@ -254,33 +261,46 @@ var doc = `{ "application/json" ], "tags": [ - "多麦商城" + "ADMIN-权限管理" ], - "summary": "多麦商城--搜索", + "summary": "管理员绑定角色", "parameters": [ { - "description": "搜索关键词", - "name": "key", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "type": "string" + "$ref": "#/definitions/md.BindAdminRoleReq" } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } }, - "/api/v1/duomai/mall/update": { - "get": { - "description": "多麦商城--更新数据", + "/admin/role/deleteAdmin/{$adm_id}": { + "delete": { + "description": "删除管理员", "consumes": [ "application/json" ], @@ -288,21 +308,37 @@ var doc = `{ "application/json" ], "tags": [ - "多麦商城" + "ADMIN-权限管理" + ], + "summary": "删除管理员", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } ], - "summary": "多麦商城--更新数据", "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } }, - "/api/v1/logistic/query": { - "post": { + "/admin/role/deleteRole/{$id}": { + "delete": { + "description": "删除角色", "consumes": [ "application/json" ], @@ -310,39 +346,46 @@ var doc = `{ "application/json" ], "tags": [ - "物流" + "ADMIN-权限管理" ], - "summary": "快递100物流查询", + "summary": "删除角色", "parameters": [ { - "description": "logisticQueryReq", - "name": "req", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/hdl.logisticQueryReq" + "$ref": "#/definitions/md.UpdateRoleStateReq" } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } }, "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"该快递公司不支持查询\"}", + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } } }, - "/api/v1/mod/pub.flutter.duomai.mall.detail.page": { + "/admin/role/permissionGroupList": { "get": { - "description": "多麦商城详情页样式", + "description": "权限组列表", "consumes": [ "application/json" ], @@ -350,68 +393,44 @@ var doc = `{ "application/json" ], "tags": [ - "多麦商城" + "ADMIN-权限管理" ], - "summary": "多麦商城详情页样式", - "responses": { - "200": { - "description": "ok", - "schema": { - "type": "string" - } + "summary": "权限组列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "管理员id", + "name": "adm_id", + "in": "query", + "required": true } - } - } - }, - "/api/v1/mod/pub.flutter.duomai.mall.home.page": { - "get": { - "description": "多麦商城首页样式", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "多麦商城" ], - "summary": "多麦商城首页样式", "responses": { "200": { - "description": "ok", + "description": "具体看返回内容", "schema": { "type": "string" } - } - } - } - }, - "/api/v1/mod/pub.flutter.duomai.mall.search.page": { - "get": { - "description": "多麦商城搜索页样式", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "多麦商城" - ], - "summary": "多麦商城搜索页样式", - "responses": { - "200": { - "description": "ok", + }, + "400": { + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } } }, - "/api/v1/privilege/card/activation": { + "/admin/role/roleBindPermissionGroup": { "post": { - "description": "权益卡激活", + "description": "角色绑定权限组", "consumes": [ "application/json" ], @@ -419,32 +438,46 @@ var doc = `{ "application/json" ], "tags": [ - "权益卡" + "ADMIN-权限管理" ], - "summary": "权益卡激活", + "summary": "角色绑定权限组", "parameters": [ { - "description": "json", - "name": "body", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/hdl.privilegeOpenCardCheckReq" + "$ref": "#/definitions/md.RoleBindPermissionGroupReq" } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } }, - "/api/v1/privilege/open_card/check": { + "/admin/role/roleList": { "get": { + "description": "角色列表", "consumes": [ "application/json" ], @@ -452,136 +485,131 @@ var doc = `{ "application/json" ], "tags": [ - "权益卡" + "ADMIN-权限管理" ], - "summary": "权益卡卡号卡密检测", + "summary": "角色列表", "parameters": [ { - "description": "json", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/hdl.privilegeOpenCardCheckReq" - } + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true } ], "responses": { "200": { - "description": "0:不存在 1:已经被使用 2:可用", + "description": "具体看返回内容", "schema": { "type": "string" } - } - } - } - }, - "/api/v1/privilege/open_card/order_query": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "权益卡" - ], - "summary": "权益卡开卡订单查询页面", - "responses": { - "200": { - "description": "ok", - "schema": { - "$ref": "#/definitions/hdl.PrivilegeOpenCardOrdQueryPageResp" - } }, "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"验证码错误\"}", + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } - }, + } + }, + "/admin/role/updateAdmin": { "post": { + "description": "修改管理员信息", + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], "tags": [ - "权益卡" + "ADMIN-权限管理" ], - "summary": "权益卡开卡订单查询", + "summary": "修改管理员信息", "parameters": [ { - "description": "json", - "name": "body", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/hdl.PrivilegeOpenCardOrdQueryReq" + "$ref": "#/definitions/md.UpdateAdminReq" } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { - "$ref": "#/definitions/model.PrivilegeOpenCardOrd" + "type": "string" } }, "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"验证码错误\"}", + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } } }, - "/api/v1/privilege/open_card/order_suc": { - "get": { + "/admin/role/updateAdminState": { + "post": { + "description": "修改管理员状态", + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], "tags": [ - "权益卡" + "ADMIN-权限管理" ], - "summary": "订单支付成功页面", - "responses": { - "200": { - "description": "ok", + "summary": "修改管理员状态", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/model.PrivilegeOpenCardOrd" + "$ref": "#/definitions/md.UpdateAdminStateReq" } } - } - } - }, - "/api/v1/privilege/open_card/pay_page": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "权益卡" ], - "summary": "权益卡开卡支付页面", "responses": { "200": { - "description": "ok", + "description": "success", "schema": { - "$ref": "#/definitions/hdl.privilegeOpenCardPayPageResp" + "type": "string" } }, "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"权益卡配置缺失\"}", + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } } }, - "/api/v1/shake_ticket/:goods_id/:type": { - "get": { - "description": "收藏/领券买/分享赚", + "/admin/role/updateRole": { + "post": { + "description": "修改角色状态", "consumes": [ "application/json" ], @@ -589,687 +617,71 @@ var doc = `{ "application/json" ], "tags": [ - "抖券" + "ADMIN-权限管理" ], - "summary": "抖券商品收藏/领券买/分享赚", + "summary": "修改角色状态", "parameters": [ { "type": "string", - "description": "商品id", - "name": "goods_id", - "in": "path", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", "required": true }, { - "type": "string", - "description": "类型(0取消收藏,1收藏,2点击 领券买,3点击分享赚)", - "name": "type", - "in": "path", - "required": true + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateRoleStateReq" + } } ], "responses": { "200": { - "description": "ok", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/shake_ticket_list": { - "get": { - "description": "定向计划/高佣专场/精选低价包邮/偏远地区包邮/抖货商品/各大榜单商品/今日值得买", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "抖券" - ], - "summary": "抖券商品推荐列表", - "parameters": [ - { - "type": "string", - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "页数", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "分类id(3定向计划/4高佣专场/5精选低价包邮/6偏远地区包邮/7抖货商品/8各大榜单商品/9今日值得买)", - "name": "category_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "渠道", - "name": "pvd", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/md.IndexRecommendList" - } - } - } - } - }, - "/api/v1/sign/fast/in": { - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "登录、注册" - ], - "summary": "用户手机快速登录", - "parameters": [ - { - "description": "json", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/md.FastLoginRequestBody" - } - } - ], - "responses": { - "200": { - "description": "ok", - "schema": { - "$ref": "#/definitions/md.LoginResponse" - } - }, - "400": { - "description": "{\"code\":400001,\"data\":[],\"msg\":\"请求参数错误\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/sub_region_list": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "地址" - ], - "summary": "获取区域id下的区域", - "parameters": [ - { - "type": "string", - "description": "上级地区类型:root(查询省级列表)、province(省级ID下的城市)、city(市级id下的区域)", - "name": "parent", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "上级地区id", - "name": "id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "ok", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/hdl.resultItem" - } - } - }, - "400": { - "description": "{\"code\":400001,\"data\":[],\"msg\":\"请求参数错误\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/user/address/:id": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "地址" - ], - "summary": "用户地址详情", - "parameters": [ - { - "type": "string", - "description": "地址id", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "ok", - "schema": { - "$ref": "#/definitions/model.UserAddress" - } - }, - "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"地址不存在\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/user/address/delete/:id": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "地址" - ], - "summary": "用户地址删除", - "parameters": [ - { - "type": "string", - "description": "ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"地址不存在\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/user/address/update": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "地址" - ], - "summary": "用户地址新增、编辑", - "parameters": [ - { - "description": "json参数,Id不传为新增", - "name": "\"\"", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/hdl.updateAddressReq" - } - } - ], - "responses": { - "200": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"地址不存在\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/user/addresses": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "地址" - ], - "summary": "用户地址列表", - "responses": { - "200": { - "description": "ok", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/model.UserAddress" - } - } - }, - "500": { - "description": "{\"code\":500000,\"data\":[],\"msg\":\"数据库操作失败\"}", + "description": "success", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } } }, "definitions": { - "hdl.PrivilegeOpenCardOrdQueryPageResp": { - "type": "object", - "properties": { - "btn_bg_color_1": { - "type": "string" - }, - "btn_bg_color_2": { - "type": "string" - }, - "btn_text": { - "type": "string" - }, - "btn_text_color": { - "type": "string" - }, - "header_img": { - "type": "string" - }, - "logistic_company": { - "type": "array", - "items": { - "$ref": "#/definitions/model.LogisticCompany" - } - } - } - }, - "hdl.PrivilegeOpenCardOrdQueryReq": { - "type": "object", - "required": [ - "com", - "num" - ], - "properties": { - "com": { - "description": "快递公司名称", - "type": "string" - }, - "num": { - "description": "快递单号", - "type": "string" - } - } - }, - "hdl.logisticQueryReq": { - "type": "object", - "required": [ - "com", - "num" - ], - "properties": { - "com": { - "description": "快递公司名称", - "type": "string" - }, - "num": { - "description": "快递单号", - "type": "string" - } - } - }, - "hdl.privilegeOpenCardCheckReq": { - "type": "object", - "required": [ - "key", - "num" - ], - "properties": { - "key": { - "description": "卡密", - "type": "string" - }, - "num": { - "description": "卡号", - "type": "string" - } - } - }, - "hdl.privilegeOpenCardPayPageResp": { - "type": "object", - "properties": { - "amount": { - "description": "付费金额", - "type": "string" - }, - "card_type": { - "description": "卡的类型:\"1\"实体卡 \"2\"虚拟卡", - "type": "string" - }, - "date_type": { - "description": "日期类型:month:月 season:季 year:年 forever:永久", - "type": "string" - }, - "page_style": { - "description": "页面样式", - "$ref": "#/definitions/hdl.privilegeOpenCardPayStyle" - } - } - }, - "hdl.privilegeOpenCardPayStyle": { - "type": "object", - "properties": { - "exclusive_privilege": { - "description": "专属特权", - "type": "array", - "items": { - "type": "object", - "properties": { - "brand_id": { - "type": "string" - }, - "brand_img": { - "type": "string" - }, - "brand_img_url": { - "type": "string" - }, - "brand_name": { - "type": "string" - }, - "is_show": { - "type": "string" - }, - "sub_title": { - "type": "string" - } - } - } - }, - "payment_btn": { - "description": "底部支付按钮", - "type": "array", - "items": { - "type": "object", - "properties": { - "bg_img": { - "type": "string" - }, - "bg_img_url": { - "type": "string" - }, - "func": { - "type": "string" - }, - "name": { - "type": "string" - }, - "text": { - "type": "string" - }, - "text_color": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - }, - "payment_choose_icon": { - "description": "支付方式选中、未选中图标", - "type": "array", - "items": { - "type": "object", - "properties": { - "icon": { - "type": "string" - }, - "icon_url": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - }, - "payment_style": { - "description": "支付方式", - "type": "array", - "items": { - "type": "object", - "properties": { - "icon": { - "type": "string" - }, - "icon_url": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - }, - "style": { - "description": "头部样式", - "type": "object", - "properties": { - "header_bg_img": { - "type": "string" - }, - "header_bg_img_url": { - "type": "string" - }, - "special_deals_img": { - "type": "string" - }, - "special_deals_img_url": { - "type": "string" - }, - "special_deals_text": { - "type": "string" - } - } - } - } - }, - "hdl.resultItem": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "440100000000" - }, - "name": { - "type": "string", - "example": "city" - } - } - }, - "hdl.updateAddressReq": { - "type": "object", - "required": [ - "city_id", - "county_id", - "detail", - "phone", - "province_id", - "receiver" - ], - "properties": { - "city_id": { - "type": "string" - }, - "county_id": { - "type": "string" - }, - "detail": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "phone": { - "type": "string" - }, - "post_code": { - "type": "string" - }, - "province_id": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "tag": { - "type": "string" - } - } - }, - "md.Apple": { - "type": "object", - "properties": { - "token": { - "type": "string" - } - } - }, - "md.FastLoginRequestBody": { - "type": "object", - "properties": { - "apple": { - "$ref": "#/definitions/md.Apple" - }, - "captcha": { - "type": "string" - }, - "is_not_create": { - "type": "string" - }, - "mobile": { - "type": "string" - }, - "parent_uid": { - "type": "string" - }, - "qq": { - "$ref": "#/definitions/md.QQLogin" - }, - "return_user_msg": { - "type": "string" - }, - "taobao": { - "$ref": "#/definitions/md.TaobaoLogin" - }, - "wechat": { - "$ref": "#/definitions/md.WeChat" - }, - "wechat_mini": { - "$ref": "#/definitions/md.WeChatMiniApp" - }, - "zone": { - "type": "string" - } - } - }, - "md.IndexRecommendList": { - "type": "object", - "properties": { - "good": { - "type": "array", - "items": { - "$ref": "#/definitions/md.RecommendGood" - } - }, - "provider": { - "description": "BarTitleList []BarTitle ` + "`" + `json:\"bar_title_list\"` + "`" + `", - "type": "string" - } - } - }, - "md.LoginResponse": { + "md.AddAdminReq": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { - "bind_phone_enable": { - "type": "string" - }, - "is_pid": { - "type": "string" - }, - "perms": { - "type": "array", - "items": { - "type": "string" - } - }, - "phone": { - "type": "string" - }, - "register_invite_code_enable": { - "type": "string" - }, - "register_popup_condition": { - "description": "弹出类型设置", - "$ref": "#/definitions/md.RegisterPopupCondition" - }, - "token": { + "memo": { "type": "string" }, - "user_id": { + "password": { "type": "string" }, "username": { "type": "string" - }, - "wechat_applet_open_id": { - "type": "string" - }, - "wechat_union_id": { - "type": "string" } } }, - "md.Marquee": { + "md.AddRoleReq": { "type": "object", + "required": [ + "memo", + "name" + ], "properties": { - "avatar_url": { - "type": "string" - }, - "content": { + "memo": { "type": "string" }, "name": { @@ -1277,375 +689,169 @@ var doc = `{ } } }, - "md.ProductDetailResponse": { + "md.AdminListReq": { "type": "object", "properties": { - "commission": { - "type": "string" - }, - "coupon_price": { - "type": "string" - }, - "good_id": { - "type": "string" - }, - "mod_list": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - } + "limit": { + "type": "integer" }, - "provider": { - "type": "string" + "page": { + "type": "integer" }, - "provider_name": { - "type": "string" + "state": { + "type": "integer" }, - "shop_avatar": { + "username": { "type": "string" } } }, - "md.QQLogin": { + "md.BindAdminRoleReq": { "type": "object", + "required": [ + "id" + ], "properties": { - "access_token": { - "type": "string" - }, - "avatar_url": { - "type": "string" - }, - "city": { - "type": "string" - }, - "expires_in": { - "type": "string" - }, - "gender": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "open_id": { - "type": "string" - }, - "pay_token": { - "type": "string" - }, - "pf": { - "type": "string" - }, - "pf_key": { - "type": "string" - }, - "province": { - "type": "string" - }, - "ret": { - "type": "string" + "id": { + "type": "integer" }, - "unionid": { - "type": "string" + "role_ids": { + "type": "array", + "items": { + "type": "integer" + } } } }, - "md.RecommendGood": { + "md.LoginReq": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { - "commission": { - "type": "string" - }, - "coupon": { - "type": "string" - }, - "current_price": { - "type": "string" - }, - "detail_data": { - "$ref": "#/definitions/md.ProductDetailResponse" - }, - "good_id": { - "type": "string" - }, - "good_image": { - "type": "string" - }, - "good_title": { - "type": "string" - }, - "inorder_count": { - "type": "string" - }, - "is_collect": { - "type": "integer" - }, - "is_coupons": { - "type": "integer" - }, - "is_share": { - "type": "integer" - }, - "market_price": { - "type": "string" - }, - "marquee_list": { - "type": "array", - "items": { - "$ref": "#/definitions/md.Marquee" - } - }, - "provider": { - "type": "string" - }, - "provider_name": { - "type": "string" - }, - "pvd": { - "type": "string" - }, - "shop_avatar": { - "type": "string" + "code": { + "type": "string", + "example": "验证码" }, - "shop_name": { - "type": "string" + "password": { + "type": "string", + "example": "登录密码" }, - "video": { - "type": "string" + "username": { + "type": "string", + "example": "登录账号" } } }, - "md.RegisterPopupCondition": { + "md.LoginResponse": { "type": "object", "properties": { - "invite_code": { - "description": "邀请码设置:弹出类型是激活码的时候起作用", - "type": "object", - "properties": { - "popup": { - "description": "是否弹出 “0”否 “1”是", - "type": "string" - }, - "should_input": { - "description": "是否必填 “0”否 “1”是", - "type": "string" - } - } - }, - "popup_type": { - "description": "弹出类型:“0”关闭 ”1”激活码 “2”邀请码", - "type": "string" - }, - "should_input": { - "description": "是否必填 “0”否 “1”是", + "token": { "type": "string" } } }, - "md.TaobaoLogin": { + "md.Response": { "type": "object", "properties": { - "access_token": { - "type": "string" - }, - "auth_code": { - "type": "string" - }, - "avatar_url": { - "type": "string" - }, - "nick_name": { - "type": "string" + "code": { + "type": "string", + "example": "响应码" }, - "open_id": { - "type": "string" + "data": { + "description": "内容" }, - "sid": { - "type": "string" + "msg": { + "type": "string", + "example": "具体错误原因" } } }, - "md.WeChat": { + "md.RoleBindPermissionGroupReq": { "type": "object", + "required": [ + "role_id" + ], "properties": { - "access_token": { - "type": "string" - }, - "avatar_url": { - "type": "string" - }, - "city": { - "type": "string" - }, - "expires_in": { - "type": "string" - }, - "gender": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "open_id": { - "type": "string" - }, - "pay_token": { - "type": "string" - }, - "pf": { - "type": "string" - }, - "pf_key": { - "type": "string" - }, - "province": { - "type": "string" - }, - "ret": { - "type": "string" + "permission_ids": { + "type": "array", + "items": { + "type": "integer" + } }, - "unionid": { - "type": "string" + "role_id": { + "type": "integer" } } }, - "md.WeChatMiniApp": { + "md.UpdateAdminReq": { "type": "object", + "required": [ + "id", + "password", + "username" + ], "properties": { - "avatar": { - "type": "string" - }, - "code": { - "type": "string" + "id": { + "type": "integer" }, - "nickname": { + "memo": { "type": "string" }, - "open_id": { + "password": { "type": "string" }, - "unionid": { + "username": { "type": "string" } } }, - "model.LogisticCompany": { + "md.UpdateAdminStateReq": { "type": "object", + "required": [ + "id", + "state" + ], "properties": { - "code": { - "type": "string" + "id": { + "type": "integer" }, - "name": { - "type": "string" + "state": { + "type": "integer" } } }, - "model.PrivilegeOpenCardOrd": { + "md.UpdateRoleReq": { "type": "object", + "required": [ + "memo", + "name", + "role_id" + ], "properties": { - "address": { - "type": "string" - }, - "after_sale_id": { - "type": "integer" - }, - "card_key": { - "type": "string" - }, - "card_num": { + "memo": { "type": "string" }, - "card_type": { - "type": "integer" - }, - "cost_price": { - "type": "string" - }, - "create_time": { - "type": "string" - }, - "date_type": { - "type": "integer" - }, - "given_data": { - "type": "string" - }, - "logistic_company": { - "type": "string" - }, - "logistic_num": { - "type": "string" - }, - "ord_id": { - "type": "integer" - }, - "pay_channel": { - "type": "integer" - }, - "pay_time": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "receiver": { + "name": { "type": "string" }, - "settle_at": { - "type": "integer" - }, - "state": { - "type": "integer" - }, - "uid": { + "role_id": { "type": "integer" - }, - "update_time": { - "type": "string" } } }, - "model.UserAddress": { + "md.UpdateRoleStateReq": { "type": "object", + "required": [ + "role_id", + "state" + ], "properties": { - "city_id": { - "type": "string" - }, - "city_name": { - "type": "string" - }, - "county_id": { - "type": "string" - }, - "county_name": { - "type": "string" - }, - "detail": { - "type": "string" - }, - "id": { + "role_id": { "type": "integer" }, - "phone": { - "type": "string" - }, - "post_code": { - "type": "string" - }, - "province_id": { - "type": "string" - }, - "province_name": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "tag": { - "type": "string" - }, - "uid": { + "state": { "type": "integer" } } @@ -1660,49 +866,18 @@ var doc = `{ } }` -type swaggerInfo struct { - Version string - Host string - BasePath string - Schemes []string - Title string - Description string -} - // SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = swaggerInfo{ - Version: "1.0", - Host: "localhost:5000", - BasePath: "/", - Schemes: []string{}, - Title: "智莺生活移动端接口", - Description: "移动端接口", -} - -type s struct{} - -func (s *s) ReadDoc() string { - sInfo := SwaggerInfo - sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) - - t, err := template.New("swagger_info").Funcs(template.FuncMap{ - "marshal": func(v interface{}) string { - a, _ := json.Marshal(v) - return string(a) - }, - }).Parse(doc) - if err != nil { - return doc - } - - var tpl bytes.Buffer - if err := t.Execute(&tpl, sInfo); err != nil { - return doc - } - - return tpl.String() +var SwaggerInfo = &swag.Spec{ + Version: "1.0", + Host: "localhost:1004 or xxxxx.medium.dengbiao.top", + BasePath: "", + Schemes: []string{}, + Title: "广告联盟-媒体平台", + Description: "媒体后台接口", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, } func init() { - swag.Register(swag.Name, &s{}) + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) } diff --git a/docs/swagger.json b/docs/swagger.json index 527c14e..d7f1415 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1,20 +1,25 @@ { "swagger": "2.0", "info": { - "description": "移动端接口", - "title": "智莺生活移动端接口", - "termsOfService": "智莺生活后端组", + "description": "媒体后台接口", + "title": "广告联盟-媒体平台", + "termsOfService": "http://swagger.io/terms/", "contact": { - "name": "sherlockwhite" + "name": "dengbiao", + "url": "http://www.swagger.io/support", + "email": "1239118001@qq.com" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0" }, - "host": "localhost:5000", - "basePath": "/", + "host": "localhost:1004 or xxxxx.medium.dengbiao.top", "paths": { - "/api/v1/acq/fix": { - "get": { - "description": "拉新活动--fix", + "/admin/login": { + "post": { + "description": "登入", "consumes": [ "application/json" ], @@ -22,68 +27,39 @@ "application/json" ], "tags": [ - "拉新活动" + "ADMIN" ], - "summary": "拉新活动--fix", - "responses": { - "200": { - "description": "ok", + "summary": "登陆", + "parameters": [ + { + "description": "用户名密码", + "name": "req", + "in": "body", + "required": true, "schema": { - "type": "string" + "$ref": "#/definitions/md.LoginReq" } } - } - } - }, - "/api/v1/acquisition/home": { - "post": { - "description": "本期榜单/上期榜单/我的邀请人数和奖励/任务列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" ], - "tags": [ - "拉新活动" - ], - "summary": "拉新--首页数据", "responses": { "200": { - "description": "ok", + "description": "token", "schema": { - "type": "string" + "$ref": "#/definitions/md.LoginResponse" } - } - } - } - }, - "/api/v1/acquisition/qrcode": { - "get": { - "description": "二维码", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "拉新活动" - ], - "summary": "拉新--邀请二维码", - "responses": { - "200": { - "description": "ok", + }, + "400": { + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } } }, - "/api/v1/acquisition/reward/detail": { + "/admin/role/addAdmin": { "post": { - "description": "拉新活动--我的奖励明细", + "description": "新增管理员", "consumes": [ "application/json" ], @@ -91,33 +67,46 @@ "application/json" ], "tags": [ - "拉新活动" + "ADMIN-权限管理" ], - "summary": "拉新活动--我的奖励明细", + "summary": "新增管理员", "parameters": [ { - "description": "1为以发放,2为待发放,3为失效", - "name": "state", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "type": "string" + "$ref": "#/definitions/md.AddAdminReq" } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } }, - "/api/v1/acquisition/reward_receive": { + "/admin/role/addRole": { "post": { - "description": "拉新活动--领取奖励", + "description": "添加角色", "consumes": [ "application/json" ], @@ -125,33 +114,46 @@ "application/json" ], "tags": [ - "拉新活动" + "ADMIN-权限管理" ], - "summary": "拉新活动--领取奖励", + "summary": "添加角色", "parameters": [ { - "description": "任务ID", - "name": "job_id", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "type": "string" + "$ref": "#/definitions/md.AddRoleReq" } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } }, - "/api/v1/credit/card/config": { + "/admin/role/adminInfo": { "get": { - "description": "获取信用卡配置", + "description": "管理员信息", "consumes": [ "application/json" ], @@ -159,22 +161,44 @@ "application/json" ], "tags": [ - "信用卡" + "ADMIN-权限管理" + ], + "summary": "管理员信息", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "管理员id", + "name": "adm_id", + "in": "query", + "required": true + } ], - "summary": "获取信用卡配置", "responses": { "200": { - "description": "ok", + "description": "具体看返回内容", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } }, - "/api/v1/duomai/mall/detail": { + "/admin/role/adminList": { "post": { - "description": "多麦商城--商城详情", + "description": "管理员列表", "consumes": [ "application/json" ], @@ -182,56 +206,46 @@ "application/json" ], "tags": [ - "多麦商城" + "ADMIN-权限管理" ], - "summary": "多麦商城--商城详情", + "summary": "管理员列表", "parameters": [ { - "description": "商城id", - "name": "brand_id", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "type": "string" + "$ref": "#/definitions/md.AdminListReq" } } ], "responses": { "200": { - "description": "ok", + "description": "具体看返回内容", "schema": { "type": "string" } - } - } - } - }, - "/api/v1/duomai/mall/home": { - "get": { - "description": "多麦商城--首页数据", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "多麦商城" - ], - "summary": "多麦商城--首页数据", - "responses": { - "200": { - "description": "ok", + }, + "400": { + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } } }, - "/api/v1/duomai/mall/search": { + "/admin/role/bindAdminRole/": { "post": { - "description": "多麦商城--搜索", + "description": "管理员绑定角色", "consumes": [ "application/json" ], @@ -239,33 +253,46 @@ "application/json" ], "tags": [ - "多麦商城" + "ADMIN-权限管理" ], - "summary": "多麦商城--搜索", + "summary": "管理员绑定角色", "parameters": [ { - "description": "搜索关键词", - "name": "key", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "type": "string" + "$ref": "#/definitions/md.BindAdminRoleReq" } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } }, - "/api/v1/duomai/mall/update": { - "get": { - "description": "多麦商城--更新数据", + "/admin/role/deleteAdmin/{$adm_id}": { + "delete": { + "description": "删除管理员", "consumes": [ "application/json" ], @@ -273,21 +300,37 @@ "application/json" ], "tags": [ - "多麦商城" + "ADMIN-权限管理" + ], + "summary": "删除管理员", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } ], - "summary": "多麦商城--更新数据", "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } }, - "/api/v1/logistic/query": { - "post": { + "/admin/role/deleteRole/{$id}": { + "delete": { + "description": "删除角色", "consumes": [ "application/json" ], @@ -295,39 +338,46 @@ "application/json" ], "tags": [ - "物流" + "ADMIN-权限管理" ], - "summary": "快递100物流查询", + "summary": "删除角色", "parameters": [ { - "description": "logisticQueryReq", - "name": "req", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/hdl.logisticQueryReq" + "$ref": "#/definitions/md.UpdateRoleStateReq" } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } }, "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"该快递公司不支持查询\"}", + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } } }, - "/api/v1/mod/pub.flutter.duomai.mall.detail.page": { + "/admin/role/permissionGroupList": { "get": { - "description": "多麦商城详情页样式", + "description": "权限组列表", "consumes": [ "application/json" ], @@ -335,68 +385,44 @@ "application/json" ], "tags": [ - "多麦商城" + "ADMIN-权限管理" ], - "summary": "多麦商城详情页样式", - "responses": { - "200": { - "description": "ok", - "schema": { - "type": "string" - } + "summary": "权限组列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "管理员id", + "name": "adm_id", + "in": "query", + "required": true } - } - } - }, - "/api/v1/mod/pub.flutter.duomai.mall.home.page": { - "get": { - "description": "多麦商城首页样式", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" ], - "tags": [ - "多麦商城" - ], - "summary": "多麦商城首页样式", "responses": { "200": { - "description": "ok", + "description": "具体看返回内容", "schema": { "type": "string" } - } - } - } - }, - "/api/v1/mod/pub.flutter.duomai.mall.search.page": { - "get": { - "description": "多麦商城搜索页样式", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "多麦商城" - ], - "summary": "多麦商城搜索页样式", - "responses": { - "200": { - "description": "ok", + }, + "400": { + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } } }, - "/api/v1/privilege/card/activation": { + "/admin/role/roleBindPermissionGroup": { "post": { - "description": "权益卡激活", + "description": "角色绑定权限组", "consumes": [ "application/json" ], @@ -404,32 +430,46 @@ "application/json" ], "tags": [ - "权益卡" + "ADMIN-权限管理" ], - "summary": "权益卡激活", + "summary": "角色绑定权限组", "parameters": [ { - "description": "json", - "name": "body", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/hdl.privilegeOpenCardCheckReq" + "$ref": "#/definitions/md.RoleBindPermissionGroupReq" } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } }, - "/api/v1/privilege/open_card/check": { + "/admin/role/roleList": { "get": { + "description": "角色列表", "consumes": [ "application/json" ], @@ -437,136 +477,131 @@ "application/json" ], "tags": [ - "权益卡" + "ADMIN-权限管理" ], - "summary": "权益卡卡号卡密检测", + "summary": "角色列表", "parameters": [ { - "description": "json", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/hdl.privilegeOpenCardCheckReq" - } + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true } ], "responses": { "200": { - "description": "0:不存在 1:已经被使用 2:可用", + "description": "具体看返回内容", "schema": { "type": "string" } - } - } - } - }, - "/api/v1/privilege/open_card/order_query": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "权益卡" - ], - "summary": "权益卡开卡订单查询页面", - "responses": { - "200": { - "description": "ok", - "schema": { - "$ref": "#/definitions/hdl.PrivilegeOpenCardOrdQueryPageResp" - } }, "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"验证码错误\"}", + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } - }, + } + }, + "/admin/role/updateAdmin": { "post": { + "description": "修改管理员信息", + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], "tags": [ - "权益卡" + "ADMIN-权限管理" ], - "summary": "权益卡开卡订单查询", + "summary": "修改管理员信息", "parameters": [ { - "description": "json", - "name": "body", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/hdl.PrivilegeOpenCardOrdQueryReq" + "$ref": "#/definitions/md.UpdateAdminReq" } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { - "$ref": "#/definitions/model.PrivilegeOpenCardOrd" + "type": "string" } }, "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"验证码错误\"}", + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } } }, - "/api/v1/privilege/open_card/order_suc": { - "get": { + "/admin/role/updateAdminState": { + "post": { + "description": "修改管理员状态", + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], "tags": [ - "权益卡" + "ADMIN-权限管理" ], - "summary": "订单支付成功页面", - "responses": { - "200": { - "description": "ok", + "summary": "修改管理员状态", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/model.PrivilegeOpenCardOrd" + "$ref": "#/definitions/md.UpdateAdminStateReq" } } - } - } - }, - "/api/v1/privilege/open_card/pay_page": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "权益卡" ], - "summary": "权益卡开卡支付页面", "responses": { "200": { - "description": "ok", + "description": "success", "schema": { - "$ref": "#/definitions/hdl.privilegeOpenCardPayPageResp" + "type": "string" } }, "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"权益卡配置缺失\"}", + "description": "具体错误", "schema": { - "type": "string" + "$ref": "#/definitions/md.Response" } } } } }, - "/api/v1/shake_ticket/:goods_id/:type": { - "get": { - "description": "收藏/领券买/分享赚", + "/admin/role/updateRole": { + "post": { + "description": "修改角色状态", "consumes": [ "application/json" ], @@ -574,687 +609,71 @@ "application/json" ], "tags": [ - "抖券" + "ADMIN-权限管理" ], - "summary": "抖券商品收藏/领券买/分享赚", + "summary": "修改角色状态", "parameters": [ { "type": "string", - "description": "商品id", - "name": "goods_id", - "in": "path", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", "required": true }, { - "type": "string", - "description": "类型(0取消收藏,1收藏,2点击 领券买,3点击分享赚)", - "name": "type", - "in": "path", - "required": true + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateRoleStateReq" + } } ], "responses": { "200": { - "description": "ok", + "description": "success", "schema": { "type": "string" } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } } } } - }, - "/api/v1/shake_ticket_list": { - "get": { - "description": "定向计划/高佣专场/精选低价包邮/偏远地区包邮/抖货商品/各大榜单商品/今日值得买", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "抖券" - ], - "summary": "抖券商品推荐列表", - "parameters": [ - { - "type": "string", - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "页数", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "分类id(3定向计划/4高佣专场/5精选低价包邮/6偏远地区包邮/7抖货商品/8各大榜单商品/9今日值得买)", - "name": "category_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "渠道", - "name": "pvd", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/md.IndexRecommendList" - } - } - } - } - }, - "/api/v1/sign/fast/in": { - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "登录、注册" - ], - "summary": "用户手机快速登录", - "parameters": [ - { - "description": "json", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/md.FastLoginRequestBody" - } - } - ], - "responses": { - "200": { - "description": "ok", - "schema": { - "$ref": "#/definitions/md.LoginResponse" - } - }, - "400": { - "description": "{\"code\":400001,\"data\":[],\"msg\":\"请求参数错误\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/sub_region_list": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "地址" - ], - "summary": "获取区域id下的区域", - "parameters": [ - { - "type": "string", - "description": "上级地区类型:root(查询省级列表)、province(省级ID下的城市)、city(市级id下的区域)", - "name": "parent", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "上级地区id", - "name": "id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "ok", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/hdl.resultItem" - } - } - }, - "400": { - "description": "{\"code\":400001,\"data\":[],\"msg\":\"请求参数错误\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/user/address/:id": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "地址" - ], - "summary": "用户地址详情", - "parameters": [ - { - "type": "string", - "description": "地址id", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "ok", - "schema": { - "$ref": "#/definitions/model.UserAddress" - } - }, - "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"地址不存在\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/user/address/delete/:id": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "地址" - ], - "summary": "用户地址删除", - "parameters": [ - { - "type": "string", - "description": "ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"地址不存在\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/user/address/update": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "地址" - ], - "summary": "用户地址新增、编辑", - "parameters": [ - { - "description": "json参数,Id不传为新增", - "name": "\"\"", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/hdl.updateAddressReq" - } - } - ], - "responses": { - "200": { - "description": "ok", - "schema": { - "type": "string" - } - }, - "400": { - "description": "{\"code\":400000,\"data\":[],\"msg\":\"地址不存在\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/user/addresses": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "地址" - ], - "summary": "用户地址列表", - "responses": { - "200": { - "description": "ok", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/model.UserAddress" - } - } - }, - "500": { - "description": "{\"code\":500000,\"data\":[],\"msg\":\"数据库操作失败\"}", - "schema": { - "type": "string" - } - } - } - } - } - }, - "definitions": { - "hdl.PrivilegeOpenCardOrdQueryPageResp": { - "type": "object", - "properties": { - "btn_bg_color_1": { - "type": "string" - }, - "btn_bg_color_2": { - "type": "string" - }, - "btn_text": { - "type": "string" - }, - "btn_text_color": { - "type": "string" - }, - "header_img": { - "type": "string" - }, - "logistic_company": { - "type": "array", - "items": { - "$ref": "#/definitions/model.LogisticCompany" - } - } - } - }, - "hdl.PrivilegeOpenCardOrdQueryReq": { - "type": "object", - "required": [ - "com", - "num" - ], - "properties": { - "com": { - "description": "快递公司名称", - "type": "string" - }, - "num": { - "description": "快递单号", - "type": "string" - } - } - }, - "hdl.logisticQueryReq": { - "type": "object", - "required": [ - "com", - "num" - ], - "properties": { - "com": { - "description": "快递公司名称", - "type": "string" - }, - "num": { - "description": "快递单号", - "type": "string" - } - } - }, - "hdl.privilegeOpenCardCheckReq": { - "type": "object", - "required": [ - "key", - "num" - ], - "properties": { - "key": { - "description": "卡密", - "type": "string" - }, - "num": { - "description": "卡号", - "type": "string" - } - } - }, - "hdl.privilegeOpenCardPayPageResp": { - "type": "object", - "properties": { - "amount": { - "description": "付费金额", - "type": "string" - }, - "card_type": { - "description": "卡的类型:\"1\"实体卡 \"2\"虚拟卡", - "type": "string" - }, - "date_type": { - "description": "日期类型:month:月 season:季 year:年 forever:永久", - "type": "string" - }, - "page_style": { - "description": "页面样式", - "$ref": "#/definitions/hdl.privilegeOpenCardPayStyle" - } - } - }, - "hdl.privilegeOpenCardPayStyle": { - "type": "object", - "properties": { - "exclusive_privilege": { - "description": "专属特权", - "type": "array", - "items": { - "type": "object", - "properties": { - "brand_id": { - "type": "string" - }, - "brand_img": { - "type": "string" - }, - "brand_img_url": { - "type": "string" - }, - "brand_name": { - "type": "string" - }, - "is_show": { - "type": "string" - }, - "sub_title": { - "type": "string" - } - } - } - }, - "payment_btn": { - "description": "底部支付按钮", - "type": "array", - "items": { - "type": "object", - "properties": { - "bg_img": { - "type": "string" - }, - "bg_img_url": { - "type": "string" - }, - "func": { - "type": "string" - }, - "name": { - "type": "string" - }, - "text": { - "type": "string" - }, - "text_color": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - }, - "payment_choose_icon": { - "description": "支付方式选中、未选中图标", - "type": "array", - "items": { - "type": "object", - "properties": { - "icon": { - "type": "string" - }, - "icon_url": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - }, - "payment_style": { - "description": "支付方式", - "type": "array", - "items": { - "type": "object", - "properties": { - "icon": { - "type": "string" - }, - "icon_url": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - }, - "style": { - "description": "头部样式", - "type": "object", - "properties": { - "header_bg_img": { - "type": "string" - }, - "header_bg_img_url": { - "type": "string" - }, - "special_deals_img": { - "type": "string" - }, - "special_deals_img_url": { - "type": "string" - }, - "special_deals_text": { - "type": "string" - } - } - } - } - }, - "hdl.resultItem": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "440100000000" - }, - "name": { - "type": "string", - "example": "city" - } - } - }, - "hdl.updateAddressReq": { - "type": "object", - "required": [ - "city_id", - "county_id", - "detail", - "phone", - "province_id", - "receiver" - ], - "properties": { - "city_id": { - "type": "string" - }, - "county_id": { - "type": "string" - }, - "detail": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "phone": { - "type": "string" - }, - "post_code": { - "type": "string" - }, - "province_id": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "tag": { - "type": "string" - } - } - }, - "md.Apple": { - "type": "object", - "properties": { - "token": { - "type": "string" - } - } - }, - "md.FastLoginRequestBody": { - "type": "object", - "properties": { - "apple": { - "$ref": "#/definitions/md.Apple" - }, - "captcha": { - "type": "string" - }, - "is_not_create": { - "type": "string" - }, - "mobile": { - "type": "string" - }, - "parent_uid": { - "type": "string" - }, - "qq": { - "$ref": "#/definitions/md.QQLogin" - }, - "return_user_msg": { - "type": "string" - }, - "taobao": { - "$ref": "#/definitions/md.TaobaoLogin" - }, - "wechat": { - "$ref": "#/definitions/md.WeChat" - }, - "wechat_mini": { - "$ref": "#/definitions/md.WeChatMiniApp" - }, - "zone": { - "type": "string" - } - } - }, - "md.IndexRecommendList": { - "type": "object", - "properties": { - "good": { - "type": "array", - "items": { - "$ref": "#/definitions/md.RecommendGood" - } - }, - "provider": { - "description": "BarTitleList []BarTitle `json:\"bar_title_list\"`", - "type": "string" - } - } - }, - "md.LoginResponse": { + } + }, + "definitions": { + "md.AddAdminReq": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { - "bind_phone_enable": { - "type": "string" - }, - "is_pid": { - "type": "string" - }, - "perms": { - "type": "array", - "items": { - "type": "string" - } - }, - "phone": { - "type": "string" - }, - "register_invite_code_enable": { - "type": "string" - }, - "register_popup_condition": { - "description": "弹出类型设置", - "$ref": "#/definitions/md.RegisterPopupCondition" - }, - "token": { + "memo": { "type": "string" }, - "user_id": { + "password": { "type": "string" }, "username": { "type": "string" - }, - "wechat_applet_open_id": { - "type": "string" - }, - "wechat_union_id": { - "type": "string" } } }, - "md.Marquee": { + "md.AddRoleReq": { "type": "object", + "required": [ + "memo", + "name" + ], "properties": { - "avatar_url": { - "type": "string" - }, - "content": { + "memo": { "type": "string" }, "name": { @@ -1262,375 +681,169 @@ } } }, - "md.ProductDetailResponse": { + "md.AdminListReq": { "type": "object", "properties": { - "commission": { - "type": "string" - }, - "coupon_price": { - "type": "string" - }, - "good_id": { - "type": "string" - }, - "mod_list": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - } + "limit": { + "type": "integer" }, - "provider": { - "type": "string" + "page": { + "type": "integer" }, - "provider_name": { - "type": "string" + "state": { + "type": "integer" }, - "shop_avatar": { + "username": { "type": "string" } } }, - "md.QQLogin": { + "md.BindAdminRoleReq": { "type": "object", + "required": [ + "id" + ], "properties": { - "access_token": { - "type": "string" - }, - "avatar_url": { - "type": "string" - }, - "city": { - "type": "string" - }, - "expires_in": { - "type": "string" - }, - "gender": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "open_id": { - "type": "string" - }, - "pay_token": { - "type": "string" - }, - "pf": { - "type": "string" - }, - "pf_key": { - "type": "string" - }, - "province": { - "type": "string" - }, - "ret": { - "type": "string" + "id": { + "type": "integer" }, - "unionid": { - "type": "string" + "role_ids": { + "type": "array", + "items": { + "type": "integer" + } } } }, - "md.RecommendGood": { + "md.LoginReq": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { - "commission": { - "type": "string" - }, - "coupon": { - "type": "string" - }, - "current_price": { - "type": "string" - }, - "detail_data": { - "$ref": "#/definitions/md.ProductDetailResponse" - }, - "good_id": { - "type": "string" - }, - "good_image": { - "type": "string" - }, - "good_title": { - "type": "string" - }, - "inorder_count": { - "type": "string" - }, - "is_collect": { - "type": "integer" - }, - "is_coupons": { - "type": "integer" - }, - "is_share": { - "type": "integer" - }, - "market_price": { - "type": "string" - }, - "marquee_list": { - "type": "array", - "items": { - "$ref": "#/definitions/md.Marquee" - } - }, - "provider": { - "type": "string" - }, - "provider_name": { - "type": "string" - }, - "pvd": { - "type": "string" - }, - "shop_avatar": { - "type": "string" + "code": { + "type": "string", + "example": "验证码" }, - "shop_name": { - "type": "string" + "password": { + "type": "string", + "example": "登录密码" }, - "video": { - "type": "string" + "username": { + "type": "string", + "example": "登录账号" } } }, - "md.RegisterPopupCondition": { + "md.LoginResponse": { "type": "object", "properties": { - "invite_code": { - "description": "邀请码设置:弹出类型是激活码的时候起作用", - "type": "object", - "properties": { - "popup": { - "description": "是否弹出 “0”否 “1”是", - "type": "string" - }, - "should_input": { - "description": "是否必填 “0”否 “1”是", - "type": "string" - } - } - }, - "popup_type": { - "description": "弹出类型:“0”关闭 ”1”激活码 “2”邀请码", - "type": "string" - }, - "should_input": { - "description": "是否必填 “0”否 “1”是", + "token": { "type": "string" } } }, - "md.TaobaoLogin": { + "md.Response": { "type": "object", "properties": { - "access_token": { - "type": "string" - }, - "auth_code": { - "type": "string" - }, - "avatar_url": { - "type": "string" - }, - "nick_name": { - "type": "string" + "code": { + "type": "string", + "example": "响应码" }, - "open_id": { - "type": "string" + "data": { + "description": "内容" }, - "sid": { - "type": "string" + "msg": { + "type": "string", + "example": "具体错误原因" } } }, - "md.WeChat": { + "md.RoleBindPermissionGroupReq": { "type": "object", + "required": [ + "role_id" + ], "properties": { - "access_token": { - "type": "string" - }, - "avatar_url": { - "type": "string" - }, - "city": { - "type": "string" - }, - "expires_in": { - "type": "string" - }, - "gender": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "open_id": { - "type": "string" - }, - "pay_token": { - "type": "string" - }, - "pf": { - "type": "string" - }, - "pf_key": { - "type": "string" - }, - "province": { - "type": "string" - }, - "ret": { - "type": "string" + "permission_ids": { + "type": "array", + "items": { + "type": "integer" + } }, - "unionid": { - "type": "string" + "role_id": { + "type": "integer" } } }, - "md.WeChatMiniApp": { + "md.UpdateAdminReq": { "type": "object", + "required": [ + "id", + "password", + "username" + ], "properties": { - "avatar": { - "type": "string" - }, - "code": { - "type": "string" + "id": { + "type": "integer" }, - "nickname": { + "memo": { "type": "string" }, - "open_id": { + "password": { "type": "string" }, - "unionid": { + "username": { "type": "string" } } }, - "model.LogisticCompany": { + "md.UpdateAdminStateReq": { "type": "object", + "required": [ + "id", + "state" + ], "properties": { - "code": { - "type": "string" + "id": { + "type": "integer" }, - "name": { - "type": "string" + "state": { + "type": "integer" } } }, - "model.PrivilegeOpenCardOrd": { + "md.UpdateRoleReq": { "type": "object", + "required": [ + "memo", + "name", + "role_id" + ], "properties": { - "address": { - "type": "string" - }, - "after_sale_id": { - "type": "integer" - }, - "card_key": { - "type": "string" - }, - "card_num": { - "type": "string" - }, - "card_type": { - "type": "integer" - }, - "cost_price": { - "type": "string" - }, - "create_time": { - "type": "string" - }, - "date_type": { - "type": "integer" - }, - "given_data": { - "type": "string" - }, - "logistic_company": { - "type": "string" - }, - "logistic_num": { - "type": "string" - }, - "ord_id": { - "type": "integer" - }, - "pay_channel": { - "type": "integer" - }, - "pay_time": { + "memo": { "type": "string" }, - "phone": { - "type": "string" - }, - "receiver": { + "name": { "type": "string" }, - "settle_at": { - "type": "integer" - }, - "state": { - "type": "integer" - }, - "uid": { + "role_id": { "type": "integer" - }, - "update_time": { - "type": "string" } } }, - "model.UserAddress": { + "md.UpdateRoleStateReq": { "type": "object", + "required": [ + "role_id", + "state" + ], "properties": { - "city_id": { - "type": "string" - }, - "city_name": { - "type": "string" - }, - "county_id": { - "type": "string" - }, - "county_name": { - "type": "string" - }, - "detail": { - "type": "string" - }, - "id": { + "role_id": { "type": "integer" }, - "phone": { - "type": "string" - }, - "post_code": { - "type": "string" - }, - "province_id": { - "type": "string" - }, - "province_name": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "tag": { - "type": "string" - }, - "uid": { + "state": { "type": "integer" } } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index ca2a7a9..5c5bba2 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,1081 +1,567 @@ -basePath: / definitions: - hdl.PrivilegeOpenCardOrdQueryPageResp: + md.AddAdminReq: properties: - btn_bg_color_1: + memo: type: string - btn_bg_color_2: + password: type: string - btn_text: - type: string - btn_text_color: - type: string - header_img: - type: string - logistic_company: - items: - $ref: '#/definitions/model.LogisticCompany' - type: array - type: object - hdl.PrivilegeOpenCardOrdQueryReq: - properties: - com: - description: 快递公司名称 - type: string - num: - description: 快递单号 - type: string - required: - - com - - num - type: object - hdl.logisticQueryReq: - properties: - com: - description: 快递公司名称 - type: string - num: - description: 快递单号 + username: type: string required: - - com - - num + - password + - username type: object - hdl.privilegeOpenCardCheckReq: + md.AddRoleReq: properties: - key: - description: 卡密 + memo: type: string - num: - description: 卡号 + name: type: string required: - - key - - num - type: object - hdl.privilegeOpenCardPayPageResp: - properties: - amount: - description: 付费金额 - type: string - card_type: - description: 卡的类型:"1"实体卡 "2"虚拟卡 - type: string - date_type: - description: 日期类型:month:月 season:季 year:年 forever:永久 - type: string - page_style: - $ref: '#/definitions/hdl.privilegeOpenCardPayStyle' - description: 页面样式 + - memo + - name type: object - hdl.privilegeOpenCardPayStyle: + md.AdminListReq: properties: - exclusive_privilege: - description: 专属特权 - items: - properties: - brand_id: - type: string - brand_img: - type: string - brand_img_url: - type: string - brand_name: - type: string - is_show: - type: string - sub_title: - type: string - type: object - type: array - payment_btn: - description: 底部支付按钮 - items: - properties: - bg_img: - type: string - bg_img_url: - type: string - func: - type: string - name: - type: string - text: - type: string - text_color: - type: string - type: - type: string - type: object - type: array - payment_choose_icon: - description: 支付方式选中、未选中图标 - items: - properties: - icon: - type: string - icon_url: - type: string - type: - type: string - type: object - type: array - payment_style: - description: 支付方式 - items: - properties: - icon: - type: string - icon_url: - type: string - type: - type: string - type: object - type: array - style: - description: 头部样式 - properties: - header_bg_img: - type: string - header_bg_img_url: - type: string - special_deals_img: - type: string - special_deals_img_url: - type: string - special_deals_text: - type: string - type: object - type: object - hdl.resultItem: - properties: - id: - example: "440100000000" - type: string - name: - example: city + limit: + type: integer + page: + type: integer + state: + type: integer + username: type: string type: object - hdl.updateAddressReq: + md.BindAdminRoleReq: properties: - city_id: - type: string - county_id: - type: string - detail: - type: string id: type: integer - phone: - type: string - post_code: - type: string - province_id: - type: string - receiver: - type: string - tag: - type: string + role_ids: + items: + type: integer + type: array required: - - city_id - - county_id - - detail - - phone - - province_id - - receiver + - id type: object - md.Apple: + md.LoginReq: properties: - token: - type: string - type: object - md.FastLoginRequestBody: - properties: - apple: - $ref: '#/definitions/md.Apple' - captcha: - type: string - is_not_create: - type: string - mobile: - type: string - parent_uid: - type: string - qq: - $ref: '#/definitions/md.QQLogin' - return_user_msg: + code: + example: 验证码 type: string - taobao: - $ref: '#/definitions/md.TaobaoLogin' - wechat: - $ref: '#/definitions/md.WeChat' - wechat_mini: - $ref: '#/definitions/md.WeChatMiniApp' - zone: + password: + example: 登录密码 type: string - type: object - md.IndexRecommendList: - properties: - good: - items: - $ref: '#/definitions/md.RecommendGood' - type: array - provider: - description: BarTitleList []BarTitle `json:"bar_title_list"` + username: + example: 登录账号 type: string + required: + - password + - username type: object md.LoginResponse: properties: - bind_phone_enable: - type: string - is_pid: - type: string - perms: - items: - type: string - type: array - phone: - type: string - register_invite_code_enable: - type: string - register_popup_condition: - $ref: '#/definitions/md.RegisterPopupCondition' - description: 弹出类型设置 token: type: string - user_id: - type: string - username: - type: string - wechat_applet_open_id: - type: string - wechat_union_id: - type: string type: object - md.Marquee: + md.Response: properties: - avatar_url: + code: + example: 响应码 type: string - content: - type: string - name: + data: + description: 内容 + msg: + example: 具体错误原因 type: string type: object - md.ProductDetailResponse: + md.RoleBindPermissionGroupReq: properties: - commission: - type: string - coupon_price: - type: string - good_id: - type: string - mod_list: + permission_ids: items: - additionalProperties: true - type: object + type: integer type: array - provider: - type: string - provider_name: - type: string - shop_avatar: - type: string + role_id: + type: integer + required: + - role_id type: object - md.QQLogin: + md.UpdateAdminReq: properties: - access_token: - type: string - avatar_url: - type: string - city: - type: string - expires_in: - type: string - gender: - type: string - nickname: - type: string - open_id: - type: string - pay_token: - type: string - pf: - type: string - pf_key: - type: string - province: + id: + type: integer + memo: type: string - ret: + password: type: string - unionid: + username: type: string + required: + - id + - password + - username type: object - md.RecommendGood: + md.UpdateAdminStateReq: properties: - commission: - type: string - coupon: - type: string - current_price: - type: string - detail_data: - $ref: '#/definitions/md.ProductDetailResponse' - good_id: - type: string - good_image: - type: string - good_title: - type: string - inorder_count: - type: string - is_collect: - type: integer - is_coupons: + id: type: integer - is_share: + state: type: integer - market_price: - type: string - marquee_list: - items: - $ref: '#/definitions/md.Marquee' - type: array - provider: - type: string - provider_name: - type: string - pvd: - type: string - shop_avatar: - type: string - shop_name: - type: string - video: - type: string - type: object - md.RegisterPopupCondition: - properties: - invite_code: - description: 邀请码设置:弹出类型是激活码的时候起作用 - properties: - popup: - description: 是否弹出 “0”否 “1”是 - type: string - should_input: - description: 是否必填 “0”否 “1”是 - type: string - type: object - popup_type: - description: 弹出类型:“0”关闭 ”1”激活码 “2”邀请码 - type: string - should_input: - description: 是否必填 “0”否 “1”是 - type: string - type: object - md.TaobaoLogin: - properties: - access_token: - type: string - auth_code: - type: string - avatar_url: - type: string - nick_name: - type: string - open_id: - type: string - sid: - type: string - type: object - md.WeChat: - properties: - access_token: - type: string - avatar_url: - type: string - city: - type: string - expires_in: - type: string - gender: - type: string - nickname: - type: string - open_id: - type: string - pay_token: - type: string - pf: - type: string - pf_key: - type: string - province: - type: string - ret: - type: string - unionid: - type: string - type: object - md.WeChatMiniApp: - properties: - avatar: - type: string - code: - type: string - nickname: - type: string - open_id: - type: string - unionid: - type: string + required: + - id + - state type: object - model.LogisticCompany: + md.UpdateRoleReq: properties: - code: + memo: type: string name: type: string - type: object - model.PrivilegeOpenCardOrd: - properties: - address: - type: string - after_sale_id: - type: integer - card_key: - type: string - card_num: - type: string - card_type: - type: integer - cost_price: - type: string - create_time: - type: string - date_type: - type: integer - given_data: - type: string - logistic_company: - type: string - logistic_num: - type: string - ord_id: - type: integer - pay_channel: - type: integer - pay_time: - type: string - phone: - type: string - receiver: - type: string - settle_at: - type: integer - state: + role_id: type: integer - uid: - type: integer - update_time: - type: string + required: + - memo + - name + - role_id type: object - model.UserAddress: + md.UpdateRoleStateReq: properties: - city_id: - type: string - city_name: - type: string - county_id: - type: string - county_name: - type: string - detail: - type: string - id: + role_id: type: integer - phone: - type: string - post_code: - type: string - province_id: - type: string - province_name: - type: string - receiver: - type: string - tag: - type: string - uid: + state: type: integer + required: + - role_id + - state type: object -host: localhost:5000 +host: localhost:1004 or xxxxx.medium.dengbiao.top info: contact: - name: sherlockwhite - description: 移动端接口 - termsOfService: 智莺生活后端组 - title: 智莺生活移动端接口 + email: 1239118001@qq.com + name: dengbiao + url: http://www.swagger.io/support + description: 媒体后台接口 + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + termsOfService: http://swagger.io/terms/ + title: 广告联盟-媒体平台 version: "1.0" paths: - /api/v1/acq/fix: - get: - consumes: - - application/json - description: 拉新活动--fix - produces: - - application/json - responses: - "200": - description: ok - schema: - type: string - summary: 拉新活动--fix - tags: - - 拉新活动 - /api/v1/acquisition/home: - post: - consumes: - - application/json - description: 本期榜单/上期榜单/我的邀请人数和奖励/任务列表 - produces: - - application/json - responses: - "200": - description: ok - schema: - type: string - summary: 拉新--首页数据 - tags: - - 拉新活动 - /api/v1/acquisition/qrcode: - get: - consumes: - - application/json - description: 二维码 - produces: - - application/json - responses: - "200": - description: ok - schema: - type: string - summary: 拉新--邀请二维码 - tags: - - 拉新活动 - /api/v1/acquisition/reward/detail: + /admin/login: post: consumes: - application/json - description: 拉新活动--我的奖励明细 + description: 登入 parameters: - - description: 1为以发放,2为待发放,3为失效 + - description: 用户名密码 in: body - name: state + name: req required: true schema: - type: string + $ref: '#/definitions/md.LoginReq' produces: - application/json responses: "200": - description: ok + description: token schema: - type: string - summary: 拉新活动--我的奖励明细 + $ref: '#/definitions/md.LoginResponse' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 登陆 tags: - - 拉新活动 - /api/v1/acquisition/reward_receive: + - ADMIN + /admin/role/addAdmin: post: consumes: - application/json - description: 拉新活动--领取奖励 + description: 新增管理员 parameters: - - description: 任务ID + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 in: body - name: job_id + name: args required: true schema: - type: string + $ref: '#/definitions/md.AddAdminReq' produces: - application/json responses: "200": - description: ok + description: success schema: type: string - summary: 拉新活动--领取奖励 - tags: - - 拉新活动 - /api/v1/credit/card/config: - get: - consumes: - - application/json - description: 获取信用卡配置 - produces: - - application/json - responses: - "200": - description: ok + "400": + description: 具体错误 schema: - type: string - summary: 获取信用卡配置 + $ref: '#/definitions/md.Response' + summary: 新增管理员 tags: - - 信用卡 - /api/v1/duomai/mall/detail: + - ADMIN-权限管理 + /admin/role/addRole: post: consumes: - application/json - description: 多麦商城--商城详情 + description: 添加角色 parameters: - - description: 商城id + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 in: body - name: brand_id + name: args required: true schema: - type: string + $ref: '#/definitions/md.AddRoleReq' produces: - application/json responses: "200": - description: ok + description: success schema: type: string - summary: 多麦商城--商城详情 - tags: - - 多麦商城 - /api/v1/duomai/mall/home: - get: - consumes: - - application/json - description: 多麦商城--首页数据 - produces: - - application/json - responses: - "200": - description: ok + "400": + description: 具体错误 schema: - type: string - summary: 多麦商城--首页数据 + $ref: '#/definitions/md.Response' + summary: 添加角色 tags: - - 多麦商城 - /api/v1/duomai/mall/search: - post: + - ADMIN-权限管理 + /admin/role/adminInfo: + get: consumes: - application/json - description: 多麦商城--搜索 + description: 管理员信息 parameters: - - description: 搜索关键词 - in: body - name: key + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization required: true - schema: - type: string + type: string + - description: 管理员id + in: query + name: adm_id + required: true + type: string produces: - application/json responses: "200": - description: ok + description: 具体看返回内容 schema: type: string - summary: 多麦商城--搜索 - tags: - - 多麦商城 - /api/v1/duomai/mall/update: - get: - consumes: - - application/json - description: 多麦商城--更新数据 - produces: - - application/json - responses: - "200": - description: ok + "400": + description: 具体错误 schema: - type: string - summary: 多麦商城--更新数据 + $ref: '#/definitions/md.Response' + summary: 管理员信息 tags: - - 多麦商城 - /api/v1/logistic/query: + - ADMIN-权限管理 + /admin/role/adminList: post: consumes: - application/json + description: 管理员列表 parameters: - - description: logisticQueryReq + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 in: body - name: req + name: args required: true schema: - $ref: '#/definitions/hdl.logisticQueryReq' + $ref: '#/definitions/md.AdminListReq' produces: - application/json responses: "200": - description: ok + description: 具体看返回内容 schema: type: string "400": - description: '{"code":400000,"data":[],"msg":"该快递公司不支持查询"}' + description: 具体错误 schema: - type: string - summary: 快递100物流查询 + $ref: '#/definitions/md.Response' + summary: 管理员列表 tags: - - 物流 - /api/v1/mod/pub.flutter.duomai.mall.detail.page: - get: - consumes: - - application/json - description: 多麦商城详情页样式 - produces: - - application/json - responses: - "200": - description: ok - schema: - type: string - summary: 多麦商城详情页样式 - tags: - - 多麦商城 - /api/v1/mod/pub.flutter.duomai.mall.home.page: - get: - consumes: - - application/json - description: 多麦商城首页样式 - produces: - - application/json - responses: - "200": - description: ok - schema: - type: string - summary: 多麦商城首页样式 - tags: - - 多麦商城 - /api/v1/mod/pub.flutter.duomai.mall.search.page: - get: - consumes: - - application/json - description: 多麦商城搜索页样式 - produces: - - application/json - responses: - "200": - description: ok - schema: - type: string - summary: 多麦商城搜索页样式 - tags: - - 多麦商城 - /api/v1/privilege/card/activation: + - ADMIN-权限管理 + /admin/role/bindAdminRole/: post: consumes: - application/json - description: 权益卡激活 + description: 管理员绑定角色 parameters: - - description: json + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 in: body - name: body + name: args required: true schema: - $ref: '#/definitions/hdl.privilegeOpenCardCheckReq' + $ref: '#/definitions/md.BindAdminRoleReq' produces: - application/json responses: "200": - description: ok + description: success schema: type: string - summary: 权益卡激活 + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 管理员绑定角色 tags: - - 权益卡 - /api/v1/privilege/open_card/check: - get: + - ADMIN-权限管理 + /admin/role/deleteAdmin/{$adm_id}: + delete: consumes: - application/json + description: 删除管理员 parameters: - - description: json - in: body - name: body + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization required: true - schema: - $ref: '#/definitions/hdl.privilegeOpenCardCheckReq' + type: string produces: - application/json responses: "200": - description: 0:不存在 1:已经被使用 2:可用 + description: success schema: type: string - summary: 权益卡卡号卡密检测 - tags: - - 权益卡 - /api/v1/privilege/open_card/order_query: - get: - produces: - - application/json - responses: - "200": - description: ok - schema: - $ref: '#/definitions/hdl.PrivilegeOpenCardOrdQueryPageResp' "400": - description: '{"code":400000,"data":[],"msg":"验证码错误"}' + description: 具体错误 schema: - type: string - summary: 权益卡开卡订单查询页面 + $ref: '#/definitions/md.Response' + summary: 删除管理员 tags: - - 权益卡 - post: + - ADMIN-权限管理 + /admin/role/deleteRole/{$id}: + delete: + consumes: + - application/json + description: 删除角色 parameters: - - description: json + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 in: body - name: body + name: args required: true schema: - $ref: '#/definitions/hdl.PrivilegeOpenCardOrdQueryReq' + $ref: '#/definitions/md.UpdateRoleStateReq' produces: - application/json responses: "200": - description: ok - schema: - $ref: '#/definitions/model.PrivilegeOpenCardOrd' - "400": - description: '{"code":400000,"data":[],"msg":"验证码错误"}' + description: success schema: type: string - summary: 权益卡开卡订单查询 - tags: - - 权益卡 - /api/v1/privilege/open_card/order_suc: - get: - produces: - - application/json - responses: - "200": - description: ok - schema: - $ref: '#/definitions/model.PrivilegeOpenCardOrd' - summary: 订单支付成功页面 - tags: - - 权益卡 - /api/v1/privilege/open_card/pay_page: - get: - produces: - - application/json - responses: - "200": - description: ok - schema: - $ref: '#/definitions/hdl.privilegeOpenCardPayPageResp' "400": - description: '{"code":400000,"data":[],"msg":"权益卡配置缺失"}' + description: 具体错误 schema: - type: string - summary: 权益卡开卡支付页面 + $ref: '#/definitions/md.Response' + summary: 删除角色 tags: - - 权益卡 - /api/v1/shake_ticket/:goods_id/:type: + - ADMIN-权限管理 + /admin/role/permissionGroupList: get: consumes: - application/json - description: 收藏/领券买/分享赚 + description: 权限组列表 parameters: - - description: 商品id - in: path - name: goods_id + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization required: true type: string - - description: 类型(0取消收藏,1收藏,2点击 领券买,3点击分享赚) - in: path - name: type + - description: 管理员id + in: query + name: adm_id required: true type: string produces: - application/json responses: "200": - description: ok + description: 具体看返回内容 schema: type: string - summary: 抖券商品收藏/领券买/分享赚 + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 权限组列表 tags: - - 抖券 - /api/v1/shake_ticket_list: - get: + - ADMIN-权限管理 + /admin/role/roleBindPermissionGroup: + post: consumes: - application/json - description: 定向计划/高佣专场/精选低价包邮/偏远地区包邮/抖货商品/各大榜单商品/今日值得买 + description: 角色绑定权限组 parameters: - - description: 页码 - in: query - name: page + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization required: true type: string - - description: 页数 - in: query - name: page_size - required: true - type: string - - description: 分类id(3定向计划/4高佣专场/5精选低价包邮/6偏远地区包邮/7抖货商品/8各大榜单商品/9今日值得买) - in: query - name: category_id - required: true - type: string - - description: 渠道 - in: query - name: pvd - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/md.IndexRecommendList' - summary: 抖券商品推荐列表 - tags: - - 抖券 - /api/v1/sign/fast/in: - post: - parameters: - - description: json + - description: 请求参数 in: body - name: body + name: args required: true schema: - $ref: '#/definitions/md.FastLoginRequestBody' + $ref: '#/definitions/md.RoleBindPermissionGroupReq' produces: - application/json responses: "200": - description: ok + description: success schema: - $ref: '#/definitions/md.LoginResponse' + type: string "400": - description: '{"code":400001,"data":[],"msg":"请求参数错误"}' + description: 具体错误 schema: - type: string - summary: 用户手机快速登录 + $ref: '#/definitions/md.Response' + summary: 角色绑定权限组 tags: - - 登录、注册 - /api/v1/sub_region_list: + - ADMIN-权限管理 + /admin/role/roleList: get: + consumes: + - application/json + description: 角色列表 parameters: - - description: 上级地区类型:root(查询省级列表)、province(省级ID下的城市)、city(市级id下的区域) - in: query - name: parent + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization required: true type: string - - description: 上级地区id - in: query - name: id - type: string produces: - application/json responses: "200": - description: ok + description: 具体看返回内容 schema: - items: - $ref: '#/definitions/hdl.resultItem' - type: array + type: string "400": - description: '{"code":400001,"data":[],"msg":"请求参数错误"}' + description: 具体错误 schema: - type: string - summary: 获取区域id下的区域 + $ref: '#/definitions/md.Response' + summary: 角色列表 tags: - - 地址 - /api/v1/user/address/:id: - get: + - ADMIN-权限管理 + /admin/role/updateAdmin: + post: + consumes: + - application/json + description: 修改管理员信息 parameters: - - description: 地址id - in: path - name: id + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization required: true type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.UpdateAdminReq' produces: - application/json responses: "200": - description: ok + description: success schema: - $ref: '#/definitions/model.UserAddress' + type: string "400": - description: '{"code":400000,"data":[],"msg":"地址不存在"}' + description: 具体错误 schema: - type: string - summary: 用户地址详情 + $ref: '#/definitions/md.Response' + summary: 修改管理员信息 tags: - - 地址 - /api/v1/user/address/delete/:id: + - ADMIN-权限管理 + /admin/role/updateAdminState: post: consumes: - application/json + description: 修改管理员状态 parameters: - - description: ID - in: path - name: id + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization required: true type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.UpdateAdminStateReq' produces: - application/json responses: "200": - description: ok + description: success schema: type: string "400": - description: '{"code":400000,"data":[],"msg":"地址不存在"}' + description: 具体错误 schema: - type: string - summary: 用户地址删除 + $ref: '#/definitions/md.Response' + summary: 修改管理员状态 tags: - - 地址 - /api/v1/user/address/update: + - ADMIN-权限管理 + /admin/role/updateRole: post: consumes: - application/json + description: 修改角色状态 parameters: - - description: json参数,Id不传为新增 + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 in: body - name: '""' + name: args required: true schema: - $ref: '#/definitions/hdl.updateAddressReq' + $ref: '#/definitions/md.UpdateRoleStateReq' produces: - application/json responses: "200": - description: ok + description: success schema: type: string "400": - description: '{"code":400000,"data":[],"msg":"地址不存在"}' - schema: - type: string - summary: 用户地址新增、编辑 - tags: - - 地址 - /api/v1/user/addresses: - get: - produces: - - application/json - responses: - "200": - description: ok - schema: - items: - $ref: '#/definitions/model.UserAddress' - type: array - "500": - description: '{"code":500000,"data":[],"msg":"数据库操作失败"}' + description: 具体错误 schema: - type: string - summary: 用户地址列表 + $ref: '#/definitions/md.Response' + summary: 修改角色状态 tags: - - 地址 + - ADMIN-权限管理 securityDefinitions: MasterID: in: header diff --git a/go.mod b/go.mod index 41cd9e9..e5d313d 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 //replace code.fnuoos.com/zhimeng/model.git => E:/company/ad/models require ( - code.fnuoos.com/zhimeng/model.git v0.0.2 + code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240816151818-a491f294f782 github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/boombuler/barcode v1.0.1