Skip to content

Commit

Permalink
chore: add comment for api file
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed May 11, 2024
1 parent 6bd5f3c commit ba1a9b1
Show file tree
Hide file tree
Showing 25 changed files with 139 additions and 8 deletions.
22 changes: 14 additions & 8 deletions openapi.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ generateService({
serversPath: './src/api/backend',
requestOptionsType: 'RequestOptions',
// 自定义网络请求函数路径
requestImportStatement: 'import { request, type RequestOptions } from "@/utils/request";',
requestImportStatement: `
/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */
import { request, type RequestOptions } from "@/utils/request";
`,
hook: {
afterOpenApiDataInited(openAPIData) {
const schemas = openAPIData.components?.schemas;
Expand Down Expand Up @@ -60,13 +66,13 @@ generateService({
const moduleName = operationObject.tags?.[0].split(' - ')[0];

// 移除 query 参数的默认值
// operationObject.parameters?.forEach((param) => {
// if ('in' in param && param.in === 'query' && param.schema) {
// if (!('$ref' in param.schema) && param.schema.default) {
// Reflect.deleteProperty(param.schema, 'default');
// }
// }
// });
operationObject.parameters?.forEach((param) => {
if ('in' in param && param.in === 'query' && param.schema) {
if (!('$ref' in param.schema) && param.schema.default) {
Reflect.deleteProperty(param.schema, 'default');
}
}
});

if (moduleName === controllerName) {
return [controllerName];
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/account.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 账户登出 GET /api/account/logout */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 登录 POST /api/auth/login */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/authEmail.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 发送邮箱验证码 POST /api/auth/email/send */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/businessTodo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 获取Todo列表 GET /api/todos */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/captcha.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 获取登录图片验证码 GET /api/auth/captcha/img */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/health.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 此处后端没有提供注释 GET /api/health/database */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/netDiskManage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 复制文件或文件夹,支持批量 POST /api/netdisk/manage/copy */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/netDiskOverview.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 获取网盘空间数据统计 GET /api/netdisk/overview/desc */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemDept.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 获取部门列表 GET /api/system/depts */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemDictItem.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 获取字典项列表 GET /api/system/dict-item */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemDictType.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 获取字典类型列表 GET /api/system/dict-type */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemEmail.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 发送邮件 POST /api/tools/email/send */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemLog.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 查询验证码日志列表 GET /api/system/log/captcha/list */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemMenu.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 获取所有菜单列表 GET /api/system/menus */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemOnline.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 下线指定在线用户 POST /api/system/online/kick */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemParamConfig.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 获取参数配置列表 GET /api/system/param-config */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemRole.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 获取角色列表 GET /api/system/roles */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemServe.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 获取服务器运行信息 GET /api/system/serve/stat */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemSse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 服务端推送消息 GET /api/sse/${param0} */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemTask.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 获取任务列表 GET /api/system/tasks */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/systemUser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 获取用户列表 GET /api/system/users */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/toolsStorage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 删除文件 POST /api/tools/storage/delete */
Expand Down
5 changes: 5 additions & 0 deletions src/api/backend/api/toolsUpload.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-ignore
/* eslint-disable */

/**
* 该文件为 @umijs/openapi 插件自动生成,请勿随意修改。如需修改请通过配置 openapi.config.ts 进行定制化。
* */

import { request, type RequestOptions } from '@/utils/request';

/** 上传 POST /api/tools/upload */
Expand Down
10 changes: 10 additions & 0 deletions src/api/backend/api/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,16 @@ declare namespace API {
pageSize?: number;
field?: string;
order?: 'ASC' | 'DESC';
/** 角色名称 */
name?: string;
/** 角色值 */
value?: string;
/** 角色备注 */
remark?: string;
/** 状态 */
status?: 0 | 1;
/** 关联菜单、权限编号 */
menuIds?: number[];
_t?: number;
};

Expand Down

0 comments on commit ba1a9b1

Please sign in to comment.