import request from '@/utils/request'


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

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

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

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

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

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

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