import { AddReq,EditReq, DelReq,UserPageQuery } from '@fast-crud/fast-crud';
import { request } from '/@/utils/service';

export const apiPrefix = '/api/system/device-damage-records/';
export function GetList(query: UserPageQuery) {
	return request({
		url: apiPrefix+"?damage_type=1",
		method: 'get',
		params: query,
	});
}
// export function GetObj(id: InfoReq) {
// 	return request({
// 		url: apiPrefix + id,
// 		method: 'get',
// 	});
// }

export function AddObj(obj: AddReq) {
	return request({
		url: apiPrefix,
		method: 'post',
		data: obj,
	});
}

export function UpdateObj(obj: EditReq) {
	return request({
		url: apiPrefix + obj.id + '/',
		method: 'put',
		data: obj,
	});
}

export function DelObj(id: DelReq) {
	return request({
		url: apiPrefix + id + '/',
		method: 'delete',
		data: { id },
	});
}

export function GetPermission() {
    return request({
        url: apiPrefix+"?damage_type=1",
        method: 'get',
    });
}
