| | |
| | | import com.yami.trading.common.util.StringUtils; |
| | | import com.yami.trading.dao.item.ItemMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private ItemLeverageService itemLeverageService; |
| | | |
| | | private Map<String, Integer> symbolDecimal = Maps.newHashMap(); |
| | | |
| | | |
| | | @Autowired |
| | | private CacheManager cacheManager; |
| | |
| | | @Cached(name = ITEM_CACHE, key = "'all'", expire = 3600) |
| | | @Override |
| | | public List<Item> list() { |
| | | List<Item> list = super.list(); |
| | | List<Item> list = super.list(new LambdaQueryWrapper<>(Item.class).eq(Item::getType,Item.cryptos)); |
| | | symbolDecimal = list.stream() |
| | | .collect(Collectors.toMap(Item::getSymbol, Item::getDecimals, (s1, s2) -> s2)); |
| | | return list; |
| | |
| | | } |
| | | |
| | | public List<Item> cacheGetAll() { |
| | | return ApplicationContextUtils.getApplicationContext().getBean(ItemService.class).list(); |
| | | return ApplicationContextUtils.getApplicationContext().getBean(ItemService.class).list(new LambdaQueryWrapper<>(Item.class).eq(Item::getType,Item.cryptos)); |
| | | } |
| | | |
| | | |