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.

112 lines
2.0 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[]> => {
1 year ago
return request({
url: '/im/user/findByName?name=' + name,
1 year ago
method: 'get'
});
};
/**
*
* @param days
*/
export const getDailyRegistrationCount = (days?: number): AxiosPromise<any[]> => {
return request({
url: '/im/user/dailyRegistrationCount',
method: 'get',
params: { days }
});
};
/**
*
*/
export const getTotalUserCount = (): AxiosPromise<number> => {
return request({
url: '/im/user/totalCount',
method: 'get'
});
};
/**
*
*/
export const getActiveUserStats = (): AxiosPromise<any> => {
return request({
url: '/im/user/activeStats',
method: 'get'
});
};
/**
*
*/
export const getLabelList = (): AxiosPromise<any> => {
return request({
url: '/im/userLabel/labelOptions',
method: 'post'
});
};
/**
*
*/
export const getGroupList = (): AxiosPromise<any> => {
return request({
url: '/im/userGroup/selectList',
method: 'post'
});
};