🐛 fix(api): Rename app-related functions and types to application for consistency

This commit is contained in:
web@ppanel
2025-01-18 18:48:28 +07:00
parent 5e5e4edd2e
commit 9d8b814212
11 changed files with 77 additions and 228 deletions
-101
View File
@@ -1,101 +0,0 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** get app config GET /v1/admin/app/config */
export async function getAppConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.AppConfig }>('/v1/admin/app/config', {
method: 'GET',
...(options || {}),
});
}
/** update app config PUT /v1/admin/app/config */
export async function updateAppConfig(body: API.AppConfig, options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/admin/app/config', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** update app version PUT /v1/admin/app/version */
export async function updateAppVersion(
body: API.UpdateAppVersionRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/app/version', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** create app version POST /v1/admin/app/version */
export async function createAppVersion(
body: API.CreateAppVersionRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/app/version', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** delete app version DELETE /v1/admin/app/version */
export async function deleteAppVersionInfo(
body: API.DeleteAppVersionRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/app/version', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** set default app version PUT /v1/admin/app/version_default */
export async function setDefaultAppVersionInfo(
body: API.DefaultAppVersionRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/app/version_default', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** query app version info GET /v1/admin/app/version_list */
export async function getAppVersionList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetAppVersionListParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.GetAppVersionListResponse }>(
'/v1/admin/app/version_list',
{
method: 'GET',
params: {
...params,
},
...(options || {}),
},
);
}
+1 -3
View File
@@ -1,9 +1,8 @@
// @ts-ignore
// API 更新时间:
// API 唯一标识:
import * as announcement from './announcement';
import * as app from './app';
import * as console from './console';
import * as coupon from './coupon';
import * as document from './document';
@@ -18,7 +17,6 @@ import * as tool from './tool';
import * as user from './user';
export default {
announcement,
app,
console,
coupon,
document,
+26
View File
@@ -58,6 +58,32 @@ export async function deleteApplication(
});
}
/** get application config GET /v1/admin/system/application_config */
export async function getApplicationConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ApplicationConfig }>(
'/v1/admin/system/application_config',
{
method: 'GET',
...(options || {}),
},
);
}
/** update application config PUT /v1/admin/system/application_config */
export async function updateApplicationConfig(
body: API.ApplicationConfig,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/application_config', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Update application version PUT /v1/admin/system/application_version */
export async function updateApplicationVersion(
body: API.UpdateApplicationVersionRequest,
+6 -57
View File
@@ -18,14 +18,6 @@ declare namespace API {
updated_at: number;
};
type AppConfig = {
name: string;
domains: string[];
describe: string;
startup_picture: string;
startup_picture_skip_time: number;
};
type Application = {
id: number;
icon: string;
@@ -34,6 +26,12 @@ declare namespace API {
subscribe_type: string;
};
type ApplicationConfig = {
domains: string[];
startup_picture: string;
startup_picture_skip_time: number;
};
type ApplicationPlatform = {
ios?: ApplicationVersion[];
mac?: ApplicationVersion[];
@@ -64,15 +62,6 @@ declare namespace API {
is_default: boolean;
};
type AppVersion = {
id: number;
os: string;
version: string;
download_url: string;
describe: string;
default_version: boolean;
};
type AuthConfig = {
sms: SmsAuthenticateConfig;
email: EmailAuthticateConfig;
@@ -145,13 +134,6 @@ declare namespace API {
application_id: number;
};
type CreateAppVersionRequest = {
os: string;
version: string;
download_url: string;
describe: string;
};
type CreateCouponRequest = {
name: string;
code?: string;
@@ -267,10 +249,6 @@ declare namespace API {
currency_symbol: string;
};
type DefaultAppVersionRequest = {
id: number;
};
type DeleteAnnouncementRequest = {
id: number;
};
@@ -283,10 +261,6 @@ declare namespace API {
id: number;
};
type DeleteAppVersionRequest = {
id: number;
};
type DeleteCouponRequest = {
id: number;
};
@@ -398,23 +372,6 @@ declare namespace API {
id: number;
};
type GetAppVersionListParams = {
page: number;
size: number;
os?: string;
};
type GetAppVersionListRequest = {
page: number;
size: number;
os?: string;
};
type GetAppVersionListResponse = {
total: number;
list: AppVersion[];
};
type GetCouponListParams = {
page: number;
size: number;
@@ -1082,14 +1039,6 @@ declare namespace API {
application_id: number;
};
type UpdateAppVersionRequest = {
id: number;
os: string;
version: string;
download_url: string;
describe: string;
};
type UpdateCouponRequest = {
id: number;
name: string;