/*
 * @Author: zc
 * @description 用户管理
 * @version:
 * @Date: 2022-08-09 16:19:55
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-11-15 10:21:44
 */
import request from '/@/utils/request';

/**
 * @description 获取用户列表
 * @param {object} params
 * @return {*}
 */
export const getUserListPaged = (params: object) => {
	return request({
		url: '/api/v1/User/paged',
		method: 'get',
		params: params,
	});
};
/**
 * @description 新增用户
 * @param {object} params
 * @return {*}
 */
export const addUser = (params: object) => {
	return request({
		url: '/api/v1/User',
		method: 'post',
		data: params,
	});
};
/**
 * @description 更新用户
 * @param {object} params
 * @return {*}
 */
export const updateUser = (params: object) => {
	return request({
		url: '/api/v1/User',
		method: 'put',
		data: params,
	});
};
/**
 * @description 删除用户
 * @param {string} userId 用户ID
 * @return {*}
 */
export const delUser = (userId: string) => {
	return request({
		url: `/api/v1/User/${userId}`,
		method: 'delete',
	});
};
/**
 * @description 重置密码
 * @param {string} userId 用户ID
 * @return {*}
 */
export const restPwd = (userId: string) => {
	return request({
		url: `/api/v1/User/initial-pwd/${userId}`,
		method: 'post',
	});
};
/**
 * @description 查询所有角色
 * @param {string} params 
 * @return {*}
 */
 export const getRoles = (params:object) => {
	return request({
		url: `/api/v1/Role/paged`,
		method: 'get',
		params:params
	});
};
/**
 * @description 获取可用组织架构树形
 * @return {*}
 */
 export const getCanUseOrg = () => {
	return request({
		url: `/api/v1/Org/getcanuseorg`,
		method: 'get'
	});
};
/**
 * @description 获取用户页面基础信息
 * @return {*}
 */
 export const getBaseData = () => {
	return request({
		url: `/api/v1/User/base-data`,
		method: 'get'
	});
};
