From 3217dd77a76ace2de014cc9218531296018db66d Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期日, 08 十月 2023 12:33:59 +0800 Subject: [PATCH] 修改系统常量 --- src/main/java/com/moon/server/entity/all/StaticData.java | 8 +++++--- src/main/java/com/moon/server/controller/sys/TokenController.java | 24 ++++++++++++++++++++++++ src/main/java/com/moon/server/helper/FileHelper.java | 2 +- src/main/java/com/moon/server/controller/show/ApplyController.java | 8 ++++---- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/moon/server/controller/show/ApplyController.java b/src/main/java/com/moon/server/controller/show/ApplyController.java index 5526bc3..9efa807 100644 --- a/src/main/java/com/moon/server/controller/show/ApplyController.java +++ b/src/main/java/com/moon/server/controller/show/ApplyController.java @@ -168,7 +168,7 @@ if (null == applyEntity) { return fail("鎵句笉鍒版暟鎹敵璇�"); } - if (!(applyEntity.getStatus() >= -1 && applyEntity.getStatus() <= StaticData.NINE)) { + if (!(applyEntity.getStatus() >= -1 && applyEntity.getStatus() <= StaticData.I9)) { return fail("璇ユ暟鎹敵璇锋棤娉曞簾寮�"); } @@ -226,7 +226,7 @@ if (null == applyEntity) { return fail("鎵句笉鍒版暟鎹敵璇�"); } - if (!(applyEntity.getStatus() >= 0 && applyEntity.getStatus() <= StaticData.NINE)) { + if (!(applyEntity.getStatus() >= 0 && applyEntity.getStatus() <= StaticData.I9)) { return fail("璇ユ暟鎹敵璇锋棤闇�鎵撳洖"); } @@ -234,7 +234,7 @@ int rows = applyService.updateForSubmit(ue.getId(), applyEntity.getId(), flowEntity.getId()); applyEntity = applyService.selectById(applyEntity.getId()); - if (StaticData.TEN == applyEntity.getStatus()) { + if (StaticData.I10 == applyEntity.getStatus()) { UserEntity user = userService.selectUser(applyEntity.getUserid()); applyService.zipDbData(user, applyEntity); } @@ -265,7 +265,7 @@ if (null == applyEntity) { return fail("鎵句笉鍒版暟鎹敵璇�"); } - if (!(applyEntity.getStatus() >= 0 && applyEntity.getStatus() <= StaticData.NINE)) { + if (!(applyEntity.getStatus() >= 0 && applyEntity.getStatus() <= StaticData.I9)) { return fail("璇ユ暟鎹敵璇锋棤闇�鎵撳洖"); } diff --git a/src/main/java/com/moon/server/controller/sys/TokenController.java b/src/main/java/com/moon/server/controller/sys/TokenController.java index 88ff2bb..4f6f540 100644 --- a/src/main/java/com/moon/server/controller/sys/TokenController.java +++ b/src/main/java/com/moon/server/controller/sys/TokenController.java @@ -3,6 +3,8 @@ import com.moon.server.annotation.SysLog; import com.moon.server.controller.all.BaseController; import com.moon.server.entity.all.ResponseMsg; +import com.moon.server.entity.all.SettingData; +import com.moon.server.entity.all.StaticData; import com.moon.server.entity.sys.TokenEntity; import com.moon.server.entity.sys.UserEntity; import com.moon.server.helper.StringHelper; @@ -77,6 +79,28 @@ } @SysLog() + @ApiOperation(value = "鎻掑叆涓�鏉℃柊浠ょ墝") + @ApiImplicitParams({ + @ApiImplicitParam(name = "type", value = "浠ょ墝绫诲埆锛�0-涓存椂锛�1-鍥哄畾", dataType = "Integer", paramType = "query", example = "1"), + @ApiImplicitParam(name = "min", value = "鍒嗛挓鏁帮細榛樿1涓湀", dataType = "Integer", paramType = "query", example = "43200") + }) + @GetMapping(value = "/insertNewToken") + public ResponseMsg<Object> insertNewToken(Integer type, Integer min, HttpServletRequest req) { + try { + if (null == type || type > 1) { + type = 0; + } + if (null == min || min < StaticData.I10) { + min = SettingData.TOKEN_EXPIRE; + } + + return success(null); + } catch (Exception ex) { + return fail(ex, null); + } + } + + @SysLog() @ApiOperation(value = "鍒犻櫎涓�鏉�") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") diff --git a/src/main/java/com/moon/server/entity/all/StaticData.java b/src/main/java/com/moon/server/entity/all/StaticData.java index f7b058b..d36f5d7 100644 --- a/src/main/java/com/moon/server/entity/all/StaticData.java +++ b/src/main/java/com/moon/server/entity/all/StaticData.java @@ -32,11 +32,13 @@ public final static int I8 = 8; - public final static int NINE = 9; + public final static int I9 = 9; - public final static int TEN = 10; + public final static int I10 = 10; - public final static int SIXTEEN = 16; + public final static int I16 = 16; + + public final static int I30 = 30; public final static int ONE_HUNDRED = 100; diff --git a/src/main/java/com/moon/server/helper/FileHelper.java b/src/main/java/com/moon/server/helper/FileHelper.java index 8157d98..cecd7fe 100644 --- a/src/main/java/com/moon/server/helper/FileHelper.java +++ b/src/main/java/com/moon/server/helper/FileHelper.java @@ -367,7 +367,7 @@ // 鎵�浠ヨ〃绀烘垚 16 杩涘埗闇�瑕� 32 涓瓧绗︼紝琛ㄧず杞崲缁撴灉涓搴旂殑瀛楃浣嶇疆 int k = 0; // 浠庣涓�涓瓧鑺傚紑濮嬶紝瀵� MD5 鐨勬瘡涓�涓瓧鑺� - for (int i = 0; i < StaticData.SIXTEEN; i++) { + for (int i = 0; i < StaticData.I16; i++) { // 杞崲鎴� 16 杩涘埗瀛楃鐨勮浆鎹� byte byte0 = tmp[i]; // 鍙栧瓧鑺備腑楂� 4 浣嶇殑鏁板瓧杞崲 -- Gitblit v1.9.3