新增: 轮询管理
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m17s

This commit is contained in:
sexygoat
2026-03-30 14:59:56 +08:00
parent dbe6070207
commit a05717c2ed
28 changed files with 6865 additions and 103 deletions

View File

@@ -0,0 +1,50 @@
/**
* 轮询并发控制 API
*/
import { BaseService } from '../BaseService'
import type { BaseResponse } from '@/types/api'
import type {
PollingConcurrency,
PollingConcurrencyListResponse,
UpdateConcurrencyParams,
ResetConcurrencyParams
} from '@/types/api/pollingConcurrency'
/**
* 轮询并发控制服务
*/
export class PollingConcurrencyService extends BaseService {
/**
* 获取轮询并发配置列表
* @returns 并发配置列表
*/
static getConcurrencyList(): Promise<BaseResponse<PollingConcurrencyListResponse>> {
return this.get<BaseResponse<PollingConcurrencyListResponse>>('/api/admin/polling-concurrency')
}
/**
* 获取指定任务类型的并发配置
* @param taskType 任务类型
* @returns 并发配置
*/
static getConcurrencyByType(taskType: string): Promise<BaseResponse<PollingConcurrency>> {
return this.get<BaseResponse<PollingConcurrency>>(`/api/admin/polling-concurrency/${taskType}`)
}
/**
* 更新轮询并发配置
* @param taskType 任务类型
* @param params 更新参数
*/
static updateConcurrency(taskType: string, params: UpdateConcurrencyParams): Promise<BaseResponse<void>> {
return this.put<BaseResponse<void>>(`/api/admin/polling-concurrency/${taskType}`, params)
}
/**
* 重置轮询并发计数
* @param params 重置参数
*/
static resetConcurrency(params?: ResetConcurrencyParams): Promise<BaseResponse<void>> {
return this.post<BaseResponse<void>>('/api/admin/polling-concurrency/reset', params || {})
}
}