/**
 * 兑换码模块 - 兑换码相关接口
 */
import RequestManager from '../request';

/**
 * 使用兑换码
 * @param {String} code 兑换码
 * @returns {Promise} 兑换结果
 */
export const useRedeemCode = async (code) => {
    return await RequestManager.post('/redeem_code', {
        code
    });
};

/**
 * 获取兑换码记录
 * @param {Number} page 页码
 * @param {Number} pageSize 每页数量
 * @returns {Promise} 兑换记录
 */
export const getRedeemRecord = async (page = 1, pageSize = 10) => {
    return await RequestManager.get('/redeem_record', {
        page,
        pageSize
    });
};
