提交 96a0e9db 作者: 方治民

feat(api): swagger v3 pont 适配

上级 e7499b6e
{
"originType": "SwaggerV2",
"originUrl": "http://127.0.0.1:8081/api/v2/api-docs",
"originType": "SwaggerV3",
"originUrl": "http://127.0.0.1:8081/api/v3/api-docs",
"templateType": "fetch",
"templatePath": "./pont-template",
"transformPath": "./pont-transform",
"outDir": "./src/api/services",
"surrounding": "typeScript",
"usingOperationId": true,
"mocks": {
"enable": true,
"basePath": "",
......
import * as Pont from 'pont-engine'
// import * as Pont from 'pont-engine'
import { Interface, BaseClass, Property, CodeGenerator } from 'pont-engine'
// 接口 API 前缀
// 通常与项目的 env 配置中的 VITE_GLOB_API_URL_PREFIX 相同
const API_URL_PREFIX = '/api'
export class FileStructures extends Pont.FileStructures {
getModsDeclaration(originCode: string): string {
return originCode
}
}
export default class BasicGenerator extends CodeGenerator {
checkJsonParam(inter: Interface, paramsCode: string): boolean {
const prettier = require('prettier')
......@@ -21,6 +15,7 @@ export default class BasicGenerator extends CodeGenerator {
// 认为没有返回值的接口表示下载(通常是)
isDownload(inter: Interface): boolean {
console.log(inter.name, inter.responseType)
return inter.responseType === 'any'
}
......@@ -88,7 +83,8 @@ export default class BasicGenerator extends CodeGenerator {
const method = inter.method.toUpperCase()
const paramsCode = inter.getParamsCode('Params', this.surrounding)
const requestParams = this.getParams(inter, paramsCode)
const undef = inter.response.getInitialValue() === 'undefined'
const initValue = inter.response.getInitialValue(true)
const undef = initValue === 'undefined' || initValue === `''`
const isBody = this.checkJsonParam(inter, paramsCode)
// TODO
......@@ -105,7 +101,7 @@ export default class BasicGenerator extends CodeGenerator {
${isBody ? '' : `export ${paramsCode}`}
${undef ? '' : `export const init = ${inter.response.getInitialValue(true)};`}
${undef ? '' : `export const init = ${initValue};`}
export function request(${requestParams}) {
return defHttp.request({
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -29,77 +29,477 @@ declare namespace defs {
/** 重定向 */
redirect?: string
/** 唯一标识 */
uid?: string
}
export class PageParam {
/** 当前页数 */
pageNo?: number
/** 分页条数 */
pageSize?: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export class PageVoPermissionVo {
/** 数据 */
data?: Array<defs.PermissionVo>
/** 数据最新时间 */
latest?: string
/** 数据总数 */
total?: number
}
export class PageVoRoleVo {
/** 数据 */
data?: Array<defs.RoleVo>
/** 数据最新时间 */
latest?: string
/** 数据总数 */
total?: number
}
export class PageVoString {
/** 数据 */
data?: Array<string>
/** 数据最新时间 */
latest?: string
/** 数据总数 */
total?: number
}
export class PageVoUserVo {
/** 数据 */
data?: Array<defs.UserVo>
/** 数据最新时间 */
latest?: string
/** 数据总数 */
total?: number
}
export class PermissionVo {
/** children */
children?: Array<defs.PermissionVo>
/** component */
component?: string
/** enable */
enable?: boolean
/** hidden */
hidden?: boolean
/** icon */
icon?: string
/** id */
id?: string
/** meta */
meta?: ObjectMap<any, object>
/** name */
name?: string
/** path */
path?: string
/** pid */
pid?: string
/** serial */
serial?: number
/** type */
type?: 'DIR' | 'MENU' | 'BUTTON'
/** uid */
uid?: string
}
export class ResultArrayListMenuVo {
/** 内容 */
body?: Array<defs.MenuVo>
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultArrayListPermissionVo {
/** 内容 */
body?: Array<defs.PermissionVo>
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultArrayListRoleVo {
/** 内容 */
body?: Array<defs.RoleVo>
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultArrayListString {
/** 内容 */
body?: Array<string>
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultBoolean {
/** 内容 */
body?: boolean
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultLoginVo {
/** body */
body?: defs.LoginVo
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultPageVoPermissionVo {
/** body */
body?: defs.PageVoPermissionVo
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultPageVoRoleVo {
/** body */
body?: defs.PageVoRoleVo
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultPageVoString {
/** body */
body?: defs.PageVoString
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultPageVoUserVo {
/** body */
body?: defs.PageVoUserVo
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class PageParam {
/** 当前页数 */
pageNo?: number
export class ResultPermissionVo {
/** body */
body?: defs.PermissionVo
/** 分页条数 */
pageSize?: number
/** 业务标识码 */
code?: number
/** 排序字段 */
sortField?: string
/** 详细信息 */
details?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class PageVo<T0 = any> {
/** 数据 */
data?: Array<T0>
export class ResultRoleVo {
/** body */
body?: defs.RoleVo
/** 数据最新时间 */
latest?: string
/** 业务标识码 */
code?: number
/** 数据总数 */
total?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class PermissionVo {
/** 子权限 */
children?: Array<defs.PermissionVo>
export class ResultString {
/** 内容 */
body?: string
/** 组件 */
component?: string
/** 业务标识码 */
code?: number
/** 是否启用 */
enable?: boolean
/** 详细信息 */
details?: string
/** 是否隐藏 */
hidden?: boolean
/** 异常信息 */
error?: string
/** 图标 */
icon?: string
/** 消息 */
message?: string
/** 主键 */
id?: string
/** 状态码 */
status?: number
/** 元数据 */
meta?: ObjectMap<any, object>
/** 耗时 */
times?: string
/** 名称 */
name?: string
/** 响应时间 */
timestamp?: string
}
/** 路径 */
path?: string
export class ResultUserExtensionVo {
/** body */
body?: defs.UserExtensionVo
/** 父级ID */
pid?: string
/** 业务标识码 */
code?: number
/** 序号 */
serial?: number
/** 详细信息 */
details?: string
/** 权限类型 */
type?: 'DIR' | 'MENU' | 'BUTTON'
/** 异常信息 */
error?: string
/** 标识 */
uid?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class Result<T0 = any> {
/** 内容 */
body?: T0
export class ResultUserInfo {
/** body */
body?: defs.UserInfo
/** 业务标识码 */
code?: number
......@@ -142,7 +542,10 @@ declare namespace defs {
age?: number
/** 性别 */
gender?: number
gender?: any
/** 简介 */
introduction?: string
}
export class UserInfo {
......@@ -210,14 +613,14 @@ declare namespace defs {
}
}
namespace API {
declare namespace API {
/**
* 身份认证
*/
export namespace auth {
/**
* 登录
* /api/auth/login
* /auth/login
*/
export namespace login {
export class Params {
......@@ -227,7 +630,7 @@ namespace API {
password: string
}
export type Response = defs.LoginVo
export type Response = defs.ResultLoginVo
export const init: Response
......@@ -240,12 +643,12 @@ namespace API {
/**
* 登出
* /api/auth/logout
* /auth/logout
*/
export namespace logout {
export class Params {}
export type Response = string
export type Response = defs.ResultString
export const init: Response
......@@ -258,29 +661,50 @@ namespace API {
/**
* 注册
* /api/auth/register
* /auth/register
*/
export namespace register {
export class Params {
/** 用户名 */
username: string
/** 密码 */
password: string
/** 真实姓名 */
realName: string
/** 手机号 */
mobile: string
/** 头像 */
avatar?: string
/** 邮箱 */
email?: string
/** 是否启用 */
enable?: boolean
/** 简介 */
introduction?: string
/** 手机号 */
mobile: string
/** 是否启用 */
enable?: boolean
}
export type Response = defs.ResultString
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 安全验证
* /auth/safe
*/
export namespace safe {
export class Params {
/** 密码 */
password: string
/** 真实姓名 */
realName: string
/** 用户名 */
username: string
}
export type Response = string
export type Response = defs.ResultString
export const init: Response
......@@ -292,13 +716,13 @@ namespace API {
}
/**
* 检查登录状态
* /api/auth/valid
* 检查登录
* /auth/valid
*/
export namespace valid {
export class Params {}
export type Response = boolean
export type Response = defs.ResultBoolean
export const init: Response
......@@ -316,12 +740,12 @@ namespace API {
export namespace example {
/**
* Hello World
* /api/example/
* /example/
*/
export namespace hello {
export class Params {}
export type Response = string
export type Response = defs.ResultString
export const init: Response
......@@ -334,12 +758,12 @@ namespace API {
/**
* 文件下载
* /api/example/download
* /example/download
*/
export namespace download {
export class Params {}
export type Response = any
export type Response = string
export const init: Response
......@@ -352,12 +776,12 @@ namespace API {
/**
* 测试失败
* /api/example/fail
* /example/fail
*/
export namespace fail {
export class Params {}
export type Response = string
export type Response = defs.ResultString
export const init: Response
......@@ -370,12 +794,12 @@ namespace API {
/**
* 查询用户属性
* /api/example/findUserExtensionInfo
* /example/findUserExtensionInfo
*/
export namespace findUserExtensionInfo {
export class Params {}
export type Response = defs.UserExtensionVo
export type Response = defs.ResultUserExtensionVo
export const init: Response
......@@ -388,12 +812,12 @@ namespace API {
/**
* JSON 传参
* /api/example/json
* /example/json
*/
export namespace json {
export class Params {}
export type Response = defs.PageVo<string>
export type Response = defs.ResultPageVoString
export const init: Response
......@@ -406,21 +830,21 @@ namespace API {
/**
* 分页条件查询
* /api/example/page
* /example/page
*/
export namespace page {
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
/** pageSize */
pageSize: number
/** pageNo */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
sortOrder?: string
}
export type Response = defs.PageVo<string>
export type Response = defs.ResultPageVoString
export const init: Response
......@@ -438,7 +862,7 @@ namespace API {
export namespace file {
/**
* 文件下载
* /api/common/file/download
* /common/file/download
*/
export namespace download {
export class Params {
......@@ -448,7 +872,7 @@ namespace API {
object: string
}
export type Response = any
export type Response = string
export const init: Response
......@@ -461,40 +885,36 @@ namespace API {
/**
* 文件上传
* /api/common/file/upload
* /common/file/upload
*/
export namespace upload {
export class Params {}
export type Response = string
export type Response = defs.ResultString
export const init: Response
export function request(
params: Params,
form: FormData,
config?: http.RequestConfig<Params | FormData>,
body: object,
config?: http.RequestConfig<object>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* Base64 图片上传
* /api/common/file/uploadBase64Image
* /common/file/uploadBase64Image
*/
export namespace uploadBase64Image {
export class Params {
/** Base64 图片信息 */
base64Image: string
}
export class Params {}
export type Response = string
export type Response = defs.ResultString
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
body: string,
config?: http.RequestConfig<string>,
options?: http.RequestOptions,
): Promise<Response>
}
......@@ -506,37 +926,39 @@ namespace API {
export namespace permission {
/**
* 新增
* /api/sys/permission/add
* /sys/permission/add
*/
export namespace add {
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** 元数据 */
meta?: string
/** id */
id: string
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 序号 */
serial?: number
/** 标识 */
uid: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: string
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid: string
/** 组件 */
component?: string
/** 图标 */
icon?: string
/** 是否隐藏 */
hidden?: boolean
/** 是否启用 */
enable?: boolean
/** 父级ID */
pid?: string
/** 元数据 */
meta?: string
}
export type Response = string
export type Response = defs.ResultString
export const init: Response
......@@ -549,7 +971,7 @@ namespace API {
/**
* 删除
* /api/sys/permission/deleted
* /sys/permission/deleted
*/
export namespace deleted {
export class Params {
......@@ -557,7 +979,7 @@ namespace API {
id: string
}
export type Response = string
export type Response = defs.ResultString
export const init: Response
......@@ -570,7 +992,7 @@ namespace API {
/**
* 查询
* /api/sys/permission/find
* /sys/permission/find
*/
export namespace find {
export class Params {
......@@ -578,7 +1000,7 @@ namespace API {
id: string
}
export type Response = defs.PermissionVo
export type Response = defs.ResultPermissionVo
export const init: Response
......@@ -591,39 +1013,39 @@ namespace API {
/**
* 修改
* /api/sys/permission/modify
* /sys/permission/modify
*/
export namespace modify {
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** id */
id: string
/** 元数据 */
meta?: string
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 序号 */
serial?: number
/** 标识 */
uid: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: string
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid: string
/** 组件 */
component?: string
/** 图标 */
icon?: string
/** 是否隐藏 */
hidden?: boolean
/** 是否启用 */
enable?: boolean
/** 父级ID */
pid?: string
/** 元数据 */
meta?: string
}
export type Response = string
export type Response = defs.ResultString
export const init: Response
......@@ -636,21 +1058,21 @@ namespace API {
/**
* 分页查询
* /api/sys/permission/page
* /sys/permission/page
*/
export namespace page {
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
/** pageSize */
pageSize: number
/** pageNo */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
sortOrder?: string
}
export type Response = defs.PageVo<defs.PermissionVo>
export type Response = defs.ResultPageVoPermissionVo
export const init: Response
......@@ -663,15 +1085,15 @@ namespace API {
/**
* 树结构查询
* /api/sys/permission/tree
* /sys/permission/tree
*/
export namespace tree {
export class Params {
/** pid */
pid?: string
pid: string
}
export type Response = Array<defs.PermissionVo>
export type Response = defs.ResultArrayListPermissionVo
export const init: Response
......@@ -689,17 +1111,19 @@ namespace API {
export namespace role {
/**
* 新增
* /api/sys/role/add
* /sys/role/add
*/
export namespace add {
export class Params {
/** 名称 */
name: string
/** id */
id: string
/** 标识 */
uid: string
/** 名称 */
name: string
}
export type Response = string
export type Response = defs.ResultString
export const init: Response
......@@ -712,7 +1136,7 @@ namespace API {
/**
* 分配权限
* /api/sys/role/assign
* /sys/role/assign
*/
export namespace assign {
export class Params {
......@@ -722,7 +1146,7 @@ namespace API {
ids: string
}
export type Response = string
export type Response = defs.ResultString
export const init: Response
......@@ -735,7 +1159,7 @@ namespace API {
/**
* 删除
* /api/sys/role/deleted
* /sys/role/deleted
*/
export namespace deleted {
export class Params {
......@@ -743,7 +1167,7 @@ namespace API {
ids: string
}
export type Response = string
export type Response = defs.ResultString
export const init: Response
......@@ -756,7 +1180,7 @@ namespace API {
/**
* 查询
* /api/sys/role/find
* /sys/role/find
*/
export namespace find {
export class Params {
......@@ -764,7 +1188,7 @@ namespace API {
id: string
}
export type Response = defs.RoleVo
export type Response = defs.ResultRoleVo
export const init: Response
......@@ -777,19 +1201,19 @@ namespace API {
/**
* 修改
* /api/sys/role/modify
* /sys/role/modify
*/
export namespace modify {
export class Params {
/** id */
id: string
/** 名称 */
name: string
/** 标识 */
uid: string
/** 名称 */
name: string
}
export type Response = string
export type Response = defs.ResultString
export const init: Response
......@@ -802,21 +1226,21 @@ namespace API {
/**
* 分页查询
* /api/sys/role/page
* /sys/role/page
*/
export namespace page {
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
/** pageSize */
pageSize: number
/** pageNo */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
sortOrder?: string
}
export type Response = defs.PageVo<defs.RoleVo>
export type Response = defs.ResultPageVoRoleVo
export const init: Response
......@@ -829,12 +1253,12 @@ namespace API {
/**
* 选项查询
* /api/sys/role/selector
* /sys/role/selector
*/
export namespace selector {
export class Params {}
export type Response = Array<defs.RoleVo>
export type Response = defs.ResultArrayListRoleVo
export const init: Response
......@@ -852,7 +1276,7 @@ namespace API {
export namespace user {
/**
* 分配角色
* /api/sys/user/assign
* /sys/user/assign
*/
export namespace assign {
export class Params {
......@@ -862,7 +1286,7 @@ namespace API {
ids: string
}
export type Response = string
export type Response = defs.ResultString
export const init: Response
......@@ -875,21 +1299,21 @@ namespace API {
/**
* 分页查询
* /api/sys/user/page
* /sys/user/page
*/
export namespace page {
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
/** pageSize */
pageSize: number
/** pageNo */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
sortOrder?: string
}
export type Response = defs.PageVo<defs.UserVo>
export type Response = defs.ResultPageVoUserVo
export const init: Response
......@@ -907,12 +1331,12 @@ namespace API {
export namespace userView {
/**
* 获取用户菜单
* /api/user/getMenuList
* /user/getMenuList
*/
export namespace getMenuList {
export class Params {}
export type Response = Array<defs.MenuVo>
export type Response = defs.ResultArrayListMenuVo
export const init: Response
......@@ -925,12 +1349,12 @@ namespace API {
/**
* 获取用户权限
* /api/user/getPermCode
* /user/getPermCode
*/
export namespace getPermCode {
export class Params {}
export type Response = Array<string>
export type Response = defs.ResultArrayListString
export const init: Response
......@@ -943,12 +1367,12 @@ namespace API {
/**
* 获取登录用户信息
* /api/user/getUserInfo
* /user/getUserInfo
*/
export namespace getUserInfo {
export class Params {}
export type Response = defs.UserInfo
export type Response = defs.ResultUserInfo
export const init: Response
......
......@@ -24,6 +24,9 @@ export class MenuVo {
/** 重定向 */
redirect = ''
/** 唯一标识 */
uid = ''
}
export class PageParam {
......@@ -40,7 +43,40 @@ export class PageParam {
sortOrder = 'ASC'
}
export class PageVo {
export class PageVoPermissionVo {
/** 数据 */
data = []
/** 数据最新时间 */
latest = ''
/** 数据总数 */
total = undefined
}
export class PageVoRoleVo {
/** 数据 */
data = []
/** 数据最新时间 */
latest = ''
/** 数据总数 */
total = undefined
}
export class PageVoString {
/** 数据 */
data = []
/** 数据最新时间 */
latest = ''
/** 数据总数 */
total = undefined
}
export class PageVoUserVo {
/** 数据 */
data = []
......@@ -52,48 +88,178 @@ export class PageVo {
}
export class PermissionVo {
/** 子权限 */
/** children */
children = []
/** 组件 */
/** component */
component = ''
/** 是否启用 */
/** enable */
enable = false
/** 是否隐藏 */
/** hidden */
hidden = false
/** 图标 */
/** icon */
icon = ''
/** 主键 */
/** id */
id = ''
/** 元数据 */
/** meta */
meta = undefined
/** 名称 */
/** name */
name = ''
/** 路径 */
/** path */
path = ''
/** 父级ID */
/** pid */
pid = ''
/** 序号 */
/** serial */
serial = undefined
/** 权限类型 */
/** type */
type = 'DIR'
/** 标识 */
/** uid */
uid = ''
}
export class Result {
export class ResultArrayListMenuVo {
/** 内容 */
body = []
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultArrayListPermissionVo {
/** 内容 */
body = []
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultArrayListRoleVo {
/** 内容 */
body = []
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultArrayListString {
/** 内容 */
body = []
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultBoolean {
/** 内容 */
body = false
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultLoginVo {
/** body */
body = new LoginVo()
/** 业务标识码 */
......@@ -118,6 +284,240 @@ export class Result {
timestamp = ''
}
export class ResultPageVoPermissionVo {
/** body */
body = new PageVoPermissionVo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultPageVoRoleVo {
/** body */
body = new PageVoRoleVo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultPageVoString {
/** body */
body = new PageVoString()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultPageVoUserVo {
/** body */
body = new PageVoUserVo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultPermissionVo {
/** body */
body = new PermissionVo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultRoleVo {
/** body */
body = new RoleVo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultString {
/** 内容 */
body = ''
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultUserExtensionVo {
/** body */
body = new UserExtensionVo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultUserInfo {
/** body */
body = new UserInfo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class RoleVo {
/** 主键 */
id = ''
......@@ -138,6 +538,9 @@ export class UserExtensionVo {
/** 性别 */
gender = undefined
/** 简介 */
introduction = ''
}
export class UserInfo {
......
......@@ -4,6 +4,7 @@
import * as login from './login'
import * as logout from './logout'
import * as register from './register'
import * as safe from './safe'
import * as valid from './valid'
export { login, logout, register, valid }
export { login, logout, register, safe, valid }
......@@ -12,7 +12,7 @@ export class Params {
password: string
}
export const init = new defs.Result()
export const init = new defs.ResultLoginVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -6,25 +6,25 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 用户名 */
username: string
/** 密码 */
password: string
/** 真实姓名 */
realName: string
/** 手机号 */
mobile: string
/** 头像 */
avatar?: string
/** 邮箱 */
email?: string
/** 是否启用 */
enable?: boolean
/** 简介 */
introduction?: string
/** 手机号 */
mobile: string
/** 密码 */
password: string
/** 真实姓名 */
realName: string
/** 用户名 */
username: string
/** 是否启用 */
enable?: boolean
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
/**
* @desc 安全验证
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 密码 */
password: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/auth/safe',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 检查登录状态
* @desc 检查登录
*/
import * as defs from '../../baseClass'
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultBoolean()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultUserExtensionVo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -5,7 +5,7 @@
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export const init = new defs.Result()
export const init = new defs.ResultPageVoString()
export function request(
body: defs.PageParam,
......
......@@ -6,17 +6,17 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
/** pageSize */
pageSize: number
/** pageNo */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
sortOrder?: string
}
export const init = new defs.Result()
export const init = new defs.ResultPageVoString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -5,22 +5,15 @@
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.ResultString()
export const init = new defs.Result()
export function request(
params: Params,
form: FormData,
config?: http.RequestConfig<Params | FormData>,
options?: http.RequestOptions,
) {
export function request(body: object, config?: http.RequestConfig<object>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/common/file/upload',
method: 'POST',
data: form || params,
headers: { 'Content-Type': 'multipart/form-data;charset=UTF-8' },
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
......
......@@ -5,19 +5,15 @@
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** Base64 图片信息 */
base64Image: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
export function request(body: string, config?: http.RequestConfig<string>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/common/file/uploadBase64Image',
method: 'POST',
data: params,
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
......
......@@ -6,33 +6,35 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** 元数据 */
meta?: string
/** id */
id: string
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 序号 */
serial?: number
/** 标识 */
uid: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: string
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid: string
/** 组件 */
component?: string
/** 图标 */
icon?: string
/** 是否隐藏 */
hidden?: boolean
/** 是否启用 */
enable?: boolean
/** 父级ID */
pid?: string
/** 元数据 */
meta?: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -10,7 +10,7 @@ export class Params {
id: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -10,7 +10,7 @@ export class Params {
id: string
}
export const init = new defs.Result()
export const init = new defs.ResultPermissionVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -6,35 +6,35 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** id */
id: string
/** 元数据 */
meta?: string
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 序号 */
serial?: number
/** 标识 */
uid: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: string
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid: string
/** 组件 */
component?: string
/** 图标 */
icon?: string
/** 是否隐藏 */
hidden?: boolean
/** 是否启用 */
enable?: boolean
/** 父级ID */
pid?: string
/** 元数据 */
meta?: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -6,17 +6,17 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
/** pageSize */
pageSize: number
/** pageNo */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
sortOrder?: string
}
export const init = new defs.Result()
export const init = new defs.ResultPageVoPermissionVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,10 +7,10 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {
/** pid */
pid?: string
pid: string
}
export const init = new defs.Result()
export const init = new defs.ResultArrayListPermissionVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -6,13 +6,15 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 名称 */
name: string
/** id */
id: string
/** 标识 */
uid: string
/** 名称 */
name: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -12,7 +12,7 @@ export class Params {
ids: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -10,7 +10,7 @@ export class Params {
ids: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -10,7 +10,7 @@ export class Params {
id: string
}
export const init = new defs.Result()
export const init = new defs.ResultRoleVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -8,13 +8,13 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 名称 */
name: string
/** 标识 */
uid: string
/** 名称 */
name: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -6,17 +6,17 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
/** pageSize */
pageSize: number
/** pageNo */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
sortOrder?: string
}
export const init = new defs.Result()
export const init = new defs.ResultPageVoRoleVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultArrayListRoleVo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -12,7 +12,7 @@ export class Params {
ids: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -6,17 +6,17 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
/** pageSize */
pageSize: number
/** pageNo */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
sortOrder?: string
}
export const init = new defs.Result()
export const init = new defs.ResultPageVoUserVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultArrayListMenuVo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultArrayListString()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultUserInfo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论