import { requestClient } from '#/api/request';

export async function getBaishunProviderConfig(params: Record<string, any>) {
  return requestClient.get<Record<string, any>>('/go/operate/baishun-game/config', {
    params,
  });
}

export async function saveBaishunProviderConfig(data: Record<string, any>) {
  return requestClient.post<Record<string, any>>('/go/operate/baishun-game/config', data);
}

export async function activateBaishunProviderProfile(data: Record<string, any>) {
  return requestClient.post<Record<string, any>>(
    '/go/operate/baishun-game/config/activate',
    data,
  );
}

export async function pageBaishunGames(params: Record<string, any>) {
  return requestClient.get<Record<string, any>>('/go/operate/baishun-game/page', {
    params,
  });
}

export async function pageBaishunCatalog(params: Record<string, any>) {
  return requestClient.get<Record<string, any>>('/go/operate/baishun-game/catalog/page', {
    params,
  });
}

export async function saveBaishunGame(data: Record<string, any>) {
  return requestClient.post<Record<string, any>>('/go/operate/baishun-game/save', data);
}

export async function deleteBaishunGame(
  id: number | string,
  sysOrigin: string,
  profile?: string,
) {
  return requestClient.delete<Record<string, any>>('/go/operate/baishun-game', {
    params: { id, profile, sysOrigin },
  });
}

export async function fetchBaishunCatalog(data: Record<string, any>) {
  return requestClient.post<Record<string, any>>(
    '/go/operate/baishun-game/catalog/fetch',
    data,
  );
}

export async function importBaishunCatalog(data: Record<string, any>) {
  return requestClient.post<Record<string, any>>(
    '/go/operate/baishun-game/import-catalog',
    data,
  );
}

export async function syncBaishunGames(data: Record<string, any>) {
  return requestClient.post<Record<string, any>>('/go/operate/baishun-game/sync', data);
}
