import request from '@/utils/httpRequest'
import { BUSINESS_PATH as prefix } from "../AppPath";

export default class BorrowService{
	list (param) {
		return request({
			url: prefix +'/borrow/findList',
			method: 'get',
			params: param
		})
	}

	saveForm (inputForm) {
		return request({
			url: prefix + `/borrow/saveForm`,
			method: 'post',
			data: inputForm
		})
	}

	queryById (id) {
		return request({
			url: prefix +'/borrow/findById',
			method: 'get',
			params: {id: id}
		})
	}

	updateStatusById(data) {
		return request({
			url: prefix + "/borrow/updateStatusById",
			method: "post",
			data: data,
		})
	}
	delete (ids) {
		return request({
			url: prefix+"/borrow/delete",
			method: 'delete',
			params: {id: ids}
		})
	}



	adminEditForm(param){
		return request({
			url: prefix + "/borrow/adminEditForm",
			method: "post",
			data: param,
		})
	}

	saveRefund (inputForm) {
		return request({
			url: prefix + `/borrow/saveRefund`,
			method: 'post',
			data: inputForm
		})
	}

	updateRefundById(data) {
		return request({
			url: prefix + "/borrow/updateRefundById",
			method: "post",
			data: data,
		})
	}

	listByUserId(){
		return request({
			url: prefix + "/borrow/listByUserId",
			method: "get",
		})
	}

	exportFile(params) {
		return request({
			url: prefix + "/borrow/export",
			method: "get",
			params: params,
			responseType: "blob",
		});
	}
	findByBorId(id){
		return request({
			url: prefix + "/borrow/findByBorId",
			method: "get",
			params:{id:id}
		})
	}

	createRefundData(param){
		return request({
			url: prefix + "/borrow/createRefundData",
			method: "post",
			data: param,
		})
	}

	findByRefundId (id) {
		return request({
			url: prefix +'/borrow/findByRefundId',
			method: 'get',
			params: {id: id}
		})
	}

	findHisById (id) {
		return request({
			url: prefix +'/borrow/findHisById',
			method: 'get',
			params: {id: id}
		})
	}

	backSourceData(id) {
		return request({
			url: prefix + "/borrow/backSourceData",
			method: "get",
			params: { id: id },
		});
	}

	getByReId (id) {
		return request({
			url: prefix +'/borrow/getByReId',
			method: 'get',
			params: {id: id}
		})
	}

}
