import request from '@/utils/request'

// 查询洗衣方式列表
export function listWashMode(query) {
    return request({
        url: '/mapi/core/washMode/list',
        method: 'get',
        params: query
    })
}

// 查询洗衣方式详细
export function getWashMode(id) {
    return request({
        url: '/mapi/core/washMode/' + id,
        method: 'get'
    })
}

// 新增洗衣方式
export function addWashMode(data) {
    return request({
        url: '/mapi/core/washMode',
        method: 'post',
        data: data
    })
}

// 修改洗衣方式
export function updateWashMode(data) {
    return request({
        url: '/mapi/core/washMode',
        method: 'put',
        data: data
    })
}

// 删除洗衣方式
export function delWashMode(id) {
    return request({
        url: '/mapi/core/washMode/' + id,
        method: 'delete'
    })
}

// 洗衣方式状态修改
export function changeWashModeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/core/washMode/changeStatus',
    method: 'put',
    data: data
  })
}
// 新增洗衣方式和类别的关系
export function addWashModeAndTypeRelation(data) {
  return request({
    url: '/mapi/cloth/WashModeRelation/saveBatchRelation',
    method: 'post',
    data: data
  })
}

// 查询洗衣方式详细
export function getRelationInfo(id) {
  return request({
    url: 'mapi/cloth/WashModeRelation/' + id,
    method: 'get'
  })
}



