| | |
| | | queryWrapper.in(CollectionUtil.isNotEmpty(symbols), "symbol", symbols); |
| | | String name = itemQuery.getName(); |
| | | queryWrapper.and(StringUtils.isNotEmpty(name), itemWrapper->itemWrapper.like("name",name).or().like("symbol", name)); |
| | | queryWrapper.eq(StrUtil.isNotBlank(type), "type", type); |
| | | queryWrapper.like(StrUtil.isNotBlank(category), "category", category); |
| | | queryWrapper.eq(StrUtil.isNotBlank(type), "type", "forex"); |
| | | queryWrapper.like(StrUtil.isNotBlank(category), "category", "forex"); |
| | | queryWrapper.orderByDesc("sorted"); |
| | | Page<Item> page = new Page<>(1, 1000); |
| | | IPage<Item> result = itemService.page(page, queryWrapper); |
| | |
| | | public Result<List<Realtime>> getRealtime(@RequestParam(value = "",required = false) String symbol) { |
| | | |
| | | try { |
| | | // if(StringUtils.isEmptyString(symbol)){ |
| | | // return new Result<>(); |
| | | // } |
| | | if(StringUtils.isEmptyString(symbol)){ |
| | | List<Item> items = itemService.findByType("forex"); |
| | | StringBuilder symbolBuilder = new StringBuilder(); |
| | | if (items != null && !items.isEmpty()) { |
| | | for (Item item : items) { |
| | | symbolBuilder.append(item.getSymbol()).append(","); |
| | | } |
| | | // 移除最后一个逗号 |
| | | if (symbolBuilder.length() > 0) { |
| | | symbolBuilder.setLength(symbolBuilder.length() - 1); |
| | | } |
| | | } |
| | | symbol = symbolBuilder.toString(); |
| | | } |
| | | List<Realtime> data = this.dataService.realtime(symbol); |
| | | data.forEach(d->{ |
| | | Item bySymbol = itemService.findBySymbol(d.getSymbol()); |
| | |
| | | port: 8086 |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/trading_order?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true |
| | | url: jdbc:mysql://127.0.0.1:3306/trading_order_no?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true |
| | | username: root |
| | | password: 123456 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | logging: |
| | | config: classpath:logback/logback-local.xml |
| | | alltick: |
| | | token: 3ba36ca15660073739f25c4b1512086a-c-app |
| | | token: a3844e6f035d241e10899875024c1f87-c-app |
| | | trade-tick: "https://quote.alltick.io/quote-b-api/trade-tick?token=${alltick.token}&query={1}" |
| | | trade-kline: "https://quote.alltick.io/quote-b-api/kline?token=${alltick.token}&query={1}" |
| | | batch-kline: "https://quote.alltick.io/quote-b-api/batch-kline?token=${alltick.token}" |
| | |
| | | config: classpath:logback/logback-prod.xml |
| | | |
| | | alltick: |
| | | token: 3ba36ca15660073739f25c4b1512086a-c-app |
| | | token: a3844e6f035d241e10899875024c1f87-c-app |
| | | trade-tick: "https://quote.alltick.io/quote-b-api/trade-tick?token=${alltick.token}&query={1}" |
| | | trade-kline: "https://quote.alltick.io/quote-b-api/kline?token=${alltick.token}&query={1}" |
| | | batch-kline: "https://quote.alltick.io/quote-b-api/batch-kline?token=${alltick.token}" |
| | |
| | | spring: |
| | | # 环境 dev|local|test|prod |
| | | profiles: |
| | | active: local |
| | | active: prod |
| | | #文件上传设置 |
| | | servlet: |
| | | multipart: |