feat(protocol): Add template preview functionality with localization support

This commit is contained in:
web
2025-08-14 09:55:13 -07:00
committed by speakeloudest
parent e4979a5de8
commit d17d77353f
38 changed files with 522 additions and 92 deletions
+18
View File
@@ -17,6 +17,24 @@ export async function createSubscribeApplication(
});
}
/** Preview Template GET /v1/admin/application/preview */
export async function previewSubscribeTemplate(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.PreviewSubscribeTemplateParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.PreviewSubscribeTemplateResponse }>(
'/v1/admin/application/preview',
{
method: 'GET',
params: {
...params,
},
...(options || {}),
},
);
}
/** Update subscribe application PUT /v1/admin/application/subscribe_application */
export async function updateSubscribeApplication(
body: API.UpdateSubscribeApplicationRequest,
+1 -1
View File
@@ -1,5 +1,5 @@
// @ts-ignore
// API 更新时间:
// API 唯一标识:
import * as ads from './ads';
+13 -2
View File
@@ -342,7 +342,6 @@ declare namespace API {
scheme?: string;
user_agent: string;
is_default: boolean;
proxy_template: string;
template: string;
output_format: string;
download_link: DownloadLink;
@@ -1213,6 +1212,19 @@ declare namespace API {
orderNo: string;
};
type PreviewSubscribeTemplateParams = {
id: number;
};
type PreviewSubscribeTemplateRequest = {
id: number;
};
type PreviewSubscribeTemplateResponse = {
/** 预览的模板内容 */
template: string;
};
type PrivacyPolicyConfig = {
privacy_policy: string;
};
@@ -1505,7 +1517,6 @@ declare namespace API {
scheme?: string;
user_agent: string;
is_default: boolean;
proxy_template: string;
template: string;
output_format: string;
download_link?: DownloadLink;
+5 -8
View File
@@ -1,5 +1,5 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Get Ads GET /v1/common/ads */
@@ -45,13 +45,10 @@ export async function checkVerificationCode(
/** Get Client GET /v1/common/client */
export async function getClient(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetSubscribeApplicationListResponse }>(
'/v1/common/client',
{
method: 'GET',
...(options || {}),
},
);
return request<API.Response & { data?: API.GetSubscribeClientResponse }>('/v1/common/client', {
method: 'GET',
...(options || {}),
});
}
/** Get verification code POST /v1/common/send_code */
+1 -1
View File
@@ -1,5 +1,5 @@
// @ts-ignore
// API 更新时间:
// API 唯一标识:
import * as auth from './auth';
+3 -9
View File
@@ -293,9 +293,9 @@ declare namespace API {
protocol: string[];
};
type GetSubscribeApplicationListResponse = {
type GetSubscribeClientResponse = {
total: number;
list: SubscribeApplication[];
list: SubscribeClient[];
};
type GetTosResponse = {
@@ -779,20 +779,14 @@ declare namespace API {
updated_at: number;
};
type SubscribeApplication = {
type SubscribeClient = {
id: number;
name: string;
description?: string;
icon?: string;
scheme?: string;
user_agent: string;
is_default: boolean;
proxy_template: string;
template: string;
output_format: string;
download_link?: DownloadLink;
created_at: number;
updated_at: number;
};
type SubscribeConfig = {