import request from '@/utils/request'

// 查询用户积分列表
export function listUserPoints(query) {
    return request({
        url: '/system/userPoints/list',
        method: 'get',
        params: query
    })
}

// 查询用户积分详细
export function getUserPoints(id) {
    return request({
        url: '/system/userPoints/' + id,
        method: 'get'
    })
}


// 查询用户积分详细
export function getUserPointsBuyUserId(userId) {
    return request({
        url: '/system/userPoints/userId/' + userId,
        method: 'get'
    })
}

// 新增用户积分
export function addUserPoints(data) {
    return request({
        url: '/system/userPoints',
        method: 'post',
        data: data
    })
}

// 修改用户积分
export function updateUserPoints(data) {
    return request({
        url: '/system/userPoints',
        method: 'put',
        data: data
    })
}

// 修改用户是否显示排行榜
export function updateSerUserPointsByIds(data) {
    return request({
        url: '/system/userPoints/editAll',
        method: 'put',
        data: data
    })
}

// 删除用户积分
export function delUserPoints(id) {
    return request({
        url: '/system/userPoints/' + id,
        method: 'delete'
    })
}
