1
0

refactor: 通用逻辑移到core中方便strategy模块一起使用

This commit is contained in:
2025-09-26 09:17:11 +08:00
parent 3991effa88
commit 0dd421ca43
19 changed files with 39 additions and 48 deletions

View File

@@ -20,10 +20,18 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-http</artifactId>
</dependency>
<dependency>
<groupId>io.github.ralfkonrad.quantlib_for_maven</groupId>

View File

@@ -1,4 +1,4 @@
package com.lanyuanxiaoyao.leopard.server.helper;
package com.lanyuanxiaoyao.leopard.core.helper;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;

View File

@@ -1,4 +1,4 @@
package com.lanyuanxiaoyao.leopard.server.service;
package com.lanyuanxiaoyao.leopard.core.service;
import com.lanyuanxiaoyao.leopard.core.entity.StockCollection;
import com.lanyuanxiaoyao.leopard.core.repository.StockCollectionRepository;

View File

@@ -1,4 +1,4 @@
package com.lanyuanxiaoyao.leopard.server.service;
package com.lanyuanxiaoyao.leopard.core.service;
import com.lanyuanxiaoyao.leopard.core.entity.Daily;
import com.lanyuanxiaoyao.leopard.core.entity.Daily_;

View File

@@ -1,15 +1,15 @@
package com.lanyuanxiaoyao.leopard.server.service;
package com.lanyuanxiaoyao.leopard.core.service;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.lanyuanxiaoyao.leopard.core.entity.Task;
import com.lanyuanxiaoyao.leopard.core.repository.TaskRepository;
import com.lanyuanxiaoyao.leopard.server.service.task.PyramidSelect;
import com.lanyuanxiaoyao.leopard.server.service.task.TaskRunner;
import com.lanyuanxiaoyao.leopard.server.service.task.UpdateDailyTask;
import com.lanyuanxiaoyao.leopard.server.service.task.UpdateFinanceIndicatorTask;
import com.lanyuanxiaoyao.leopard.server.service.task.UpdateStockTask;
import com.lanyuanxiaoyao.leopard.server.service.task.UpdateYearlyTask;
import com.lanyuanxiaoyao.leopard.core.task.PyramidSelect;
import com.lanyuanxiaoyao.leopard.core.task.TaskRunner;
import com.lanyuanxiaoyao.leopard.core.task.UpdateDailyTask;
import com.lanyuanxiaoyao.leopard.core.task.UpdateFinanceIndicatorTask;
import com.lanyuanxiaoyao.leopard.core.task.UpdateStockTask;
import com.lanyuanxiaoyao.leopard.core.task.UpdateYearlyTask;
import com.lanyuanxiaoyao.service.template.service.SimpleServiceSupport;
import jakarta.transaction.Transactional;
import java.util.Map;

View File

@@ -1,4 +1,4 @@
package com.lanyuanxiaoyao.leopard.server.service;
package com.lanyuanxiaoyao.leopard.core.service;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;

View File

@@ -1,4 +1,4 @@
package com.lanyuanxiaoyao.leopard.server.service.task;
package com.lanyuanxiaoyao.leopard.core.task;
import com.lanyuanxiaoyao.leopard.core.entity.StockCollection;
import com.lanyuanxiaoyao.leopard.core.repository.StockCollectionRepository;

View File

@@ -1,11 +1,11 @@
package com.lanyuanxiaoyao.leopard.server.service.task;
package com.lanyuanxiaoyao.leopard.core.task;
import cn.hutool.core.exceptions.ExceptionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.lanyuanxiaoyao.leopard.core.entity.Task;
import com.lanyuanxiaoyao.leopard.core.repository.TaskRepository;
import com.lanyuanxiaoyao.leopard.server.service.TaskService;
import com.lanyuanxiaoyao.leopard.core.service.TaskService;
import java.time.LocalDateTime;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;

View File

@@ -1,14 +1,14 @@
package com.lanyuanxiaoyao.leopard.server.service.task;
package com.lanyuanxiaoyao.leopard.core.task;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.lanyuanxiaoyao.leopard.core.entity.Daily;
import com.lanyuanxiaoyao.leopard.core.entity.Stock;
import com.lanyuanxiaoyao.leopard.core.helper.NumberHelper;
import com.lanyuanxiaoyao.leopard.core.repository.DailyRepository;
import com.lanyuanxiaoyao.leopard.core.repository.StockRepository;
import com.lanyuanxiaoyao.leopard.server.helper.NumberHelper;
import com.lanyuanxiaoyao.leopard.server.service.TuShareService;
import com.lanyuanxiaoyao.leopard.core.service.TuShareService;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;

View File

