- 修改reduceBalanceWithToken方法使用TokenConsumptionDto参数对象 - 添加通过会话ID查询用户的功能并验证用户会话有效性 - 在支付控制器中更新订单信息时保存二维码内容 - 为PaymentOrder实体添加codeUrl和qrCode字段支持 - 更新SysUserMapper添加getBySessionId查询方法 - 优化微信和支付宝支付回调日志记录 - 改进token消费参数验证逻辑 - 调整数据库映射文件以支持新增字段
163 lines
4.2 KiB
Java
163 lines
4.2 KiB
Java
package com.kexue.skills.service;
|
||
|
||
import com.github.pagehelper.PageInfo;
|
||
import com.kexue.skills.entity.Account;
|
||
import com.kexue.skills.entity.dto.AccountDto;
|
||
import com.kexue.skills.entity.dto.TokenConsumptionDto;
|
||
|
||
import java.math.BigDecimal;
|
||
import java.util.List;
|
||
|
||
/**
|
||
* (Account)表服务接口
|
||
*
|
||
* @author 王志维
|
||
* @since 2025-02-21 23:01:48
|
||
*/
|
||
public interface AccountService extends BaseService {
|
||
/**
|
||
* 分页查询
|
||
*
|
||
* @param queryDto 筛选条件
|
||
* @return 查询结果
|
||
*/
|
||
PageInfo<Account> getPageList(AccountDto queryDto);
|
||
|
||
/**
|
||
* 查询列表
|
||
*
|
||
* @param queryDto 筛选条件
|
||
* @return 查询结果
|
||
*/
|
||
List<Account> getList(AccountDto queryDto);
|
||
|
||
/**
|
||
* 通过主键查询单条数据
|
||
*
|
||
* @param accountId 主键
|
||
* @return 实例对象
|
||
*/
|
||
Account queryById(Long accountId);
|
||
|
||
/**
|
||
* 通过用户ID查询账户
|
||
*
|
||
* @param userId 用户ID
|
||
* @return 实例对象
|
||
*/
|
||
Account queryByUserId(Long userId);
|
||
|
||
/**
|
||
* 新增数据
|
||
*
|
||
* @param account 实例对象
|
||
* @return 实例对象
|
||
*/
|
||
Account insert(Account account);
|
||
|
||
/**
|
||
* 更新数据
|
||
*
|
||
* @param account 实例对象
|
||
* @return 实例对象
|
||
*/
|
||
Account update(Account account);
|
||
|
||
/**
|
||
* 增加账户余额
|
||
*
|
||
* @param userId 用户ID
|
||
* @param amount 增加金额
|
||
* @param isWithdrawable 是否可提现
|
||
* @param transactionNo 交易单号
|
||
* @param businessId 业务ID
|
||
* @param businessType 业务类型
|
||
* @param remark 备注
|
||
* @return 影响行数
|
||
*/
|
||
int addBalance(Long userId, BigDecimal amount, boolean isWithdrawable, String transactionNo, Long businessId, String businessType, String remark);
|
||
|
||
/**
|
||
* 增加账户余额(默认不可提现)
|
||
*
|
||
* @param userId 用户ID
|
||
* @param amount 增加金额
|
||
* @param transactionNo 交易单号
|
||
* @param businessId 业务ID
|
||
* @param businessType 业务类型
|
||
* @param remark 备注
|
||
* @return 影响行数
|
||
*/
|
||
int addBalance(Long userId, BigDecimal amount, String transactionNo, Long businessId, String businessType, String remark);
|
||
|
||
/**
|
||
* 减少账户余额
|
||
*
|
||
* @param userId 用户ID
|
||
* @param amount 减少金额
|
||
* @param transactionNo 交易单号
|
||
* @param businessId 业务ID
|
||
* @param businessType 业务类型
|
||
* @param remark 备注
|
||
* @return 影响行数
|
||
*/
|
||
int reduceBalance(Long userId, BigDecimal amount, String transactionNo, Long businessId, String businessType, String remark);
|
||
|
||
/**
|
||
* 减少账户余额(token消费转换)
|
||
* @param tokenConsumptionDto token消费
|
||
*
|
||
*/
|
||
int reduceBalanceWithToken(TokenConsumptionDto tokenConsumptionDto);
|
||
|
||
/**
|
||
* 增加账户余额(签到奖励token转换)
|
||
*
|
||
* @param userId 用户ID
|
||
* @param amount 增加金额
|
||
* @param transactionNo 交易单号
|
||
* @param businessId 业务ID
|
||
* @param businessType 业务类型
|
||
* @param remark 备注
|
||
* @return 影响行数
|
||
*/
|
||
int addSignInBalance(Long userId, BigDecimal amount, String transactionNo, Long businessId, String businessType, String remark);
|
||
|
||
/**
|
||
* 给用户赠送金额(不可提现)
|
||
*
|
||
* @param userId 用户ID
|
||
* @param amount 赠送金额
|
||
* @param transactionNo 交易单号
|
||
* @param businessId 业务ID
|
||
* @param businessType 业务类型
|
||
* @param remark 备注
|
||
* @return 影响行数
|
||
*/
|
||
int addGiftBalance(Long userId, BigDecimal amount, String transactionNo, Long businessId, String businessType, String remark);
|
||
|
||
/**
|
||
* 通过主键逻辑删除
|
||
*
|
||
* @param accountId 主键
|
||
* @param updateBy 更新人
|
||
* @return 影响行数
|
||
*/
|
||
int logicDeleteById(Long accountId, String updateBy);
|
||
|
||
/**
|
||
* 通过主键物理删除
|
||
*
|
||
* @param accountId 主键
|
||
* @return 影响行数
|
||
*/
|
||
int deleteById(Long accountId);
|
||
|
||
/**
|
||
* 获取用户交易记录
|
||
*
|
||
* @param userId 用户ID
|
||
* @return 交易记录列表
|
||
*/
|
||
List<com.kexue.skills.entity.AccountTransaction> getTransactions(Long userId);
|
||
} |