You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.1 KiB

1 year ago
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { UserVO, UserBanDTO, UserUnbanDTO, UserQuery } from '@/api/im/user/types';
/**
*
* @param query
* @returns {*}
*/
export const listUser = (query?: UserQuery): AxiosPromise<UserVO[]> => {
return request({
url: '/im/user/list',
method: 'get',
params: query
});
};
/**
*
* @param id
*/
export const getUser = (id: string | number): AxiosPromise<UserVO> => {
return request({
url: '/im/user/' + id,
method: 'get'
});
};
/**
*
* @param data
*/
export const ban = (data: UserBanDTO) => {
return request({
url: '/im/user/ban',
method: 'put',
data: data
});
};
/**
*
* @param data
*/
export const unban = (data: UserUnbanDTO) => {
return request({
url: '/im/user/unban',
method: 'put',
data: data
});
};
export const findUserByName = (name?: String): AxiosPromise<UserVO[]> => {
return request({
url: '/im/user/findByName?name=' + name,
1 year ago
method: 'get'
});
};