@@ -1,4 +1,4 @@
package com.lanyuanxiaoyao.leopard.server.service.task;
package com.lanyuanxiaoyao.leopard.core.task;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjectUtil;
@@ -6,10 +6,10 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.lanyuanxiaoyao.leopard.core.entity.FinanceIndicator;
import com.lanyuanxiaoyao.leopard.core.entity.QFinanceIndicator;
import com.lanyuanxiaoyao.leopard.core.entity.Stock;
import com.lanyuanxiaoyao.leopard.core.helper.NumberHelper;
import com.lanyuanxiaoyao.leopard.core.repository.FinanceIndicatorRepository;
import com.lanyuanxiaoyao.leopard.core.repository.StockRepository;
import com.lanyuanxiaoyao.leopard.server.helper.NumberHelper;
import com.lanyuanxiaoyao.leopard.server.service.TuShareService;
import com.lanyuanxiaoyao.leopard.core.service.TuShareService;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;

View File

@@ -1,9 +1,9 @@
package com.lanyuanxiaoyao.leopard.server.service.task;
package com.lanyuanxiaoyao.leopard.core.task;
import cn.hutool.core.util.EnumUtil;
import com.lanyuanxiaoyao.leopard.core.entity.Stock;
import com.lanyuanxiaoyao.leopard.core.repository.StockRepository;
import com.lanyuanxiaoyao.leopard.server.service.TuShareService;
import com.lanyuanxiaoyao.leopard.core.service.TuShareService;
import java.time.LocalDate;
import java.util.Map;
import java.util.stream.Collectors;

View File

@@ -1,4 +1,4 @@
package com.lanyuanxiaoyao.leopard.server.service.task;
package com.lanyuanxiaoyao.leopard.core.task;
import com.lanyuanxiaoyao.leopard.core.entity.Daily;
import com.lanyuanxiaoyao.leopard.core.entity.QDaily;

View File

@@ -41,24 +41,6 @@
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-http</artifactId>
</dependency>
<dependency>
<groupId>io.github.ralfkonrad.quantlib_for_maven</groupId>
<artifactId>quantlib</artifactId>
</dependency>
<dependency>
<groupId>org.ta4j</groupId>
<artifactId>ta4j-core</artifactId>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>

View File

@@ -3,7 +3,7 @@ package com.lanyuanxiaoyao.leopard.server.controller;
import com.lanyuanxiaoyao.leopard.core.entity.Stock;
import com.lanyuanxiaoyao.leopard.core.entity.Task;
import com.lanyuanxiaoyao.leopard.core.repository.StockRepository;
import com.lanyuanxiaoyao.leopard.server.service.TaskService;
import com.lanyuanxiaoyao.leopard.core.service.TaskService;
import com.lanyuanxiaoyao.service.template.controller.GlobalResponse;
import java.util.Arrays;
import java.util.Comparator;

View File

@@ -1,7 +1,7 @@
package com.lanyuanxiaoyao.leopard.server.controller;
import com.lanyuanxiaoyao.leopard.core.service.TaskService;
import com.lanyuanxiaoyao.leopard.server.service.QuartzService;
import com.lanyuanxiaoyao.leopard.server.service.TaskService;
import com.lanyuanxiaoyao.service.template.controller.GlobalResponse;
import java.time.LocalDateTime;
import java.util.List;

View File

@@ -1,9 +1,9 @@
package com.lanyuanxiaoyao.leopard.server.controller;
import com.lanyuanxiaoyao.leopard.core.entity.StockCollection;
import com.lanyuanxiaoyao.leopard.core.service.StockCollectionService;
import com.lanyuanxiaoyao.leopard.core.service.StockService;
import com.lanyuanxiaoyao.leopard.server.entity.StockDetailVo;
import com.lanyuanxiaoyao.leopard.server.service.StockCollectionService;
import com.lanyuanxiaoyao.leopard.server.service.StockService;
import com.lanyuanxiaoyao.service.template.controller.SimpleControllerSupport;
import java.util.HashSet;
import java.util.Set;

View File

@@ -2,9 +2,9 @@ package com.lanyuanxiaoyao.leopard.server.controller;
import cn.hutool.core.bean.BeanUtil;
import com.lanyuanxiaoyao.leopard.core.entity.Stock;
import com.lanyuanxiaoyao.leopard.core.helper.NumberHelper;
import com.lanyuanxiaoyao.leopard.core.service.StockService;
import com.lanyuanxiaoyao.leopard.server.entity.StockDetailVo;
import com.lanyuanxiaoyao.leopard.server.helper.NumberHelper;
import com.lanyuanxiaoyao.leopard.server.service.StockService;
import com.lanyuanxiaoyao.service.template.controller.GlobalResponse;
import com.lanyuanxiaoyao.service.template.controller.SimpleControllerSupport;
import java.time.LocalDate;

View File

@@ -4,7 +4,7 @@ import cn.hutool.core.date.BetweenFormatter;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.lanyuanxiaoyao.leopard.core.entity.Task;
import com.lanyuanxiaoyao.leopard.server.service.TaskService;
import com.lanyuanxiaoyao.leopard.core.service.TaskService;
import com.lanyuanxiaoyao.service.template.controller.GlobalResponse;
import com.lanyuanxiaoyao.service.template.controller.SimpleControllerSupport;
import java.time.Duration;

View File

@@ -3,6 +3,7 @@ package com.lanyuanxiaoyao.leopard.server.service;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.lanyuanxiaoyao.leopard.core.service.TaskService;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;