11
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled

This commit is contained in:
francis-fh
2026-06-17 18:38:40 +08:00
parent e5a41feea9
commit 183a25f709
10 changed files with 1001 additions and 7 deletions

View File

@@ -0,0 +1,110 @@
import { request } from '@umijs/max';
/** 直播带岗列表项 */
export interface LiveStreamItem {
id: number;
title: string;
liveUrl: string;
description?: string;
startTime?: string;
endTime?: string;
companyId?: string;
companyName: string;
createTime?: string;
updateTime?: string;
}
/** 直播带岗列表查询参数 */
export interface LiveListParams {
title?: string;
companyName?: string;
}
/** 直播带岗列表响应 */
export interface LiveListResult {
code: number;
msg?: string;
total: number;
rows: LiveStreamItem[];
data?: any;
}
/** 获取直播带岗列表 GET /app/live/list */
export async function getLiveList(params?: LiveListParams) {
return request<LiveListResult>('/api/app/live/list', {
method: 'GET',
params,
});
}
// ==================== 管理端 CMS 接口 ====================
const CMS_BASE_URL = '/api/cms/live';
/** 管理端直播列表查询参数 */
export interface CmsLiveListParams {
title?: string;
companyName?: string;
pageNum?: number;
pageSize?: number;
current?: number;
}
/** 管理端通用响应 */
export interface CmsLiveCommonResult {
code: number;
msg?: string;
data?: any;
}
/** 管理端直播列表响应 */
export interface CmsLiveListResult {
code: number;
msg?: string;
total: number;
rows: LiveStreamItem[];
data?: any;
}
/** 管理端新增/编辑直播参数 */
export interface CmsLiveForm {
id?: number;
title: string;
liveUrl: string;
description?: string;
startTime?: string;
endTime?: string;
companyId?: string;
companyName?: string;
}
/** 获取直播带岗管理列表 GET /api/cms/live/list */
export async function getCmsLiveList(params?: CmsLiveListParams) {
return request<CmsLiveListResult>(`${CMS_BASE_URL}/list`, {
method: 'GET',
params,
});
}
/** 新增直播带岗 POST /api/cms/live */
export async function addCmsLive(data: CmsLiveForm) {
return request<CmsLiveCommonResult>(CMS_BASE_URL, {
method: 'POST',
data,
});
}
/** 修改直播带岗 PUT /api/cms/live */
export async function updateCmsLive(data: CmsLiveForm) {
return request<CmsLiveCommonResult>(CMS_BASE_URL, {
method: 'PUT',
data,
});
}
/** 删除直播带岗 DELETE /api/cms/live/{id} */
export async function deleteCmsLive(id: number) {
return request<CmsLiveCommonResult>(`${CMS_BASE_URL}/${id}`, {
method: 'DELETE',
});
}