提交 23acbedb 作者: 方治民

feat: pont 接口生成适配 json 传参方式

上级 cb22edda
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
"lint-staged": "12.3.7", "lint-staged": "12.3.7",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"pont-engine": "^1.3.3", "pont-engine": "^1.4.0",
"postcss": "^8.4.16", "postcss": "^8.4.16",
"postcss-html": "^1.5.0", "postcss-html": "^1.5.0",
"postcss-less": "^6.0.0", "postcss-less": "^6.0.0",
......
...@@ -67,7 +67,7 @@ specifiers: ...@@ -67,7 +67,7 @@ specifiers:
path-to-regexp: ^6.2.1 path-to-regexp: ^6.2.1
picocolors: ^1.0.0 picocolors: ^1.0.0
pinia: ^2.0.21 pinia: ^2.0.21
pont-engine: ^1.3.3 pont-engine: ^1.4.0
postcss: ^8.4.16 postcss: ^8.4.16
postcss-html: ^1.5.0 postcss-html: ^1.5.0
postcss-less: ^6.0.0 postcss-less: ^6.0.0
...@@ -198,7 +198,7 @@ devDependencies: ...@@ -198,7 +198,7 @@ devDependencies:
lint-staged: 12.3.7 lint-staged: 12.3.7
npm-run-all: 4.1.5 npm-run-all: 4.1.5
picocolors: 1.0.0 picocolors: 1.0.0
pont-engine: 1.3.3 pont-engine: 1.4.0
postcss: 8.4.16 postcss: 8.4.16
postcss-html: 1.5.0 postcss-html: 1.5.0
postcss-less: 6.0.0_postcss@8.4.16 postcss-less: 6.0.0_postcss@8.4.16
...@@ -5436,7 +5436,7 @@ packages: ...@@ -5436,7 +5436,7 @@ packages:
source-map: 0.6.1 source-map: 0.6.1
wordwrap: 1.0.0 wordwrap: 1.0.0
optionalDependencies: optionalDependencies:
uglify-js: 3.17.0 uglify-js: 3.17.3
dev: true dev: true
/hard-rejection/2.1.0: /hard-rejection/2.1.0:
...@@ -7142,8 +7142,8 @@ packages: ...@@ -7142,8 +7142,8 @@ packages:
engines: {node: '>=10.13.0'} engines: {node: '>=10.13.0'}
dev: false dev: false
/pont-engine/1.3.3: /pont-engine/1.4.0:
resolution: {integrity: sha512-JvN32pu25vrc/cw8/hkgNXNIJS+sxTZ9+7ZXZnvpsLdujmlTD7V67ka1Ak37BeylKTNb1sWdRrg4bSQXDqaB3Q==} resolution: {integrity: sha512-PwitNXZpTXcsGn04wEYIy6pLArVVOkMNBVztSVTgX1ixlE0p76IA7CvGKlKxGRU3Fl6CBFvkI7RCGSvbfSb89g==}
hasBin: true hasBin: true
dependencies: dependencies:
chalk: 2.4.2 chalk: 2.4.2
...@@ -8661,8 +8661,8 @@ packages: ...@@ -8661,8 +8661,8 @@ packages:
resolution: {integrity: sha512-e4+UtA5IRO+ha6hYklwj6r7BjiGMxS0O+UaSg9HbaTefg4kMkzj4tXzEBajRR+wkxf+golgAWKzLbytCUDMJAA==} resolution: {integrity: sha512-e4+UtA5IRO+ha6hYklwj6r7BjiGMxS0O+UaSg9HbaTefg4kMkzj4tXzEBajRR+wkxf+golgAWKzLbytCUDMJAA==}
dev: true dev: true
/uglify-js/3.17.0: /uglify-js/3.17.3:
resolution: {integrity: sha512-aTeNPVmgIMPpm1cxXr2Q/nEbvkmV8yq66F3om7X3P/cvOXQ0TMQ64Wk63iyT1gPlmdmGzjGpyLh1f3y8MZWXGg==} resolution: {integrity: sha512-JmMFDME3iufZnBpyKL+uS78LRiC+mK55zWfM5f/pWBJfpOttXAqYfdDGRukYhJuyRinvPVAtUhvy7rlDybNtFg==}
engines: {node: '>=0.8.0'} engines: {node: '>=0.8.0'}
hasBin: true hasBin: true
requiresBuild: true requiresBuild: true
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"originType": "SwaggerV2", "originType": "SwaggerV2",
"originUrl": "http://127.0.0.1:8081/api/v2/api-docs", "originUrl": "http://127.0.0.1:8081/api/v2/api-docs",
"templateType": "fetch", "templateType": "fetch",
"templatePath": "./pont.template", "templatePath": "./pont-template",
"transformPath": "./pont.transform", "transformPath": "./pont-transform",
"outDir": "./src/api/services", "outDir": "./src/api/services",
"surrounding": "typeScript", "surrounding": "typeScript",
"mocks": { "mocks": {
......
...@@ -12,19 +12,44 @@ export class FileStructures extends Pont.FileStructures { ...@@ -12,19 +12,44 @@ export class FileStructures extends Pont.FileStructures {
} }
export default class BasicGenerator extends CodeGenerator { export default class BasicGenerator extends CodeGenerator {
checkJsonParam(inter: Interface, paramsCode: string): boolean {
const prettier = require('prettier')
const requestParams = inter.getRequestParams(this.surrounding)
const code = prettier.format(paramsCode, { parser: 'typescript' })
return code.includes('{}') && requestParams.includes('body')
}
// 认为没有返回值的接口表示下载(通常是)
isDownload(inter: Interface): boolean {
return inter.responseType === 'any'
}
// 认为包含 form 参数的接口表示带有上传功能
isUpload(inter: Interface): boolean {
return inter.getRequestParams(this.surrounding).includes('form')
}
getParams(inter: Interface, paramsCode: string) { getParams(inter: Interface, paramsCode: string) {
let requestParams = inter.getRequestParams(this.surrounding) let requestParams = inter.getRequestParams(this.surrounding)
let bodyTypeDef = ''
const prettier = require('prettier') const prettier = require('prettier')
if (prettier.format(paramsCode, { parser: 'typescript' }).includes('{}')) { if (prettier.format(paramsCode, { parser: 'typescript' }).includes('{}')) {
if (!requestParams.includes('form')) { if (!requestParams.includes('form')) {
requestParams = requestParams.replace('params', 'params?') requestParams = requestParams.replace('params', 'params?')
} }
if (requestParams.includes('body')) {
requestParams = requestParams.replace('params?: Params, ', '')
bodyTypeDef = requestParams.replace(/^.*body: (.*),.*$/gi, '$1')
}
} }
return `${requestParams.replace( return `${requestParams.replace(
'options?: any', 'options?: any',
`config?: http.RequestConfig<Params${requestParams.includes('form') ? ' | FormData' : ''}>`, `config?: http.RequestConfig<${
bodyTypeDef ? bodyTypeDef : `Params${requestParams.includes('form') ? ' | FormData' : ''}`
}>`,
)}, options?: http.RequestOptions` )}, options?: http.RequestOptions`
} }
...@@ -64,7 +89,12 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -64,7 +89,12 @@ export default class BasicGenerator extends CodeGenerator {
const paramsCode = inter.getParamsCode('Params', this.surrounding) const paramsCode = inter.getParamsCode('Params', this.surrounding)
const requestParams = this.getParams(inter, paramsCode) const requestParams = this.getParams(inter, paramsCode)
const undef = inter.response.getInitialValue() === 'undefined' const undef = inter.response.getInitialValue() === 'undefined'
const isBody = this.checkJsonParam(inter, paramsCode)
// TODO
// 扩展 hooks mode
// 采用 vue-request 或 @tanstack/vue-query
// export function useRequest()
return ` return `
/** /**
* @desc ${inter.description} * @desc ${inter.description}
...@@ -73,7 +103,7 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -73,7 +103,7 @@ export default class BasicGenerator extends CodeGenerator {
${undef ? '' : `import * as defs from '../../baseClass';`} ${undef ? '' : `import * as defs from '../../baseClass';`}
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export ${paramsCode} ${isBody ? '' : `export ${paramsCode}`}
${undef ? '' : `export const init = ${inter.response.getInitialValue(true)};`} ${undef ? '' : `export const init = ${inter.response.getInitialValue(true)};`}
...@@ -84,11 +114,13 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -84,11 +114,13 @@ export default class BasicGenerator extends CodeGenerator {
${ ${
method === 'GET' method === 'GET'
? 'params' ? 'params'
: `data: ${requestParams.includes('form') ? 'form || params' : 'params'}` : `data: ${requestParams.includes('form') ? 'form || params' : isBody ? 'body' : 'params'}`
}, },
${ ${
requestParams.includes('form') requestParams.includes('form')
? `headers: { 'Content-Type': 'multipart/form-data;charset=UTF-8' },` ? `headers: { 'Content-Type': 'multipart/form-data;charset=UTF-8' },`
: isBody
? `headers: { 'Content-Type': 'application/json' },`
: '' : ''
} }
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
"description": "身份认证", "description": "身份认证",
"interfaces": [ "interfaces": [
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "登录", "description": "登录",
"name": "login", "name": "login",
"method": "post", "method": "post",
...@@ -89,7 +91,9 @@ ...@@ -89,7 +91,9 @@
"parameters": [] "parameters": []
}, },
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "注册", "description": "注册",
"name": "register", "name": "register",
"method": "post", "method": "post",
...@@ -235,6 +239,32 @@ ...@@ -235,6 +239,32 @@
} }
} }
] ]
},
{
"description": "检查登录状态",
"name": "valid",
"method": "get",
"path": "/api/auth/valid",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "boolean",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
} }
], ],
"name": "auth" "name": "auth"
...@@ -243,7 +273,7 @@ ...@@ -243,7 +273,7 @@
"description": "示例", "description": "示例",
"interfaces": [ "interfaces": [
{ {
"description": "hello", "description": "Hello World",
"name": "hello", "name": "hello",
"method": "get", "method": "get",
"path": "/api/example/", "path": "/api/example/",
...@@ -269,7 +299,7 @@ ...@@ -269,7 +299,7 @@
"parameters": [] "parameters": []
}, },
{ {
"description": "download", "description": "文件下载",
"name": "download", "name": "download",
"method": "get", "method": "get",
"path": "/api/example/download", "path": "/api/example/download",
...@@ -285,7 +315,7 @@ ...@@ -285,7 +315,7 @@
"parameters": [] "parameters": []
}, },
{ {
"description": "fail", "description": "测试失败",
"name": "fail", "name": "fail",
"method": "get", "method": "get",
"path": "/api/example/fail", "path": "/api/example/fail",
...@@ -311,7 +341,88 @@ ...@@ -311,7 +341,88 @@
"parameters": [] "parameters": []
}, },
{ {
"description": "page", "description": "查询用户属性",
"name": "findUserExtensionInfo",
"method": "get",
"path": "/api/example/findUserExtensionInfo",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "UserExtensionVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"consumes": [
"application/json"
],
"description": "JSON 传参",
"name": "json",
"method": "post",
"path": "/api/example/json",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "PageVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "body",
"description": "param",
"name": "param",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "PageParam",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"description": "分页条件查询",
"name": "page", "name": "page",
"method": "get", "method": "get",
"path": "/api/example/page", "path": "/api/example/page",
...@@ -401,20 +512,42 @@ ...@@ -401,20 +512,42 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'ASC'", "'DESC'"], "enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": [] "typeProperties": []
} }
} }
] ]
}
],
"name": "example"
}, },
{ {
"description": "测试 MyBatis Plus 查询", "description": "文件管理",
"name": "test", "interfaces": [
{
"description": "文件下载",
"name": "download",
"method": "get", "method": "get",
"path": "/api/example/test", "path": "/api/common/file/download",
"response": { "response": {
"typeArgs": [ "typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{ {
"in": "query",
"description": "bucket",
"name": "bucket",
"required": true,
"dataType": {
"typeArgs": [], "typeArgs": [],
"typeName": "string", "typeName": "string",
"isDefsType": false, "isDefsType": false,
...@@ -423,24 +556,28 @@ ...@@ -423,24 +556,28 @@
"enum": [], "enum": [],
"typeProperties": [] "typeProperties": []
} }
], },
"typeName": "Result", {
"isDefsType": true, "in": "query",
"description": "object",
"name": "object",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": [], "enum": [],
"typeProperties": [] "typeProperties": []
},
"parameters": []
} }
], }
"name": "example" ]
}, },
{ {
"description": "文件管理", "consumes": [
"interfaces": [ "multipart/form-data"
{ ],
"consumes": ["multipart/form-data"],
"description": "文件上传", "description": "文件上传",
"name": "upload", "name": "upload",
"method": "post", "method": "post",
...@@ -481,6 +618,51 @@ ...@@ -481,6 +618,51 @@
} }
} }
] ]
},
{
"consumes": [
"application/json"
],
"description": "Base64 图片上传",
"name": "uploadBase64Image",
"method": "post",
"path": "/api/common/file/uploadBase64Image",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "Base64 图片信息",
"name": "base64Image",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
} }
], ],
"name": "file" "name": "file"
...@@ -489,11 +671,13 @@ ...@@ -489,11 +671,13 @@
"description": "权限管理", "description": "权限管理",
"interfaces": [ "interfaces": [
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "新增", "description": "新增",
"name": "add", "name": "add",
"method": "post", "method": "post",
"path": "/api/manage/permission/add", "path": "/api/sys/permission/add",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -675,7 +859,11 @@ ...@@ -675,7 +859,11 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'DIR'", "'MENU'", "'BUTTON'"], "enum": [
"'DIR'",
"'MENU'",
"'BUTTON'"
],
"typeProperties": [] "typeProperties": []
} }
}, },
...@@ -697,11 +885,13 @@ ...@@ -697,11 +885,13 @@
] ]
}, },
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "删除", "description": "删除",
"name": "deleted", "name": "deleted",
"method": "post", "method": "post",
"path": "/api/manage/permission/deleted", "path": "/api/sys/permission/deleted",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -743,7 +933,7 @@ ...@@ -743,7 +933,7 @@
"description": "查询", "description": "查询",
"name": "find", "name": "find",
"method": "get", "method": "get",
"path": "/api/manage/permission/find", "path": "/api/sys/permission/find",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -782,11 +972,13 @@ ...@@ -782,11 +972,13 @@
] ]
}, },
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "修改", "description": "修改",
"name": "modify", "name": "modify",
"method": "post", "method": "post",
"path": "/api/manage/permission/modify", "path": "/api/sys/permission/modify",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -983,7 +1175,11 @@ ...@@ -983,7 +1175,11 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'DIR'", "'MENU'", "'BUTTON'"], "enum": [
"'DIR'",
"'MENU'",
"'BUTTON'"
],
"typeProperties": [] "typeProperties": []
} }
}, },
...@@ -1008,7 +1204,7 @@ ...@@ -1008,7 +1204,7 @@
"description": "分页查询", "description": "分页查询",
"name": "page", "name": "page",
"method": "get", "method": "get",
"path": "/api/manage/permission/page", "path": "/api/sys/permission/page",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1095,18 +1291,20 @@ ...@@ -1095,18 +1291,20 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'ASC'", "'DESC'"], "enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": [] "typeProperties": []
} }
} }
] ]
}, },
{ {
"consumes": ["application/x-www-form-urlencoded"],
"description": "树结构查询", "description": "树结构查询",
"name": "tree", "name": "tree",
"method": "get", "method": "get",
"path": "/api/manage/permission/tree", "path": "/api/sys/permission/tree",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1141,7 +1339,7 @@ ...@@ -1141,7 +1339,7 @@
"in": "query", "in": "query",
"description": "pid", "description": "pid",
"name": "pid", "name": "pid",
"required": true, "required": false,
"dataType": { "dataType": {
"typeArgs": [], "typeArgs": [],
"typeName": "string", "typeName": "string",
...@@ -1161,11 +1359,13 @@ ...@@ -1161,11 +1359,13 @@
"description": "角色管理", "description": "角色管理",
"interfaces": [ "interfaces": [
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "新增", "description": "新增",
"name": "add", "name": "add",
"method": "post", "method": "post",
"path": "/api/manage/role/add", "path": "/api/sys/role/add",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1219,11 +1419,13 @@ ...@@ -1219,11 +1419,13 @@
] ]
}, },
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "分配权限", "description": "分配权限",
"name": "assign", "name": "assign",
"method": "post", "method": "post",
"path": "/api/manage/role/assign", "path": "/api/sys/role/assign",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1277,11 +1479,13 @@ ...@@ -1277,11 +1479,13 @@
] ]
}, },
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "删除", "description": "删除",
"name": "deleted", "name": "deleted",
"method": "post", "method": "post",
"path": "/api/manage/role/deleted", "path": "/api/sys/role/deleted",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1304,8 +1508,8 @@ ...@@ -1304,8 +1508,8 @@
"parameters": [ "parameters": [
{ {
"in": "query", "in": "query",
"description": "id", "description": "ids 多个以逗号分割",
"name": "id", "name": "ids",
"required": true, "required": true,
"dataType": { "dataType": {
"typeArgs": [], "typeArgs": [],
...@@ -1323,7 +1527,7 @@ ...@@ -1323,7 +1527,7 @@
"description": "查询", "description": "查询",
"name": "find", "name": "find",
"method": "get", "method": "get",
"path": "/api/manage/role/find", "path": "/api/sys/role/find",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1362,11 +1566,13 @@ ...@@ -1362,11 +1566,13 @@
] ]
}, },
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "修改", "description": "修改",
"name": "modify", "name": "modify",
"method": "post", "method": "post",
"path": "/api/manage/role/modify", "path": "/api/sys/role/modify",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1438,7 +1644,7 @@ ...@@ -1438,7 +1644,7 @@
"description": "分页查询", "description": "分页查询",
"name": "page", "name": "page",
"method": "get", "method": "get",
"path": "/api/manage/role/page", "path": "/api/sys/role/page",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1525,7 +1731,10 @@ ...@@ -1525,7 +1731,10 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'ASC'", "'DESC'"], "enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": [] "typeProperties": []
} }
} }
...@@ -1535,7 +1744,7 @@ ...@@ -1535,7 +1744,7 @@
"description": "选项查询", "description": "选项查询",
"name": "selector", "name": "selector",
"method": "get", "method": "get",
"path": "/api/manage/role/selector", "path": "/api/sys/role/selector",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1574,109 +1783,13 @@ ...@@ -1574,109 +1783,13 @@
"description": "用户管理", "description": "用户管理",
"interfaces": [ "interfaces": [
{ {
"description": "获取用户菜单", "consumes": [
"name": "getMenuList", "application/json"
"method": "get",
"path": "/api/user/getMenuList",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "MenuVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"description": "获取用户权限",
"name": "getPermCode",
"method": "get",
"path": "/api/user/getPermCode",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
], ],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"description": "获取登录用户信息",
"name": "getUserInfo",
"method": "get",
"path": "/api/user/getUserInfo",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "UserInfo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"consumes": ["application/json"],
"description": "分配角色", "description": "分配角色",
"name": "assign", "name": "assign",
"method": "post", "method": "post",
"path": "/api/user/manage/assign", "path": "/api/sys/user/assign",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1733,7 +1846,7 @@ ...@@ -1733,7 +1846,7 @@
"description": "分页查询", "description": "分页查询",
"name": "page", "name": "page",
"method": "get", "method": "get",
"path": "/api/user/manage/page", "path": "/api/sys/user/page",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1820,7 +1933,10 @@ ...@@ -1820,7 +1933,10 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'ASC'", "'DESC'"], "enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": [] "typeProperties": []
} }
} }
...@@ -1828,6 +1944,110 @@ ...@@ -1828,6 +1944,110 @@
} }
], ],
"name": "user" "name": "user"
},
{
"description": "用户信息",
"interfaces": [
{
"description": "获取用户菜单",
"name": "getMenuList",
"method": "get",
"path": "/api/user/getMenuList",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "MenuVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"description": "获取用户权限",
"name": "getPermCode",
"method": "get",
"path": "/api/user/getPermCode",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"description": "获取登录用户信息",
"name": "getUserInfo",
"method": "get",
"path": "/api/user/getUserInfo",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "UserInfo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
}
],
"name": "userView"
} }
], ],
"baseClasses": [ "baseClasses": [
...@@ -1985,6 +2205,72 @@ ...@@ -1985,6 +2205,72 @@
"templateArgs": [] "templateArgs": []
}, },
{ {
"description": "公共的分页排序查询参数",
"name": "PageParam",
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "pageNo",
"description": "当前页数",
"required": true
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "pageSize",
"description": "分页条数",
"required": true
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "sortField",
"description": "排序字段",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": []
},
"name": "sortOrder",
"description": "排序方向(ASC|DESC)",
"required": false
}
],
"templateArgs": []
},
{
"description": "公共分页查询响应输出", "description": "公共分页查询响应输出",
"name": "PageVo", "name": "PageVo",
"properties": [ "properties": [
...@@ -2246,7 +2532,11 @@ ...@@ -2246,7 +2532,11 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'DIR'", "'MENU'", "'BUTTON'"], "enum": [
"'DIR'",
"'MENU'",
"'BUTTON'"
],
"typeProperties": [] "typeProperties": []
}, },
"name": "type", "name": "type",
...@@ -2471,6 +2761,40 @@ ...@@ -2471,6 +2761,40 @@
"templateArgs": [] "templateArgs": []
}, },
{ {
"name": "UserExtensionVo",
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "age",
"description": "年龄",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "gender",
"description": "性别",
"required": false
}
],
"templateArgs": []
},
{
"name": "UserInfo", "name": "UserInfo",
"properties": [ "properties": [
{ {
...@@ -2525,6 +2849,20 @@ ...@@ -2525,6 +2849,20 @@
"enum": [], "enum": [],
"typeProperties": [] "typeProperties": []
}, },
"name": "mobile",
"description": "手机号",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "realName", "name": "realName",
"description": "真实姓名", "description": "真实姓名",
"required": false "required": false
......
...@@ -31,6 +31,20 @@ declare namespace defs { ...@@ -31,6 +31,20 @@ declare namespace defs {
redirect?: string redirect?: string
} }
export class PageParam {
/** 当前页数 */
pageNo?: number
/** 分页条数 */
pageSize?: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export class PageVo<T0 = any> { export class PageVo<T0 = any> {
/** 数据 */ /** 数据 */
data?: Array<T0> data?: Array<T0>
...@@ -123,6 +137,14 @@ declare namespace defs { ...@@ -123,6 +137,14 @@ declare namespace defs {
uid?: string uid?: string
} }
export class UserExtensionVo {
/** 年龄 */
age?: number
/** 性别 */
gender?: number
}
export class UserInfo { export class UserInfo {
/** 头像 */ /** 头像 */
avatar?: string avatar?: string
...@@ -133,6 +155,9 @@ declare namespace defs { ...@@ -133,6 +155,9 @@ declare namespace defs {
/** 用户主页 */ /** 用户主页 */
homePath?: string homePath?: string
/** 手机号 */
mobile?: string
/** 真实姓名 */ /** 真实姓名 */
realName?: string realName?: string
...@@ -265,6 +290,24 @@ namespace API { ...@@ -265,6 +290,24 @@ namespace API {
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
/**
* 检查登录状态
* /api/auth/valid
*/
export namespace valid {
export class Params {}
export type Response = boolean
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
} }
/** /**
...@@ -272,7 +315,7 @@ namespace API { ...@@ -272,7 +315,7 @@ namespace API {
*/ */
export namespace example { export namespace example {
/** /**
* hello * Hello World
* /api/example/ * /api/example/
*/ */
export namespace hello { export namespace hello {
...@@ -290,7 +333,7 @@ namespace API { ...@@ -290,7 +333,7 @@ namespace API {
} }
/** /**
* download * 文件下载
* /api/example/download * /api/example/download
*/ */
export namespace download { export namespace download {
...@@ -308,7 +351,7 @@ namespace API { ...@@ -308,7 +351,7 @@ namespace API {
} }
/** /**
* fail * 测试失败
* /api/example/fail * /api/example/fail
*/ */
export namespace fail { export namespace fail {
...@@ -326,7 +369,43 @@ namespace API { ...@@ -326,7 +369,43 @@ namespace API {
} }
/** /**
* page * 查询用户属性
* /api/example/findUserExtensionInfo
*/
export namespace findUserExtensionInfo {
export class Params {}
export type Response = defs.UserExtensionVo
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* JSON 传参
* /api/example/json
*/
export namespace json {
export class Params {}
export type Response = defs.PageVo<string>
export const init: Response
export function request(
body: defs.PageParam,
config?: http.RequestConfig<defs.PageParam>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 分页条件查询
* /api/example/page * /api/example/page
*/ */
export namespace page { export namespace page {
...@@ -351,31 +430,36 @@ namespace API { ...@@ -351,31 +430,36 @@ namespace API {
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
}
/** /**
* 测试 MyBatis Plus 查询 * 文件管理
* /api/example/test
*/ */
export namespace test { export namespace file {
export class Params {} /**
* 文件下载
* /api/common/file/download
*/
export namespace download {
export class Params {
/** bucket */
bucket: string
/** object */
object: string
}
export type Response = string export type Response = any
export const init: Response export const init: Response
export function request( export function request(
params?: Params, params: Params,
config?: http.RequestConfig<Params>, config?: http.RequestConfig<Params>,
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
}
/** /**
* 文件管理
*/
export namespace file {
/**
* 文件上传 * 文件上传
* /api/common/file/upload * /api/common/file/upload
*/ */
...@@ -393,6 +477,27 @@ namespace API { ...@@ -393,6 +477,27 @@ namespace API {
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
/**
* Base64 图片上传
* /api/common/file/uploadBase64Image
*/
export namespace uploadBase64Image {
export class Params {
/** Base64 图片信息 */
base64Image: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
} }
/** /**
...@@ -401,7 +506,7 @@ namespace API { ...@@ -401,7 +506,7 @@ namespace API {
export namespace permission { export namespace permission {
/** /**
* 新增 * 新增
* /api/manage/permission/add * /api/sys/permission/add
*/ */
export namespace add { export namespace add {
export class Params { export class Params {
...@@ -444,7 +549,7 @@ namespace API { ...@@ -444,7 +549,7 @@ namespace API {
/** /**
* 删除 * 删除
* /api/manage/permission/deleted * /api/sys/permission/deleted
*/ */
export namespace deleted { export namespace deleted {
export class Params { export class Params {
...@@ -465,7 +570,7 @@ namespace API { ...@@ -465,7 +570,7 @@ namespace API {
/** /**
* 查询 * 查询
* /api/manage/permission/find * /api/sys/permission/find
*/ */
export namespace find { export namespace find {
export class Params { export class Params {
...@@ -486,7 +591,7 @@ namespace API { ...@@ -486,7 +591,7 @@ namespace API {
/** /**
* 修改 * 修改
* /api/manage/permission/modify * /api/sys/permission/modify
*/ */
export namespace modify { export namespace modify {
export class Params { export class Params {
...@@ -531,7 +636,7 @@ namespace API { ...@@ -531,7 +636,7 @@ namespace API {
/** /**
* 分页查询 * 分页查询
* /api/manage/permission/page * /api/sys/permission/page
*/ */
export namespace page { export namespace page {
export class Params { export class Params {
...@@ -558,12 +663,12 @@ namespace API { ...@@ -558,12 +663,12 @@ namespace API {
/** /**
* 树结构查询 * 树结构查询
* /api/manage/permission/tree * /api/sys/permission/tree
*/ */
export namespace tree { export namespace tree {
export class Params { export class Params {
/** pid */ /** pid */
pid: string pid?: string
} }
export type Response = Array<defs.PermissionVo> export type Response = Array<defs.PermissionVo>
...@@ -584,7 +689,7 @@ namespace API { ...@@ -584,7 +689,7 @@ namespace API {
export namespace role { export namespace role {
/** /**
* 新增 * 新增
* /api/manage/role/add * /api/sys/role/add
*/ */
export namespace add { export namespace add {
export class Params { export class Params {
...@@ -607,7 +712,7 @@ namespace API { ...@@ -607,7 +712,7 @@ namespace API {
/** /**
* 分配权限 * 分配权限
* /api/manage/role/assign * /api/sys/role/assign
*/ */
export namespace assign { export namespace assign {
export class Params { export class Params {
...@@ -630,12 +735,12 @@ namespace API { ...@@ -630,12 +735,12 @@ namespace API {
/** /**
* 删除 * 删除
* /api/manage/role/deleted * /api/sys/role/deleted
*/ */
export namespace deleted { export namespace deleted {
export class Params { export class Params {
/** id */ /** ids 多个以逗号分割 */
id: string ids: string
} }
export type Response = string export type Response = string
...@@ -651,7 +756,7 @@ namespace API { ...@@ -651,7 +756,7 @@ namespace API {
/** /**
* 查询 * 查询
* /api/manage/role/find * /api/sys/role/find
*/ */
export namespace find { export namespace find {
export class Params { export class Params {
...@@ -672,7 +777,7 @@ namespace API { ...@@ -672,7 +777,7 @@ namespace API {
/** /**
* 修改 * 修改
* /api/manage/role/modify * /api/sys/role/modify
*/ */
export namespace modify { export namespace modify {
export class Params { export class Params {
...@@ -697,7 +802,7 @@ namespace API { ...@@ -697,7 +802,7 @@ namespace API {
/** /**
* 分页查询 * 分页查询
* /api/manage/role/page * /api/sys/role/page
*/ */
export namespace page { export namespace page {
export class Params { export class Params {
...@@ -724,7 +829,7 @@ namespace API { ...@@ -724,7 +829,7 @@ namespace API {
/** /**
* 选项查询 * 选项查询
* /api/manage/role/selector * /api/sys/role/selector
*/ */
export namespace selector { export namespace selector {
export class Params {} export class Params {}
...@@ -746,49 +851,68 @@ namespace API { ...@@ -746,49 +851,68 @@ namespace API {
*/ */
export namespace user { export namespace user {
/** /**
* 获取用户菜单 * 分配角色
* /api/user/getMenuList * /api/sys/user/assign
*/ */
export namespace getMenuList { export namespace assign {
export class Params {} export class Params {
/** id */
id: string
/** ids 多个以逗号分割 */
ids: string
}
export type Response = Array<defs.MenuVo> export type Response = string
export const init: Response export const init: Response
export function request( export function request(
params?: Params, params: Params,
config?: http.RequestConfig<Params>, config?: http.RequestConfig<Params>,
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
/** /**
* 获取用户权限 * 分页查询
* /api/user/getPermCode * /api/sys/user/page
*/ */
export namespace getPermCode { export namespace page {
export class Params {} export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export type Response = Array<string> export type Response = defs.PageVo<defs.UserVo>
export const init: Response export const init: Response
export function request( export function request(
params?: Params, params: Params,
config?: http.RequestConfig<Params>, config?: http.RequestConfig<Params>,
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
}
/** /**
* 获取登录用户信息 * 用户信息
* /api/user/getUserInfo
*/ */
export namespace getUserInfo { export namespace userView {
/**
* 获取用户菜单
* /api/user/getMenuList
*/
export namespace getMenuList {
export class Params {} export class Params {}
export type Response = defs.UserInfo export type Response = Array<defs.MenuVo>
export const init: Response export const init: Response
...@@ -800,50 +924,36 @@ namespace API { ...@@ -800,50 +924,36 @@ namespace API {
} }
/** /**
* 分配角色 * 获取用户权限
* /api/user/manage/assign * /api/user/getPermCode
*/ */
export namespace assign { export namespace getPermCode {
export class Params { export class Params {}
/** id */
id: string
/** ids 多个以逗号分割 */
ids: string
}
export type Response = string export type Response = Array<string>
export const init: Response export const init: Response
export function request( export function request(
params: Params, params?: Params,
config?: http.RequestConfig<Params>, config?: http.RequestConfig<Params>,
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
/** /**
* 分页查询 * 获取登录用户信息
* /api/user/manage/page * /api/user/getUserInfo
*/ */
export namespace page { export namespace getUserInfo {
export class Params { export class Params {}
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export type Response = defs.PageVo<defs.UserVo> export type Response = defs.UserInfo
export const init: Response export const init: Response
export function request( export function request(
params: Params, params?: Params,
config?: http.RequestConfig<Params>, config?: http.RequestConfig<Params>,
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
......
...@@ -26,6 +26,20 @@ export class MenuVo { ...@@ -26,6 +26,20 @@ export class MenuVo {
redirect = '' redirect = ''
} }
export class PageParam {
/** 当前页数 */
pageNo = undefined
/** 分页条数 */
pageSize = undefined
/** 排序字段 */
sortField = ''
/** 排序方向(ASC|DESC) */
sortOrder = 'ASC'
}
export class PageVo { export class PageVo {
/** 数据 */ /** 数据 */
data = [] data = []
...@@ -118,6 +132,14 @@ export class RoleVo { ...@@ -118,6 +132,14 @@ export class RoleVo {
uid = '' uid = ''
} }
export class UserExtensionVo {
/** 年龄 */
age = undefined
/** 性别 */
gender = undefined
}
export class UserInfo { export class UserInfo {
/** 头像 */ /** 头像 */
avatar = '' avatar = ''
...@@ -128,6 +150,9 @@ export class UserInfo { ...@@ -128,6 +150,9 @@ export class UserInfo {
/** 用户主页 */ /** 用户主页 */
homePath = '' homePath = ''
/** 手机号 */
mobile = ''
/** 真实姓名 */ /** 真实姓名 */
realName = '' realName = ''
......
...@@ -4,5 +4,6 @@ ...@@ -4,5 +4,6 @@
import * as login from './login' import * as login from './login'
import * as logout from './logout' import * as logout from './logout'
import * as register from './register' import * as register from './register'
import * as valid from './valid'
export { login, logout, register } export { login, logout, register, valid }
/** /**
* @desc 测试 MyBatis Plus 查询 * @desc 检查登录状态
*/ */
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
...@@ -12,7 +12,7 @@ export const init = new defs.Result() ...@@ -12,7 +12,7 @@ export const init = new defs.Result()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/example/test', url: '/auth/valid',
method: 'GET', method: 'GET',
params, params,
......
/** /**
* @desc download * @desc 文件下载
*/ */
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
......
/** /**
* @desc fail * @desc 测试失败
*/ */
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
......
/**
* @desc 查询用户属性
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/example/findUserExtensionInfo',
method: 'GET',
params,
...config,
},
options,
)
}
/** /**
* @desc hello * @desc Hello World
*/ */
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
import * as hello from './hello' import * as hello from './hello'
import * as download from './download' import * as download from './download'
import * as fail from './fail' import * as fail from './fail'
import * as findUserExtensionInfo from './findUserExtensionInfo'
import * as json from './json'
import * as page from './page' import * as page from './page'
import * as test from './test'
export { hello, download, fail, page, test } export { hello, download, fail, findUserExtensionInfo, json, page }
/**
* @desc JSON 传参
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export const init = new defs.Result()
export function request(
body: defs.PageParam,
config?: http.RequestConfig<defs.PageParam>,
options?: http.RequestOptions,
) {
return defHttp.request(
{
url: '/example/json',
method: 'POST',
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
options,
)
}
/** /**
* @desc page * @desc 分页条件查询
*/ */
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
......
/**
* @desc 文件下载
*/
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** bucket */
bucket: string
/** object */
object: string
}
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/common/file/download',
method: 'GET',
params,
...config,
},
options,
)
}
/** /**
* @description 文件管理 * @description 文件管理
*/ */
import * as download from './download'
import * as upload from './upload' import * as upload from './upload'
import * as uploadBase64Image from './uploadBase64Image'
export { upload } export { download, upload, uploadBase64Image }
/**
* @desc Base64 图片上传
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** Base64 图片信息 */
base64Image: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/common/file/uploadBase64Image',
method: 'POST',
data: params,
...config,
},
options,
)
}
...@@ -4,6 +4,7 @@ import * as file from './file' ...@@ -4,6 +4,7 @@ import * as file from './file'
import * as permission from './permission' import * as permission from './permission'
import * as role from './role' import * as role from './role'
import * as user from './user' import * as user from './user'
import * as userView from './userView'
export const API = { export const API = {
auth, auth,
...@@ -12,4 +13,5 @@ export const API = { ...@@ -12,4 +13,5 @@ export const API = {
permission, permission,
role, role,
user, user,
userView,
} }
...@@ -37,7 +37,7 @@ export const init = new defs.Result() ...@@ -37,7 +37,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/permission/add', url: '/sys/permission/add',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -15,7 +15,7 @@ export const init = new defs.Result() ...@@ -15,7 +15,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/permission/deleted', url: '/sys/permission/deleted',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -15,7 +15,7 @@ export const init = new defs.Result() ...@@ -15,7 +15,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/permission/find', url: '/sys/permission/find',
method: 'GET', method: 'GET',
params, params,
......
...@@ -39,7 +39,7 @@ export const init = new defs.Result() ...@@ -39,7 +39,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/permission/modify', url: '/sys/permission/modify',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -21,7 +21,7 @@ export const init = new defs.Result() ...@@ -21,7 +21,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/permission/page', url: '/sys/permission/page',
method: 'GET', method: 'GET',
params, params,
......
...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params { export class Params {
/** pid */ /** pid */
pid: string pid?: string
} }
export const init = new defs.Result() export const init = new defs.Result()
...@@ -15,7 +15,7 @@ export const init = new defs.Result() ...@@ -15,7 +15,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/permission/tree', url: '/sys/permission/tree',
method: 'GET', method: 'GET',
params, params,
......
...@@ -17,7 +17,7 @@ export const init = new defs.Result() ...@@ -17,7 +17,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/add', url: '/sys/role/add',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -17,7 +17,7 @@ export const init = new defs.Result() ...@@ -17,7 +17,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/assign', url: '/sys/role/assign',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -6,8 +6,8 @@ import * as defs from '../../baseClass' ...@@ -6,8 +6,8 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export class Params { export class Params {
/** id */ /** ids 多个以逗号分割 */
id: string ids: string
} }
export const init = new defs.Result() export const init = new defs.Result()
...@@ -15,7 +15,7 @@ export const init = new defs.Result() ...@@ -15,7 +15,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/deleted', url: '/sys/role/deleted',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -15,7 +15,7 @@ export const init = new defs.Result() ...@@ -15,7 +15,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/find', url: '/sys/role/find',
method: 'GET', method: 'GET',
params, params,
......
...@@ -19,7 +19,7 @@ export const init = new defs.Result() ...@@ -19,7 +19,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/modify', url: '/sys/role/modify',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -21,7 +21,7 @@ export const init = new defs.Result() ...@@ -21,7 +21,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/page', url: '/sys/role/page',
method: 'GET', method: 'GET',
params, params,
......
...@@ -12,7 +12,7 @@ export const init = new defs.Result() ...@@ -12,7 +12,7 @@ export const init = new defs.Result()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/selector', url: '/sys/role/selector',
method: 'GET', method: 'GET',
params, params,
......
...@@ -17,7 +17,7 @@ export const init = new defs.Result() ...@@ -17,7 +17,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/user/manage/assign', url: '/sys/user/assign',
method: 'POST', method: 'POST',
data: params, data: params,
......
/** /**
* @description 用户管理 * @description 用户管理
*/ */
import * as getMenuList from './getMenuList'
import * as getPermCode from './getPermCode'
import * as getUserInfo from './getUserInfo'
import * as assign from './assign' import * as assign from './assign'
import * as page from './page' import * as page from './page'
export { getMenuList, getPermCode, getUserInfo, assign, page } export { assign, page }
...@@ -21,7 +21,7 @@ export const init = new defs.Result() ...@@ -21,7 +21,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/user/manage/page', url: '/sys/user/page',
method: 'GET', method: 'GET',
params, params,
......
/**
* @description 用户信息
*/
import * as getMenuList from './getMenuList'
import * as getPermCode from './getPermCode'
import * as getUserInfo from './getUserInfo'
export { getMenuList, getPermCode, getUserInfo }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论