Class CoinTradeController

java.lang.Object
io.github.seenings.coin.api.impl.CoinTradeController
All Implemented Interfaces:
io.github.seenings.trade.http.HttpCoinTradeService

@RestController public class CoinTradeController extends Object implements io.github.seenings.trade.http.HttpCoinTradeService
CoinTradeController
Since:
2023-01-01
Author:
chixuehui
  • Constructor Details

    • CoinTradeController

      public CoinTradeController()
  • Method Details

    • freezeToSysUse

      public Long freezeToSysUse(@RequestParam("userId") Long userId, @RequestParam("coinMount") Long coinMount, @RequestParam("busiType") io.github.seenings.coin.enumeration.BusiType busiType, @RequestParam("description") String description)
      Specified by:
      freezeToSysUse in interface io.github.seenings.trade.http.HttpCoinTradeService
    • freezeToTemporary

      public Long freezeToTemporary(@RequestParam("userId") Long userId, @RequestParam("coinMount") Long coinMount, @RequestParam("busiType") io.github.seenings.coin.enumeration.BusiType busiType, @RequestParam("description") String description)
      Specified by:
      freezeToTemporary in interface io.github.seenings.trade.http.HttpCoinTradeService
    • checkEnoughAndFreeze

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

      public Boolean checkEnough(@RequestParam("userId") Long userId, @RequestParam("coinMount") Long coinMount)
      检查是否有足够的虚拟币
      Specified by:
      checkEnough in interface io.github.seenings.trade.http.HttpCoinTradeService
      Parameters:
      userId - 用户ID
      coinMount - 币的数量
      Returns:
      是否足够
    • simpleTradeTypeTo

      public Long simpleTradeTypeTo(@RequestParam("userId") Long userId, @RequestParam("coinAmount") Long coinAmount, @RequestParam("busiType") io.github.seenings.coin.enumeration.BusiType busiType)
      Specified by:
      simpleTradeTypeTo in interface io.github.seenings.trade.http.HttpCoinTradeService