@origen-ui/admin-cli 1.1.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -9
- package/package.json +26 -2
- package/templates/current/clean/.node-version +1 -0
- package/templates/current/clean/CHANGELOG.md +125 -0
- package/templates/current/clean/README.md +2 -1
- package/templates/current/clean/component-catalog.json +58 -17
- package/templates/current/clean/e2e/admin-shell.spec.ts +6 -0
- package/templates/current/clean/e2e/demo-shell.spec.ts +94 -50
- package/templates/current/clean/package.json +39 -25
- package/templates/current/clean/playwright.config.ts +1 -0
- package/templates/current/clean/playwright.demo.config.ts +1 -1
- package/templates/current/clean/pnpm-workspace.yaml +18 -0
- package/templates/current/clean/scaffold.lock.json +2 -2
- package/templates/current/clean/scripts/check-admin-scaffold.mjs +5 -1
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +7 -2
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +7 -2
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +7 -2
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +11 -2
- package/templates/current/clean/scripts/clean-overlay/src/main.ts +23 -14
- package/templates/current/clean/scripts/clean-overlay/src/router/componentCache.ts +12 -0
- package/templates/current/clean/scripts/clean-overlay/src/router/componentRegistry.ts +2 -13
- package/templates/current/clean/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +34 -4
- package/templates/current/clean/scripts/clean-overlay/src/router/paths.ts +21 -0
- package/templates/current/clean/scripts/clean-overlay/src/router/staticRoutes.ts +6 -6
- package/templates/current/clean/scripts/demo-api.ts +88 -12
- package/templates/current/clean/scripts/generate-api.ts +87 -3
- package/templates/current/clean/scripts/remove-examples.mjs +4 -4
- package/templates/current/clean/scripts/vite-build-policy.spec.ts +1 -0
- package/templates/current/clean/src/api/generated/data-contracts.ts +2 -5
- package/templates/current/clean/src/api/generated/http-client.ts +28 -26
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +5 -8
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +1 -4
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +2 -5
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +8 -10
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +11 -12
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +8 -10
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +8 -10
- package/templates/current/clean/src/api/generated//350/256/244/350/257/201.ts +3 -6
- package/templates/current/clean/src/app/errorMessage.spec.ts +76 -0
- package/templates/current/clean/src/app/errorMessage.ts +53 -0
- package/templates/current/clean/src/app/menu-host.spec.ts +77 -0
- package/templates/current/clean/src/app/menu.spec.ts +39 -0
- package/templates/current/clean/src/app/menu.ts +48 -12
- package/templates/current/clean/src/app/runtimeConfig.ts +1 -1
- package/templates/current/clean/src/demo-api.spec.ts +314 -3
- package/templates/current/clean/src/features/auth/pages/Login.vue +9 -2
- package/templates/current/clean/src/features/auth/store/auth.ts +6 -19
- package/templates/current/clean/src/features/errors/pages/Forbidden.vue +7 -2
- package/templates/current/clean/src/features/errors/pages/NotFound.vue +7 -2
- package/templates/current/clean/src/features/errors/pages/ServerError.vue +7 -2
- package/templates/current/clean/src/features/errors/pages/error-pages.spec.ts +11 -2
- package/templates/current/clean/src/features/system/access/api/admin-repository.ts +2 -6
- package/templates/current/clean/src/features/system/access/api/rbac.ts +19 -9
- package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.spec.ts +134 -0
- package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.ts +96 -0
- package/templates/current/clean/src/features/workspace/pages/Profile.vue +1 -1
- package/templates/current/clean/src/layouts/AdminLayout.vue +3 -0
- package/templates/current/clean/src/layouts/TopBar.vue +37 -6
- package/templates/current/clean/src/layouts/topBarMenuSearch.spec.ts +24 -1
- package/templates/current/clean/src/layouts/topBarMenuSearch.ts +10 -0
- package/templates/current/clean/src/locales/en-US.json +30 -3
- package/templates/current/clean/src/locales/en-US.runtime.ts +2 -0
- package/templates/current/clean/src/locales/index.ts +39 -26
- package/templates/current/clean/src/locales/zh-CN.json +30 -3
- package/templates/current/clean/src/locales/zh-CN.runtime.ts +2 -0
- package/templates/current/clean/src/locales/zh-TW.json +30 -3
- package/templates/current/clean/src/locales/zh-TW.runtime.ts +2 -0
- package/templates/current/clean/src/main.ts +23 -14
- package/templates/current/clean/src/router/bootstrap.ts +10 -16
- package/templates/current/clean/src/router/componentCache.ts +12 -0
- package/templates/current/clean/src/router/componentRegistry.ts +2 -13
- package/templates/current/clean/src/router/dynamicMenuRefresh.spec.ts +101 -0
- package/templates/current/clean/src/router/dynamicMenuRefresh.ts +24 -0
- package/templates/current/clean/src/router/dynamicRoutes.spec.ts +34 -4
- package/templates/current/clean/src/router/dynamicRoutes.ts +14 -3
- package/templates/current/clean/src/router/paths.spec.ts +50 -0
- package/templates/current/clean/src/router/paths.ts +21 -0
- package/templates/current/clean/src/router/queryEncryption.spec.ts +10 -1
- package/templates/current/clean/src/router/routeQuery.spec.ts +2 -1
- package/templates/current/clean/src/router/routeQuery.ts +4 -1
- package/templates/current/clean/src/router/staticRoutes.ts +6 -6
- package/templates/current/clean/src/templates/og-table.ts +2 -4
- package/templates/current/clean/tsconfig.json +0 -1
- package/templates/current/clean/vite.build-policy.ts +55 -8
- package/templates/current/clean/vite.config.ts +30 -0
- package/templates/current/examples/.node-version +1 -0
- package/templates/current/examples/CHANGELOG.md +125 -0
- package/templates/current/examples/README.md +2 -1
- package/templates/current/examples/component-catalog.json +58 -17
- package/templates/current/examples/e2e/admin-shell.spec.ts +6 -0
- package/templates/current/examples/e2e/demo-shell.spec.ts +94 -50
- package/templates/current/examples/package.json +39 -25
- package/templates/current/examples/playwright.config.ts +1 -0
- package/templates/current/examples/playwright.demo.config.ts +1 -1
- package/templates/current/examples/pnpm-workspace.yaml +18 -0
- package/templates/current/examples/scaffold.lock.json +2 -2
- package/templates/current/examples/scripts/check-admin-scaffold.mjs +5 -1
- package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +7 -2
- package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +7 -2
- package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +7 -2
- package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +11 -2
- package/templates/current/examples/scripts/clean-overlay/src/main.ts +23 -14
- package/templates/current/examples/scripts/clean-overlay/src/router/componentCache.ts +12 -0
- package/templates/current/examples/scripts/clean-overlay/src/router/componentRegistry.ts +2 -13
- package/templates/current/examples/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +34 -4
- package/templates/current/examples/scripts/clean-overlay/src/router/paths.ts +21 -0
- package/templates/current/examples/scripts/clean-overlay/src/router/staticRoutes.ts +6 -6
- package/templates/current/examples/scripts/demo-api.ts +88 -12
- package/templates/current/examples/scripts/generate-api.ts +87 -3
- package/templates/current/examples/scripts/remove-examples.mjs +4 -4
- package/templates/current/examples/scripts/vite-build-policy.spec.ts +1 -0
- package/templates/current/examples/src/api/generated/data-contracts.ts +2 -5
- package/templates/current/examples/src/api/generated/http-client.ts +28 -26
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +5 -8
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +1 -4
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +2 -5
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +8 -10
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +11 -12
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +8 -10
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +8 -10
- package/templates/current/examples/src/api/generated//350/256/244/350/257/201.ts +3 -6
- package/templates/current/examples/src/app/errorMessage.spec.ts +76 -0
- package/templates/current/examples/src/app/errorMessage.ts +53 -0
- package/templates/current/examples/src/app/menu-host.spec.ts +77 -0
- package/templates/current/examples/src/app/menu.spec.ts +39 -0
- package/templates/current/examples/src/app/menu.ts +48 -12
- package/templates/current/examples/src/app/runtimeConfig.ts +1 -1
- package/templates/current/examples/src/demo-api.spec.ts +314 -3
- package/templates/current/examples/src/features/auth/pages/Login.vue +9 -2
- package/templates/current/examples/src/features/auth/store/auth.ts +6 -19
- package/templates/current/examples/src/features/errors/pages/Forbidden.vue +2 -1
- package/templates/current/examples/src/features/errors/pages/NotFound.vue +2 -1
- package/templates/current/examples/src/features/errors/pages/ServerError.vue +2 -1
- package/templates/current/examples/src/features/feature-composables.spec.ts +11 -1
- package/templates/current/examples/src/features/system/access/api/admin-repository.ts +2 -6
- package/templates/current/examples/src/features/system/access/api/rbac.ts +19 -9
- package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.spec.ts +134 -0
- package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.ts +96 -0
- package/templates/current/examples/src/features/system/menus/components/MenuEditorForm.vue +115 -28
- package/templates/current/examples/src/features/system/menus/composables/useMenuManagement.ts +162 -66
- package/templates/current/examples/src/features/system/menus/menuDraft.spec.ts +204 -0
- package/templates/current/examples/src/features/system/menus/menuDraft.ts +116 -0
- package/templates/current/examples/src/features/system/menus/menuTreePrecheck.spec.ts +268 -0
- package/templates/current/examples/src/features/system/menus/menuTreePrecheck.ts +317 -0
- package/templates/current/examples/src/features/system/roles/components/RoleEditorForm.vue +1 -0
- package/templates/current/examples/src/features/workspace/pages/Profile.vue +1 -1
- package/templates/current/examples/src/layouts/AdminLayout.vue +3 -0
- package/templates/current/examples/src/layouts/TopBar.vue +37 -6
- package/templates/current/examples/src/layouts/topBarMenuSearch.spec.ts +24 -1
- package/templates/current/examples/src/layouts/topBarMenuSearch.ts +10 -0
- package/templates/current/examples/src/locales/en-US.json +30 -3
- package/templates/current/examples/src/locales/en-US.runtime.ts +2 -0
- package/templates/current/examples/src/locales/index.ts +39 -26
- package/templates/current/examples/src/locales/zh-CN.json +30 -3
- package/templates/current/examples/src/locales/zh-CN.runtime.ts +2 -0
- package/templates/current/examples/src/locales/zh-TW.json +30 -3
- package/templates/current/examples/src/locales/zh-TW.runtime.ts +2 -0
- package/templates/current/examples/src/main.ts +24 -22
- package/templates/current/examples/src/router/bootstrap.ts +10 -16
- package/templates/current/examples/src/router/componentCache.ts +18 -0
- package/templates/current/examples/src/router/componentRegistry.ts +1 -18
- package/templates/current/examples/src/router/dynamicMenuRefresh.spec.ts +101 -0
- package/templates/current/examples/src/router/dynamicMenuRefresh.ts +24 -0
- package/templates/current/examples/src/router/dynamicRoutes.spec.ts +20 -2
- package/templates/current/examples/src/router/dynamicRoutes.ts +14 -3
- package/templates/current/examples/src/router/paths.spec.ts +50 -0
- package/templates/current/examples/src/router/paths.ts +21 -0
- package/templates/current/examples/src/router/queryEncryption.spec.ts +10 -1
- package/templates/current/examples/src/router/routeQuery.spec.ts +2 -1
- package/templates/current/examples/src/router/routeQuery.ts +4 -1
- package/templates/current/examples/src/router/staticRoutes.ts +3 -3
- package/templates/current/examples/src/templates/og-table.ts +2 -4
- package/templates/current/examples/tsconfig.json +0 -1
- package/templates/current/examples/vite.build-policy.ts +55 -8
- package/templates/current/examples/vite.config.ts +30 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readdir, readFile, writeFile } from 'node:fs/promises'
|
|
1
2
|
import path from 'node:path'
|
|
2
3
|
import { fileURLToPath } from 'node:url'
|
|
3
4
|
// 使用 swagger-typescript-api 从 OpenAPI 规范生成 API 客户端
|
|
@@ -6,10 +7,11 @@ import { generateApi } from 'swagger-typescript-api'
|
|
|
6
7
|
/* eslint-disable node/prefer-global/process */
|
|
7
8
|
|
|
8
9
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
10
|
+
const outputDirectory = path.resolve(__dirname, '../src/api/generated')
|
|
9
11
|
|
|
10
12
|
generateApi({
|
|
11
13
|
name: 'Api.ts',
|
|
12
|
-
output:
|
|
14
|
+
output: outputDirectory,
|
|
13
15
|
input: path.resolve(__dirname, '../openapi.json'),
|
|
14
16
|
modular: true,
|
|
15
17
|
moduleNameFirstTag: true,
|
|
@@ -18,10 +20,92 @@ generateApi({
|
|
|
18
20
|
singleHttpClient: true,
|
|
19
21
|
cleanOutput: true,
|
|
20
22
|
})
|
|
23
|
+
.then(() => normalizeGeneratedApi(outputDirectory))
|
|
21
24
|
.then(() => {
|
|
22
25
|
process.stdout.write('API client generated successfully!\n')
|
|
23
26
|
})
|
|
24
|
-
.catch((
|
|
25
|
-
console.error('Failed to generate API client:',
|
|
27
|
+
.catch((error) => {
|
|
28
|
+
console.error('Failed to generate API client:', error)
|
|
26
29
|
process.exit(1)
|
|
27
30
|
})
|
|
31
|
+
|
|
32
|
+
async function normalizeGeneratedApi(directory: string) {
|
|
33
|
+
for (const entry of await readdir(directory, { withFileTypes: true })) {
|
|
34
|
+
if (!entry.isFile() || !entry.name.endsWith('.ts')) continue
|
|
35
|
+
const filePath = path.join(directory, entry.name)
|
|
36
|
+
const source = await readFile(filePath, 'utf8')
|
|
37
|
+
const normalized = normalizeGeneratedSource(source, entry.name)
|
|
38
|
+
if (normalized !== source) await writeFile(filePath, normalized, 'utf8')
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function normalizeGeneratedSource(source: string, fileName: string) {
|
|
43
|
+
let normalized = source
|
|
44
|
+
.replace(/^\/\* eslint-disable \*\/\r?\n/u, '')
|
|
45
|
+
.replace(/^\/\* tslint:disable \*\/\r?\n/u, '')
|
|
46
|
+
.replace(/^\/\/ @ts-nocheck\r?\n/u, '')
|
|
47
|
+
.replace(/\bany\b/gu, 'unknown')
|
|
48
|
+
|
|
49
|
+
if (fileName === 'http-client.ts') normalized = normalizeHttpClient(normalized)
|
|
50
|
+
return normalized
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function normalizeHttpClient(source: string) {
|
|
54
|
+
let normalized = source.replace(
|
|
55
|
+
' return value.map((v: unknown) => this.encodeQueryParam(key, v)).join("&");',
|
|
56
|
+
' if (!Array.isArray(value)) return "";\n return value.map((v) => this.encodeQueryParam(key, v)).join("&");',
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
const formatterStart = normalized.indexOf(' private contentFormatters:')
|
|
60
|
+
const formatterEnd = normalized.indexOf('\n\n protected mergeRequestParams', formatterStart)
|
|
61
|
+
if (formatterStart < 0 || formatterEnd < 0)
|
|
62
|
+
throw new Error('Generated HTTP client formatters changed unexpectedly.')
|
|
63
|
+
|
|
64
|
+
const formatter = ` private contentFormatters: Record<ContentType, (input: unknown) => BodyInit | null> = {
|
|
65
|
+
[ContentType.Json]: (input: unknown) =>
|
|
66
|
+
input === null || typeof input === "undefined"
|
|
67
|
+
? null
|
|
68
|
+
: JSON.stringify(input) ?? null,
|
|
69
|
+
[ContentType.JsonApi]: (input: unknown) =>
|
|
70
|
+
input === null || typeof input === "undefined"
|
|
71
|
+
? null
|
|
72
|
+
: JSON.stringify(input) ?? null,
|
|
73
|
+
[ContentType.Text]: (input: unknown) =>
|
|
74
|
+
typeof input === "string" ? input : JSON.stringify(input) ?? null,
|
|
75
|
+
[ContentType.FormData]: (input: unknown) => {
|
|
76
|
+
if (input instanceof FormData) {
|
|
77
|
+
return input;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const record = isRecord(input) ? input : {};
|
|
81
|
+
return Object.keys(record).reduce((formData, key) => {
|
|
82
|
+
const property = record[key];
|
|
83
|
+
formData.append(
|
|
84
|
+
key,
|
|
85
|
+
property instanceof Blob
|
|
86
|
+
? property
|
|
87
|
+
: typeof property === "object" && property !== null
|
|
88
|
+
? JSON.stringify(property) ?? ""
|
|
89
|
+
: String(property),
|
|
90
|
+
);
|
|
91
|
+
return formData;
|
|
92
|
+
}, new FormData());
|
|
93
|
+
},
|
|
94
|
+
[ContentType.UrlEncoded]: (input: unknown) =>
|
|
95
|
+
this.toQueryString(isRecord(input) ? input : {}),
|
|
96
|
+
};`
|
|
97
|
+
normalized = `${normalized.slice(0, formatterStart)}${formatter}${normalized.slice(formatterEnd)}`
|
|
98
|
+
|
|
99
|
+
const classMarker = 'export class HttpClient<SecurityDataType = unknown> {'
|
|
100
|
+
if (!normalized.includes('function isRecord(value: unknown): value is Record<string, unknown>')) {
|
|
101
|
+
normalized = normalized.replace(
|
|
102
|
+
classMarker,
|
|
103
|
+
`function isRecord(value: unknown): value is Record<string, unknown> {
|
|
104
|
+
return typeof value === "object" && value !== null;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
${classMarker}`,
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
return normalized
|
|
111
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { existsSync } from 'node:fs'
|
|
3
3
|
import { cp, rm } from 'node:fs/promises'
|
|
4
|
-
import {
|
|
4
|
+
import { resolve } from 'node:path'
|
|
5
5
|
import process from 'node:process'
|
|
6
|
-
import {
|
|
6
|
+
import { REPOSITORY_ROOT } from '../../lib/repository-root.mjs'
|
|
7
7
|
|
|
8
8
|
const args = new Set(process.argv.slice(2))
|
|
9
9
|
const rootIndex = process.argv.indexOf('--root')
|
|
10
10
|
const root = rootIndex >= 0 ? resolve(process.argv[rootIndex + 1] || '.') : process.cwd()
|
|
11
11
|
const dryRun = args.has('--dry-run')
|
|
12
12
|
const overlayIndex = process.argv.indexOf('--overlay')
|
|
13
|
+
const repositoryRoot = REPOSITORY_ROOT
|
|
13
14
|
const repositoryOverlay = resolve(
|
|
14
|
-
|
|
15
|
-
'..',
|
|
15
|
+
repositoryRoot,
|
|
16
16
|
'apps',
|
|
17
17
|
'admin',
|
|
18
18
|
'scaffold',
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// @ts-nocheck
|
|
4
1
|
/*
|
|
5
2
|
* ---------------------------------------------------------------
|
|
6
3
|
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
@@ -11,7 +8,7 @@
|
|
|
11
8
|
*/
|
|
12
9
|
|
|
13
10
|
export interface LoginCredentials {
|
|
14
|
-
/**
|
|
11
|
+
/** 用户名 */
|
|
15
12
|
username: string;
|
|
16
13
|
/** 密码 */
|
|
17
14
|
password: string;
|
|
@@ -27,7 +24,7 @@ export interface LoginResponse {
|
|
|
27
24
|
permissions?: string[];
|
|
28
25
|
/** 角色ID列表 */
|
|
29
26
|
roleIds?: string[];
|
|
30
|
-
/**
|
|
27
|
+
/** 授权版本号 */
|
|
31
28
|
authorizationRevision?: number;
|
|
32
29
|
}
|
|
33
30
|
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// @ts-nocheck
|
|
4
1
|
/*
|
|
5
2
|
* ---------------------------------------------------------------
|
|
6
3
|
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
@@ -10,7 +7,7 @@
|
|
|
10
7
|
* ---------------------------------------------------------------
|
|
11
8
|
*/
|
|
12
9
|
|
|
13
|
-
export type QueryParamsType = Record<string | number,
|
|
10
|
+
export type QueryParamsType = Record<string | number, unknown>;
|
|
14
11
|
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
|
|
15
12
|
|
|
16
13
|
export interface FullRequestParams extends Omit<RequestInit, "body"> {
|
|
@@ -62,6 +59,10 @@ export enum ContentType {
|
|
|
62
59
|
Text = "text/plain",
|
|
63
60
|
}
|
|
64
61
|
|
|
62
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
63
|
+
return typeof value === "object" && value !== null;
|
|
64
|
+
}
|
|
65
|
+
|
|
65
66
|
export class HttpClient<SecurityDataType = unknown> {
|
|
66
67
|
public baseUrl: string = "/api";
|
|
67
68
|
private securityData: SecurityDataType | null = null;
|
|
@@ -85,7 +86,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
85
86
|
this.securityData = data;
|
|
86
87
|
};
|
|
87
88
|
|
|
88
|
-
protected encodeQueryParam(key: string, value:
|
|
89
|
+
protected encodeQueryParam(key: string, value: unknown) {
|
|
89
90
|
const encodedKey = encodeURIComponent(key);
|
|
90
91
|
return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`;
|
|
91
92
|
}
|
|
@@ -96,7 +97,8 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
96
97
|
|
|
97
98
|
protected addArrayQueryParam(query: QueryParamsType, key: string) {
|
|
98
99
|
const value = query[key];
|
|
99
|
-
|
|
100
|
+
if (!Array.isArray(value)) return "";
|
|
101
|
+
return value.map((v) => this.encodeQueryParam(key, v)).join("&");
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
protected toQueryString(rawQuery?: QueryParamsType): string {
|
|
@@ -118,38 +120,38 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
118
120
|
return queryString ? `?${queryString}` : "";
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
private contentFormatters: Record<ContentType, (input:
|
|
122
|
-
[ContentType.Json]: (input:
|
|
123
|
-
input
|
|
124
|
-
?
|
|
125
|
-
: input,
|
|
126
|
-
[ContentType.JsonApi]: (input:
|
|
127
|
-
input
|
|
128
|
-
?
|
|
129
|
-
: input,
|
|
130
|
-
[ContentType.Text]: (input:
|
|
131
|
-
input
|
|
132
|
-
|
|
133
|
-
: input,
|
|
134
|
-
[ContentType.FormData]: (input: any) => {
|
|
123
|
+
private contentFormatters: Record<ContentType, (input: unknown) => BodyInit | null> = {
|
|
124
|
+
[ContentType.Json]: (input: unknown) =>
|
|
125
|
+
input === null || typeof input === "undefined"
|
|
126
|
+
? null
|
|
127
|
+
: JSON.stringify(input) ?? null,
|
|
128
|
+
[ContentType.JsonApi]: (input: unknown) =>
|
|
129
|
+
input === null || typeof input === "undefined"
|
|
130
|
+
? null
|
|
131
|
+
: JSON.stringify(input) ?? null,
|
|
132
|
+
[ContentType.Text]: (input: unknown) =>
|
|
133
|
+
typeof input === "string" ? input : JSON.stringify(input) ?? null,
|
|
134
|
+
[ContentType.FormData]: (input: unknown) => {
|
|
135
135
|
if (input instanceof FormData) {
|
|
136
136
|
return input;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
const record = isRecord(input) ? input : {};
|
|
140
|
+
return Object.keys(record).reduce((formData, key) => {
|
|
141
|
+
const property = record[key];
|
|
141
142
|
formData.append(
|
|
142
143
|
key,
|
|
143
144
|
property instanceof Blob
|
|
144
145
|
? property
|
|
145
146
|
: typeof property === "object" && property !== null
|
|
146
|
-
? JSON.stringify(property)
|
|
147
|
-
:
|
|
147
|
+
? JSON.stringify(property) ?? ""
|
|
148
|
+
: String(property),
|
|
148
149
|
);
|
|
149
150
|
return formData;
|
|
150
151
|
}, new FormData());
|
|
151
152
|
},
|
|
152
|
-
[ContentType.UrlEncoded]: (input:
|
|
153
|
+
[ContentType.UrlEncoded]: (input: unknown) =>
|
|
154
|
+
this.toQueryString(isRecord(input) ? input : {}),
|
|
153
155
|
};
|
|
154
156
|
|
|
155
157
|
protected mergeRequestParams(
|
|
@@ -193,7 +195,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
193
195
|
}
|
|
194
196
|
};
|
|
195
197
|
|
|
196
|
-
public request = async <T =
|
|
198
|
+
public request = async <T = unknown, E = unknown>({
|
|
197
199
|
body,
|
|
198
200
|
secure,
|
|
199
201
|
path,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// @ts-nocheck
|
|
4
1
|
/*
|
|
5
2
|
* ---------------------------------------------------------------
|
|
6
3
|
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
@@ -47,7 +44,7 @@ export class 系统管理内容文章<SecurityDataType = unknown> {
|
|
|
47
44
|
},
|
|
48
45
|
params: RequestParams = {},
|
|
49
46
|
) =>
|
|
50
|
-
this.http.request<PageResultContentArticle,
|
|
47
|
+
this.http.request<PageResultContentArticle, unknown>({
|
|
51
48
|
path: `/system/content-articles`,
|
|
52
49
|
method: "GET",
|
|
53
50
|
query: query,
|
|
@@ -69,7 +66,7 @@ export class 系统管理内容文章<SecurityDataType = unknown> {
|
|
|
69
66
|
data: ContentArticleDraft,
|
|
70
67
|
params: RequestParams = {},
|
|
71
68
|
) =>
|
|
72
|
-
this.http.request<ContentArticle,
|
|
69
|
+
this.http.request<ContentArticle, unknown>({
|
|
73
70
|
path: `/system/content-articles`,
|
|
74
71
|
method: "POST",
|
|
75
72
|
body: data,
|
|
@@ -94,7 +91,7 @@ export class 系统管理内容文章<SecurityDataType = unknown> {
|
|
|
94
91
|
},
|
|
95
92
|
params: RequestParams = {},
|
|
96
93
|
) =>
|
|
97
|
-
this.http.request<void,
|
|
94
|
+
this.http.request<void, unknown>({
|
|
98
95
|
path: `/system/content-articles`,
|
|
99
96
|
method: "DELETE",
|
|
100
97
|
body: data,
|
|
@@ -113,7 +110,7 @@ export class 系统管理内容文章<SecurityDataType = unknown> {
|
|
|
113
110
|
* @response `200` `ContentArticle` 成功
|
|
114
111
|
*/
|
|
115
112
|
contentArticlesDetail = (id: string, params: RequestParams = {}) =>
|
|
116
|
-
this.http.request<ContentArticle,
|
|
113
|
+
this.http.request<ContentArticle, unknown>({
|
|
117
114
|
path: `/system/content-articles/${id}`,
|
|
118
115
|
method: "GET",
|
|
119
116
|
secure: true,
|
|
@@ -135,7 +132,7 @@ export class 系统管理内容文章<SecurityDataType = unknown> {
|
|
|
135
132
|
data: ContentArticleDraft,
|
|
136
133
|
params: RequestParams = {},
|
|
137
134
|
) =>
|
|
138
|
-
this.http.request<ContentArticle,
|
|
135
|
+
this.http.request<ContentArticle, unknown>({
|
|
139
136
|
path: `/system/content-articles/${id}`,
|
|
140
137
|
method: "PUT",
|
|
141
138
|
body: data,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// @ts-nocheck
|
|
4
1
|
/*
|
|
5
2
|
* ---------------------------------------------------------------
|
|
6
3
|
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
@@ -42,7 +39,7 @@ export class 系统管理审计<SecurityDataType = unknown> {
|
|
|
42
39
|
},
|
|
43
40
|
params: RequestParams = {},
|
|
44
41
|
) =>
|
|
45
|
-
this.http.request<PageResultRbacAuditEvent,
|
|
42
|
+
this.http.request<PageResultRbacAuditEvent, unknown>({
|
|
46
43
|
path: `/system/audit`,
|
|
47
44
|
method: "GET",
|
|
48
45
|
query: query,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// @ts-nocheck
|
|
4
1
|
/*
|
|
5
2
|
* ---------------------------------------------------------------
|
|
6
3
|
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
@@ -37,7 +34,7 @@ export class 系统管理文件上传<SecurityDataType = unknown> {
|
|
|
37
34
|
},
|
|
38
35
|
params: RequestParams = {},
|
|
39
36
|
) =>
|
|
40
|
-
this.http.request<UploadResponse,
|
|
37
|
+
this.http.request<UploadResponse, unknown>({
|
|
41
38
|
path: `/system/uploads`,
|
|
42
39
|
method: "POST",
|
|
43
40
|
body: data,
|
|
@@ -57,7 +54,7 @@ export class 系统管理文件上传<SecurityDataType = unknown> {
|
|
|
57
54
|
* @response `204` `void` 删除成功
|
|
58
55
|
*/
|
|
59
56
|
uploadsDelete = (id: string, params: RequestParams = {}) =>
|
|
60
|
-
this.http.request<void,
|
|
57
|
+
this.http.request<void, unknown>({
|
|
61
58
|
path: `/system/uploads/${id}`,
|
|
62
59
|
method: "DELETE",
|
|
63
60
|
secure: true,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// @ts-nocheck
|
|
4
1
|
/*
|
|
5
2
|
* ---------------------------------------------------------------
|
|
6
3
|
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
@@ -50,7 +47,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
|
|
|
50
47
|
},
|
|
51
48
|
params: RequestParams = {},
|
|
52
49
|
) =>
|
|
53
|
-
this.http.request<PageResultAdminUser,
|
|
50
|
+
this.http.request<PageResultAdminUser, unknown>({
|
|
54
51
|
path: `/system/users`,
|
|
55
52
|
method: "GET",
|
|
56
53
|
query: query,
|
|
@@ -69,7 +66,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
|
|
|
69
66
|
* @response `200` `AdminUser` 创建成功
|
|
70
67
|
*/
|
|
71
68
|
usersCreate = (data: AdminUserDraft, params: RequestParams = {}) =>
|
|
72
|
-
this.http.request<AdminUser,
|
|
69
|
+
this.http.request<AdminUser, unknown>({
|
|
73
70
|
path: `/system/users`,
|
|
74
71
|
method: "POST",
|
|
75
72
|
body: data,
|
|
@@ -94,7 +91,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
|
|
|
94
91
|
},
|
|
95
92
|
params: RequestParams = {},
|
|
96
93
|
) =>
|
|
97
|
-
this.http.request<void,
|
|
94
|
+
this.http.request<void, unknown>({
|
|
98
95
|
path: `/system/users`,
|
|
99
96
|
method: "DELETE",
|
|
100
97
|
body: data,
|
|
@@ -113,7 +110,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
|
|
|
113
110
|
* @response `200` `AdminUser` 成功
|
|
114
111
|
*/
|
|
115
112
|
usersDetail = (id: string, params: RequestParams = {}) =>
|
|
116
|
-
this.http.request<AdminUser,
|
|
113
|
+
this.http.request<AdminUser, unknown>({
|
|
117
114
|
path: `/system/users/${id}`,
|
|
118
115
|
method: "GET",
|
|
119
116
|
secure: true,
|
|
@@ -135,7 +132,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
|
|
|
135
132
|
data: AdminUserDraft,
|
|
136
133
|
params: RequestParams = {},
|
|
137
134
|
) =>
|
|
138
|
-
this.http.request<AdminUser,
|
|
135
|
+
this.http.request<AdminUser, unknown>({
|
|
139
136
|
path: `/system/users/${id}`,
|
|
140
137
|
method: "PUT",
|
|
141
138
|
body: data,
|
|
@@ -149,7 +146,8 @@ export class 系统管理用户<SecurityDataType = unknown> {
|
|
|
149
146
|
*
|
|
150
147
|
* @tags 系统管理-用户
|
|
151
148
|
* @name UsersStatusPartialUpdate
|
|
152
|
-
* @summary
|
|
149
|
+
* @summary 批量更新用户状态
|
|
150
|
+
* @request PATCH:/system/users/status
|
|
153
151
|
* @secure
|
|
154
152
|
* @response `204` `void` 更新成功
|
|
155
153
|
*/
|
|
@@ -160,7 +158,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
|
|
|
160
158
|
},
|
|
161
159
|
params: RequestParams = {},
|
|
162
160
|
) =>
|
|
163
|
-
this.http.request<void,
|
|
161
|
+
this.http.request<void, unknown>({
|
|
164
162
|
path: `/system/users/status`,
|
|
165
163
|
method: "PATCH",
|
|
166
164
|
body: data,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// @ts-nocheck
|
|
4
1
|
/*
|
|
5
2
|
* ---------------------------------------------------------------
|
|
6
3
|
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
@@ -30,12 +27,13 @@ export class 系统管理菜单<SecurityDataType = unknown> {
|
|
|
30
27
|
*
|
|
31
28
|
* @tags 系统管理-菜单
|
|
32
29
|
* @name MenusTreeList
|
|
33
|
-
* @summary
|
|
30
|
+
* @summary 获取菜单树
|
|
31
|
+
* @request GET:/system/menus/tree
|
|
34
32
|
* @secure
|
|
35
33
|
* @response `200` `(BackendMenuNode)[]` 成功
|
|
36
34
|
*/
|
|
37
35
|
menusTreeList = (params: RequestParams = {}) =>
|
|
38
|
-
this.http.request<BackendMenuNode[],
|
|
36
|
+
this.http.request<BackendMenuNode[], unknown>({
|
|
39
37
|
path: `/system/menus/tree`,
|
|
40
38
|
method: "GET",
|
|
41
39
|
secure: true,
|
|
@@ -64,7 +62,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
|
|
|
64
62
|
},
|
|
65
63
|
params: RequestParams = {},
|
|
66
64
|
) =>
|
|
67
|
-
this.http.request<PageResultRbacMenu,
|
|
65
|
+
this.http.request<PageResultRbacMenu, unknown>({
|
|
68
66
|
path: `/system/menus`,
|
|
69
67
|
method: "GET",
|
|
70
68
|
query: query,
|
|
@@ -83,7 +81,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
|
|
|
83
81
|
* @response `200` `RbacMenu` 创建成功
|
|
84
82
|
*/
|
|
85
83
|
menusCreate = (data: RbacMenuDraft, params: RequestParams = {}) =>
|
|
86
|
-
this.http.request<RbacMenu,
|
|
84
|
+
this.http.request<RbacMenu, unknown>({
|
|
87
85
|
path: `/system/menus`,
|
|
88
86
|
method: "POST",
|
|
89
87
|
body: data,
|
|
@@ -108,7 +106,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
|
|
|
108
106
|
},
|
|
109
107
|
params: RequestParams = {},
|
|
110
108
|
) =>
|
|
111
|
-
this.http.request<void,
|
|
109
|
+
this.http.request<void, unknown>({
|
|
112
110
|
path: `/system/menus`,
|
|
113
111
|
method: "DELETE",
|
|
114
112
|
body: data,
|
|
@@ -127,7 +125,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
|
|
|
127
125
|
* @response `200` `RbacMenu` 成功
|
|
128
126
|
*/
|
|
129
127
|
menusDetail = (id: string, params: RequestParams = {}) =>
|
|
130
|
-
this.http.request<RbacMenu,
|
|
128
|
+
this.http.request<RbacMenu, unknown>({
|
|
131
129
|
path: `/system/menus/${id}`,
|
|
132
130
|
method: "GET",
|
|
133
131
|
secure: true,
|
|
@@ -145,7 +143,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
|
|
|
145
143
|
* @response `200` `RbacMenu` 更新成功
|
|
146
144
|
*/
|
|
147
145
|
menusUpdate = (id: string, data: RbacMenuDraft, params: RequestParams = {}) =>
|
|
148
|
-
this.http.request<RbacMenu,
|
|
146
|
+
this.http.request<RbacMenu, unknown>({
|
|
149
147
|
path: `/system/menus/${id}`,
|
|
150
148
|
method: "PUT",
|
|
151
149
|
body: data,
|
|
@@ -159,7 +157,8 @@ export class 系统管理菜单<SecurityDataType = unknown> {
|
|
|
159
157
|
*
|
|
160
158
|
* @tags 系统管理-菜单
|
|
161
159
|
* @name MenusStatusPartialUpdate
|
|
162
|
-
* @summary
|
|
160
|
+
* @summary 批量更新菜单状态
|
|
161
|
+
* @request PATCH:/system/menus/status
|
|
163
162
|
* @secure
|
|
164
163
|
* @response `204` `void` 更新成功
|
|
165
164
|
*/
|
|
@@ -170,7 +169,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
|
|
|
170
169
|
},
|
|
171
170
|
params: RequestParams = {},
|
|
172
171
|
) =>
|
|
173
|
-
this.http.request<void,
|
|
172
|
+
this.http.request<void, unknown>({
|
|
174
173
|
path: `/system/menus/status`,
|
|
175
174
|
method: "PATCH",
|
|
176
175
|
body: data,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// @ts-nocheck
|
|
4
1
|
/*
|
|
5
2
|
* ---------------------------------------------------------------
|
|
6
3
|
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
@@ -48,7 +45,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
|
|
|
48
45
|
},
|
|
49
46
|
params: RequestParams = {},
|
|
50
47
|
) =>
|
|
51
|
-
this.http.request<PageResultAdminRole,
|
|
48
|
+
this.http.request<PageResultAdminRole, unknown>({
|
|
52
49
|
path: `/system/roles`,
|
|
53
50
|
method: "GET",
|
|
54
51
|
query: query,
|
|
@@ -67,7 +64,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
|
|
|
67
64
|
* @response `200` `AdminRole` 创建成功
|
|
68
65
|
*/
|
|
69
66
|
rolesCreate = (data: AdminRoleDraft, params: RequestParams = {}) =>
|
|
70
|
-
this.http.request<AdminRole,
|
|
67
|
+
this.http.request<AdminRole, unknown>({
|
|
71
68
|
path: `/system/roles`,
|
|
72
69
|
method: "POST",
|
|
73
70
|
body: data,
|
|
@@ -92,7 +89,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
|
|
|
92
89
|
},
|
|
93
90
|
params: RequestParams = {},
|
|
94
91
|
) =>
|
|
95
|
-
this.http.request<void,
|
|
92
|
+
this.http.request<void, unknown>({
|
|
96
93
|
path: `/system/roles`,
|
|
97
94
|
method: "DELETE",
|
|
98
95
|
body: data,
|
|
@@ -111,7 +108,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
|
|
|
111
108
|
* @response `200` `AdminRole` 成功
|
|
112
109
|
*/
|
|
113
110
|
rolesDetail = (id: string, params: RequestParams = {}) =>
|
|
114
|
-
this.http.request<AdminRole,
|
|
111
|
+
this.http.request<AdminRole, unknown>({
|
|
115
112
|
path: `/system/roles/${id}`,
|
|
116
113
|
method: "GET",
|
|
117
114
|
secure: true,
|
|
@@ -133,7 +130,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
|
|
|
133
130
|
data: AdminRoleDraft,
|
|
134
131
|
params: RequestParams = {},
|
|
135
132
|
) =>
|
|
136
|
-
this.http.request<AdminRole,
|
|
133
|
+
this.http.request<AdminRole, unknown>({
|
|
137
134
|
path: `/system/roles/${id}`,
|
|
138
135
|
method: "PUT",
|
|
139
136
|
body: data,
|
|
@@ -147,7 +144,8 @@ export class 系统管理角色<SecurityDataType = unknown> {
|
|
|
147
144
|
*
|
|
148
145
|
* @tags 系统管理-角色
|
|
149
146
|
* @name RolesStatusPartialUpdate
|
|
150
|
-
* @summary
|
|
147
|
+
* @summary 批量更新角色状态
|
|
148
|
+
* @request PATCH:/system/roles/status
|
|
151
149
|
* @secure
|
|
152
150
|
* @response `204` `void` 更新成功
|
|
153
151
|
*/
|
|
@@ -158,7 +156,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
|
|
|
158
156
|
},
|
|
159
157
|
params: RequestParams = {},
|
|
160
158
|
) =>
|
|
161
|
-
this.http.request<void,
|
|
159
|
+
this.http.request<void, unknown>({
|
|
162
160
|
path: `/system/roles/status`,
|
|
163
161
|
method: "PATCH",
|
|
164
162
|
body: data,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// @ts-nocheck
|
|
4
1
|
/*
|
|
5
2
|
* ---------------------------------------------------------------
|
|
6
3
|
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
@@ -48,7 +45,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
|
|
|
48
45
|
},
|
|
49
46
|
params: RequestParams = {},
|
|
50
47
|
) =>
|
|
51
|
-
this.http.request<PageResultOrderDraft,
|
|
48
|
+
this.http.request<PageResultOrderDraft, unknown>({
|
|
52
49
|
path: `/system/order-drafts`,
|
|
53
50
|
method: "GET",
|
|
54
51
|
query: query,
|
|
@@ -67,7 +64,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
|
|
|
67
64
|
* @response `200` `OrderDraft` 创建成功
|
|
68
65
|
*/
|
|
69
66
|
orderDraftsCreate = (data: OrderDraftDraft, params: RequestParams = {}) =>
|
|
70
|
-
this.http.request<OrderDraft,
|
|
67
|
+
this.http.request<OrderDraft, unknown>({
|
|
71
68
|
path: `/system/order-drafts`,
|
|
72
69
|
method: "POST",
|
|
73
70
|
body: data,
|
|
@@ -92,7 +89,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
|
|
|
92
89
|
},
|
|
93
90
|
params: RequestParams = {},
|
|
94
91
|
) =>
|
|
95
|
-
this.http.request<void,
|
|
92
|
+
this.http.request<void, unknown>({
|
|
96
93
|
path: `/system/order-drafts`,
|
|
97
94
|
method: "DELETE",
|
|
98
95
|
body: data,
|
|
@@ -111,7 +108,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
|
|
|
111
108
|
* @response `200` `OrderDraft` 成功
|
|
112
109
|
*/
|
|
113
110
|
orderDraftsDetail = (id: string, params: RequestParams = {}) =>
|
|
114
|
-
this.http.request<OrderDraft,
|
|
111
|
+
this.http.request<OrderDraft, unknown>({
|
|
115
112
|
path: `/system/order-drafts/${id}`,
|
|
116
113
|
method: "GET",
|
|
117
114
|
secure: true,
|
|
@@ -133,7 +130,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
|
|
|
133
130
|
data: OrderDraftDraft,
|
|
134
131
|
params: RequestParams = {},
|
|
135
132
|
) =>
|
|
136
|
-
this.http.request<OrderDraft,
|
|
133
|
+
this.http.request<OrderDraft, unknown>({
|
|
137
134
|
path: `/system/order-drafts/${id}`,
|
|
138
135
|
method: "PUT",
|
|
139
136
|
body: data,
|
|
@@ -147,7 +144,8 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
|
|
|
147
144
|
*
|
|
148
145
|
* @tags 系统管理-订单草稿
|
|
149
146
|
* @name OrderDraftsStatusPartialUpdate
|
|
150
|
-
* @summary
|
|
147
|
+
* @summary 更新订单草稿状态
|
|
148
|
+
* @request PATCH:/system/order-drafts/{id}/status
|
|
151
149
|
* @secure
|
|
152
150
|
* @response `200` `OrderDraft` 更新成功
|
|
153
151
|
*/
|
|
@@ -158,7 +156,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
|
|
|
158
156
|
},
|
|
159
157
|
params: RequestParams = {},
|
|
160
158
|
) =>
|
|
161
|
-
this.http.request<OrderDraft,
|
|
159
|
+
this.http.request<OrderDraft, unknown>({
|
|
162
160
|
path: `/system/order-drafts/${id}/status`,
|
|
163
161
|
method: "PATCH",
|
|
164
162
|
body: data,
|