import request from "@/utils/request"

/** 承销商 — 分页列表 */
export function listDistributor(query) {
  return request({
    url: "/tradeMarket/distributor/list",
    method: "get",
    params: query
  })
}

/** 详情 */
export function getDistributor(id) {
  return request({
    url: "/tradeMarket/distributor/" + id,
    method: "get"
  })
}

/** 新增 */
export function addDistributor(data) {
  return request({
    url: "/tradeMarket/distributor",
    method: "post",
    data
  })
}

/** 修改 */
export function updateDistributor(data) {
  return request({
    url: "/tradeMarket/distributor",
    method: "put",
    data
  })
}

/** 删除 */
export function delDistributor(ids) {
  return request({
    url: "/tradeMarket/distributor/" + ids,
    method: "delete"
  })
}

/** 分配账号 */
export function assignAccountDistributor(id) {
  return request({
    url: "/tradeMarket/distributor/assignAccount/" + id,
    method: "post"
  })
}
