import request from "@/utils/request";

// 经纪人列表
export function agentList(params) {
  return request({
    url: "/business/casBroker/list",
    method: "GET",
    params,
  });
}

// 经纪人信息添加
export function agentAdd(data) {
  return request({
    url: "/business/casBroker",
    method: "post",
    data,
  });
}

// 经纪人详细信息
export function agentDetail(id) {
  return request({
    url: `/business/casBroker/${id}`,
    method: "GET",
  });
}

// 经纪人信息修改
export function agentEdit(data) {
  return request({
    url: "/business/casBroker",
    method: "put",
    data,
  });
}

// 科研机构获取账号
export function getAccount(id) {
  return request({
    url: `/business/casBroker/getAccount/${id}`,
    method: "get",
  });
}

export function resetPassword(id, password) {
  return request({
    url: `/business/casBroker/restPassword/${id}/${password}`,
    method: "put",
  });
}

// 分配账号
export function allocateAccount(data) {
  return request({
    url: "/business/casBroker/allocateAccount",
    method: "post",
    data,
  });
}

export function deleteAgent(ids) {
  return request({
    url: `/business/casBroker/${ids}`,
    method: "DELETE",
  });
}
