feat(douyu): 增加供给目标管理界面
This commit is contained in:
@@ -5,6 +5,9 @@ import type {
|
||||
DouyuExchangeResultImage,
|
||||
DouyuGoodsItem,
|
||||
DouyuRechargeChannel,
|
||||
DouyuSupplyTarget,
|
||||
DouyuSupplyTargetUpdate,
|
||||
DouyuSupplyTargetUpsert,
|
||||
DouyuTaskAccountItem,
|
||||
DouyuTaskBatchRequest,
|
||||
DouyuTaskBatchResult,
|
||||
@@ -19,6 +22,12 @@ export const douyuApi = {
|
||||
taskTypes: () => api.get<Record<string, string>, Record<string, string>>('/douyu/task-types'),
|
||||
getAccountPlatformStatus: () =>
|
||||
api.get<DouyuAccountPlatformStatus, DouyuAccountPlatformStatus>('/douyu/account-platform-status'),
|
||||
listSupplyTargets: () =>
|
||||
api.get<DouyuSupplyTarget[], DouyuSupplyTarget[]>('/douyu/supply-targets'),
|
||||
createSupplyTarget: (data: DouyuSupplyTargetUpsert) =>
|
||||
api.post<DouyuSupplyTarget, DouyuSupplyTarget>('/douyu/supply-targets', data),
|
||||
updateSupplyTarget: (targetId: number, data: DouyuSupplyTargetUpdate) =>
|
||||
api.put<DouyuSupplyTarget, DouyuSupplyTarget>(`/douyu/supply-targets/${targetId}`, data),
|
||||
listAccounts: (params?: { search?: string; tag?: string; ids?: string }) =>
|
||||
api.get<DouyuTaskAccountItem[], DouyuTaskAccountItem[]>('/douyu/accounts', { params }),
|
||||
listAccountsPaged: (params: PageParams & { ids?: string; tag?: string }) =>
|
||||
|
||||
@@ -745,6 +745,33 @@ export interface DouyuSupplyTargetStatus {
|
||||
needs_replenishment: boolean;
|
||||
}
|
||||
|
||||
export interface DouyuSupplyTarget extends DouyuSupplyTargetStatus {
|
||||
platform: string;
|
||||
enabled: boolean;
|
||||
updated_by: number | null;
|
||||
updated_at: string | null;
|
||||
}
|
||||
|
||||
export interface DouyuSupplyTargetUpsert {
|
||||
platform?: 'douyu';
|
||||
scope: string;
|
||||
commodity_id: string;
|
||||
value_class: 'high_value' | 'ordinary';
|
||||
target_covered: number;
|
||||
target_available: number;
|
||||
target_allocatable: number;
|
||||
safety_buffer: number;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export interface DouyuSupplyTargetUpdate {
|
||||
target_covered: number;
|
||||
target_available: number;
|
||||
target_allocatable: number;
|
||||
safety_buffer: number;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export interface DouyuPlatformAlert {
|
||||
code: string;
|
||||
severity: 'critical' | 'warning' | 'info';
|
||||
|
||||
Reference in New Issue
Block a user