1
0

feat: 增加额外得分数据保存

This commit is contained in:
2025-10-11 15:04:16 +08:00
parent 5390a879e7
commit 49a03adf21
6 changed files with 228 additions and 182 deletions

View File

@@ -3,6 +3,8 @@ package com.lanyuanxiaoyao.leopard.server.entity;
import com.lanyuanxiaoyao.leopard.core.entity.Stock;
import com.lanyuanxiaoyao.leopard.core.entity.StockScore;
import java.time.LocalDate;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author lanyuanxiaoyao
@@ -16,7 +18,8 @@ public record StockScoreVo(
Stock.Market market,
String industry,
LocalDate listedDate,
Double score
Double score,
String extra
) {
public static StockScoreVo of(StockScore score) {
return new StockScoreVo(
@@ -27,7 +30,13 @@ public record StockScoreVo(
score.getStock().getMarket(),
score.getStock().getIndustry(),
score.getStock().getListedDate(),
score.getScore()
score.getScore(),
score.getExtra()
.entrySet()
.stream()
.sorted(Map.Entry.comparingByKey())
.map(entry -> entry.getKey() + ": " + entry.getValue())
.collect(Collectors.joining("<br>"))
);
}
}