定义新实训数据结构

This commit is contained in:
joylink_zhangsai 2022-08-09 10:27:22 +08:00
parent b892606e76
commit 17fbc6ae51
3 changed files with 200 additions and 0 deletions

View File

@ -0,0 +1,77 @@
package club.joylink.rtss.entity.training2;
import java.time.LocalDateTime;
public class Training2 {
private Long id;
private Long mapId;
/**
* 名称
*/
private String name;
/**
* 描述
*/
private String description;
/**
* 地图定位json
*/
private String mapLocationJson;
/**
* 初始背景
*/
private String bgSceneJson;
/**
* List<Opera> 的json
*/
private String operaListJson;
/**
* List<Step2> 的json
*/
private String stepListJson;
/**
* 保存数据时的背景
*/
private String saveSceneJson;
/**
* 仿真内所有成员
*/
private String memberJson;
/**
* 参演的仿真成员
*/
private String playerJson;
/**
* 满分
*/
private Integer fullMarks;
/**
* 及格分
*/
private Integer passingMarks;
/**
* 状态
*/
private String status;
private Long creatorId;
private LocalDateTime createTime;
private Long updaterId;
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,89 @@
package club.joylink.rtss.vo.client.training2;
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
import club.joylink.rtss.util.JsonUtils;
import club.joylink.rtss.vo.map.graph.Point;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List;
import java.util.Map;
/**
* 实训操作
*/
@Getter
@Setter
@NoArgsConstructor
public class Opera {
private String id = "1";
private Type type = Type.META;
public enum Type {
/**
* 元操作最小操作单位
*/
META,
ATS,
CONVERSATION,
}
@JsonIgnore
private OperaDetail detail;
public String getDetailJson() {
if (detail != null) {
return JsonUtils.writeValueAsString(detail);
}
return null;
}
public void setDetailJson(String detailJson) {
if (detailJson != null) {
switch (type) {
case META:
this.detail = JsonUtils.read(detailJson, MetaOperaDetail.class);
break;
case ATS:
this.detail = JsonUtils.read(detailJson, AtsOperaDetail.class);
break;
case CONVERSATION:
this.detail = JsonUtils.read(detailJson, ConversationOperaDetail.class);
break;
}
}
}
public static abstract class OperaDetail {
}
@Getter
@Setter
@NoArgsConstructor
public static class MetaOperaDetail extends OperaDetail{
private String elementCode = "Signal_X1254";
private Point point;
}
@Getter
@Setter
@NoArgsConstructor
public static class AtsOperaDetail extends OperaDetail{
private Operation.Type operationType;
private Map<String, Object> params;
}
@Getter
@Setter
@NoArgsConstructor
public static class ConversationOperaDetail extends OperaDetail{
private String conversationId;
private List<String> memberIds;
}
}

View File

@ -0,0 +1,34 @@
package club.joylink.rtss.vo.client.training2;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
@NoArgsConstructor
public class Step2 {
private String id;
private String name;
private String description;
private List<String> operaIds;
/**
* 步骤分值
*/
private Float score;
private Condition condition;
@Getter
@Setter
@NoArgsConstructor
public class Condition {
}
}