|
@@ -105,29 +105,6 @@ public class BlessRecallScore extends AbstractScorer4Recall {
|
|
|
return ListMerger.mergeLists(yearResult, dayResult, anyResult);
|
|
|
}
|
|
|
|
|
|
- public Pair<LocalDateTime, LocalDateTime> getStartTimeAndEndTime(String timeRangeList) {
|
|
|
- if (timeRangeList == null || timeRangeList.isEmpty()) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- // 时间格式 2024-12-20 00:00~2024-12-25 08:00
|
|
|
- if (StringUtils.startsWith(timeRangeList, "daily")) {
|
|
|
- // 判断是否是 daily 开头
|
|
|
- return null;
|
|
|
- } else {
|
|
|
- String[] split = StringUtils.split(timeRangeList, "~");
|
|
|
- if (split.length != 2) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- String startTime = split[0];
|
|
|
- String endTime = split[1];
|
|
|
- // 解析 startTime endTime
|
|
|
- DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
|
|
|
- LocalDateTime startLocalDateTime = LocalDateTime.parse(startTime, dateTimeFormatter);
|
|
|
- LocalDateTime endLocalDateTime = LocalDateTime.parse(endTime, dateTimeFormatter);
|
|
|
- return Pair.of(startLocalDateTime, endLocalDateTime);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
public boolean isFestivalTime(LocalDateTime now, List<String> timeRangeList) {
|
|
|
if (timeRangeList == null || timeRangeList.isEmpty()) {
|
|
|
return false;
|