feat(huya): 增加协作单礼包字典与名称编辑
This commit is contained in:
@@ -43,6 +43,9 @@ import type {
|
||||
HuyaCollabCkRequest,
|
||||
HuyaCollabCkStatusRequest,
|
||||
HuyaCollabFrequentGift,
|
||||
HuyaCollabGiftCatalog,
|
||||
HuyaCollabGiftCatalogCreate,
|
||||
HuyaCollabGiftCatalogUpdate,
|
||||
HuyaCollabImagesRequest,
|
||||
HuyaCollabImportResult,
|
||||
HuyaCollabMetric,
|
||||
@@ -243,6 +246,19 @@ export const huyaApi = {
|
||||
api.delete<{ success: boolean; name: string }, { success: boolean; name: string }>(
|
||||
`/huya/collab-shops/${id}`,
|
||||
),
|
||||
|
||||
// ---- 礼包字典(标准名称 + 所需积分;名称编辑会级联历史协作单)----
|
||||
listCollabGiftCatalog: () =>
|
||||
api.get<HuyaCollabGiftCatalog[], HuyaCollabGiftCatalog[]>('/huya/collab-gifts'),
|
||||
createCollabGift: (data: HuyaCollabGiftCatalogCreate) =>
|
||||
api.post<HuyaCollabGiftCatalog, HuyaCollabGiftCatalog>('/huya/collab-gifts', data),
|
||||
updateCollabGift: (id: number, data: HuyaCollabGiftCatalogUpdate) =>
|
||||
api.put<HuyaCollabGiftCatalog, HuyaCollabGiftCatalog>(`/huya/collab-gifts/${id}`, data),
|
||||
deleteCollabGift: (id: number) =>
|
||||
api.delete<
|
||||
{ success: boolean; id: number; name: string; points: number },
|
||||
{ success: boolean; id: number; name: string; points: number }
|
||||
>(`/huya/collab-gifts/${id}`),
|
||||
getCollabOrder: (id: number) =>
|
||||
api.get<HuyaCollabOrder, HuyaCollabOrder>(`/huya/external-orders/${id}`),
|
||||
createCollabOrder: (data: HuyaCollabOrderCreate) =>
|
||||
|
||||
@@ -1824,3 +1824,33 @@ export interface HuyaCollabShopUpdate {
|
||||
/** 改名时是否级联更新已有订单里的店铺名(默认 true) */
|
||||
rename_orders?: boolean;
|
||||
}
|
||||
|
||||
/** 协作台账的礼包字典项(与实时活动礼包 HuyaCollabGift 分开) */
|
||||
export interface HuyaCollabGiftCatalog {
|
||||
id: number;
|
||||
name: string;
|
||||
points: number;
|
||||
sort_order: number;
|
||||
/** false = 停用(不再出现在可选项里;已有订单仍显示原值) */
|
||||
is_active: boolean;
|
||||
remark: string;
|
||||
created_by_name: string;
|
||||
updated_by_name: string;
|
||||
created_at: string | null;
|
||||
updated_at: string | null;
|
||||
}
|
||||
|
||||
export interface HuyaCollabGiftCatalogCreate {
|
||||
name: string;
|
||||
points: number;
|
||||
sort_order?: number;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface HuyaCollabGiftCatalogUpdate {
|
||||
name?: string;
|
||||
points?: number;
|
||||
sort_order?: number;
|
||||
is_active?: boolean;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user