|
@@ -11,81 +11,57 @@ import java.util.Objects;
|
|
|
*/
|
|
|
public enum WebsocketTypeEnum {
|
|
|
|
|
|
- client_paper_download(0, "客户端已下载试卷"),
|
|
|
+ client_paper_download("客户端已下载试卷","clientPaperDownload"),
|
|
|
|
|
|
- sync_status(1, "状态同步"),
|
|
|
+ sync_status("状态同步","syncStatus"),
|
|
|
|
|
|
- sync_ack(2, "同步确认"),
|
|
|
+ sync_ack( "同步确认","syncAck"),
|
|
|
|
|
|
- invigilate_liveness_verify(3, "监考强制活体验证"),
|
|
|
+ invigilate_liveness_verify( "监考强制活体验证","invigilateLivenessVerify"),
|
|
|
|
|
|
- invigilate_notice(4, "监考消息"),
|
|
|
+ invigilate_notice( "监考消息","invigilateNotice"),
|
|
|
|
|
|
- invigilate_notice_ack(5, "监考消息确认"),
|
|
|
+ invigilate_notice_ack( "监考消息确认","invigilateNoticeAck"),
|
|
|
|
|
|
- invigilate_stop_exam(6, "监考强制收卷");
|
|
|
+ invigilate_stop_exam( "监考强制收卷","invigilateStopExam");
|
|
|
|
|
|
- private int id;
|
|
|
private String code;
|
|
|
+ private String desc;
|
|
|
|
|
|
- private WebsocketTypeEnum(int id, String code) {
|
|
|
- this.id = id;
|
|
|
+ private WebsocketTypeEnum(String code,String desc) {
|
|
|
this.code = code;
|
|
|
+ this.desc = desc;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 状态转换 toId
|
|
|
+ * 状态转换 toDesc
|
|
|
*
|
|
|
* @param value
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String convertToCode(String value) {
|
|
|
+ public static String convertToDesc(String value) {
|
|
|
if (Objects.equals(value.trim(), client_paper_download.name())) {
|
|
|
- return client_paper_download.getCode();
|
|
|
+ return client_paper_download.getDesc();
|
|
|
} else if (Objects.equals(value.trim(), sync_status.name())) {
|
|
|
- return sync_status.getCode();
|
|
|
+ return sync_status.getDesc();
|
|
|
} else if (Objects.equals(value.trim(), sync_ack.name())) {
|
|
|
- return sync_ack.getCode();
|
|
|
+ return sync_ack.getDesc();
|
|
|
} else if (Objects.equals(value.trim(), invigilate_liveness_verify.name())) {
|
|
|
- return invigilate_liveness_verify.getCode();
|
|
|
+ return invigilate_liveness_verify.getDesc();
|
|
|
} else if (Objects.equals(value.trim(), invigilate_notice.name())) {
|
|
|
- return invigilate_notice.getCode();
|
|
|
+ return invigilate_notice.getDesc();
|
|
|
} else if (Objects.equals(value.trim(), invigilate_notice_ack.name())) {
|
|
|
- return invigilate_notice_ack.getCode();
|
|
|
+ return invigilate_notice_ack.getDesc();
|
|
|
} else {
|
|
|
- return invigilate_stop_exam.getCode();
|
|
|
+ return invigilate_stop_exam.getDesc();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 状态转换 toName
|
|
|
- *
|
|
|
- * @param value
|
|
|
- * @return
|
|
|
- */
|
|
|
- public static String convertToName(String value) {
|
|
|
- if (Objects.equals(value.trim(), client_paper_download.getCode())) {
|
|
|
- return client_paper_download.name();
|
|
|
- } else if (Objects.equals(value.trim(), sync_status.getCode())) {
|
|
|
- return sync_status.name();
|
|
|
- } else if (Objects.equals(value.trim(), sync_ack.getCode())) {
|
|
|
- return sync_ack.name();
|
|
|
- } else if (Objects.equals(value.trim(), invigilate_liveness_verify.getCode())) {
|
|
|
- return invigilate_liveness_verify.name();
|
|
|
- } else if (Objects.equals(value.trim(), invigilate_notice.getCode())) {
|
|
|
- return invigilate_notice.name();
|
|
|
- } else if (Objects.equals(value.trim(), invigilate_notice_ack.getCode())) {
|
|
|
- return invigilate_notice_ack.name();
|
|
|
- } else {
|
|
|
- return invigilate_stop_exam.name();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public int getId() {
|
|
|
- return id;
|
|
|
- }
|
|
|
-
|
|
|
public String getCode() {
|
|
|
return code;
|
|
|
}
|
|
|
+
|
|
|
+ public String getDesc() {
|
|
|
+ return desc;
|
|
|
+ }
|
|
|
}
|