import request from '@/utils/request';

/**
 * 获取用户统计数据
 */
export async function getUserStatistic() {
    const res = await request.get('/user/userInfo/statistic');
    if (res.data.code === 200) {
        return res.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 获取用户统计曲线数据
 */
export async function getUserStatisticCurve(params) {
    const res = await request.get('/user/userInfo/statisticCurve', { params });
    if (res.data.code === 200) {
        return res.data;
    }
    return Promise.reject(new Error(res.data.msg));
}
