| | |
| | | import com.yami.trading.bean.item.domain.Item; |
| | | import com.yami.trading.bean.item.dto.ItemDTO; |
| | | import com.yami.trading.bean.item.dto.ItemLeverageDTO; |
| | | import com.yami.trading.bean.robot.domain.Robot; |
| | | import com.yami.trading.common.util.ApplicationContextUtils; |
| | | import com.yami.trading.common.util.MarketOpenChecker; |
| | | import com.yami.trading.common.util.StringUtils; |
| | |
| | | return baseMapper.findList(page, queryWrapper); |
| | | } |
| | | |
| | | @Cached(name = ITEM_CACHE, key = "'all'", expire = 3600) |
| | | @Cached(name = ITEM_CACHE, key = "'itemAll'", expire = 3600) |
| | | @Override |
| | | public List<Item> list() { |
| | | List<Item> list = super.list(new LambdaQueryWrapper<>(Item.class).eq(Item::getType,Item.cryptos)); |
| | |
| | | } |
| | | |
| | | // 清除 list() 方法的缓存(关键:与@Cached的name和key一致) |
| | | /*@CacheEvict(cacheNames = ITEM_CACHE, key = "'all'") |
| | | /*@CacheEvict(cacheNames = ITEM_CACHE, key = "'itemAll'") |
| | | public void clearListCache() { |
| | | log.info("已清除 list() 方法的缓存"); |
| | | }*/ |
| | |
| | | * @return |
| | | */ |
| | | public boolean isSuspended(String symbol) { |
| | | Item item = findBySymbol(symbol); |
| | | //虚拟币新币才判断 |
| | | if (item.getType().equals(Item.cryptos) /*&& (item.getCurrencyType() != null && item.getCurrencyType() == 1)*/) { |
| | | //item = getById(item.getUuid()); |
| | | if (item.getStatus() != null && item.getStatus() == 0) { |
| | | return true; |
| | | //Item item = findBySymbol(symbol); |
| | | Item item = getOne(new LambdaQueryWrapper<Item>().eq(Item::getSymbol, symbol)); |
| | | if (item != null) { |
| | | //虚拟币新币才判断 |
| | | if (item.getType().equals(Item.cryptos) /*&& (item.getCurrencyType() != null && item.getCurrencyType() == 1)*/) { |
| | | //item = getById(item.getUuid()); |
| | | if (item.getStatus() != null && item.getStatus() == 0) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |