| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.example.pojo.Currency; |
| | | import org.example.pojo.bo.CurrencyBitgetBo; |
| | | import org.example.pojo.bo.CurrencyGateBo; |
| | | import org.example.pojo.bo.CurrencyMexcBo; |
| | | import org.example.server.impl.CurrencySerivceImpl; |
| | | import org.example.common.MarketDataClient; |
| | | import org.example.util.ConverterUtil; |
| | | import org.example.util.RedisUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | |
| | | getList.parallelStream().forEach(person -> person.setId(StringUtils.remove(person.getId(), "_"))); |
| | | |
| | | List<Currency> dbList = currencyService.list(new LambdaQueryWrapper<Currency>().eq(Currency::getSource, "gate")); |
| | | Set<String> symbolSet = dbList.stream().map(Currency::getSymbol).collect(Collectors.toSet()); |
| | | List<Currency> removeList = dbList.stream() |
| | | .filter(currency -> !symbolSet.contains(currency.getSymbol())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | if(CollectionUtils.isNotEmpty(removeList)){ |
| | | removeList.forEach(f->{ |
| | | RedisUtil.delete("gate"+f.getSymbol()); |
| | | }); |
| | | } |
| | | |
| | | |
| | | currencyService.remove(new LambdaQueryWrapper<Currency>().eq(Currency::getSource,"gate")); |
| | | |
| | | // 比对接口返回的数据和数据库中已有的数据,找出新增的数据 |