计划任务编辑详情前后端适配
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
package quant.rich.emoney.pojo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain=true)
|
||||
public class MultiIndexPlanDetail {
|
||||
|
||||
/**
|
||||
* 指标
|
||||
*/
|
||||
List<MultiIndexPlanPart> indexes;
|
||||
|
||||
/**
|
||||
* 抓取的 K 线粒度
|
||||
*/
|
||||
List<Integer> periods;
|
||||
|
||||
/**
|
||||
* 设置抓取周期并去重
|
||||
* @param periods
|
||||
* @return
|
||||
*/
|
||||
public MultiIndexPlanDetail setPeriods(List<Integer> periods) {
|
||||
if (CollectionUtils.isEmpty(periods)) {
|
||||
this.periods = Collections.emptyList();
|
||||
return this;
|
||||
}
|
||||
Set<Integer> hashSet = new HashSet<>();
|
||||
periods.forEach(period -> {
|
||||
if (period != null) {
|
||||
hashSet.add(period);
|
||||
}
|
||||
});
|
||||
this.periods = new ArrayList<>(hashSet);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取抓取周期。已去重
|
||||
* @return
|
||||
*/
|
||||
public List<Integer> getPeriods() {
|
||||
setPeriods(periods);
|
||||
return periods;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Accessors(chain=true)
|
||||
public static class MultiIndexPlanPart {
|
||||
|
||||
/**
|
||||
* 单指标代码
|
||||
*/
|
||||
String indexCode;
|
||||
|
||||
/**
|
||||
* 单指标参数
|
||||
*/
|
||||
Map<String, String> params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package quant.rich.emoney.pojo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain=true)
|
||||
public class SingleIndexPlanDetail {
|
||||
|
||||
/**
|
||||
* 单指标代码
|
||||
*/
|
||||
String indexCode;
|
||||
|
||||
/**
|
||||
* 单指标参数
|
||||
*/
|
||||
Map<String, String> params;
|
||||
|
||||
/**
|
||||
* 抓取的 K 线粒度
|
||||
*/
|
||||
List<Integer> periods;
|
||||
|
||||
/**
|
||||
* 设置抓取周期并去重
|
||||
* @param periods
|
||||
* @return
|
||||
*/
|
||||
public SingleIndexPlanDetail setPeriods(List<Integer> periods) {
|
||||
if (CollectionUtils.isEmpty(periods)) {
|
||||
this.periods = Collections.emptyList();
|
||||
return this;
|
||||
}
|
||||
Set<Integer> hashSet = new HashSet<>();
|
||||
periods.forEach(period -> {
|
||||
if (period != null) {
|
||||
hashSet.add(period);
|
||||
}
|
||||
});
|
||||
this.periods = new ArrayList<>(hashSet);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取抓取周期。已去重
|
||||
* @return
|
||||
*/
|
||||
public List<Integer> getPeriods() {
|
||||
setPeriods(periods);
|
||||
return periods;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user