import request from '@/utils/request'

export function allClothFlaw() {
  return request({
    url: '/mapi/core/flaw/all',
    method: 'get',
  })
}

// 查询衣服瑕疵列表
export function listFlaw(query) {
    return request({
        url: '/mapi/core/flaw/list',
        method: 'get',
        params: query
    })
}

// 查询衣服瑕疵详细
export function getFlaw(id) {
    return request({
        url: '/mapi/core/flaw/' + id,
        method: 'get'
    })
}

// 新增衣服瑕疵
export function addFlaw(data) {
    return request({
        url: '/mapi/core/flaw',
        method: 'post',
        data: data
    })
}

// 修改衣服瑕疵
export function updateFlaw(data) {
    return request({
        url: '/mapi/core/flaw',
        method: 'put',
        data: data
    })
}

// 删除衣服瑕疵
export function delFlaw(id) {
    return request({
        url: '/mapi/core/flaw/' + id,
        method: 'delete'
    })
}

// 衣服瑕疵状态修改
export function changeFlawStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/core/flaw/changeStatus',
    method: 'put',
    data: data
  })
}
