import request from '@/utils/request'

// 分页查询
export const pageList = (query) => {
  return request({
    url: '/member/marketTeamBrokerageConfig/list',
    method: 'get',
    params: query
  })
}

// 新增/修改
export const saveAndEdit = (data) => {
  return request({
    url: '/member/marketTeamBrokerageConfig/insertOrUpdate',
    method: 'post',
    data: data
  })
}

// 修改状态
export const updateStatus = (data) => {
  return request({
    url: '/member/marketTeamBrokerageConfig/insertOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除模板
export const deleteById = (id) => {
  return request({
    url: '/member/marketTeamBrokerageConfig/deleteById',
    method: 'delete',
    params: {id:id}
  })
}

export function getSelectById(id) {
  return request({
    url: '/member/marketTeamBrokerageConfig/selectById?id=' + id,
    method: 'get'
  })
}

// 绑定团队
export const bindTeam = (data) => {
  return request({
    url: '/member/marketTeamBrokerage/bindTeam',
    method: 'post',
    data: data
  })
}

// 获取绑定/未绑定的团队列表
export const queryBindTeam = (query) => {
  return request({
    url: '/member/marketTeam/queryBindTeam',
    method: 'get',
    params: query
  })
}

// 移除绑定团队
export const unBindTeam = (data) => {
  return request({
    url: '/member/marketTeamBrokerage/unBindTeam',
    method: 'post',
    data: data
  })
}
