import request from '@/utils/request'

// 查询Document列表
export function listDocument11691998078000(query) {
	return request({
		url: '/forms/api/gen/Document11691998078000/list',
		method: 'get',
		params: query
	})
}

// 查询Document详细
export function getDocument11691998078000(id) {
	return request({
		url: '/forms/api/gen/Document11691998078000/' + id,
		method: 'get'
	})
}

// 查询request
export function RequstByParam1692179335796(method, tag) {
	return request({
		url: '/forms/api/router/get/RequstByParam1692179335796',
		method: 'post',
		data: {
			"method": method,
			"tag": tag
		}
	})
}

// 增量初始化
export function addInitApijsonConfig(id) {
	return request({
		url: '/forms/api/get',
		method: 'post',
		data: {
			"id": id,
			"data()": "addInitApijsonConfig(document,id)"
		}
	})
}

// 全量初始化
export function allInitApijsonConfig() {
	return request({
		url: '/forms/api/get',
		method: 'post',
		data: {
			"data()": "allInitApijsonConfig()"
		}
	})
}

// 新增Document
export function addDocument11691998078000(data) {
	return request({
		url: '/forms/api/genCode/json',
		method: 'post',
		data: data
	})
}

// 修改Document
export function updateDocument11691998078000(data) {
	let param = {
		"id": data.id,
		"name": data.name,
		"apijson": data.apijson,
		"requestId": data.requestId,
		"structure": data.structure
	}
	return request({
		url: '/forms/api/router/crud/EditJsonToUrl1692188414050',
		method: 'post',
		data: param
	})
}

// 删除Document
export function delDocument11691998078000(row) {
	var data = row.url.split("/").filter(item => item != '');
	let param = {
		"ids": [row.id],
		"method": data[1],
		"tag": data[2]
	}
	return request({
		url: '/forms/api/router/crud/DelJsonUrl1709020083834',
		method: 'post',
		data: param
	})
}
