图片上传示例 前端图片跨域下载示例 文档更新

This commit is contained in:
pixel
2019-10-26 23:19:31 +08:00
parent 76d725d404
commit f90a675c43
10 changed files with 1116 additions and 63 deletions
+378 -20
View File
@@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2019-09-22 17:09:11.1201116 +0800 CST m=+0.066820301
// 2019-10-26 23:18:53.1133875 +0800 CST m=+0.203566501
package docs
@@ -90,7 +90,73 @@ var doc = `{
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.DeleteApiParams"
"$ref": "#/definitions/dbModel.Api"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/api/getAllApis": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Api"
],
"summary": "获取所有的Api 不分页",
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/api/getApiById": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Api"
],
"summary": "根据id获取api",
"parameters": [
{
"description": "分页获取用户列表",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/modelInterface.PageInfo"
}
}
],
@@ -120,10 +186,10 @@ var doc = `{
"tags": [
"Api"
],
"summary": "分页获取角色列表",
"summary": "分页获取API列表",
"parameters": [
{
"description": "分页获取用户列表",
"description": "分页获取API列表",
"name": "data",
"in": "body",
"required": true,
@@ -143,7 +209,7 @@ var doc = `{
}
}
},
"/api/setAuthAndPath": {
"/api/setAuthAndApi": {
"post": {
"security": [
{
@@ -182,6 +248,45 @@ var doc = `{
}
}
},
"/api/updataApi": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Api"
],
"summary": "创建基础api",
"parameters": [
{
"description": "创建api",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.CreateApiParams"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/authority/createAuthority": {
"post": {
"security": [
@@ -260,6 +365,45 @@ var doc = `{
}
}
},
"/authority/getAuthAndApi": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"authority"
],
"summary": "获取本角色所有有权限的apiId",
"parameters": [
{
"description": "获取本角色所有有权限的apiId",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.GetAuthorityId"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/authority/getAuthorityList": {
"post": {
"security": [
@@ -361,6 +505,81 @@ var doc = `{
}
}
},
"/fileUploadAndDownload/getFileList": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"FileUploadAndDownload"
],
"summary": "分页文件列表",
"parameters": [
{
"description": "分页获取文件户列表",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/modelInterface.PageInfo"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/fileUploadAndDownload/upload": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"FileUploadAndDownload"
],
"summary": "上传文件示例",
"parameters": [
{
"type": "file",
"description": "上传文件示例",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/menu/addBaseMenu": {
"post": {
"security": [
@@ -377,16 +596,16 @@ var doc = `{
"tags": [
"menu"
],
"summary": "分页获取基础menu列表",
"summary": "新增菜单",
"parameters": [
{
"description": "分页获取基础menu列表",
"description": "新增菜单",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/modelInterface.PageInfo"
"$ref": "#/definitions/dbModel.BaseMenu"
}
}
],
@@ -455,7 +674,7 @@ var doc = `{
"tags": [
"menu"
],
"summary": "获取指定角色menu",
"summary": "删除菜单",
"parameters": [
{
"description": "删除菜单",
@@ -478,6 +697,45 @@ var doc = `{
}
}
},
"/menu/getBaseMenuById": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"menu"
],
"summary": "根据id获取菜单",
"parameters": [
{
"description": "根据id获取菜单",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.GetById"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/menu/getBaseMenuTree": {
"post": {
"security": [
@@ -589,6 +847,45 @@ var doc = `{
}
}
},
"/menu/updataBaseMen": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"menu"
],
"summary": "更新菜单",
"parameters": [
{
"description": "更新菜单",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/dbModel.BaseMenu"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/user/changePassword": {
"post": {
"security": [
@@ -625,7 +922,7 @@ var doc = `{
}
}
},
"/user/getInfoList": {
"/user/getUserList": {
"post": {
"security": [
{
@@ -664,6 +961,45 @@ var doc = `{
}
}
},
"/user/setUserAuthority": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "设置用户权限",
"parameters": [
{
"description": "设置用户权限",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.SetUserAuth"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/user/uploadHeaderImg": {
"post": {
"security": [
@@ -726,10 +1062,10 @@ var doc = `{
"api.AuthAndPathIn": {
"type": "object",
"properties": {
"apis": {
"apiIds": {
"type": "array",
"items": {
"$ref": "#/definitions/dbModel.Api"
"type": "integer"
}
},
"authorityId": {
@@ -781,14 +1117,6 @@ var doc = `{
}
}
},
"api.DeleteApiParams": {
"type": "object",
"properties": {
"path": {
"type": "integer"
}
}
},
"api.DeleteAuthorityPatams": {
"type": "object",
"properties": {
@@ -797,6 +1125,22 @@ var doc = `{
}
}
},
"api.GetAuthorityId": {
"type": "object",
"properties": {
"authorityId": {
"type": "string"
}
}
},
"api.GetById": {
"type": "object",
"properties": {
"id": {
"type": "number"
}
}
},
"api.IdInfo": {
"type": "object",
"properties": {
@@ -816,12 +1160,26 @@ var doc = `{
}
}
},
"api.SetUserAuth": {
"type": "object",
"properties": {
"authorityId": {
"type": "string"
},
"uuid": {
"type": "string"
}
}
},
"dbModel.Api": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"group": {
"type": "string"
},
"path": {
"type": "string"
}
+377 -19
View File
@@ -73,7 +73,73 @@
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.DeleteApiParams"
"$ref": "#/definitions/dbModel.Api"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/api/getAllApis": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Api"
],
"summary": "获取所有的Api 不分页",
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/api/getApiById": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Api"
],
"summary": "根据id获取api",
"parameters": [
{
"description": "分页获取用户列表",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/modelInterface.PageInfo"
}
}
],
@@ -103,10 +169,10 @@
"tags": [
"Api"
],
"summary": "分页获取角色列表",
"summary": "分页获取API列表",
"parameters": [
{
"description": "分页获取用户列表",
"description": "分页获取API列表",
"name": "data",
"in": "body",
"required": true,
@@ -126,7 +192,7 @@
}
}
},
"/api/setAuthAndPath": {
"/api/setAuthAndApi": {
"post": {
"security": [
{
@@ -165,6 +231,45 @@
}
}
},
"/api/updataApi": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Api"
],
"summary": "创建基础api",
"parameters": [
{
"description": "创建api",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.CreateApiParams"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/authority/createAuthority": {
"post": {
"security": [
@@ -243,6 +348,45 @@
}
}
},
"/authority/getAuthAndApi": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"authority"
],
"summary": "获取本角色所有有权限的apiId",
"parameters": [
{
"description": "获取本角色所有有权限的apiId",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.GetAuthorityId"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/authority/getAuthorityList": {
"post": {
"security": [
@@ -344,6 +488,81 @@
}
}
},
"/fileUploadAndDownload/getFileList": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"FileUploadAndDownload"
],
"summary": "分页文件列表",
"parameters": [
{
"description": "分页获取文件户列表",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/modelInterface.PageInfo"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/fileUploadAndDownload/upload": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"FileUploadAndDownload"
],
"summary": "上传文件示例",
"parameters": [
{
"type": "file",
"description": "上传文件示例",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/menu/addBaseMenu": {
"post": {
"security": [
@@ -360,16 +579,16 @@
"tags": [
"menu"
],
"summary": "分页获取基础menu列表",
"summary": "新增菜单",
"parameters": [
{
"description": "分页获取基础menu列表",
"description": "新增菜单",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/modelInterface.PageInfo"
"$ref": "#/definitions/dbModel.BaseMenu"
}
}
],
@@ -438,7 +657,7 @@
"tags": [
"menu"
],
"summary": "获取指定角色menu",
"summary": "删除菜单",
"parameters": [
{
"description": "删除菜单",
@@ -461,6 +680,45 @@
}
}
},
"/menu/getBaseMenuById": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"menu"
],
"summary": "根据id获取菜单",
"parameters": [
{
"description": "根据id获取菜单",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.GetById"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/menu/getBaseMenuTree": {
"post": {
"security": [
@@ -572,6 +830,45 @@
}
}
},
"/menu/updataBaseMen": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"menu"
],
"summary": "更新菜单",
"parameters": [
{
"description": "更新菜单",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/dbModel.BaseMenu"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/user/changePassword": {
"post": {
"security": [
@@ -608,7 +905,7 @@
}
}
},
"/user/getInfoList": {
"/user/getUserList": {
"post": {
"security": [
{
@@ -647,6 +944,45 @@
}
}
},
"/user/setUserAuthority": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "设置用户权限",
"parameters": [
{
"description": "设置用户权限",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.SetUserAuth"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}",
"schema": {
"type": "string"
}
}
}
}
},
"/user/uploadHeaderImg": {
"post": {
"security": [
@@ -709,10 +1045,10 @@
"api.AuthAndPathIn": {
"type": "object",
"properties": {
"apis": {
"apiIds": {
"type": "array",
"items": {
"$ref": "#/definitions/dbModel.Api"
"type": "integer"
}
},
"authorityId": {
@@ -764,14 +1100,6 @@
}
}
},
"api.DeleteApiParams": {
"type": "object",
"properties": {
"path": {
"type": "integer"
}
}
},
"api.DeleteAuthorityPatams": {
"type": "object",
"properties": {
@@ -780,6 +1108,22 @@
}
}
},
"api.GetAuthorityId": {
"type": "object",
"properties": {
"authorityId": {
"type": "string"
}
}
},
"api.GetById": {
"type": "object",
"properties": {
"id": {
"type": "number"
}
}
},
"api.IdInfo": {
"type": "object",
"properties": {
@@ -799,12 +1143,26 @@
}
}
},
"api.SetUserAuth": {
"type": "object",
"properties": {
"authorityId": {
"type": "string"
},
"uuid": {
"type": "string"
}
}
},
"dbModel.Api": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"group": {
"type": "string"
},
"path": {
"type": "string"
}
+236 -16
View File
@@ -11,9 +11,9 @@ definitions:
type: object
api.AuthAndPathIn:
properties:
apis:
apiIds:
items:
$ref: '#/definitions/dbModel.Api'
type: integer
type: array
authorityId:
type: string
@@ -46,16 +46,21 @@ definitions:
authorityName:
type: string
type: object
api.DeleteApiParams:
properties:
path:
type: integer
type: object
api.DeleteAuthorityPatams:
properties:
authorityId:
type: integer
type: object
api.GetAuthorityId:
properties:
authorityId:
type: string
type: object
api.GetById:
properties:
id:
type: number
type: object
api.IdInfo:
properties:
id:
@@ -68,10 +73,19 @@ definitions:
username:
type: string
type: object
api.SetUserAuth:
properties:
authorityId:
type: string
uuid:
type: string
type: object
dbModel.Api:
properties:
description:
type: string
group:
type: string
path:
type: string
type: object
@@ -146,7 +160,7 @@ paths:
name: data
required: true
schema:
$ref: '#/definitions/api.DeleteApiParams'
$ref: '#/definitions/dbModel.Api'
type: object
produces:
- application/json
@@ -160,7 +174,23 @@ paths:
summary: 删除指定api
tags:
- Api
/api/getApiList:
/api/getAllApis:
post:
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"获取成功"}'
schema:
type: string
security:
- ApiKeyAuth: []
summary: 获取所有的Api 不分页
tags:
- Api
/api/getApiById:
post:
consumes:
- application/json
@@ -181,10 +211,34 @@ paths:
type: string
security:
- ApiKeyAuth: []
summary: 分页获取角色列表
summary: 根据id获取api
tags:
- Api
/api/setAuthAndPath:
/api/getApiList:
post:
consumes:
- application/json
parameters:
- description: 分页获取API列表
in: body
name: data
required: true
schema:
$ref: '#/definitions/modelInterface.PageInfo'
type: object
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"获取成功"}'
schema:
type: string
security:
- ApiKeyAuth: []
summary: 分页获取API列表
tags:
- Api
/api/setAuthAndApi:
post:
consumes:
- application/json
@@ -208,6 +262,30 @@ paths:
summary: 创建api和角色关系
tags:
- Api
/api/updataApi:
post:
consumes:
- application/json
parameters:
- description: 创建api
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.CreateApiParams'
type: object
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"获取成功"}'
schema:
type: string
security:
- ApiKeyAuth: []
summary: 创建基础api
tags:
- Api
/authority/createAuthority:
post:
consumes:
@@ -256,6 +334,30 @@ paths:
summary: 删除角色
tags:
- authority
/authority/getAuthAndApi:
post:
consumes:
- application/json
parameters:
- description: 获取本角色所有有权限的apiId
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.GetAuthorityId'
type: object
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"获取成功"}'
schema:
type: string
security:
- ApiKeyAuth: []
summary: 获取本角色所有有权限的apiId
tags:
- authority
/authority/getAuthorityList:
post:
consumes:
@@ -320,12 +422,12 @@ paths:
summary: 用户注册账号
tags:
- Base
/menu/addBaseMenu:
/fileUploadAndDownload/getFileList:
post:
consumes:
- application/json
parameters:
- description: 分页获取基础menu列表
- description: 分页获取文件户列表
in: body
name: data
required: true
@@ -341,7 +443,53 @@ paths:
type: string
security:
- ApiKeyAuth: []
summary: 分页获取基础menu列表
summary: 分页文件列表
tags:
- FileUploadAndDownload
/fileUploadAndDownload/upload:
post:
consumes:
- multipart/form-data
parameters:
- description: 上传文件示例
in: formData
name: file
required: true
type: file
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"上传成功"}'
schema:
type: string
security:
- ApiKeyAuth: []
summary: 上传文件示例
tags:
- FileUploadAndDownload
/menu/addBaseMenu:
post:
consumes:
- application/json
parameters:
- description: 新增菜单
in: body
name: data
required: true
schema:
$ref: '#/definitions/dbModel.BaseMenu'
type: object
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"获取成功"}'
schema:
type: string
security:
- ApiKeyAuth: []
summary: 新增菜单
tags:
- menu
/menu/addMenuAuthority:
@@ -389,7 +537,31 @@ paths:
type: string
security:
- ApiKeyAuth: []
summary: 获取指定角色menu
summary: 删除菜单
tags:
- menu
/menu/getBaseMenuById:
post:
consumes:
- application/json
parameters:
- description: 根据id获取菜单
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.GetById'
type: object
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"获取成功"}'
schema:
type: string
security:
- ApiKeyAuth: []
summary: 根据id获取菜单
tags:
- menu
/menu/getBaseMenuTree:
@@ -460,6 +632,30 @@ paths:
summary: 分页获取基础menu列表
tags:
- menu
/menu/updataBaseMen:
post:
consumes:
- application/json
parameters:
- description: 更新菜单
in: body
name: data
required: true
schema:
$ref: '#/definitions/dbModel.BaseMenu'
type: object
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"获取成功"}'
schema:
type: string
security:
- ApiKeyAuth: []
summary: 更新菜单
tags:
- menu
/user/changePassword:
post:
parameters:
@@ -482,7 +678,7 @@ paths:
summary: 用户修改密码
tags:
- User
/user/getInfoList:
/user/getUserList:
post:
consumes:
- application/json
@@ -506,6 +702,30 @@ paths:
summary: 分页获取用户列表
tags:
- User
/user/setUserAuthority:
post:
consumes:
- application/json
parameters:
- description: 设置用户权限
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.SetUserAuth'
type: object
produces:
- application/json
responses:
"200":
description: '{"success":true,"data":{},"msg":"修改成功"}'
schema:
type: string
security:
- ApiKeyAuth: []
summary: 设置用户权限
tags:
- User
/user/uploadHeaderImg:
post:
consumes: