import request from "@/utils/request";

/**
 * 获取所有地域
 * @param params 
 * @returns 
 */
export const getRegion = () => {
  return request<any, any[]>({
    url: `/system/admin/common/region`,
    method: "get"
  });
}

/**
 * 获取所有短信签名
 * @param params 
 * @returns 
 */
export const getSms = ({ type }: { type: string }) => {
  return request<any, any[]>({
    url: `/account/admin/common/sms`,
    method: "get",
    params: { type }
  });
}

/**
 * 获取所有银行
 * @param params 
 * @returns 
 */
export const getBankInfo = (params: Object) => {
  return request<any, any[]>({
    url: `/system/admin/common/bankInfo`,
    method: "get",
    params
  });
}

/**
 * 类目信息表
 * @returns
 */
export const getCategory = () => {
  return request<any, any[]>({
    url: `/system/admin/common/category`,
    method: "get"
  });
}

interface getBankBranchListParams {
  bankAliceCode?: string;
  cityCode?: string;
}
/**
 * 获取所有支行
 * @params
 * bankAliceCode    银行别名code bankAliasCode 从 /system/admin/common/bankInfo 获取
 * cityCode         市编码 wxProvinceCode 从 /system/admin/common/region 获取
 * @returns
 */
export const getBankBranchList = (params: getBankBranchListParams) => {
  return request<any, any[]>({
    url: `/order/admin/data/entryManager/bankBranchList`,
    method: "get",
    params
  });
}

/**
 * 申请进件
 * @data Object
 * @returns 
 */
export const entryManagerPost = (data: Object) => {
  return request<any, any[]>({
    url: `/order/admin/data/entryManager`,
    method: "post",
    data
  });
}

/**
 * 申请进件
 * @data {
 *  url string 图片地址
 *  type string 可选
 *    IdCard 身份证
 *    BankCard 银行卡
 *    BusinessLicense 营业执照
 * }
 * @returns 
 */
export const getInfoByImg = (params: Object) => {
  return request<any, any[]>({
    url: `/order/admin/data/entryManager/getInfoByImg`,
    method: "get",
    params
  });
}

/**
 * 获取进件信息详情
 * @data { shopId }
 * @returns 
 */
export const entryManagerDetail = (params: Object) => {
  return request<any, any[]>({
    url: `/order/admin/data/entryManager`,
    method: "get",
    params
  });
}

/**
 * 获取进件列表
 * @data { params }
 * @returns 
 */
export const entryManagerList = (params: Object) => {
  return request<any, any[]>({
    url: `/order/admin/data/entryManager/list`,
    method: "get",
    params
  });
}

/**
 * 主动查询进件信息状态
 * @data { params }
 * @returns 
 */
export const queryEntry = (params: Object) => {
  return request<any, any[]>({
    url: `/order/admin/data/entryManager/queryEntry`,
    method: "get",
    params
  });
}

/**
 * 商户支付信息获取
 * @data { params }
 * @returns 
 */
export const shopMerchantGet = (params: Object) => {
  return request<any, any[]>({
    url: `/order/admin/shopMerchant`,
    method: "get",
    params
  });
}

/**
 * 商户支付信息修改 修改聚合支付信息
 * @data { params }
 * @returns 
 */
export const shopMerchantPut = (data: Object) => {
  return request<any, any[]>({
    url: `/order/admin/shopMerchant`,
    method: "put",
    data
  });
}

/**
 * 获取当前店铺的主店进件信息
 * @data { params }
 * @returns 
 */
export const getMainMerchant = (params: Object) => {
  return request<any, any[]>({
    url: `/order/admin/shopMerchant/getMainMerchant`,
    method: "get",
    params
  });
}
