فهرست منبع

枚举改大写

xiatian 4 سال پیش
والد
کامیت
9387f28f30

+ 1 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TBUserController.java

@@ -171,7 +171,7 @@ public class TBUserController {
         //添加用户缓存
         redisUtil.setUser(user.getId(), user);
         String source = null;
-        if (Objects.equals(platform.name(), Platform.win.name()) || Objects.equals(platform.name(), Platform.mac.name()) || Objects.equals(platform.name(), Platform.ios.name()) || Objects.equals(platform.name(), Platform.android.name())) {
+        if (Objects.equals(platform.name(), Platform.WIN.name()) || Objects.equals(platform.name(), Platform.MAC.name()) || Objects.equals(platform.name(), Platform.IOS.name()) || Objects.equals(platform.name(), Platform.ANDROID.name())) {
             source = platform.getSource().split(",")[0];
         } else {
             source = platform.getSource();

+ 4 - 4
themis-business/src/main/java/com/qmth/themis/business/constant/SystemConstant.java

@@ -178,20 +178,20 @@ public class SystemConstant {
         Long redisExpire = REDIS_EXPIRE_TIME;
         if (platform.getSource().contains(Source.ADMIN_WEB.name())) {
             calendar.add(Calendar.DAY_OF_YEAR, SystemConstant.WEB_SESSION_EXPIRE);
-        } else if (Objects.equals(platform.name(), Platform.win.name()) &&
+        } else if (Objects.equals(platform.name(), Platform.WIN.name()) &&
                 (platform.getSource().contains(Source.ADMIN_CLIENT.name()) || platform.getSource().contains(Source.OE_CLIENT.name()))) {
             calendar.add(Calendar.DAY_OF_YEAR, SystemConstant.WIN_SESSION_EXPIRE);
-        } else if (Objects.equals(platform.name(), Platform.mac.name()) &&
+        } else if (Objects.equals(platform.name(), Platform.MAC.name()) &&
                 (platform.getSource().contains(Source.ADMIN_CLIENT.name()) || platform.getSource().contains(Source.OE_CLIENT.name()))) {
             calendar.add(Calendar.DAY_OF_YEAR, SystemConstant.MAC_SESSION_EXPIRE);
         } else if (platform.getSource().contains(Source.OE_ANSWER.name())) {
             calendar.add(Calendar.DAY_OF_YEAR, SystemConstant.WXAPP_SESSION_EXPIRE);
             redisExpire = REDIS_PHONE_EXPIRE_TIME;
-        } else if (Objects.equals(platform.name(), Platform.ios.name()) &&
+        } else if (Objects.equals(platform.name(), Platform.IOS.name()) &&
                 (platform.getSource().contains(Source.OE_ANSWER.name()) || platform.getSource().contains(Source.MOBILE_FIRST.name()) || platform.getSource().contains(Source.MOBILE_SECOND.name()))) {
             calendar.add(Calendar.DAY_OF_YEAR, SystemConstant.IOS_SESSION_EXPIRE);
             redisExpire = REDIS_PHONE_EXPIRE_TIME;
-        } else if (Objects.equals(platform.name(), Platform.android.name()) &&
+        } else if (Objects.equals(platform.name(), Platform.ANDROID.name()) &&
                 (platform.getSource().contains(Source.OE_ANSWER.name()) || platform.getSource().contains(Source.MOBILE_FIRST.name()) || platform.getSource().contains(Source.MOBILE_SECOND.name()))) {
             calendar.add(Calendar.DAY_OF_YEAR, SystemConstant.ANDROID_SESSION_EXPIRE);
             redisExpire = REDIS_PHONE_EXPIRE_TIME;

+ 6 - 6
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEMobileServiceImpl.java

@@ -78,14 +78,14 @@ public class TEMobileServiceImpl implements TEMobileService {
 		String token = RandomStringUtils.randomAlphanumeric(32);
 		TEStudentCacheDto teStudentCacheDto = (TEStudentCacheDto) redisUtil.getStudent(es.getStudentId());
 		String source = null;
-		if (Objects.equals(platform.name(), Platform.win.name())
-				|| Objects.equals(platform.name(), Platform.mac.name())) {
+		if (Objects.equals(platform.name(), Platform.WIN.name())
+				|| Objects.equals(platform.name(), Platform.MAC.name())) {
 			source = platform.getSource().split(",")[1];
-		} else if (Objects.equals(platform.name(), Platform.wxapp.name())
-				|| Objects.equals(platform.name(), Platform.web.name())) {
+		} else if (Objects.equals(platform.name(), Platform.WXAPP.name())
+				|| Objects.equals(platform.name(), Platform.WEB.name())) {
 			source = platform.getSource();
-		} else if (Objects.equals(platform.name(), Platform.ios.name())
-				|| Objects.equals(platform.name(), Platform.android.name())) {
+		} else if (Objects.equals(platform.name(), Platform.IOS.name())
+				|| Objects.equals(platform.name(), Platform.ANDROID.name())) {
 			source = platform.getSource().split(",")[2];
 		}
 		String sessionId = SessionUtil.digest(teStudentCacheDto.getIdentity(),

+ 6 - 6
themis-common/src/main/java/com/qmth/themis/common/enums/Platform.java

@@ -2,12 +2,12 @@ package com.qmth.themis.common.enums;
 
 public enum Platform {
 
-    web("admin_web"),
-    win("admin_client,oe_client"),
-    mac("admin_client,oe_client"),
-    wxapp("oe_answer"),
-    ios("oe_answer,mobile_monitor_first,mobile_monitor_second"),
-    android("oe_answer,mobile_monitor_first,mobile_monitor_second");
+    WEB("ADMIN_WEB"),
+    WIN("ADMIN_CLIENT,OE_CLIENT"),
+    MAC("ADMIN_CLIENT,OE_CLIENT"),
+    WXAPP("OE_ANSWER"),
+    IOS("OE_ANSWER,MOBILE_FIRST,MOBILE_SECOND"),
+    ANDROID("OE_ANSWER,MOBILE_FIRST,MOBILE_SECOND");
 
     public static Platform findByName(String name) {
         if (name == null) {

+ 3 - 3
themis-exam/src/main/java/com/qmth/themis/exam/api/TEStudentController.java

@@ -163,11 +163,11 @@ public class TEStudentController {
         //添加用户缓存
         redisUtil.setStudent(teStudent.getId(), teStudentCacheDto);
         String source = null;
-        if (Objects.equals(platform.name(), Platform.win.name()) || Objects.equals(platform.name(), Platform.mac.name())) {
+        if (Objects.equals(platform.name(), Platform.WIN.name()) || Objects.equals(platform.name(), Platform.MAC.name())) {
             source = platform.getSource().split(",")[1];
-        } else if (Objects.equals(platform.name(), Platform.wxapp.name()) || Objects.equals(platform.name(), Platform.web.name())) {
+        } else if (Objects.equals(platform.name(), Platform.WXAPP.name()) || Objects.equals(platform.name(), Platform.WEB.name())) {
             source = platform.getSource();
-        } else if (Objects.equals(platform.name(), Platform.ios.name()) || Objects.equals(platform.name(), Platform.android.name())) {
+        } else if (Objects.equals(platform.name(), Platform.IOS.name()) || Objects.equals(platform.name(), Platform.ANDROID.name())) {
             source = platform.getSource().split(",")[2];
         }
         //添加用户会话缓存