feat: 移除stock的上市状态,默认库里的股票都是上市的
This commit is contained in:
@@ -104,12 +104,6 @@ public class CommonOptionsController {
|
||||
.map(industry -> new Option(industry, industry))
|
||||
.toList()
|
||||
);
|
||||
case "stock_listed" -> GlobalResponse.responseSuccess(
|
||||
List.of(
|
||||
new Option("已上市", true),
|
||||
new Option("已退市", false)
|
||||
)
|
||||
);
|
||||
case "task_template_id" -> GlobalResponse.responseSuccess(
|
||||
taskTemplateService.list()
|
||||
.stream()
|
||||
@@ -129,13 +123,6 @@ 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()))
|
||||
|
||||
@@ -36,8 +36,7 @@ public class StockController extends SimpleControllerSupport<Stock, Void, StockC
|
||||
stock.getName(),
|
||||
stock.getFullname(),
|
||||
stock.getMarket(),
|
||||
stock.getIndustry(),
|
||||
stock.isListed()
|
||||
stock.getIndustry()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -57,8 +56,7 @@ public class StockController extends SimpleControllerSupport<Stock, Void, StockC
|
||||
String name,
|
||||
String fullname,
|
||||
Stock.Market market,
|
||||
String industry,
|
||||
Boolean listed
|
||||
String industry
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,15 @@ package com.lanyuanxiaoyao.leopard.server.entity;
|
||||
import com.lanyuanxiaoyao.leopard.server.Constants;
|
||||
import com.lanyuanxiaoyao.leopard.server.entity.base.SimpleEnum;
|
||||
import com.lanyuanxiaoyao.service.template.entity.SimpleEntity;
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.EnumType;
|
||||
import jakarta.persistence.Enumerated;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.Table;
|
||||
import java.util.Set;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -52,9 +55,10 @@ public class Stock extends SimpleEntity {
|
||||
private Market market;
|
||||
@Comment("行业")
|
||||
private String industry;
|
||||
@Column(nullable = false)
|
||||
@Comment("上市状态")
|
||||
private boolean listed = true;
|
||||
|
||||
@OneToMany(mappedBy = "stock", cascade = CascadeType.REMOVE)
|
||||
@ToString.Exclude
|
||||
private Set<Daily> dailies;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
|
||||
Reference in New Issue
Block a user