From 001e1a3481fab4f0b01af61da322f999ef31e4df Mon Sep 17 00:00:00 2001 From: Gary Date: Mon, 22 Jan 2024 16:04:09 +0800 Subject: [PATCH] 1.add enum for app update --- .../main/java/enums/AppUpdateSatusEnum.java | 30 ++++++++++++++++ .../main/java/enums/AppUpdateTypeEnum.java | 36 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 luoo_common/src/main/java/enums/AppUpdateSatusEnum.java create mode 100644 luoo_common/src/main/java/enums/AppUpdateTypeEnum.java diff --git a/luoo_common/src/main/java/enums/AppUpdateSatusEnum.java b/luoo_common/src/main/java/enums/AppUpdateSatusEnum.java new file mode 100644 index 0000000..708977b --- /dev/null +++ b/luoo_common/src/main/java/enums/AppUpdateSatusEnum.java @@ -0,0 +1,30 @@ +package enums; + +public enum AppUpdateSatusEnum { + INIT(0, "未发布"), GRAYSCALE(1, "灰度发布"), ALL(2, "全网发布"); + + private Integer status; + private String description; + + AppUpdateSatusEnum(int status, String description) { + this.status = status; + this.description = description; + } + + public Integer getStatus() { + return status; + } + + public String getDescription() { + return description; + } + + public static AppUpdateSatusEnum getByStatus(Integer status) { + for (AppUpdateSatusEnum at : AppUpdateSatusEnum.values()) { + if (at.status.equals(status)) { + return at; + } + } + return null; + } +} diff --git a/luoo_common/src/main/java/enums/AppUpdateTypeEnum.java b/luoo_common/src/main/java/enums/AppUpdateTypeEnum.java new file mode 100644 index 0000000..26c881b --- /dev/null +++ b/luoo_common/src/main/java/enums/AppUpdateTypeEnum.java @@ -0,0 +1,36 @@ +package enums; + +public enum AppUpdateTypeEnum { + ALL(0, ".apk", "全更新"), WGT(1, ".wgt", "局部热更新"); + + private Integer type; + private String suffix; + private String description; + + AppUpdateTypeEnum(int type, String suffix, String description) { + this.type = type; + this.suffix = suffix; + this.description = description; + } + + public Integer getType() { + return type; + } + + public String getSuffix() { + return suffix; + } + + public String getDescription() { + return description; + } + + public static AppUpdateTypeEnum getByType(Integer type) { + for (AppUpdateTypeEnum at : AppUpdateTypeEnum.values()) { + if (at.getType().equals(type)) { + return at; + } + } + return null; + } +}