import Http from "../utils/net/Http";
import Urls from "./Urls";
const tagInfo = "[/src/api/Protocol.ts]:";

let Protocol = {
	async list(keyword:string = '',page: number = 1, pageSize: number = 10){
		let url = Urls.protocol.list;
		let param = {
			keyword,
			page,
			pageSize
		};
		let res = await Http.get(url, param);
		return res;
	},
	async detail(id: number){
		let url = Urls.protocol.detail;
		let param = {
			id
		};
		let res = await Http.get(url, param);
		return res;
	},
	async add(param: object = {}): Promise<any> {
		let url = Urls.protocol.add;
		let res = await Http.post(url, param);
		return res;
	},
	async edit(param: object = {}): Promise<any> {
		let url = Urls.protocol.edit;
		let res = await Http.post(url, param);
		return res;
	}
	
};
export default Protocol;
