import request from '@/utils/request'

// 查询类型列表
export function listType(data) {
  return request({
    url: '/system/web/productType/all',
    method: 'post',
    data: data
  })
}

// 查询产品列表
export function listProduct(data) {
  return request({
    url: '/system/web/product/searchByPage',
    method: 'post',
    data: data
  })
}

//获取产品类型
export function listProductType(data) {
  return request({
    url: '/system/web/productType/all',
    method: 'post',
    data: data
  })
}

//获取产品附属信息
export function listProductAuxiliary(data) {
  return request({
    url: '/system/web/productType/expansions',
    method: 'post',
    params: data
  })
}

//关联贫困集体查询
export function listCollectiveFarmer(data) {
  return request({
    url: '/system/web/collectiveFarmer/searchByPage',
    method: 'post',
    data: data
  })
}

//关联单个贫困户
export function listFarmer(data) {
  return request({
    url: '/system/web/farmer/searchByPage',
    method: 'post',
    data: data
  })
}

//类别保存
export function saveProductType(data) {
  return request({
    url: '/system/web/product/save',
    method: 'post',
    data: data
  })
}

//产品生成
export function createProduct(data) {
  return request({
    url: '/system/web/product/publish',
    method: 'post',
    data: data
  })
}

//产品修改
export function updateProduct(data) {
  return request({
    url: '/system/web/product/update',
    method: 'post',
    data: data
  })
}

//商品详情
export function detailProduct(query) {
  return request({
    url: 'system/web/product/findByProductInfoGuid',
    method: 'get',
    params: query
  })
}



