// @ts-ignore
/* eslint-disable */
import request from '../request';

/** 创建应用角色 POST /operation/createRole */
export async function createRole(
	body: BusinessAPI.RoleCreateCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseRoleVO>('/operation/createRole', {
		method: 'POST',
		headers: {
			'Content-Type': 'application/json',
		},
		data: body,
		...(options || {}),
	});
}

/** 删除应用角色 POST /operation/destroyRole */
export async function destroyRole(
	body: BusinessAPI.RoleDestroyCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.Response>('/operation/destroyRole', {
		method: 'POST',
		headers: {
			'Content-Type': 'application/json',
		},
		data: body,
		...(options || {}),
	});
}

/** 应用角色列表 GET /operation/listRole */
export async function listRole(
	// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
	params: BusinessAPI.listRoleParams,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.MultiResponseRoleVO>('/operation/listRole', {
		method: 'GET',
		params: {
			...params,
			roleListQry: undefined,
			...params['roleListQry'],
		},
		...(options || {}),
	});
}

/** 应用角色分页 GET /operation/pageRole */
export async function pageRole(
	// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
	params: BusinessAPI.pageRoleParams,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.PageResponseRoleVO>('/operation/pageRole', {
		method: 'GET',
		params: {
			...params,
			rolePageQry: undefined,
			...params['rolePageQry'],
		},
		...(options || {}),
	});
}

/** 查看应用角色 GET /operation/showRole */
export async function showRole(
	// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
	params: BusinessAPI.showRoleParams,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseRoleVO>('/operation/showRole', {
		method: 'GET',
		params: {
			...params,
			roleShowQry: undefined,
			...params['roleShowQry'],
		},
		...(options || {}),
	});
}

/** 更新应用应用角色 POST /operation/updateRole */
export async function updateRole(
	body: BusinessAPI.RoleUpdateCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseRoleVO>('/operation/updateRole', {
		method: 'POST',
		headers: {
			'Content-Type': 'application/json',
		},
		data: body,
		...(options || {}),
	});
}
