Class FreezeServiceImpl

java.lang.Object
io.github.seenings.coin.service.impl.FreezeServiceImpl
All Implemented Interfaces:
io.github.seenings.account.service.FreezeService

@Service public class FreezeServiceImpl extends Object implements io.github.seenings.account.service.FreezeService
FreezeServiceImpl
Since:
2023-01-01
Author:
chixuehui
  • Constructor Details

    • FreezeServiceImpl

      public FreezeServiceImpl()
  • Method Details

    • freezeToSysUse

      public Long freezeToSysUse(Long userId, Long coinMount, io.github.seenings.coin.enumeration.BusiType busiType, String description)
      冻结账户转给系统使用账户
      Specified by:
      freezeToSysUse in interface io.github.seenings.account.service.FreezeService
      Parameters:
      userId - 用户ID
      coinMount - 虚拟币数量
      busiType - 交易类型
      description - 描述
      Returns:
      交易ID
    • freezeToTemporary

      public Long freezeToTemporary(Long userId, Long coinMount, io.github.seenings.coin.enumeration.BusiType busiType, String description)
      Specified by:
      freezeToTemporary in interface io.github.seenings.account.service.FreezeService
    • checkEnough

      public Boolean checkEnough(Long userId, Long coinMount)
      检查是否有足够的虚拟币
      Specified by:
      checkEnough in interface io.github.seenings.account.service.FreezeService
      Parameters:
      userId - 用户ID
      coinMount - 币的数量
      Returns:
      是否足够
    • checkEnoughAndFreeze

      public Set<Long> checkEnoughAndFreeze(Long userId, Long coinMount, io.github.seenings.coin.enumeration.BusiType busiType, String description)
      检查资金是否足够,如果够冻结
      Specified by:
      checkEnoughAndFreeze in interface io.github.seenings.account.service.FreezeService
      Parameters:
      userId - 用户ID
      coinMount - 虚拟币个数
      Returns:
      冻结的交易ID,资金不够时返回空