| | |
| | | import com.xcong.excoin.modules.member.entity.MemberEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberWalletContractEntity; |
| | | import com.xcong.excoin.rabbit.pricequeue.OrderModel; |
| | | import com.xcong.excoin.rabbit.pricequeue.WebsocketPriceService; |
| | | import com.xcong.excoin.rabbit.producer.OrderProducer; |
| | | import com.xcong.excoin.utils.CalculateUtil; |
| | | import com.xcong.excoin.utils.RedisUtils; |
| | | import com.xcong.excoin.utils.ThreadPoolUtils; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private OrderProducer orderProducer; |
| | | |
| | | @Test |
| | | public void sendMsg() { |
| | | List<OrderModel> list = new ArrayList<>(); |
| | | OrderModel orderModel = new OrderModel(1L, RabbitPriceTypeEnum.ENTRUST_OPEN_MORE.getValue(), "111", "BTC"); |
| | | list.add(orderModel); |
| | | orderProducer.sendLimitClose(JSONObject.toJSONString(list)); |
| | | } |
| | | |
| | | |
| | | // 面值*(多单张数*多单开仓价-空单张数*空单开仓价)-余额-已实现盈亏 / 面值*(多单张数-空单张数)-(维持保证金率+TAKER手续费)*面值*(开多张数+开空张数) |
| | | |
| | |
| | | */ |
| | | @Test |
| | | public void forceSetPriceTest() { |
| | | MemberEntity memberEntity = memberDao.selectById(5L); |
| | | MemberEntity memberEntity = memberDao.selectById(21L); |
| | | CalculateUtil.getForceSetPriceForWhole("BTC/USDT", memberEntity); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Resource |
| | | private RedisUtils redisUtils; |
| | | |
| | | @Test |
| | | public void redisTest() { |
| | | for (int i = 827; i < 999; i++) { |
| | | redisUtils.del(AppContants.CLOSING_ORDER_PREFIX + i); |
| | | } |
| | | } |
| | | |
| | | @Resource |
| | | private WebsocketPriceService websocketPriceService; |
| | | |
| | | @Test |
| | | public void wholeBombTest() { |
| | | websocketPriceService.wholeBomb("BTC/USDT", "9000"); |
| | | } |
| | | |
| | | @Test |
| | | public void forceTest() { |
| | | MemberEntity memberEntity = memberDao.selectById(5L); |
| | | CalculateUtil.getForceSetPriceForWhole(null, memberEntity); |
| | | } |
| | | |
| | | |
| | | |
| | | } |