import request from '@/utils/request'
// 查询属性列表
export function list(name) {
  return request({
    url: '/product/attributeInfo/list?name='+name,
    method: 'get'
  })
}

//新增属性
export function insertAttribute(attribute) {
  return request({
    url: '/product/attributeInfo/insertAttribute',
    method: 'post',
    data: attribute
  })
}

//删除属性
export function deleteById(attributeInfoId) {
  return request({
    url: '/product/attributeInfo/deleteAttributeById?attributeInfoId='+attributeInfoId,
    method: 'get'
  })
}
//获取属性组列表
export function getAttributeGroupList(attributeName) {
  return request({
    url: '/product/attributeGroup/getAttributeGroupList?attributeName='+attributeName,
    method: 'get'
  })
}

export function insertAttributeGroup(attributeGroupReq) {
  return request({
    url: '/product/attributeGroup/insertAttributeGroup',
    method: 'post',
    data: attributeGroupReq
  })
}

export function deleteAttributeById(groupId) {
  return request({
    url: '/product/attributeGroup/deleteAttributeById?groupId='+groupId,
    method: 'get'
  })
}
