Class CoinTradeController
java.lang.Object
io.github.seenings.coin.api.impl.CoinTradeController
- All Implemented Interfaces:
HttpCoinTradeService
CoinTradeController
- Since:
- 2023-01-01
- Author:
- chixuehui
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckEnough(Long userId, Long coinMount) 检查是否有足够的虚拟币checkEnoughAndFreeze(Long userId, Long coinMount, BusiType busiType, String description) 检查资金是否足够,如果够冻结freezeToSysUse(Long userId, Long coinMount, BusiType busiType, String description) freezeToTemporary(Long userId, Long coinMount, BusiType busiType, String description) simpleTradeTypeTo(Long userId, Long coinAmount, BusiType busiType)
-
Constructor Details
-
CoinTradeController
public CoinTradeController()
-
-
Method Details
-
freezeToSysUse
public Long freezeToSysUse(@RequestParam("userId") Long userId, @RequestParam("coinMount") Long coinMount, @RequestParam("busiType") BusiType busiType, @RequestParam("description") String description) - Specified by:
freezeToSysUsein interfaceHttpCoinTradeService
-
freezeToTemporary
public Long freezeToTemporary(@RequestParam("userId") Long userId, @RequestParam("coinMount") Long coinMount, @RequestParam("busiType") BusiType busiType, @RequestParam("description") String description) - Specified by:
freezeToTemporaryin interfaceHttpCoinTradeService
-
checkEnoughAndFreeze
public Set<Long> checkEnoughAndFreeze(@RequestParam("userId") Long userId, @RequestParam("coinMount") Long coinMount, @RequestParam("busiType") BusiType busiType, @RequestParam("description") String description) 检查资金是否足够,如果够冻结- Specified by:
checkEnoughAndFreezein interfaceHttpCoinTradeService- Parameters:
userId- 用户IDcoinMount- 虚拟币个数- Returns:
- 冻结的交易ID,资金不够时返回空
-
checkEnough
public Boolean checkEnough(@RequestParam("userId") Long userId, @RequestParam("coinMount") Long coinMount) 检查是否有足够的虚拟币- Specified by:
checkEnoughin interfaceHttpCoinTradeService- Parameters:
userId- 用户IDcoinMount- 币的数量- Returns:
- 是否足够
-
simpleTradeTypeTo
public Long simpleTradeTypeTo(@RequestParam("userId") Long userId, @RequestParam("coinAmount") Long coinAmount, @RequestParam("busiType") BusiType busiType) - Specified by:
simpleTradeTypeToin interfaceHttpCoinTradeService
-