import { defHttp } from '/@/utils/http/axios';
import {
  PageParams,
  InfoParams,
  RentListGetResultModel,
  SceneLiveItem,
  bindAnchorListParam,
  GetAllSceneModel,
  // SceneLiveModel,
} from './model';
import { Result, UploadFileParams } from '/#/axios';
enum Api {
  pageList = '/basic-api/brand/brandBindList',
  bindAnchorList = '/zfb-api/zfb/shop/sys/user/bindList',
  olderBindAnchorList = '/basic-api/sys/user/bindList',
  // brandTypeList = '/zfb-api/zfb/shop/brand/brandTypeList',
  brandTypeList = '/basic-api/brand/brandTypeList',
  // bindUser = '/zfb-api/zfb/shop/sys/brand/bindUser',
  bindUser = '/basic-api/brand/bindUser',
  brandUpdate = '/basic-api/brand/update',
  brandDelete = '/basic-api/brand/delete',
  upload = '/basic-api/sys/oss/upload',
  uploadVideo = '/basic-api/sys/oss/upLoadVideo',
  getAllScene = '/zfb-api/zfb/scene/list',
  getBrandInfo = '/basic-api/brand/info',
  addSave = '/basic-api/brand/save',
}
export type SceneLiveItemResult = SceneLiveItem;
/**
 * @description: Get sample list value
 */

export const ListApi = (params: PageParams) =>
  defHttp.get<RentListGetResultModel>({
    url: Api.pageList,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const bindOldAnchorListApi = (params: bindAnchorListParam) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.olderBindAnchorList,
    params: params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const bindAnchorListApi = (params: bindAnchorListParam) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.bindAnchorList,
    params: params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const bindUserApi = (params: any) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.bindUser,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const brandTypeListApi = (params: PageParams) =>
  defHttp.get<RentListGetResultModel>({
    url: Api.brandTypeList,

    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export function uploadLiveApi(
  params: UploadFileParams,
  // onUploadProgress: (progressEvent: ProgressEvent) => void,
) {
  return defHttp.uploadFile<Result>(
    {
      url: Api.upload,
      // onUploadProgress,
    },
    params,
  );
}
export function uploadLiveVideoApi(
  params: UploadFileParams,
  // onUploadProgress: (progressEvent: ProgressEvent) => void,
) {
  return defHttp.uploadFile<Result>(
    {
      url: Api.uploadVideo,
      // onUploadProgress,
    },
    params,
  );
}

export const getAllSceneApi = (params: PageParams) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.getAllScene,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const getLiveInfoApi = (params: InfoParams) => {
  return defHttp.post<SceneLiveItem>({
    url: Api.getBrandInfo,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
};
export const brandUpdateApi = (params: SceneLiveItem) =>
  defHttp.post<GetAllSceneModel>({
    url: Api.brandUpdate,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const LiveSceneAddApi = (params: SceneLiveItem) =>
  defHttp.post<GetAllSceneModel>({
    url: Api.brandDelete,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const LiveSceneDeleteApi = (params: string[]) =>
  defHttp.post<GetAllSceneModel>({
    url: Api.brandDelete,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const addSave = (params: SceneLiveItem) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.addSave,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
