mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-04 23:16:37 +08:00
6bd7dc91fc
Move OpenFlare route registration from RegisterCustomRoutes to v1.RegisterV1Routes so business APIs are mounted directly at /api/v1/openflare instead of under the /custom example prefix. Update handler Swagger annotations, frontend service base paths, and regenerated swagger docs accordingly.
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import {OpenFlareBaseService} from './base.service';
|
|
import type {
|
|
ManagedDomainItem,
|
|
ManagedDomainMatchResult,
|
|
ManagedDomainMutationPayload,
|
|
} from './types';
|
|
|
|
export class WebsiteService extends OpenFlareBaseService {
|
|
protected static override readonly basePath: string = '/api/v1/openflare/managed-domains';
|
|
|
|
static async list(): Promise<ManagedDomainItem[]> {
|
|
return this.get<ManagedDomainItem[]>('/');
|
|
}
|
|
|
|
static async create(
|
|
payload: ManagedDomainMutationPayload,
|
|
): Promise<ManagedDomainItem> {
|
|
return this.post<ManagedDomainItem>('/', payload);
|
|
}
|
|
|
|
static async update(
|
|
id: number,
|
|
payload: ManagedDomainMutationPayload,
|
|
): Promise<ManagedDomainItem> {
|
|
return this.post<ManagedDomainItem>(`/${id}/update`, payload);
|
|
}
|
|
|
|
static async deleteById(id: number): Promise<void> {
|
|
return this.post<void>(`/${id}/delete`);
|
|
}
|
|
|
|
static async match(domain: string): Promise<ManagedDomainMatchResult> {
|
|
return this.get<ManagedDomainMatchResult>('/match', {domain});
|
|
}
|
|
} |