import request from "@/utils/request.js";

/**
 * @description 获取合作商列表
 * @param {*} (pageNum,pageSize)
 * @returns data
 */
export function businessListApi(pageNum, pageSize, type, id) {
  return request({
    url: `/serviceInfo/page?pageNum=${pageNum}&pageSize=${pageSize}&type=${type}&id=${id || ''}`,
    method: 'get'
  })
}

/**
 * @description 新增合作商
 * @param {*} data
 * @returns data
 */
export function addBusinessApi(data) {
  return request({
    url: `/serviceInfo/save`,
    method: 'post',
    data
  })
}

/**
 * @description 获取api接入管理列表
 * @param {*} (pageNum,pageSize)
 * @returns data
 */
export function apiManageListApi(pageNum, pageSize) {
  return request({
    url: `/serviceInfo/page?type=1pageNum=${pageNum}&pageSize=${pageSize}`,
    method: 'get'
  })
}

/**
 * @description 设置登录账号
 * @param {*} data
 * @returns data
 */
export function saveMallUserInfo(data) {
  return request({
    url: `/serviceInfo/saveMallUserInfo`,
    method: 'post',
    data
  })
}

/**
 * @description 修改登录账号 详情
 * @param {*} data
 * @returns data
 */
export function getMallUserInfo(id) {
  return request({
    url: `/serviceInfo/getMallUserInfo?serviceId=${id}`,
    method: 'get'
  })
}

/**
 * @description 设置时长
 * @param {*} data
 * @returns data
 */
export function setRemainingTimes(data) {
  return request({
    url: `/serviceInfo/setRemainingTimes`,
    method: 'post',
    data
  })
}

/**
 * @description 所有模版
 * @param {*} (pageNum,pageSize)
 * @returns data
 */
export function modelAllList(pageNum, pageSize) {
  return request({
    url: `/personMould/alList?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: 'get'
  })
}

/**
 * @description 已关联模版
 * @param {*} 
 * @returns data
 */
export function personMouldIdList(id) {
  return request({
    url: `/serviceInfo/personMouldIdList?serviceId=${id || ''}`,
    method: 'get'
  })
}

/**
 * @description 保存关联模版
 * @param {*} 
 * @returns data
 */
export function associatedMould(data) {
  return request({
    url: `/serviceInfo/associatedMould`,
    method: 'post',
    data
  })
}