feat(douyu): 增加协作单礼包字典与权限控制

This commit is contained in:
yml2213
2026-11-06 15:09:50 +08:00
parent 578e259eea
commit 973042288f
12 changed files with 987 additions and 45 deletions
+27
View File
@@ -175,6 +175,15 @@ export interface DouyuCollabShop {
remark: string;
}
export interface DouyuCollabGift {
id: number;
name: string;
points: number;
sort_order: number;
is_active: boolean;
remark: string;
}
export interface DouyuCollabAccountLookup {
found: boolean;
ok: boolean;
@@ -300,6 +309,24 @@ export const douyuCollabApi = {
api.delete<{ success: boolean; name: string; id: number }, { success: boolean; name: string; id: number }>(
`/douyu/collab-shops/${id}`,
),
giftRecords: () =>
api.get<DouyuCollabGift[], DouyuCollabGift[]>('/douyu/collab-gifts'),
createGift: (data: { name: string; points: number; remark?: string }) =>
api.post<DouyuCollabGift, DouyuCollabGift>('/douyu/collab-gifts', data),
updateGift: (
id: number,
data: {
name?: string;
points?: number;
sort_order?: number;
is_active?: boolean;
remark?: string;
},
) => api.put<DouyuCollabGift, DouyuCollabGift>(`/douyu/collab-gifts/${id}`, data),
deleteGift: (id: number) =>
api.delete<{ success: boolean; name: string; id: number }, { success: boolean; name: string; id: number }>(
`/douyu/collab-gifts/${id}`,
),
gifts: () => api.get<string[], string[]>('/douyu/external-orders/gifts'),
goods: () => api.get<DouyuCollabGoods[], DouyuCollabGoods[]>('/douyu/external-orders/goods'),
refreshGoods: (accountId?: number) =>