import request from "@/utils/request"

/** 畜牧科技资源 — 分页列表 */
export function listTechResource(query) {
  return request({
    url: "/techService/techResource/list",
    method: "get",
    params: query
  })
}

/** 详情 */
export function getTechResource(id) {
  return request({
    url: "/techService/techResource/" + id,
    method: "get"
  })
}

/** 新增 */
export function addTechResource(data) {
  return request({
    url: "/techService/techResource",
    method: "post",
    data
  })
}

/** 修改 */
export function updateTechResource(data) {
  return request({
    url: "/techService/techResource",
    method: "put",
    data
  })
}

/** 删除 */
export function delTechResource(ids) {
  return request({
    url: "/techService/techResource/" + ids,
    method: "delete"
  })
}

/** 发布 */
export function publishTechResource(id) {
  return request({
    url: "/techService/techResource/publish/" + id,
    method: "post"
  })
}

/** 下架 */
export function offlineTechResource(id) {
  return request({
    url: "/techService/techResource/offline/" + id,
    method: "post"
  })
}

/** 分配账号（专家） */
export function assignAccountTechResource(id) {
  return request({
    url: "/techService/techResource/assignAccount/" + id,
    method: "post"
  })
}
