update time for response news
This commit is contained in:
@@ -20,6 +20,12 @@ import cn.stock.market.domain.basic.entity.SiteSetting;
|
||||
import cn.stock.market.domain.basic.repository.SiteSettingRepository;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
@SpringBootApplication(exclude = {
|
||||
MongoAutoConfiguration.class, MongoDataAutoConfiguration.class,
|
||||
RedisAutoConfiguration.class,
|
||||
@@ -31,6 +37,11 @@ public class StockMarketLaunch implements CommandLineRunner {
|
||||
|
||||
public static void main(String[] args) {
|
||||
HttpGlobalConfig.setTimeout(45000);
|
||||
TimeZone.setDefault(TimeZone.getTimeZone("Europe/Madrid"));
|
||||
log.info("JVM ZoneId: {}", ZoneId.systemDefault());
|
||||
log.info("Sample: now={}, madrid={}",
|
||||
new Date(),
|
||||
ZonedDateTime.now(ZoneId.of("Europe/Madrid")));
|
||||
SpringApplication.run(StockMarketLaunch.class, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -1063,7 +1063,7 @@ public class StockService {
|
||||
market.setRate(String.valueOf(stockIndex.getPercentChange()));
|
||||
vo1.setIndexVo(market);
|
||||
|
||||
List<ChartCandle> kLines = HomeApiIndex.fetchChartData(stockIndex.getId(), 419);
|
||||
List<ChartCandle> kLines = HomeApiIndex.fetchChartData(stockIndex.getId(), 100);
|
||||
// List kline = HomeApiIndex.convertToJsonList(kLines);
|
||||
vo1.setKLine(kLines);
|
||||
indexVoList.add(vo1);
|
||||
|
||||
@@ -83,7 +83,7 @@ public class HomeApiIndex {
|
||||
public static List<ChartCandle> fetchChartData(String symbol, int amount) throws Exception {
|
||||
List<ChartCandle> result = new ArrayList<>();
|
||||
|
||||
String url = BASE_URL + "?symbol=" + symbol + "&interval=D&amount=" + amount;
|
||||
String url = BASE_URL + "?symbol=" + symbol + "&interval=H&amount=" + amount;
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
|
||||
@@ -8,6 +8,7 @@ import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
@@ -75,6 +76,7 @@ public class SiteNewsPO {
|
||||
/**
|
||||
* 显示时间 */
|
||||
@ApiModelProperty("显示时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Europe/Madrid")
|
||||
Date showTime;
|
||||
|
||||
/**
|
||||
|
||||
@@ -311,7 +311,7 @@ public class InvestingTask {
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 0 0/3 * * ?")
|
||||
@PostConstruct
|
||||
// @PostConstruct
|
||||
public void getCincoDiasNews() {
|
||||
String baseUrl = "https://cincodias.elpais.com";
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
spring:
|
||||
jpa:
|
||||
show-sql: true
|
||||
|
||||
# Redis配置
|
||||
redis:
|
||||
host: 43.160.197.177
|
||||
password: redispass123
|
||||
port: 6379
|
||||
host: 167.235.39.59
|
||||
password: a5v8b86P4mVzFlUqJV
|
||||
port: 47379
|
||||
database: 1
|
||||
lettuce:
|
||||
pool:
|
||||
@@ -17,9 +18,9 @@ spring:
|
||||
datasource:
|
||||
stock-market:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://43.160.197.177:3306/germany_stock?useUnicode=true&characterEncoding=utf-8
|
||||
url: jdbc:mysql://de-cdb-pj5o5m8b.sql.tencentcdb.com:24110/stock-api?useUnicode=true&characterEncoding=utf-8
|
||||
username: root
|
||||
password: mysqlpass123
|
||||
password: 6QJXv8dA76klnqsWh6f
|
||||
maxActive: 500
|
||||
testWhileIdle: true
|
||||
validationQuery: SELECT 1
|
||||
|
||||
Reference in New Issue
Block a user