import { apiGet, apiPost } from '@/lib/http' import type { DouyuCustomerFulfillment, DouyuCustomerPlatform, DouyuCustomerSystem, } from '@/types/douyu-fulfillment' export function fetchDouyuFulfillment(orderNo: string) { return apiGet( `/api/v1/douyu-fulfillment/${encodeURIComponent(orderNo)}`, ) } export function saveDouyuProfile( orderNo: string, input: { roleName: string platform: DouyuCustomerPlatform system: DouyuCustomerSystem }, ) { return apiPost( `/api/v1/douyu-fulfillment/${encodeURIComponent(orderNo)}/profile`, input, ) } export function startDouyuBinding(orderNo: string, forceRefresh = false) { return apiPost( `/api/v1/douyu-fulfillment/${encodeURIComponent(orderNo)}/binding/start`, { forceRefresh }, ) } export function pollDouyuBinding(orderNo: string) { return apiGet( `/api/v1/douyu-fulfillment/${encodeURIComponent(orderNo)}/binding/status`, ) } export function confirmDouyuBinding(orderNo: string) { return apiPost( `/api/v1/douyu-fulfillment/${encodeURIComponent(orderNo)}/binding/confirm`, {}, ) }