1
0

feat(all): 增加股票上市状态

This commit is contained in:
2025-08-30 22:19:26 +08:00
parent cbab5afeab
commit 877f460c26
4 changed files with 36 additions and 3 deletions

View File

@@ -100,6 +100,12 @@ public class CommonOptionsController {
.map(industry -> new Option(industry, industry))
.toList()
);
case "stock_listed" -> GlobalResponse.responseSuccess(
List.of(
new Option("已上市", true),
new Option("已退市", false)
)
);
default -> GlobalResponse.responseSuccess(List.of());
};
}
@@ -113,6 +119,13 @@ public class CommonOptionsController {
.toList(),
field
));
case "stock_listed" -> GlobalResponse.responseSuccess(buildMapping(
List.of(
new Mapping("true", "已上市"),
new Mapping("false", "已退市")
),
field
));
case "task_status" -> GlobalResponse.responseSuccess(buildMapping(
Arrays.stream(Task.Status.values())
.map(status -> new Mapping(status.name(), status.getChineseName()))

View File

@@ -36,7 +36,8 @@ public class StockController extends SimpleControllerSupport<Stock, Void, StockC
stock.getName(),
stock.getFullname(),
stock.getMarket(),
stock.getIndustry()
stock.getIndustry(),
stock.isListed()
);
}
@@ -56,7 +57,8 @@ public class StockController extends SimpleControllerSupport<Stock, Void, StockC
String name,
String fullname,
Stock.Market market,
String industry
String industry,
Boolean listed
) {
}
}

View File

@@ -50,7 +50,6 @@ public class Stock extends SimpleEntity {
@Comment("交易市场")
@Enumerated(EnumType.STRING)
private Market market;
@Column(nullable = false)
@Comment("行业")
private String industry;
@Column(nullable = false)