From cdd0e5fc0523e71fa337a81a6b46c9204dd1be43 Mon Sep 17 00:00:00 2001 From: "yihang.lv" Date: Fri, 26 Apr 2019 13:07:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i3plus/pojo/base/enumutil/SwebEnumUtil.java | 205 +++++++++++++++++++++ .../pojo/sweb/modelbean/SwebLoginUserModel.java | 5 + 2 files changed, 210 insertions(+) diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/SwebEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/SwebEnumUtil.java index 4b2e9fc..e55fa30 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/SwebEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/SwebEnumUtil.java @@ -259,4 +259,209 @@ public class SwebEnumUtil { return tmp; } } + + /** + * 用户消息类型 + * 1.NOTICE:通知 + * 2.STATION_LETTER:站内信 + * 3.SWEB_NOTICE:SWEB通知 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum MESSAGE_TYPE { + + MAIL(1, "邮件", "邮件"), + LETTER(2, "站内信", "站内信"), + SWEB_NOTICE(3, "SWEB通知", "SWEB通知"), + SWEB_PUBLIC_NOTICE(4, "SWEB公告", "SWEB公告"); + + private int value; + private String name; + private String description; + + MESSAGE_TYPE() { + } + + MESSAGE_TYPE(int value, String name, String description) { + this.value = value; + this.name = name; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public static String valueOfCode(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].name; + } + } + return tmp; + } + + public static String valueOfDescription(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + + public static String codeOfDescription(String code) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].name.equals(code)) { + tmp = values()[i].description; + } + } + return tmp; + } + } + + /** + * 附件来源 + * 1.NOTICE:通知 + * 2.STATION_LETTER:站内信 + * 3.SWEB_NOTICE:SWEB通知 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum FILE_ATTACH_SOURCE { + MAIL(1, "邮件", "邮件"), + LETTER(2, "站内信", "站内信"), + SWEB_NOTICE(3, "SWEB通知", "SWEB通知"), + SWEB_PUBLIC_NOTICE(4, "SWEB公告", "SWEB公告"); + + private int value; + private String name; + private String description; + + FILE_ATTACH_SOURCE() { + } + + FILE_ATTACH_SOURCE(int value, String name, String description) { + this.value = value; + this.name = name; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public static String valueOfCode(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].name; + } + } + return tmp; + } + + public static String valueOfDescription(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + + public static String codeOfDescription(String code) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].name.equals(code)) { + tmp = values()[i].description; + } + } + return tmp; + } + } + + /** + * 前端系统平台 + * IMPP_FE:impp系统 + * SWEB_FE:sweb系统 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum FE_PLATFORM { + IMPP_FE("IMPP_FE", "IMPP_FE", "impp系统"), + SWEB_FE("SWEB_FE", "SWEB_FE", "sweb系统"); + + private String value; + private String name; + private String description; + + FE_PLATFORM() { + } + + FE_PLATFORM(String value, String name, String description) { + this.value = value; + this.name = name; + this.description = description; + } + + public String getValue() { + return value; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public static String valueOfCode(String val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].name; + } + } + return tmp; + } + + public static String valueOfDescription(String val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + + public static String codeOfDescription(String code) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].name.equals(code)) { + tmp = values()[i].description; + } + } + return tmp; + } + } } diff --git a/modules/i3plus-pojo-sweb/src/main/java/cn/estsh/i3plus/pojo/sweb/modelbean/SwebLoginUserModel.java b/modules/i3plus-pojo-sweb/src/main/java/cn/estsh/i3plus/pojo/sweb/modelbean/SwebLoginUserModel.java index 8076ebd..3594480 100644 --- a/modules/i3plus-pojo-sweb/src/main/java/cn/estsh/i3plus/pojo/sweb/modelbean/SwebLoginUserModel.java +++ b/modules/i3plus-pojo-sweb/src/main/java/cn/estsh/i3plus/pojo/sweb/modelbean/SwebLoginUserModel.java @@ -31,4 +31,9 @@ public class SwebLoginUserModel implements Serializable { @ApiParam(value = "ip地址") private String ip; + + public SwebLoginUserModel(Long id, String userName) { + this.id = id; + this.userName = userName; + } }