支持账号按筛选全量批量操作
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import api from './client';
|
||||
import type {
|
||||
AccountItem,
|
||||
AccountBulkSelection,
|
||||
AccountBulkTagRequest,
|
||||
AssignmentsSummary,
|
||||
BasicSummary,
|
||||
MessageCountResponse,
|
||||
@@ -27,8 +29,12 @@ export const accountApi = {
|
||||
api.put<MessageResponse, MessageResponse>(`/accounts/${id}/tag`, { tag }),
|
||||
batchTag: (account_ids: number[], tag: string) =>
|
||||
api.put<MessageCountResponse, MessageCountResponse>('/accounts/batch-tag', { account_ids, tag }),
|
||||
batchTagSelection: (data: AccountBulkTagRequest) =>
|
||||
api.put<MessageCountResponse, MessageCountResponse>('/accounts/batch-tag-selection', data),
|
||||
listTags: () => api.get<string[], string[]>('/accounts/tags/list'),
|
||||
delete: (id: number) => api.delete<MessageResponse, MessageResponse>(`/accounts/${id}`),
|
||||
batchDelete: (account_ids: number[]) =>
|
||||
api.delete<MessageDeletedResponse, MessageDeletedResponse>('/accounts/batch/delete', { params: { account_ids: account_ids.join(',') } }),
|
||||
batchDeleteSelection: (data: AccountBulkSelection) =>
|
||||
api.post<MessageDeletedResponse, MessageDeletedResponse>('/accounts/batch-delete', data),
|
||||
};
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import api from './client';
|
||||
import type {
|
||||
BasicSummary,
|
||||
AccountBulkSelection,
|
||||
AccountBulkTagRequest,
|
||||
HuyaAccountItem,
|
||||
HuyaAccountSummary,
|
||||
HuyaAutoRegisterBatch,
|
||||
@@ -78,10 +80,14 @@ export const huyaApi = {
|
||||
api.put<MessageResponse, MessageResponse>(`/huya/accounts/${id}/tag`, { tag }),
|
||||
batchTag: (account_ids: number[], tag: string) =>
|
||||
api.put<MessageCountResponse, MessageCountResponse>('/huya/accounts/batch-tag', { account_ids, tag }),
|
||||
batchTagSelection: (data: AccountBulkTagRequest) =>
|
||||
api.put<MessageCountResponse, MessageCountResponse>('/huya/accounts/batch-tag-selection', data),
|
||||
listTags: () => api.get<string[], string[]>('/huya/accounts/tags/list'),
|
||||
deleteAccount: (id: number) => api.delete<MessageResponse, MessageResponse>(`/huya/accounts/${id}`),
|
||||
deleteAccounts: (accountIds: number[]) =>
|
||||
api.delete<MessageDeletedResponse, MessageDeletedResponse>('/huya/accounts/batch', { params: { account_ids: accountIds.join(',') } }),
|
||||
deleteAccountsSelection: (data: AccountBulkSelection) =>
|
||||
api.post<MessageDeletedResponse, MessageDeletedResponse>('/huya/accounts/batch-delete', data),
|
||||
listCookies: () => api.get<HuyaCookieItem[], HuyaCookieItem[]>('/huya/cookies'),
|
||||
listCookiesPaged: (params: PageParams & { include_cookie?: boolean }) =>
|
||||
api.get<PaginatedResponse<HuyaCookieItem>, PaginatedResponse<HuyaCookieItem>>('/huya/cookies', { params }),
|
||||
|
||||
@@ -23,6 +23,19 @@ export interface PageParams {
|
||||
search?: string;
|
||||
}
|
||||
|
||||
export interface AccountBulkSelection {
|
||||
account_ids?: number[];
|
||||
all_matching?: boolean;
|
||||
search?: string;
|
||||
tag?: string;
|
||||
assigned_only?: boolean;
|
||||
has_cookie?: boolean;
|
||||
}
|
||||
|
||||
export interface AccountBulkTagRequest extends AccountBulkSelection {
|
||||
tag_value: string;
|
||||
}
|
||||
|
||||
export interface PaginatedResponse<T> {
|
||||
items: T[];
|
||||
total: number;
|
||||
@@ -412,7 +425,12 @@ export interface HuyaPasswordAccountImportResult extends MessageCountResponse {
|
||||
}
|
||||
|
||||
export interface HuyaPasswordLoginSelectedRequest {
|
||||
account_ids: number[];
|
||||
account_ids?: number[];
|
||||
all_matching?: boolean;
|
||||
search?: string;
|
||||
tag?: string;
|
||||
assigned_only?: boolean;
|
||||
has_cookie?: boolean;
|
||||
}
|
||||
|
||||
export interface HuyaCookieItem {
|
||||
|
||||
Reference in New Issue
Block a user