import request from '/@/utils/request';

export function fetchList(query?: Object) {
	return request({
		url: 'admin/agentUser/page',
		method: 'get',
		params: query,
	});
}

export function addObj(obj?: Object) {
	return request({
		url: 'admin/agentUser/save',
		method: 'post',
		data: obj,
	});
}

export function getObj(id?: string) {
	return request({
		url: `admin/agentUser/info/${id}`,
		method: 'get',
	});
}

export function putObj(id: string, obj?: Object) {
	return request({
		url: `admin/agentUser/edit/${id}`,
		method: 'patch',
		data: obj,
	});
}

export function changeStatus(id: string) {
	return request({
		url: `/admin/agentUser/changeStatus/${id}`,
		method: 'patch',
	});
}

export function changePwd(id: string, data?: Object) {
	return request({
		url: `/admin/agentUser/changePwd/${id}`,
		method: 'patch',
		data: data,
	});
}
