Sfoglia il codice sorgente

backend structure ok

tanlie 3 mesi fa
parent
commit
b707e8d0ee
91 ha cambiato i file con 3253 aggiunte e 130 eliminazioni
  1. 3 0
      .gitignore
  2. 62 0
      wishing-platform/platform-core/platform-core-base/pom.xml
  3. 27 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/config/BaseBeanConfig.java
  4. 61 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/config/kaptcha/CaptchaConfiguration.java
  5. 104 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/config/kaptcha/CaptchaProperties.java
  6. 78 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/constants/BaseConstants.java
  7. 26 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/dto/AttachmentDTO.java
  8. 38 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/exceptions/BizException.java
  9. 151 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/exceptions/GlobalDefaultExceptionHandler.java
  10. 90 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/redis/RedisConfig.java
  11. 53 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/redis/RedisConfigCacheManager.java
  12. 37 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/redis/RedisKeyEnum.java
  13. 42 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/response/ResultCodeEnum.java
  14. 70 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/response/UnifyResponse.java
  15. 61 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/BaseWebSecurityConfiguration.java
  16. 23 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/config/SecurityConfig.java
  17. 38 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/constants/Constants.java
  18. 74 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/dto/AuthUserDetails.java
  19. 76 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/filter/AuthenticationTokenFilter.java
  20. 40 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/handler/BaseAccessDeniedHandler.java
  21. 40 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/handler/BaseAuthenticationEntryPoint.java
  22. 39 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/properties/JwtProperties.java
  23. 121 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/utils/CurrentUtils.java
  24. 88 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/service/AbstractLoginService.java
  25. 130 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/service/CaptchaServiceImpl.java
  26. 29 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/service/ICaptchaService.java
  27. 173 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/utils/RedisUtils.java
  28. 52 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/utils/SpringUtil.java
  29. 53 0
      wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/vo/LoginUserInfo.java
  30. 2 2
      wishing-platform/platform-core/pom.xml
  31. 9 9
      wishing-platform/platform-entity/platform-entity-upms/pom.xml
  32. 55 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/CommonGeoCount.java
  33. 41 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/Dictionary.java
  34. 44 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/DictionaryOption.java
  35. 81 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/GatewayLog.java
  36. 45 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/MarketMapDepartment.java
  37. 49 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/SystemParams.java
  38. 49 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/SystemSmsLog.java
  39. 68 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsFile.java
  40. 71 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsMenu.java
  41. 68 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsMenuBase.java
  42. 50 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsMenuPermission.java
  43. 44 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsMenuPermissionBase.java
  44. 48 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsRole.java
  45. 42 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsRoleDepartment.java
  46. 42 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsRoleMenus.java
  47. 44 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsRolePermission.java
  48. 51 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsTenant.java
  49. 105 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsUser.java
  50. 44 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsUserRole.java
  51. 44 0
      wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsUserScope.java
  52. 0 0
      wishing-platform/platform-entity/platform-entity-upms/src/test/java/cn/qinys/AppTest.java
  53. 4 4
      wishing-platform/platform-entity/platform-entity-wishing/pom.xml
  54. 16 0
      wishing-platform/platform-entity/platform-entity-wishing/src/main/java/cn/qinys/platform/entity/wishing/WishingTree.java
  55. 16 0
      wishing-platform/platform-entity/platform-entity-wishing/src/main/java/cn/qinys/platform/entity/wishing/WishingUser.java
  56. 0 0
      wishing-platform/platform-entity/platform-entity-wishing/src/test/java/cn/qinys/AppTest.java
  57. BIN
      wishing-platform/platform-entity/platform-entity-wishing/target/classes/cn/qinys/platform/entity/wishing/WishingTree.class
  58. BIN
      wishing-platform/platform-entity/platform-entity-wishing/target/classes/cn/qinys/platform/entity/wishing/WishingUser.class
  59. 34 0
      wishing-platform/platform-entity/pom.xml
  60. 1 1
      wishing-platform/platform-gateway/pom.xml
  61. 1 1
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/GatewayApplication.java
  62. 2 2
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/config/GlobalExceptionConfiguration.java
  63. 1 1
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/config/RedisConfiguration.java
  64. 1 1
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/config/RequestRateLimitConfiguration.java
  65. 1 1
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/constants/GatewayConstants.java
  66. 1 1
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/dto/LoginDTO.java
  67. 1 1
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/dto/LoginUserInfoDTO.java
  68. 1 1
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/entity/GatewayLog.java
  69. 3 3
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/filter/AccessLogFilter.java
  70. 1 1
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/limiter/DiyRedisRateLimiter.java
  71. 1 1
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/limiter/DiyRequestRateLimiterGatewayFilterFactory.java
  72. 2 2
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/mapper/GatewayLogMapper.java
  73. 2 2
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/msgsender/IMessageService.java
  74. 6 6
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/msgsender/RabbitmqServiceImpl.java
  75. 1 1
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/response/UnifyResponse.java
  76. 1 1
      wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/utils/RedisUtils.java
  77. 1 1
      wishing-platform/platform-gateway/src/main/resources/application-local.yml
  78. 1 1
      wishing-platform/platform-gateway/src/main/resources/application-router.yml
  79. 1 1
      wishing-platform/platform-gateway/src/main/resources/application.yml
  80. 42 0
      wishing-platform/platform-service/platform-service-mobile/pom.xml
  81. 17 0
      wishing-platform/platform-service/platform-service-mobile/src/main/java/cn/qinys/platform/MobileApplication.java
  82. 22 0
      wishing-platform/platform-service/platform-service-mobile/src/main/java/cn/qinys/platform/mobile/controller/TestController.java
  83. 23 0
      wishing-platform/platform-service/platform-service-mobile/src/main/java/cn/qinys/platform/mobile/controller/WishingTreeController.java
  84. 41 0
      wishing-platform/platform-service/platform-service-mobile/src/main/resources/application-local.yml
  85. 20 0
      wishing-platform/platform-service/platform-service-mobile/src/main/resources/application.yml
  86. 8 3
      wishing-platform/platform-service/pom.xml
  87. 5 5
      wishing-platform/pom.xml
  88. 0 13
      wishing-platform/wishing-core/wishing-core-base/src/main/java/cn/qinys/App.java
  89. 0 13
      wishing-platform/wishing-entity/src/main/java/cn/qinys/App.java
  90. 0 13
      wishing-platform/wishing-service/src/main/java/cn/qinys/App.java
  91. 0 38
      wishing-platform/wishing-service/src/test/java/cn/qinys/AppTest.java

+ 3 - 0
.gitignore

@@ -8,3 +8,6 @@ Thumbs.db
 wishing-tree-server/.idea/
 wishing-tree-server/.idea/
 wishing-platform/.idea/
 wishing-platform/.idea/
 wishing-platform/wishing-gateway/target/
 wishing-platform/wishing-gateway/target/
+wishing-platform/platform-core/platform-core-base/target/
+wishing-platform/platform-gateway/target/
+wishing-platform/platform-service/platform-service-mobile/target/

+ 62 - 0
wishing-platform/platform-core/platform-core-base/pom.xml

@@ -0,0 +1,62 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>cn.qinys</groupId>
+        <artifactId>platform-core</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>platform-core-base</artifactId>
+
+    <name>wishing-core-base</name>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.penggle</groupId>
+            <artifactId>kaptcha</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.19.0</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+        </dependency>
+
+    </dependencies>
+</project>

+ 27 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/config/BaseBeanConfig.java

@@ -0,0 +1,27 @@
+package cn.qinys.platform.base.config;
+
+import org.springframework.boot.web.client.RestTemplateBuilder;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+import java.time.Duration;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/3/7 9:46
+ */
+@Configuration
+public class BaseBeanConfig {
+
+    @Bean
+    RestTemplate restTemplate() {
+        RestTemplateBuilder builder = new RestTemplateBuilder();
+        builder.connectTimeout(Duration.ofSeconds(30));
+        builder.readTimeout(Duration.ofSeconds(120));
+        return builder.build();
+    }
+
+}

+ 61 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/config/kaptcha/CaptchaConfiguration.java

@@ -0,0 +1,61 @@
+package cn.qinys.platform.base.config.kaptcha;
+
+import com.google.code.kaptcha.Constants;
+import com.google.code.kaptcha.impl.DefaultKaptcha;
+import com.google.code.kaptcha.util.Config;
+import jakarta.annotation.Resource;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+
+import java.util.Properties;
+
+/**
+ * 验证码配置类
+ *
+ * @author v-lishiquan.gx@chinatelecom.cn
+ * @date 2019-12-27
+ */
+@Configuration
+@ConditionalOnClass(DefaultKaptcha.class)
+@Slf4j
+public class CaptchaConfiguration {
+
+    @Resource
+    private CaptchaProperties captchaProperties;
+
+    @Bean
+    @ConditionalOnMissingBean
+    public DefaultKaptcha defaultKaptcha() {
+        Properties prop = new Properties();
+        prop.setProperty(Constants.KAPTCHA_IMAGE_WIDTH, String.valueOf(captchaProperties.getWidth()));
+        prop.setProperty(Constants.KAPTCHA_IMAGE_HEIGHT, String.valueOf(captchaProperties.getHeight()));
+
+        CaptchaProperties.Content content = captchaProperties.getContent();
+        prop.setProperty(Constants.KAPTCHA_TEXTPRODUCER_CHAR_STRING, content.getSource());
+        prop.setProperty(Constants.KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, String.valueOf(content.getLength()));
+        prop.setProperty(Constants.KAPTCHA_TEXTPRODUCER_CHAR_SPACE, String.valueOf(content.getSpace()));
+
+        CaptchaProperties.BackgroundColor backgroundColor = captchaProperties.getBackgroundColor();
+        prop.setProperty(Constants.KAPTCHA_BACKGROUND_CLR_FROM, backgroundColor.getFrom());
+        prop.setProperty(Constants.KAPTCHA_BACKGROUND_CLR_TO, backgroundColor.getTo());
+
+        CaptchaProperties.Border border = captchaProperties.getBorder();
+        prop.setProperty(Constants.KAPTCHA_BORDER, border.getEnabled() ? "yes" : "no");
+        prop.setProperty(Constants.KAPTCHA_BORDER_COLOR, border.getColor());
+        prop.setProperty(Constants.KAPTCHA_BORDER_THICKNESS, String.valueOf(border.getThickness()));
+
+        CaptchaProperties.Font font = captchaProperties.getFont();
+        prop.setProperty(Constants.KAPTCHA_TEXTPRODUCER_FONT_NAMES, font.getName());
+        prop.setProperty(Constants.KAPTCHA_TEXTPRODUCER_FONT_SIZE, String.valueOf(font.getSize()));
+        prop.setProperty(Constants.KAPTCHA_TEXTPRODUCER_FONT_COLOR, font.getColor());
+
+        DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
+        defaultKaptcha.setConfig(new Config(prop));
+        return defaultKaptcha;
+    }
+
+}

+ 104 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/config/kaptcha/CaptchaProperties.java

@@ -0,0 +1,104 @@
+package cn.qinys.platform.base.config.kaptcha;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.NestedConfigurationProperty;
+import org.springframework.stereotype.Component;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/2/4 18:14
+ */
+@Component
+@Data
+public class CaptchaProperties {
+    /**
+     * 宽度
+     */
+    private Integer width = 200;
+    /**
+     * 高度
+     */
+    private Integer height = 50;
+    /**
+     * 内容
+     */
+    @NestedConfigurationProperty
+    private Content content = new Content();
+    /**
+     * 背景色
+     */
+    @NestedConfigurationProperty
+    private BackgroundColor backgroundColor = new BackgroundColor();
+    /**
+     * 字体
+     */
+    @NestedConfigurationProperty
+    private Font font = new Font();
+    /**
+     * 边框
+     */
+    @NestedConfigurationProperty
+    private Border border = new Border();
+
+    @Data
+    public static class BackgroundColor {
+        /**
+         * 开始渐变色
+         */
+        private String from = "lightGray";
+        /**
+         * 结束渐变色
+         */
+        private String to = "white";
+    }
+
+    @Data
+    public static class Content {
+        /**
+         * 内容源
+         */
+        private String source = "abcdefghjklmnpqrstuvwxyz23456789";
+        /**
+         * 内容长度
+         */
+        private Integer length = 4;
+        /**
+         * 内容间隔
+         */
+        private Integer space = 2;
+    }
+
+    @Data
+    public static class Border {
+        /**
+         * 是否开启
+         */
+        private Boolean enabled = false;
+        /**
+         * 颜色
+         */
+        private String color = "white";
+        /**
+         * 厚度
+         */
+        private Integer thickness = 1;
+    }
+
+    @Data
+    public static class Font {
+        /**
+         * 名称
+         */
+        private String name = "Arial";
+        /**
+         * 颜色
+         */
+        private String color = "black";
+        /**
+         * 大小
+         */
+        private Integer size = 40;
+    }
+}

+ 78 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/constants/BaseConstants.java

@@ -0,0 +1,78 @@
+package cn.qinys.platform.base.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Objects;
+import java.util.stream.Stream;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/3/5 16:31
+ */
+public class BaseConstants {
+
+    @Getter
+    @AllArgsConstructor
+    public enum StorageType {
+        // 文件存储类型
+        LOCAL("local", "本地服务"),
+        ZOS("zos", "天翼云 zos");
+        private final String code;
+        private final String desc;
+    }
+
+
+    @Getter
+    @AllArgsConstructor
+    public enum NoticeType {
+        // 消息类型
+        NEW_TASK(1, "新派单任务"),
+        TASK_TIMEOUT(2, "任务超时");
+        private final Integer code;
+        private final String desc;
+    }
+
+
+    @Getter
+    @AllArgsConstructor
+    public enum StorageSpace {
+        // 文件存储空间
+        MARKET_MAP("map", "行销图片空间");
+        private final String code;
+        private final String desc;
+    }
+
+    @Getter
+    @AllArgsConstructor
+    public enum CaptchaTypeCons {
+        // 常量
+        WORD_CAPTCHA("1", "字符类型验证码"),
+        ARITHMETIC_CAPTCHA("2", "算术类型验证码"),
+        ;
+        private final String code;
+        private final String desc;
+    }
+
+    @Getter
+    @AllArgsConstructor
+    public enum CalcTypeCons {
+        // 常量
+        PLUS(0, "+"),
+        MINUS(1, "-"),
+        MULTI(2, "*"),
+        DIV(3, "/"),
+        ;
+
+        private final Integer code;
+        private final String desc;
+
+        public static CalcTypeCons codeOf(Integer code) {
+            return Stream.of(values()).filter(e -> Objects.equals(e.getCode(), code)).findAny().orElse(PLUS);
+        }
+    }
+
+
+}

+ 26 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/dto/AttachmentDTO.java

@@ -0,0 +1,26 @@
+package cn.qinys.platform.base.dto;
+
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * code is far away from bug with the animal protecting
+ *
+ * @author v-lishiquan.gx@chinatelecom.cn
+ * @description
+ * @date 2020-04-29
+ */
+@Data
+@Accessors(chain = true)
+public class AttachmentDTO implements Serializable {
+    private String id;
+    private String name;
+    private String virtualName;
+    private String url;
+    private String status = "finished";
+    private String storageType;
+    private String suffix;
+}

+ 38 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/exceptions/BizException.java

@@ -0,0 +1,38 @@
+package cn.qinys.platform.base.exceptions;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * Description:
+ * @author tanlie
+ * Date: 2022-10-12 16:28
+ */
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class BizException extends RuntimeException {
+
+    private Integer code;
+
+    private String msg;
+
+    private Object data;
+
+    public BizException(Integer code){
+        this.code = code;
+    }
+
+
+    public BizException(String msg){
+        this.msg = msg;
+    }
+
+
+    public BizException(Integer code, String msg){
+        this.msg = msg;
+        this.code = code;
+    }
+
+
+}

+ 151 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/exceptions/GlobalDefaultExceptionHandler.java

@@ -0,0 +1,151 @@
+package cn.qinys.platform.base.exceptions;
+
+
+
+import cn.qinys.platform.base.response.UnifyResponse;
+import cn.qinys.platform.base.response.ResultCodeEnum;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.validation.BindException;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.MissingServletRequestParameterException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.client.HttpClientErrorException;
+
+import java.net.ConnectException;
+import java.nio.file.AccessDeniedException;
+import java.sql.SQLException;
+
+/**
+ * code is far away from bug with the animal protecting
+ *
+ * @author v-lishiquan.gx@chinatelecom.cn
+ * @description 全局异常处理
+ * @date Create in 2019-1-21
+ */
+@RestControllerAdvice
+@Slf4j
+public class GlobalDefaultExceptionHandler {
+
+    /**
+     * 全局异常 300
+     *
+     * @param ex 异常
+     * @return 返回值
+     */
+    @ExceptionHandler(value = Exception.class)
+    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+    public UnifyResponse<String> defaultErrorHandler(Exception ex) {
+        log.error("全局异常: [{}]", ex.getMessage(), ex);
+        return new UnifyResponse<String>(ResultCodeEnum.INTERNAL_SERVER_ERROR).setData(ex.getMessage());
+        // 网络安全中心要求发生异常时不能泄漏代码和数据库的信息,直接返回ex.getMessage()可能会泄露.
+        //return new Result<String>(ResultCodeEnum.INTERNAL_SERVER_ERROR).setData("");
+    }
+
+
+    @ExceptionHandler(value = AccessDeniedException.class)
+    @ResponseStatus(HttpStatus.UNAUTHORIZED)
+    public UnifyResponse<String> accessDeniedHandler(Exception ex) {
+        log.error("401:该账号无权限: [{}]", ex.getMessage());
+        return new UnifyResponse<>(ResultCodeEnum.UNAUTHORIZED);
+    }
+
+
+    /**
+     * 校验不通过
+     *
+     * @param ex 异常
+     * @return 返回值
+     */
+    @ExceptionHandler(value = MethodArgumentNotValidException.class)
+    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+    public UnifyResponse<String> validationErrorHandler(MethodArgumentNotValidException ex) {
+        StringBuilder sb = new StringBuilder();
+        ex.getBindingResult().getAllErrors().forEach(error -> sb.append(error.getDefaultMessage()).append(","));
+        log.error("验证未通过 ==> [{}], 字段 ==> [{}]", ex.getMessage(), sb.toString());
+        //return new Result<String>(ResultCodeEnum.VALIDATE_NOT_ACCESS).setMsg(sb.toString());
+        return new UnifyResponse<>(400, sb.toString());
+    }
+
+    /**
+     * 缺少请求参数
+     *
+     * @param ex 异常
+     * @return 返回值
+     */
+    @ExceptionHandler(value = MissingServletRequestParameterException.class)
+    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+    public UnifyResponse<String> missingServletRequestParameterErrorHandler(MissingServletRequestParameterException ex) {
+        log.error("缺少请求参数:[{}]", ex.getMessage());
+        return new UnifyResponse<String>(ResultCodeEnum.MISSING_REQUEST_PARAMETER).setData(ex.getMessage());
+    }
+
+    /**
+     * 请求参数类型错误
+     *
+     * @param ex 异常
+     * @return 返回值
+     */
+    @ExceptionHandler(value = BindException.class)
+    @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
+    public UnifyResponse<String> badRequestErrorHandler(BindException ex) {
+        log.error("请求参数类型错误:[{}]", ex.getMessage());
+        return new UnifyResponse<String>(ResultCodeEnum.BAD_REQUEST).setData(ex.getMessage());
+    }
+
+    /**
+     * 数据库操作错误
+     *
+     * @param ex 异常
+     * @return 返回值
+     */
+    @ExceptionHandler(value = SQLException.class)
+    @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
+    public UnifyResponse<String> databaseErrorHandler(SQLException ex) {
+        log.error("数据库操作错误:[{}]", ex.getMessage());
+        return new UnifyResponse<String>(ResultCodeEnum.DATABASE_ERROR).setData(ex.getMessage());
+    }
+
+    /**
+     * 网络连接失败
+     *
+     * @param ex 异常
+     * @return 返回值
+     */
+    @ExceptionHandler(value = ConnectException.class)
+    @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
+    public UnifyResponse<String> connect(ConnectException ex) {
+        log.error("网络连接失败:[{}]", ex.getMessage());
+        return new UnifyResponse<String>(ResultCodeEnum.CONNECTION_ERROR).setData(ex.getMessage());
+    }
+
+    /**
+     * 业务异常
+     *
+     * @param ex 异常
+     * @return 返回值
+     */
+    @ExceptionHandler(value = BizException.class)
+    @ResponseStatus(value = HttpStatus.OK)
+    public UnifyResponse<String> bizException(BizException ex) {
+        log.info("业务异常:[{}]=={}", ex.getMsg(), ex.getData());
+        return new UnifyResponse<>(400, ex.getMsg(), ex.getMsg());
+    }
+
+
+
+    /**
+     * 无权限
+     *
+     * @param ex 异常
+     * @return 返回值
+     */
+    @ExceptionHandler(value = HttpClientErrorException.class)
+    @ResponseStatus(value = HttpStatus.FORBIDDEN)
+    public UnifyResponse<String> badRequestException(HttpClientErrorException ex) {
+        return new UnifyResponse<>(403, ex.getMessage());
+    }
+
+}

+ 90 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/redis/RedisConfig.java

@@ -0,0 +1,90 @@
+package cn.qinys.platform.base.redis;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.cache.RedisCacheConfiguration;
+import org.springframework.data.redis.cache.RedisCacheManager;
+import org.springframework.data.redis.cache.RedisCacheWriter;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializationContext;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+import java.net.UnknownHostException;
+import java.time.Duration;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/1/9 9:07
+ */
+@EnableCaching
+@Configuration
+public class RedisConfig {
+    /**
+     * 缓存管理器
+     *
+     * @param factory
+     * @return
+     */
+    @Bean
+    @SuppressWarnings("all")
+    public RedisCacheManager cacheManager(RedisConnectionFactory factory) {
+        ObjectMapper om = new ObjectMapper();
+        RedisSerializer<String> redisSerializer = new StringRedisSerializer();
+        Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
+        // 解决查询缓存转换异常的问题
+        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+        jackson2JsonRedisSerializer.setObjectMapper(om);
+        // 配置序列化(解决乱码的问题)
+        RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig()
+                .entryTtl(Duration.ofMillis(-1))
+                .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(redisSerializer))
+                .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(jackson2JsonRedisSerializer))
+                .disableCachingNullValues();
+        RedisCacheWriter cacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(factory);
+
+        return new RedisConfigCacheManager(cacheWriter, config);
+    }
+
+    //重写template配置累
+    @Bean
+    @SuppressWarnings("all")
+    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) throws UnknownHostException {
+
+        RedisTemplate<String, Object> template = new RedisTemplate();
+        template.setConnectionFactory(factory);
+        //json序列化
+        Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
+        ObjectMapper om = new ObjectMapper();
+        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+        jackson2JsonRedisSerializer.setObjectMapper(om);
+        //String 序列化
+        StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
+        //key 采用string序列化
+        template.setKeySerializer(stringRedisSerializer);
+        template.setHashKeySerializer(stringRedisSerializer);  //hash key也采用string
+        //value 采用json
+        template.setValueSerializer(jackson2JsonRedisSerializer);
+        template.setHashValueSerializer(jackson2JsonRedisSerializer);
+
+        template.afterPropertiesSet();
+        return template;
+    }
+
+    @Bean
+    public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory factory) {
+        return new StringRedisTemplate(factory);
+    }
+
+}

+ 53 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/redis/RedisConfigCacheManager.java

@@ -0,0 +1,53 @@
+package cn.qinys.platform.base.redis;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.data.redis.cache.*;
+import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializationContext;
+
+import java.time.Duration;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/9/5 11:01
+ */
+public class RedisConfigCacheManager extends RedisCacheManager {
+
+    private static final CacheKeyPrefix DEFAULT_CACHE_KEY_PREFIX = cacheName -> cacheName + ":";
+
+    public RedisConfigCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration defaultCacheConfiguration) {
+        super(cacheWriter, defaultCacheConfiguration);
+    }
+
+    private static final RedisSerializationContext.SerializationPair<Object> DEFAULT_PAIR = RedisSerializationContext.SerializationPair
+            .fromSerializer(new GenericJackson2JsonRedisSerializer());
+
+    /**
+     * @param name
+     * @param cacheConfig
+     * @return
+     */
+    @Override
+    protected RedisCache createRedisCache(String name, RedisCacheConfiguration cacheConfig) {
+        final int lastIndexOf = StringUtils.lastIndexOf(name, '#');
+        if (lastIndexOf > -1) {
+            final String ttl = StringUtils.substring(name, lastIndexOf + 1);
+            final Duration duration = Duration.ofSeconds(Long.parseLong(ttl));
+            cacheConfig = cacheConfig.entryTtl(duration);
+            //修改缓存key和value值的序列化方式
+            cacheConfig = cacheConfig.computePrefixWith(DEFAULT_CACHE_KEY_PREFIX)
+                    .serializeValuesWith(DEFAULT_PAIR);
+            final String cacheName = StringUtils.substring(name, 0, lastIndexOf);
+            return super.createRedisCache(cacheName, cacheConfig);
+        } else {
+            //修改缓存key和value值的序列化方式
+            cacheConfig = cacheConfig.computePrefixWith(DEFAULT_CACHE_KEY_PREFIX)
+                    .serializeValuesWith(DEFAULT_PAIR);
+            return super.createRedisCache(name, cacheConfig);
+        }
+    }
+
+
+}

+ 37 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/redis/RedisKeyEnum.java

@@ -0,0 +1,37 @@
+package cn.qinys.platform.base.redis;
+
+import lombok.Getter;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/1/9 9:12
+ */
+@Getter
+public enum RedisKeyEnum {
+
+    //登录相关
+    CAPTCHA("captcha:", "验证码", 300),
+
+    CURRENT_USER("current_user:", "当前用户", 3600 * 12),
+    CURRENT_USER_TOKEN("current_user_token:", "当前用户token", 3600 * 12),
+
+    LOGIN_FAIL("login_fail:", "登录错误尝试", 3600 * 24),
+
+
+
+    // 验证码相关
+    SMS_COUNT("sms_count:", "每半个小时发送的短信数量", 1800),
+    SMS_VALIDATE("sms_validate:", "短信验证码", 300);
+
+    RedisKeyEnum(String code, String msg, Integer expireTime) {
+        this.code = code;
+        this.msg = msg;
+        this.expireTime = expireTime;
+    }
+
+    private final String code;
+    private final String msg;
+    private final Integer expireTime;
+}

+ 42 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/response/ResultCodeEnum.java

@@ -0,0 +1,42 @@
+package cn.qinys.platform.base.response;
+
+import lombok.Getter;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/1/9 8:34
+ */
+@Getter
+public enum ResultCodeEnum {
+    // 返回代码
+    SUCCESS(200, "成功"),
+    FAILURE(300, "失败"),
+
+    BAD_REQUEST(400, "错误的请求参数"),
+    UNAUTHORIZED(401, "未认证(签名错误)"),
+    MISSING_REQUEST_PARAMETER(402, "缺少请求参数"),
+
+    INTERNAL_SERVER_ERROR(500, "当前定位失效,请稍后重试~"),
+    DATABASE_ERROR(501, "数据库操作错误"),
+    CONNECTION_ERROR(502, "网络连接失败"),
+
+    IO_STREAM_ERROR(601, "IO流异常"),
+
+    DOWNLOAD_FILE_ERROR(603, "下载文件异常"),
+    UPLOAD_FILE_ERROR(604, "上传文件异常"),
+    READ_EXCEL_ERROR(608, "读取Excel异常"),
+    UPLOAD_EXCEL_TEMPLATE_ERROR(609, "上传的模板错误"),
+
+    ;
+
+    private final int code;
+    private final String desc;
+
+    ResultCodeEnum(int code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+}

+ 70 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/response/UnifyResponse.java

@@ -0,0 +1,70 @@
+package cn.qinys.platform.base.response;
+
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/1/9 8:32
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+public class UnifyResponse<T> implements Serializable {
+
+    private static final long serialVersionUID = 4822942452184119123L;
+    private int code;
+    private String msg;
+    private T data;
+
+    public UnifyResponse(ResultCodeEnum rCode) {
+        this.code = rCode.getCode();
+        this.msg = rCode.getDesc();
+    }
+
+    public UnifyResponse(String msg) {
+        this.code = ResultCodeEnum.SUCCESS.getCode();
+        this.msg = msg;
+    }
+
+    public UnifyResponse(T data) {
+        this.code = ResultCodeEnum.SUCCESS.getCode();
+        this.msg = ResultCodeEnum.SUCCESS.getDesc();
+        this.data = data;
+    }
+
+    public UnifyResponse(String msg, T data) {
+        this.code = ResultCodeEnum.SUCCESS.getCode();
+        this.msg = msg;
+        this.data = data;
+    }
+
+    public UnifyResponse(ResultCodeEnum rCode, T data) {
+        this.code = rCode.getCode();
+        this.msg = rCode.getDesc();
+        this.data = data;
+    }
+
+    public UnifyResponse(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public UnifyResponse(int code, String msg, T data) {
+        this.code = code;
+        this.msg = msg;
+        this.data = data;
+    }
+
+    public UnifyResponse setCodeEnum(ResultCodeEnum rCode) {
+        this.code = rCode.getCode();
+        return this;
+    }
+
+}

+ 61 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/BaseWebSecurityConfiguration.java

@@ -0,0 +1,61 @@
+package cn.qinys.platform.base.security;
+
+import cn.qinys.platform.base.security.filter.AuthenticationTokenFilter;
+import cn.qinys.platform.base.security.handler.BaseAccessDeniedHandler;
+import cn.qinys.platform.base.security.handler.BaseAuthenticationEntryPoint;
+import cn.qinys.platform.base.security.properties.JwtProperties;
+import jakarta.annotation.Resource;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Bean;
+import org.springframework.http.HttpMethod;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
+import org.springframework.security.config.http.SessionCreationPolicy;
+import org.springframework.security.web.SecurityFilterChain;
+import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
+
+
+/**
+ * Description: security 配置
+ *
+ * @author tanlie
+ * Date: 2023/12/22 16:41
+ */
+@Configuration
+public class BaseWebSecurityConfiguration {
+    // configuration registers SecurityFilterChain bean
+    @Resource
+    private JwtProperties jwtProperties;
+    @Resource
+    private AuthenticationTokenFilter jwtAuthenticationTokenFilter;
+    @Resource
+    private BaseAuthenticationEntryPoint authenticationEntryPoint;
+    @Resource
+    private BaseAccessDeniedHandler accessDeniedHandler;
+
+    @Bean
+    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
+        http
+                // Disable CSRF
+                .csrf(AbstractHttpConfigurer::disable)
+                // Stateless session management
+                .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
+                // Authorization rules
+                .authorizeHttpRequests(authorize -> authorize
+                        // Allow preflight OPTIONS requests
+                        .requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
+                        // Allow ignore urls from properties
+                        .requestMatchers(jwtProperties.getIgnoreUrls().toArray(new String[0])).permitAll()
+                        // All other requests require authentication
+                        .anyRequest().authenticated()
+                )
+                // Exception handling
+                .exceptionHandling(ex -> ex
+                        .authenticationEntryPoint(authenticationEntryPoint)
+                        .accessDeniedHandler(accessDeniedHandler)
+                )
+                // Add JWT filter before UsernamePasswordAuthenticationFilter
+                .addFilterBefore(jwtAuthenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
+        return http.build();
+    }
+}

+ 23 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/config/SecurityConfig.java

@@ -0,0 +1,23 @@
+package cn.qinys.platform.base.security.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.crypto.password.PasswordEncoder;
+
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/2/26 11:42
+ */
+@Configuration
+public class SecurityConfig {
+    @Bean
+    public PasswordEncoder passwordEncoder() {
+        return new BCryptPasswordEncoder();
+    }
+
+
+}

+ 38 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/constants/Constants.java

@@ -0,0 +1,38 @@
+package cn.qinys.platform.base.security.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2023/12/22 17:06
+ */
+public class Constants {
+    private Constants(){}
+
+    @Getter
+    @AllArgsConstructor
+    public enum JwtEnum {
+        // 基础枚举类
+        AUTHORIZATION("Authorization", "权限头"),
+        BEARER("Bearer ", "jwtToken的头"),
+        TOKEN("token", "Token的paramKey"),
+        ;
+
+        private final String code;
+        private final String desc;
+    }
+
+
+    @Getter
+    @AllArgsConstructor
+    public enum YesOrNoCons {
+        // 是否的构造
+        YES("1", "是"),
+        NO("0", "否");
+        private final String code;
+        private final String desc;
+    }
+}

+ 74 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/dto/AuthUserDetails.java

@@ -0,0 +1,74 @@
+package cn.qinys.platform.base.security.dto;
+
+import cn.qinys.platform.base.security.constants.Constants;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2023/12/22 18:03
+ */
+@Data
+@Accessors(chain = true)
+public class AuthUserDetails implements UserDetails, Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+    private String username;
+    private String password;
+    private String mobile;
+    private String isExpired;
+    private String isLocked;
+    private LocalDateTime pwdExpired;
+    private String fullName;
+    private String tenantId;
+    private String tenantName;
+    private List<GrantedAuthority> authorities;
+
+    @Override
+    public Collection<? extends GrantedAuthority> getAuthorities() {
+        return this.authorities;
+    }
+
+    @Override
+    public String getPassword() {
+        return this.password;
+    }
+
+    @Override
+    public String getUsername() {
+        return this.username;
+    }
+
+    @Override
+    public boolean isAccountNonExpired() {
+        return Objects.equals(this.isExpired, Constants.YesOrNoCons.NO.getCode());
+    }
+
+    @Override
+    public boolean isAccountNonLocked() {
+        return Objects.equals(this.isLocked, Constants.YesOrNoCons.NO.getCode());
+    }
+
+    @Override
+    public boolean isCredentialsNonExpired() {
+        return LocalDateTime.now().isBefore(this.pwdExpired);
+    }
+
+    @Override
+    public boolean isEnabled() {
+        return true;
+    }
+}

+ 76 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/filter/AuthenticationTokenFilter.java

@@ -0,0 +1,76 @@
+package cn.qinys.platform.base.security.filter;
+
+
+import cn.qinys.platform.base.redis.RedisKeyEnum;
+import cn.qinys.platform.base.security.properties.JwtProperties;
+import cn.qinys.platform.base.security.utils.CurrentUtils;
+import cn.qinys.platform.base.utils.RedisUtils;
+import cn.qinys.platform.base.vo.LoginUserInfo;
+import jakarta.annotation.Resource;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.springframework.util.AntPathMatcher;
+import org.springframework.util.PathMatcher;
+import org.springframework.util.StringUtils;
+import org.springframework.web.filter.OncePerRequestFilter;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2023/12/22 16:50
+ */
+@Component
+@Slf4j
+public class AuthenticationTokenFilter extends OncePerRequestFilter {
+    private static final PathMatcher PATH_MATCHER = new AntPathMatcher();
+    @Resource
+    private JwtProperties jwtProperties;
+    @Resource
+    private RedisUtils redisUtils;
+
+
+    @Override
+    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException {
+        String path = request.getRequestURI();
+
+        boolean ignore = false;
+        for (String ignoreUrl : jwtProperties.getIgnoreUrls()) {
+            if (PATH_MATCHER.match(ignoreUrl, path)) {
+                ignore = true;
+                break;
+            }
+        }
+        if (ignore) {
+            UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
+                    "", "", new ArrayList<>());
+            authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
+            SecurityContextHolder.getContext().setAuthentication(authentication);
+            chain.doFilter(request, response);
+            return;
+        }
+
+        String token = CurrentUtils.getToken();
+        if (StringUtils.hasLength(token)) {
+            String key = RedisKeyEnum.CURRENT_USER.getCode() + token;
+            LoginUserInfo userInfo = (LoginUserInfo) redisUtils.get(key);
+            if (userInfo != null && SecurityContextHolder.getContext().getAuthentication() == null) {
+                UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
+                        userInfo.getUsername(), token, new ArrayList<>());
+                authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
+                SecurityContextHolder.getContext().setAuthentication(authentication);
+            }
+        }
+        chain.doFilter(request, response);
+    }
+}

+ 40 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/handler/BaseAccessDeniedHandler.java

@@ -0,0 +1,40 @@
+package cn.qinys.platform.base.security.handler;
+
+import com.alibaba.fastjson2.JSON;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.security.access.AccessDeniedException;
+import org.springframework.security.web.access.AccessDeniedHandler;
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2023/12/22 17:00
+ */
+@Component
+@Slf4j
+public class BaseAccessDeniedHandler implements AccessDeniedHandler {
+    @Override
+    public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException ex) throws IOException, ServletException {
+        log.error("授权失败,禁止访问 {}, 异常: {}", request.getRequestURI(), ex.getMessage());
+        Map<String, Object> map = new HashMap<>(2);
+        map.put("code", 403);
+        map.put("msg", "授权认证失败");
+        map.put("data", null);
+        response.setStatus(HttpStatus.FORBIDDEN.value());
+        response.setContentType(MediaType.APPLICATION_JSON_VALUE);
+        response.setCharacterEncoding(StandardCharsets.UTF_8.name());
+        response.getWriter().write(JSON.toJSONString(map));
+    }
+}

+ 40 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/handler/BaseAuthenticationEntryPoint.java

@@ -0,0 +1,40 @@
+package cn.qinys.platform.base.security.handler;
+
+import com.alibaba.fastjson2.JSON;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.AuthenticationEntryPoint;
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2023/12/22 16:55
+ */
+@Component
+@Slf4j
+public class BaseAuthenticationEntryPoint implements AuthenticationEntryPoint {
+
+    @Override
+    public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException {
+
+        Map<String,Object> map = new HashMap<>(3);
+        map.put("code",401);
+        map.put("msg","授权认证失败");
+        map.put("data","");
+        response.setStatus(HttpStatus.UNAUTHORIZED.value());
+        response.setContentType(MediaType.APPLICATION_JSON_VALUE);
+        response.setCharacterEncoding(StandardCharsets.UTF_8.name());
+        response.getWriter().write(JSON.toJSONString(map));
+    }
+}

+ 39 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/properties/JwtProperties.java

@@ -0,0 +1,39 @@
+package cn.qinys.platform.base.security.properties;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2023/12/22 16:46
+ */
+@Component
+@ConfigurationProperties(prefix = "jwt")
+@Data
+public class JwtProperties implements Serializable {
+    public static final String DEFAULT_SIGN = "bXktc2VjcmV0LXRva2VuLXRvLWNoYW5nZS1pbi1wcm9kdWN0aW9u";
+
+    private String sign;
+
+    private List<String> ignoreUrls = new ArrayList<>();
+
+    private List<String> blackUrls = new ArrayList<>();
+
+    private Long expiredSeconds;
+
+    public Long getExpiredSeconds() {
+        return (expiredSeconds == null || expiredSeconds <= 0) ? 7200L : expiredSeconds;
+    }
+
+    public String getSign() {
+        return StringUtils.hasLength(sign) ? sign : DEFAULT_SIGN;
+    }
+}

+ 121 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/security/utils/CurrentUtils.java

@@ -0,0 +1,121 @@
+package cn.qinys.platform.base.security.utils;
+
+
+
+import cn.qinys.platform.base.redis.RedisKeyEnum;
+import cn.qinys.platform.base.security.constants.Constants;
+import cn.qinys.platform.base.utils.RedisUtils;
+import cn.qinys.platform.base.utils.SpringUtil;
+import cn.qinys.platform.base.vo.LoginUserInfo;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/1/8 19:16
+ */
+
+public class CurrentUtils {
+
+
+    private CurrentUtils() {
+
+    }
+
+    /**
+     * 从token 中获取获取用id
+     *
+     * @return
+     */
+    public static String getCurrentUserId() {
+        String token = getToken();
+        RedisUtils redisUtils = SpringUtil.getBean(RedisUtils.class);
+        LoginUserInfo userInfo = (LoginUserInfo) redisUtils.get(RedisKeyEnum.CURRENT_USER.getCode() + token);
+        return userInfo == null ? "0" : userInfo.getId();
+    }
+
+
+    /**
+     * 从token 中获取获取用id
+     *
+     * @return
+     */
+    public static String getCurrentWxId() {
+        String token = getToken();
+        RedisUtils redisUtils = SpringUtil.getBean(RedisUtils.class);
+        LoginUserInfo userInfo = (LoginUserInfo) redisUtils.get(RedisKeyEnum.CURRENT_USER.getCode() + token);
+        return userInfo == null ? null : userInfo.getWxId();
+    }
+
+    /**
+     * 从token中获取用户名称
+     *
+     * @return
+     */
+    public static String getCurrentUsername() {
+        String token = getToken();
+        RedisUtils redisUtils = SpringUtil.getBean(RedisUtils.class);
+        LoginUserInfo userInfo = (LoginUserInfo) redisUtils.get(RedisKeyEnum.CURRENT_USER.getCode() + token);
+        return userInfo == null ? "" : userInfo.getUsername();
+    }
+
+    /**
+     * 登录缓存
+     *
+     * @param userInfo
+     */
+    public static void setCurrentUserInfo(LoginUserInfo userInfo, String token) {
+        String loginKey = RedisKeyEnum.CURRENT_USER.getCode() + token;
+        RedisUtils redisUtils = SpringUtil.getBean(RedisUtils.class);
+        redisUtils.set(loginKey, userInfo, RedisKeyEnum.CURRENT_USER.getExpireTime());
+    }
+
+    /**
+     * 刷新登录缓存
+     *
+     * @param userInfo
+     */
+    public static void refresh(LoginUserInfo userInfo) {
+        String loginKey = RedisKeyEnum.CURRENT_USER.getCode() + getToken();
+        RedisUtils redisUtils = SpringUtil.getBean(RedisUtils.class);
+        redisUtils.set(loginKey, userInfo, RedisKeyEnum.CURRENT_USER.getExpireTime());
+    }
+
+    /**
+     * 从token中获取用户名称
+     *
+     * @return
+     */
+    public static LoginUserInfo getCurrentUserInfo() {
+        String token = getToken();
+        RedisUtils redisUtils = SpringUtil.getBean(RedisUtils.class);
+        return (LoginUserInfo) redisUtils.get(RedisKeyEnum.CURRENT_USER.getCode() + token);
+    }
+
+
+    /**
+     * 从token中获取用户名称
+     *
+     * @return
+     */
+    public static List<String> getPermissionCodes() {
+        String token = getToken();
+        RedisUtils redisUtils = SpringUtil.getBean(RedisUtils.class);
+        LoginUserInfo userInfo = (LoginUserInfo) redisUtils.get(RedisKeyEnum.CURRENT_USER.getCode() + token);
+        return userInfo == null || userInfo.getPermissionCodes() == null ? new ArrayList<>() : userInfo.getPermissionCodes();
+    }
+
+
+    public static String getToken() {
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        HttpServletRequest request = (HttpServletRequest) attributes.getRequest();
+        String token = request.getHeader(Constants.JwtEnum.AUTHORIZATION.getCode());
+        return token == null ? null : token.replaceFirst(Constants.JwtEnum.BEARER.getCode(), "").trim();
+    }
+}

+ 88 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/service/AbstractLoginService.java

@@ -0,0 +1,88 @@
+package cn.qinys.platform.base.service;
+
+
+import cn.qinys.platform.base.exceptions.BizException;
+import cn.qinys.platform.base.redis.RedisKeyEnum;
+import cn.qinys.platform.base.security.utils.CurrentUtils;
+import cn.qinys.platform.base.utils.RedisUtils;
+import cn.qinys.platform.base.vo.LoginUserInfo;
+import jakarta.annotation.Resource;
+import org.springframework.util.StringUtils;
+
+
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/3/8 8:26
+ */
+public abstract class AbstractLoginService {
+
+    /**
+     * 每天失败尝试次数
+     */
+    protected int failTries = 5;
+
+    @Resource
+    RedisUtils redisUtils;
+
+    /**
+     * 登录用户信息
+     *
+     * @param userInfo
+     * @param token
+     */
+    protected void setLoginUserInfo(LoginUserInfo userInfo, String token) {
+        CurrentUtils.setCurrentUserInfo(userInfo, token);
+    }
+
+    /**
+     * 失败次数校验
+     *
+     * @param account
+     */
+    protected void checkFailCount(String account) {
+        String failKey = RedisKeyEnum.LOGIN_FAIL.getCode() + account;
+        Integer failCount = (Integer) redisUtils.get(failKey);
+        if (failCount != null && failCount >= failTries) {
+            throw new BizException("失败尝试次数太多,请24小时后再重试。");
+        }
+    }
+
+    /**
+     * 记录失败次数
+     *
+     * @param account
+     */
+    protected void setFailCount(String account) {
+        String failKey = RedisKeyEnum.LOGIN_FAIL.getCode() + account;
+        Integer failCount = (Integer) redisUtils.get(failKey);
+        failCount = failCount == null ? 1 : (failCount + 1);
+        redisUtils.set(failKey, failCount, RedisKeyEnum.LOGIN_FAIL.getExpireTime());
+    }
+
+    /**
+     * 踢人下线
+     *
+     * @param account
+     */
+    protected void kicKOut(String account) {
+        String token = (String) redisUtils.get(RedisKeyEnum.CURRENT_USER_TOKEN.getCode() + account);
+        if (StringUtils.hasLength(token)) {
+            redisUtils.delete(RedisKeyEnum.CURRENT_USER.getCode() + token);
+        }
+        redisUtils.delete(RedisKeyEnum.CURRENT_USER_TOKEN.getCode() + account);
+    }
+
+    /**
+     * 记录token
+     *
+     * @param account
+     * @param token
+     */
+    protected void recordToken(String account, String token) {
+        redisUtils.set(RedisKeyEnum.CURRENT_USER_TOKEN.getCode() + account, token, RedisKeyEnum.CURRENT_USER_TOKEN.getExpireTime());
+    }
+
+}

+ 130 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/service/CaptchaServiceImpl.java

@@ -0,0 +1,130 @@
+package cn.qinys.platform.base.service;
+
+
+import cn.qinys.platform.base.constants.BaseConstants;
+import cn.qinys.platform.base.exceptions.BizException;
+import cn.qinys.platform.base.redis.RedisKeyEnum;
+import cn.qinys.platform.base.utils.RedisUtils;
+import com.google.code.kaptcha.impl.DefaultKaptcha;
+import jakarta.annotation.Resource;
+import lombok.extern.slf4j.Slf4j;
+
+
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Random;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * 验证码 的服务实现类
+ *
+ * @author v-lishiquan.gx@chinatelecom.cn
+ * @date 2019-12-27
+ */
+@Service
+@Slf4j
+public class CaptchaServiceImpl implements ICaptchaService {
+
+    @Resource
+    private DefaultKaptcha defaultKaptcha;
+    @Resource
+    private RedisUtils redisUtils;
+
+    @Override
+    public Map<String, String> render(String type) {
+        String key = UUID.randomUUID().toString().replaceAll("-", "");
+
+        if (BaseConstants.CaptchaTypeCons.ARITHMETIC_CAPTCHA.getCode().equalsIgnoreCase(type)) {
+            return this.generateArithmeticCaptcha(key);
+        }
+        return this.generateWordCaptcha(key);
+    }
+
+    @Override
+    public boolean validate(String captchaKey, String captchaCode) {
+        if (!StringUtils.hasLength(captchaKey)) {
+            return false;
+        }
+        String key = RedisKeyEnum.CAPTCHA.getCode() + captchaKey;
+        Object captchaText = redisUtils.get(key);
+        redisUtils.delete(key);
+        if (Objects.isNull(captchaText)) {
+            return false;
+        }
+        return captchaCode.equalsIgnoreCase(captchaText.toString());
+    }
+
+    private Map<String, String> generateWordCaptcha(String key) {
+        String code = defaultKaptcha.createText().toUpperCase();
+        return this.generateCode(key, code, code);
+    }
+
+    private Map<String, String> generateArithmeticCaptcha(String key) {
+        int result;
+        Random random = new Random();
+        StringBuilder number = new StringBuilder();
+        int xx = random.nextInt(10);
+        int yy = random.nextInt(10);
+        // 0~3 对应加减乘除
+        int round = (int) Math.round(Math.random() * 3);
+        BaseConstants.CalcTypeCons calcTypeCons = BaseConstants.CalcTypeCons.values()[round];
+        number.append(yy);
+        switch (calcTypeCons) {
+            case PLUS:
+                result = yy + xx;
+                number.append(calcTypeCons.getDesc());
+                break;
+            case MINUS:
+                result = yy - xx;
+                number.append(calcTypeCons.getDesc());
+                break;
+            case MULTI:
+                result = yy * xx;
+                number.append(calcTypeCons.getDesc());
+                break;
+            default:
+                if (xx != 0 && yy % xx == 0) {
+                    result = yy / xx;
+                    number.append(calcTypeCons.getDesc());
+                } else {
+                    result = yy + xx;
+                    number.append(BaseConstants.CalcTypeCons.PLUS.getDesc());
+                }
+        }
+        number.append(xx);
+        number.append(" = ?");
+        return this.generateCode(key, number.toString(), String.valueOf(result));
+    }
+
+    private Map<String, String> generateCode(String key, String picContent, String value) {
+        try {
+            BufferedImage captchaImage = defaultKaptcha.createImage(picContent);
+            // 生成BASE64
+            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+            ImageIO.write(captchaImage, "jpg", outputStream);
+            String base64Img = this.encodeBase64(outputStream.toByteArray());
+            redisUtils.set(RedisKeyEnum.CAPTCHA.getCode() + key, value, RedisKeyEnum.CAPTCHA.getExpireTime());
+            //返回给用户的验证码图片
+            Map<String, String> imgMap = new ConcurrentHashMap<>();
+            imgMap.put(key, "data:image/jpeg;base64," + base64Img);
+            return imgMap;
+        } catch (IOException ex) {
+            throw new BizException("生成验证码错误");
+        }
+    }
+
+    private String encodeBase64(byte[] input) {
+        return new String(Base64.encodeBase64(input));
+    }
+
+
+}

+ 29 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/service/ICaptchaService.java

@@ -0,0 +1,29 @@
+package cn.qinys.platform.base.service;
+
+import java.util.Map;
+
+/**
+ * 验证码 的服务接口
+ *
+ * @author v-lishiquan.gx@chinatelecom.cn
+ * @date 2019-12-27
+ */
+public interface ICaptchaService {
+    /**
+     * 渲染验证码
+     *
+     * @param type 类型1:字母验证码 2:算术验证码
+     * @return 验证码内容
+     */
+    Map<String, String> render(String type);
+
+    /**
+     * 校对验证码,默认超时15分钟(900s)
+     *
+     * @param captchaKey  需要验证的唯一串
+     * @param captchaCode 需要验证的字符串
+     * @return 是否验证成功
+     */
+    boolean validate(String captchaKey, String captchaCode);
+
+}

+ 173 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/utils/RedisUtils.java

@@ -0,0 +1,173 @@
+package cn.qinys.platform.base.utils;
+
+import jakarta.annotation.Resource;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/1/9 9:08
+ */
+@Component
+public class RedisUtils {
+
+    @Resource
+    private RedisTemplate<String, Object> redisTemplate;
+
+    /**
+     * 分布式锁过期时间
+     */
+    private final long EXPIRE_TIME = 5 * 10000;
+
+    public Object get(String key) {
+        return redisTemplate.opsForValue().get(key);
+    }
+
+    public void set(String key, Object obj) {
+        redisTemplate.opsForValue().set(key, obj);
+    }
+
+    public void set(String key, Object obj, long expire) {
+        redisTemplate.opsForValue().set(key, obj, expire, TimeUnit.SECONDS);
+    }
+
+    public Boolean delete(String key) {
+        return redisTemplate.delete(key);
+    }
+
+
+    public Long delete(List<String> keys) {
+        return redisTemplate.delete(keys);
+    }
+
+    public Long delete(Set<String> keys) {
+        return redisTemplate.delete(keys);
+    }
+
+    public Long lPush(String key, Object... obj) {
+        return redisTemplate.opsForList().leftPush(key, obj);
+    }
+
+    public Long rPush(String key, Object... obj) {
+        return redisTemplate.opsForList().rightPush(key, obj);
+    }
+
+    public Object lPop(String key) {
+        return redisTemplate.opsForList().leftPop(key);
+    }
+
+    public Object rPop(String key) {
+        return redisTemplate.opsForList().rightPop(key);
+    }
+
+    public Boolean exists(String key) {
+        return redisTemplate.hasKey(key);
+    }
+
+    public Long ttl(String key) {
+        return redisTemplate.getExpire(key, TimeUnit.SECONDS);
+    }
+
+    public void expire(String key, Long timeout) {
+        redisTemplate.expire(key, timeout, TimeUnit.SECONDS);
+    }
+
+    public Map<Object, Object> hGetAll(String key) {
+        return redisTemplate.opsForHash().entries(key);
+    }
+
+    public void hPut(String key, Object field, Object obj) {
+        this.redisTemplate.opsForHash().put(key, field, obj);
+    }
+
+    public Object hGet(String key, String field) {
+        return redisTemplate.opsForHash().get(key, field);
+    }
+
+    public void hSet(String key, String field, Object value) {
+        redisTemplate.opsForHash().put(key, field, value);
+    }
+
+    public Long hDel(String key, Object... fields) {
+        return redisTemplate.opsForHash().delete(key, fields);
+    }
+
+    public Set<String> keys(String pattern) {
+        return redisTemplate.keys(pattern);
+    }
+
+    /**
+     * redisTemplate删除迷糊匹配的key的缓存
+     */
+    public void deleteByPrefix(String prefix) {
+        Set<String> keys = redisTemplate.keys(prefix);
+        if (keys != null && !keys.isEmpty()) {
+            redisTemplate.delete(keys);
+        }
+    }
+
+    public boolean incr(String key, long delta) {
+        if (delta < 0) {
+            throw new RuntimeException("递增因子必须大于0");
+        }
+        try {
+            redisTemplate.opsForValue().increment(key, delta);
+            return true;
+        } catch (Exception ex) {
+            return false;
+        }
+    }
+
+    /**
+     * Redis加锁的操作
+     *
+     * @param key
+     * @param value
+     * @return
+     */
+    public Boolean tryLock(String key, String value) {
+        if (redisTemplate.opsForValue().setIfAbsent(key, value, EXPIRE_TIME, TimeUnit.SECONDS)) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Redis加锁的操作
+     *
+     * @param key
+     * @param value
+     * @return
+     */
+    public Boolean tryLock(String key, String value, long expireTime) {
+        if (redisTemplate.opsForValue().setIfAbsent(key, value, expireTime, TimeUnit.SECONDS)) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Redis解锁的操作
+     *
+     * @param key
+     * @param value
+     */
+    public void unlock(String key, String value) {
+        String currentValue = (String) redisTemplate.opsForValue().get(key);
+        try {
+            if (!StringUtils.isEmpty(currentValue) && currentValue.equals(value)) {
+                redisTemplate.opsForValue().getOperations().delete(key);
+            }
+        } catch (Exception e) {
+        }
+    }
+}

+ 52 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/utils/SpringUtil.java

@@ -0,0 +1,52 @@
+package cn.qinys.platform.base.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/2/21 18:54
+ */
+
+@Component
+public class SpringUtil implements ApplicationContextAware {
+    private final Logger log = LoggerFactory.getLogger(SpringUtil.class);
+    private static ApplicationContext applicationContext;
+
+    public SpringUtil() {
+    }
+
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        if (SpringUtil.applicationContext == null) {
+            SpringUtil.applicationContext = applicationContext;
+        }
+
+        this.log.info("ApplicationContext配置成功,applicationContext对象:" + SpringUtil.applicationContext);
+    }
+
+    public static ApplicationContext getApplicationContext() {
+        return applicationContext;
+    }
+
+    public static Object getBean(String name) {
+        return getApplicationContext().getBean(name);
+    }
+
+    public static <T> T getBean(Class<T> clazz) {
+        return getApplicationContext().getBean(clazz);
+    }
+
+    public static <T> T getBean(String name, Class<T> clazz) {
+        return getApplicationContext().getBean(name, clazz);
+    }
+
+    public static String[] getBeanNames() {
+        return getApplicationContext().getBeanDefinitionNames();
+    }
+}

+ 53 - 0
wishing-platform/platform-core/platform-core-base/src/main/java/cn/qinys/platform/base/vo/LoginUserInfo.java

@@ -0,0 +1,53 @@
+package cn.qinys.platform.base.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Description:
+ *
+ * @author tanlie
+ * Date: 2024/2/26 14:59
+ */
+@Data
+public class LoginUserInfo implements Serializable {
+    /**
+     * 登录用户id
+     */
+    private String id;
+    /**
+     * 登录用户wxId
+     */
+    private String wxId;
+    /**
+     * 登录用户 username
+     */
+    private String username;
+    /**
+     * 登录的角色id
+     */
+    private String loginRoleId;
+    /**
+     * 登录的角色名称
+     */
+    private String loginRoleName;
+    /**
+     * 手机号
+     */
+    private String mobile;
+
+    /**
+     * 权限码
+     */
+    private List<String> permissionCodes;
+
+
+    /**
+     * 超级管理员
+     */
+    private String superAdmin;
+
+
+}

+ 2 - 2
wishing-platform/wishing-core/pom.xml → wishing-platform/platform-core/pom.xml

@@ -6,10 +6,10 @@
         <artifactId>wishing-platform</artifactId>
         <artifactId>wishing-platform</artifactId>
         <version>1.0.0-SNAPSHOT</version>
         <version>1.0.0-SNAPSHOT</version>
     </parent>
     </parent>
-    <artifactId>wishing-core</artifactId>
+    <artifactId>platform-core</artifactId>
     <packaging>pom</packaging>
     <packaging>pom</packaging>
     <modules>
     <modules>
-        <module>wishing-core-base</module>
+        <module>platform-core-base</module>
     </modules>
     </modules>
     <properties>
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

+ 9 - 9
wishing-platform/wishing-service/pom.xml → wishing-platform/platform-entity/platform-entity-upms/pom.xml

@@ -3,15 +3,13 @@
     <modelVersion>4.0.0</modelVersion>
     <modelVersion>4.0.0</modelVersion>
     <parent>
     <parent>
         <groupId>cn.qinys</groupId>
         <groupId>cn.qinys</groupId>
-        <artifactId>wishing-platform</artifactId>
+        <artifactId>platform-entity</artifactId>
         <version>1.0.0-SNAPSHOT</version>
         <version>1.0.0-SNAPSHOT</version>
     </parent>
     </parent>
 
 
-    <artifactId>wishing-service</artifactId>
-    <packaging>jar</packaging>
+    <artifactId>platform-entity-upms</artifactId>
 
 
-    <name>wishing-service</name>
-    <url>http://maven.apache.org</url>
+    <name>wishing-entity-upms</name>
 
 
     <properties>
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -19,10 +17,12 @@
 
 
     <dependencies>
     <dependencies>
         <dependency>
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>3.8.1</version>
-            <scope>test</scope>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
         </dependency>
         </dependency>
     </dependencies>
     </dependencies>
 </project>
 </project>

+ 55 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/CommonGeoCount.java

@@ -0,0 +1,55 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 高德逆地理解析key使用量统计(CommonGeoCount)实体类
+ *
+ * @author tanlie
+ * @since 2024-06-13 15:48:14
+ */
+
+@Data
+@TableName("common_geo_count")
+public class CommonGeoCount implements Serializable {
+
+    /**
+    * id
+    * 自增 => @TableId(type = IdType.AUTO)
+    */    
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+    /**
+    * key
+    */    
+    @TableField("geo_key")
+    private String geoKey;
+    /**
+    * 日期
+    */    
+    @TableField("date")
+    private String date;
+    /**
+    * 使用量
+    */    
+    @TableField("use_count")
+    private Integer useCount;
+    /**
+    * 创建时间
+    */    
+    @TableField("create_time")
+    private Date createTime;
+    /**
+    * 更新时间
+    */    
+    @TableField("update_time")
+    private Date updateTime;
+
+}

+ 41 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/Dictionary.java

@@ -0,0 +1,41 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * Dictionary 实体类
+ *
+ * @author v-lishiquan.gx@chinatelecom.cn
+ * @date 2020-07-03
+ */
+@Data
+@TableName("upms_dictionary")
+public class Dictionary implements Serializable {
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.ASSIGN_ID)
+    private String id;
+    /**
+     * 字典名称-英文
+     */
+    private String dictNameEn;
+    /**
+     * 字典名称-中文
+     */
+    private String dictNameCn;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 创建日期
+     */
+    private LocalDateTime createTime;
+}

+ 44 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/DictionaryOption.java

@@ -0,0 +1,44 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * DictionaryOption 实体类
+ *
+ * @author v-lishiquan.gx@chinatelecom.cn
+ * @date 2020-07-06
+ */
+@Data
+@TableName("upms_dictionary_option")
+public class DictionaryOption implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.ASSIGN_ID)
+    private String id;
+    /**
+     * 字典id
+     */
+    private String dictId;
+    /**
+     * 字典标签
+     */
+    private String dictLabel;
+    /**
+     * 字典值
+     */
+    private String dictValue;
+    /**
+     * 排序号
+     */
+    private Integer ord;
+
+}

+ 81 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/GatewayLog.java

@@ -0,0 +1,81 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+/**
+ * (GatewayLog)实体类
+ *
+ * @author makejava
+ * @since 2024-04-26 17:20:15
+ */
+
+@Data
+@TableName("upms_gateway_log")
+public class GatewayLog implements Serializable {
+
+        
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+    * 头部token
+    */    
+    @TableField("token")
+    private String token;
+    /**
+    * 访问实例
+    */    
+    @TableField("target_server")
+    private String targetServer;
+    /**
+    * 请求路径
+    */    
+    @TableField("request_path")
+    private String requestPath;
+    /**
+    * 请求方法
+    */    
+    @TableField("request_method")
+    private String requestMethod;
+    /**
+    * 协议
+    */    
+    @TableField("http_schema")
+    private String httpSchema;
+    /**
+    * 请求体
+    */    
+    @TableField("request_body")
+    private String requestBody;
+    /**
+    * 相应体
+    */    
+    @TableField("response_data")
+    private String responseData;
+    /**
+    * 请求ip
+    */    
+    @TableField("ip")
+    private String ip;
+    /**
+    * 请求时间
+    */    
+    @TableField("request_time")
+    private Date requestTime;
+    /**
+    * 响应时间
+    */    
+    @TableField("response_time")
+    private Date responseTime;
+    /**
+    * 执行时间按
+    */    
+    @TableField("execute_time")
+    private Long executeTime;
+
+}

+ 45 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/MarketMapDepartment.java

@@ -0,0 +1,45 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * (MarketMapDepartment)实体类
+ *
+ * @author makejava
+ * @since 2024-05-31 08:53:55
+ */
+
+@Data
+@TableName("third_market_map_department")
+public class MarketMapDepartment implements Serializable {
+
+        
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+        
+    @TableField("name")
+    private String name;
+
+    @TableField("pid")
+    private Integer pid;
+
+    @TableField("all_path_name")
+    private String allPathName;
+        
+    @TableField("tenant_id")
+    private String tenantId;
+        
+    @TableField("create_time")
+    private Date createTime;
+        
+    @TableField("update_time")
+    private Date updateTime;
+
+}

+ 49 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/SystemParams.java

@@ -0,0 +1,49 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * (SystemParams)实体类
+ *
+ * @author tanlie
+ * @since 2023-12-08 09:44:44
+ */
+
+@Data
+@TableName("system_params")
+public class SystemParams implements Serializable {
+
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+    /**
+     * 参数名称
+     */
+    @TableField("code")
+    private String code;
+    /**
+     * 参数名称
+     */
+    @TableField("value")
+    private String value;
+    /**
+     * 备注
+     */
+    @TableField("remark")
+    private String remark;
+
+    @TableField("created_at")
+    private Date createdAt;
+
+    @TableField("updated_at")
+    private Date updatedAt;
+
+}
+

+ 49 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/SystemSmsLog.java

@@ -0,0 +1,49 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * (SystemSmsLog)实体类
+ *
+ * @author makejava
+ * @since 2024-03-08 09:13:39
+ */
+
+@Data
+@TableName("system_sms_log")
+public class SystemSmsLog implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+    /**
+     * 手机号
+     */
+    @TableField("mobile")
+    private String mobile;
+    /**
+     * 发送内容
+     */
+    @TableField("content")
+    private String content;
+    /**
+     * 发送结果
+     */
+    @TableField("result")
+    private String result;
+
+    @TableField("create_time")
+    private LocalDateTime createTime;
+
+    @TableField("update_time")
+    private LocalDateTime updateTime;
+
+    @TableField("tenant_id")
+    private String tenantId;
+}

+ 68 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsFile.java

@@ -0,0 +1,68 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+/**
+ * (UpmsFile)实体类
+ *
+ * @author makejava
+ * @since 2024-03-18 09:54:38
+ */
+
+@Data
+@TableName("upms_file")
+public class UpmsFile implements Serializable {
+
+        
+    @TableId(type = IdType.ASSIGN_ID)
+    private String id;
+    /**
+    * 文件名
+    */    
+    @TableField("name")
+    private String name;
+    /**
+    * 后缀
+    */    
+    @TableField("suffix")
+    private String suffix;
+    /**
+    * 路径
+    */    
+    @TableField("virtual_name")
+    private String virtualName;
+    /**
+    * url
+    */    
+    @TableField("url")
+    private String url;
+    /**
+    * 存储类型
+    */    
+    @TableField("storage_type")
+    private String storageType;
+    /**
+    * 文件大小
+    */    
+    @TableField("size")
+    private Long size;
+    /**
+    * 创建时间
+    */    
+    @TableField("create_time")
+    private LocalDateTime createTime;
+    /**
+    * 修改时间
+    */    
+    @TableField("update_time")
+    private LocalDateTime updateTime;
+
+    private String tenantId;
+
+}

+ 71 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsMenu.java

@@ -0,0 +1,71 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+/**
+ * 租户菜单表(UpmsMenu)实体类
+ *
+ * @author tanlie
+ * @since 2024-02-06 15:25:38
+ */
+
+@Data
+@TableName("upms_menu")
+public class UpmsMenu implements Serializable {
+    /**
+    * 主键
+    * 自增 => @TableId(type = IdType.AUTO)
+    */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+    /**
+    * 菜单名称
+    */
+    private String title;
+    /**
+    * 父id
+    */
+    private Integer parentId;
+    /**
+    * 菜单路径
+    */
+    private String path;
+    /**
+    * 页面组件
+    */
+    private String component;
+    /**
+    * 图标
+    */
+    private String icon;
+    /**
+    * 菜单级别
+    */
+    private Integer level;
+    /**
+    * 路由缓冲
+    */
+    private String keepAlive;
+    /**
+    * 排序号
+    */
+    private Integer ord;
+    /**
+    * 完整路径
+    */
+    private String allPath;
+    /**
+    * 是否隐藏
+    */
+    private String hidden;
+
+    private String tenantId;
+
+    private String parentPath;
+
+}
+

+ 68 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsMenuBase.java

@@ -0,0 +1,68 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 租户菜单表(UpmsMenu)实体类
+ *
+ * @author tanlie
+ * @since 2024-02-06 15:25:38
+ */
+
+@Data
+@TableName("upms_menu_base")
+public class UpmsMenuBase implements Serializable {
+    /**
+    * 主键
+    * 自增 => @TableId(type = IdType.AUTO)
+    */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+    /**
+    * 菜单名称
+    */
+    private String title;
+    /**
+    * 父id
+    */
+    private Integer parentId;
+    /**
+    * 菜单路径
+    */
+    private String path;
+    /**
+    * 页面组件
+    */
+    private String component;
+    /**
+    * 图标
+    */
+    private String icon;
+    /**
+    * 菜单级别
+    */
+    private Integer level;
+    /**
+    * 路由缓冲
+    */
+    private String keepAlive;
+    /**
+    * 排序号
+    */
+    private Integer ord;
+    /**
+    * 完整路径
+    */
+    private String allPath;
+    /**
+    * 是否隐藏
+    */
+    private String hidden;
+
+}
+

+ 50 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsMenuPermission.java

@@ -0,0 +1,50 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 租户权限表(UpmsMenuPermission)实体类
+ *
+ * @author makejava
+ * @since 2024-02-28 11:43:45
+ */
+
+@Data
+@TableName("upms_menu_permission")
+public class UpmsMenuPermission implements Serializable {
+
+    /**
+     * 主键
+     * 自增 => @TableId(type = IdType.AUTO)
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+    /**
+     * 菜单id
+     */
+    @TableField("menu_id")
+    private Integer menuId;
+    /**
+     * 权限名
+     */
+    @TableField("permission_name")
+    private String permissionName;
+    /**
+     * 权限代码
+     */
+    @TableField("permission_code")
+    private String permissionCode;
+
+    @TableField("tenant_id")
+    private String tenantId;
+
+    @TableField("menu_path")
+    private String menuPath;
+
+}

+ 44 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsMenuPermissionBase.java

@@ -0,0 +1,44 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 租户权限表(UpmsMenuPermission)实体类
+ *
+ * @author makejava
+ * @since 2024-02-28 11:43:45
+ */
+
+@Data
+@TableName("upms_menu_permission_base")
+public class UpmsMenuPermissionBase implements Serializable {
+
+    /**
+     * 主键
+     * 自增 => @TableId(type = IdType.AUTO)
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+    /**
+     * 菜单id
+     */
+    @TableField("menu_id")
+    private Integer menuId;
+    /**
+     * 权限名
+     */
+    @TableField("permission_name")
+    private String permissionName;
+    /**
+     * 权限代码
+     */
+    @TableField("permission_code")
+    private String permissionCode;
+
+}

+ 48 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsRole.java

@@ -0,0 +1,48 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+/**
+ * 租户角色配置表(UpmsRole)实体类
+ *
+ * @author makejava
+ * @since 2024-02-27 11:03:32
+ */
+
+@Data
+@TableName("upms_role")
+public class UpmsRole implements Serializable {
+
+        
+    @TableId(type = IdType.ASSIGN_ID)
+    private String id;
+    /**
+    * 角色中文名
+    */    
+    @TableField("role_cn_name")
+    private String roleCnName;
+    /**
+    * 角色英文名
+    */    
+    @TableField("role_en_name")
+    private String roleEnName;
+    /**
+    * 是否是超级管理员
+    */    
+    @TableField("super_admin")
+    private String superAdmin;
+
+    /**
+     * 是否可删除
+     */
+    @TableField("deletable")
+    private String deletable;
+
+    @TableField("tenant_id")
+    private String tenantId;
+}

+ 42 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsRoleDepartment.java

@@ -0,0 +1,42 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 角色菜单关系表(UpmsRoleMenus)实体类
+ *
+ * @author makejava
+ * @since 2024-02-28 11:16:27
+ */
+
+@Data
+@TableName("upms_role_department")
+public class UpmsRoleDepartment implements Serializable {
+
+    /**
+     * 主键
+     * 自增 => @TableId(type = IdType.AUTO)
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+    /**
+     * 菜单id
+     */
+    @TableField("department_id")
+    private Integer departmentId;
+    /**
+     * 角色id
+     */
+    @TableField("role_id")
+    private String roleId;
+
+    @TableField("tenant_id")
+    private String tenantId;
+
+}

+ 42 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsRoleMenus.java

@@ -0,0 +1,42 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 角色菜单关系表(UpmsRoleMenus)实体类
+ *
+ * @author makejava
+ * @since 2024-02-28 11:16:27
+ */
+
+@Data
+@TableName("upms_role_menus")
+public class UpmsRoleMenus implements Serializable {
+
+    /**
+     * 主键
+     * 自增 => @TableId(type = IdType.AUTO)
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+    /**
+     * 菜单id
+     */
+    @TableField("menu_id")
+    private Integer menuId;
+    /**
+     * 角色id
+     */
+    @TableField("role_id")
+    private String roleId;
+
+    @TableField("tenant_id")
+    private String tenantId;
+
+}

+ 44 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsRolePermission.java

@@ -0,0 +1,44 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+/**
+ * 角色权限码关系表(UpmsRolePermission)实体类
+ *
+ * @author makejava
+ * @since 2024-02-28 14:40:35
+ */
+
+@Data
+@TableName("upms_role_permission")
+public class UpmsRolePermission implements Serializable {
+
+    /**
+    * 主键
+    * 自增 => @TableId(type = IdType.AUTO)
+    */    
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+    /**
+    * 角色id
+    */    
+    @TableField("role_id")
+    private String roleId;
+    /**
+    * 菜单id
+    */    
+    @TableField("menu_id")
+    private Integer menuId;
+
+    /**
+     * 菜单id
+     */
+    @TableField("permission_id")
+    private Integer permissionId;
+
+}

+ 51 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsTenant.java

@@ -0,0 +1,51 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 租户表(UpmsTenant)实体类
+ *
+ * @author makejava
+ * @since 2024-05-20 16:31:14
+ */
+
+@Data
+@TableName("upms_tenant")
+public class UpmsTenant implements Serializable {
+
+    /**
+    * 主键
+    * 自增 => @TableId(type = IdType.AUTO)
+    */    
+    @TableId(type = IdType.ASSIGN_ID)
+    private String id;
+    /**
+    * 租户名称
+    */    
+    @TableField("name")
+    private String name;
+    /**
+     * 默认用户名
+     */
+    @TableField("default_username")
+    private String defaultUsername;
+
+    @TableLogic
+    private Integer deleted;
+    /**
+    * 备注
+    */    
+    @TableField("remark")
+    private String remark;
+        
+    @TableField("create_time")
+    private Date createTime;
+        
+    @TableField("update_time")
+    private Date updateTime;
+
+}

+ 105 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsUser.java

@@ -0,0 +1,105 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 用户表(UpmsUser)实体类
+ *
+ * @author makejava
+ * @since 2024-02-27 16:16:52
+ */
+
+@Data
+@TableName("upms_user")
+public class UpmsUser implements Serializable {
+
+    /**
+     * 主键
+     * 自增 => @TableId(type = IdType.AUTO)
+     */
+    @TableId(type = IdType.ASSIGN_ID)
+    private String id;
+    /**
+     * 用户名/工号
+     */
+    @TableField("username")
+    private String username;
+    /**
+     * 手机号
+     */
+    @TableField("mobile")
+    private String mobile;
+    /**
+     * 密码
+     */
+    @TableField("password")
+    private String password;
+    /**
+     * 密码是否过期
+     */
+    @TableField("expired")
+    private String expired;
+    /**
+     * 账号是否锁定
+     */
+    @TableField("locked")
+    private String locked;
+    /**
+     * 密码过期时间
+     */
+    @TableField("pwd_expired")
+    private LocalDateTime pwdExpired;
+    /**
+     * 性别
+     */
+    @TableField("sex")
+    private String sex;
+    /**
+     * 姓名
+     */
+    @TableField("full_name")
+    private String fullName;
+    /**
+     * 电子邮箱
+     */
+    @TableField("email")
+    private String email;
+
+    /**
+     * 软删除
+     */
+    @TableField("deleted")
+    @TableLogic
+    private String deleted;
+    /**
+     * 登录次数
+     */
+    @TableField("login_count")
+    private Integer loginCount;
+
+    /**
+     * 头像
+     */
+    @TableField("avatar")
+    private String avatar;
+
+    @TableField("create_time")
+    private LocalDateTime createTime;
+
+    @TableField("update_time")
+    private LocalDateTime updateTime;
+
+    @TableField("last_login_time")
+    private LocalDateTime lastLoginTime;
+
+    @TableField("pwd_change_time")
+    private LocalDateTime pwdChangeTime;
+
+    @TableField("tenant_id")
+    private String tenantId;
+
+}

+ 44 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsUserRole.java

@@ -0,0 +1,44 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 用户角色关系表(UpmsUserRole)实体类
+ *
+ * @author makejava
+ * @since 2024-02-27 17:18:50
+ */
+
+@Data
+@TableName("upms_user_role")
+public class UpmsUserRole implements Serializable {
+
+    /**
+     * 主键
+     * 自增 => @TableId(type = IdType.AUTO)
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+    /**
+     * 用户id
+     */
+    @TableField("user_id")
+    private String userId;
+    /**
+     * 角色id
+     */
+    @TableField("role_id")
+    private String roleId;
+    /**
+     * 的角色
+     */
+    @TableField("active")
+    private String active;
+
+}

+ 44 - 0
wishing-platform/platform-entity/platform-entity-upms/src/main/java/cn/qinys/platform/entity/upms/UpmsUserScope.java

@@ -0,0 +1,44 @@
+package cn.qinys.platform.entity.upms;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 后台用户数据权限表(UpmsUserScope)实体类
+ *
+ * @author makejava
+ * @since 2024-11-26 17:10:40
+ */
+@Data
+@TableName("upms_user_scope")
+public class UpmsUserScope implements Serializable {
+
+    /**
+     * 自增id
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+    /**
+     * 用户id
+     */
+    private String userId;
+    /**
+     * 地理编码id
+     */
+    private String areaId;
+    /**
+     * 地理编码级别
+     */
+    private Integer level;
+    /**
+     * 地理编码pid
+     */
+    private String areaPid;
+
+
+}
+

+ 0 - 0
wishing-platform/wishing-entity/src/test/java/cn/qinys/AppTest.java → wishing-platform/platform-entity/platform-entity-upms/src/test/java/cn/qinys/AppTest.java


+ 4 - 4
wishing-platform/wishing-entity/pom.xml → wishing-platform/platform-entity/platform-entity-wishing/pom.xml

@@ -3,15 +3,15 @@
     <modelVersion>4.0.0</modelVersion>
     <modelVersion>4.0.0</modelVersion>
     <parent>
     <parent>
         <groupId>cn.qinys</groupId>
         <groupId>cn.qinys</groupId>
-        <artifactId>wishing-platform</artifactId>
+        <artifactId>platform-entity</artifactId>
         <version>1.0.0-SNAPSHOT</version>
         <version>1.0.0-SNAPSHOT</version>
     </parent>
     </parent>
 
 
-    <artifactId>wishing-entity</artifactId>
+    <artifactId>platform-entity-wishing</artifactId>
     <packaging>jar</packaging>
     <packaging>jar</packaging>
 
 
-    <name>wishing-entity</name>
-    <url>http://maven.apache.org</url>
+    <name>platform-entity-wishing</name>
+
 
 
     <properties>
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

+ 16 - 0
wishing-platform/platform-entity/platform-entity-wishing/src/main/java/cn/qinys/platform/entity/wishing/WishingTree.java

@@ -0,0 +1,16 @@
+package cn.qinys.platform.entity.wishing;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author lie tan
+ * @description
+ * @date 2026-05-17 21:33
+ **/
+@Data
+@TableName("wishing_tree")
+public class WishingTree implements Serializable {
+}

+ 16 - 0
wishing-platform/platform-entity/platform-entity-wishing/src/main/java/cn/qinys/platform/entity/wishing/WishingUser.java

@@ -0,0 +1,16 @@
+package cn.qinys.platform.entity.wishing;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author lie tan
+ * @description
+ * @date 2026-05-17 21:33
+ **/
+@Data
+@TableName("wishing_user")
+public class WishingUser implements Serializable {
+}

+ 0 - 0
wishing-platform/wishing-gateway/src/test/java/cn/qinys/AppTest.java → wishing-platform/platform-entity/platform-entity-wishing/src/test/java/cn/qinys/AppTest.java


BIN
wishing-platform/platform-entity/platform-entity-wishing/target/classes/cn/qinys/platform/entity/wishing/WishingTree.class


BIN
wishing-platform/platform-entity/platform-entity-wishing/target/classes/cn/qinys/platform/entity/wishing/WishingUser.class


+ 34 - 0
wishing-platform/platform-entity/pom.xml

@@ -0,0 +1,34 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>cn.qinys</groupId>
+        <artifactId>wishing-platform</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>platform-entity</artifactId>
+    <packaging>pom</packaging>
+
+    <name>wishing-entity</name>
+    <modules>
+        <module>platform-entity-upms</module>
+        <module>platform-entity-wishing</module>
+    </modules>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

+ 1 - 1
wishing-platform/wishing-gateway/pom.xml → wishing-platform/platform-gateway/pom.xml

@@ -7,7 +7,7 @@
         <version>1.0.0-SNAPSHOT</version>
         <version>1.0.0-SNAPSHOT</version>
     </parent>
     </parent>
 
 
-    <artifactId>wishing-gateway</artifactId>
+    <artifactId>platform-gateway</artifactId>
     <name>wishing-gateway</name>
     <name>wishing-gateway</name>
 
 
 
 

+ 1 - 1
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/GatewayApplication.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/GatewayApplication.java

@@ -1,4 +1,4 @@
-package cn.qinys.wishing;
+package cn.qinys.platform;
 
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;

+ 2 - 2
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/config/GlobalExceptionConfiguration.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/config/GlobalExceptionConfiguration.java

@@ -1,7 +1,7 @@
-package cn.qinys.wishing.gateway.config;
+package cn.qinys.platform.gateway.config;
 
 
 
 
-import cn.qinys.wishing.gateway.response.UnifyResponse;
+import cn.qinys.platform.gateway.response.UnifyResponse;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;

+ 1 - 1
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/config/RedisConfiguration.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/config/RedisConfiguration.java

@@ -1,4 +1,4 @@
-package cn.qinys.wishing.gateway.config;
+package cn.qinys.platform.gateway.config;
 
 
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.PropertyAccessor;
 import com.fasterxml.jackson.annotation.PropertyAccessor;

+ 1 - 1
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/config/RequestRateLimitConfiguration.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/config/RequestRateLimitConfiguration.java

@@ -1,4 +1,4 @@
-package cn.qinys.wishing.gateway.config;
+package cn.qinys.platform.gateway.config;
 
 
 
 
 import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;
 import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;

+ 1 - 1
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/constants/GatewayConstants.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/constants/GatewayConstants.java

@@ -1,4 +1,4 @@
-package cn.qinys.wishing.gateway.constants;
+package cn.qinys.platform.gateway.constants;
 
 
 import lombok.Getter;
 import lombok.Getter;
 
 

+ 1 - 1
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/dto/LoginDTO.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/dto/LoginDTO.java

@@ -1,4 +1,4 @@
-package cn.qinys.wishing.gateway.dto;
+package cn.qinys.platform.gateway.dto;
 
 
 import lombok.Data;
 import lombok.Data;
 
 

+ 1 - 1
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/dto/LoginUserInfoDTO.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/dto/LoginUserInfoDTO.java

@@ -1,4 +1,4 @@
-package cn.qinys.wishing.gateway.dto;
+package cn.qinys.platform.gateway.dto;
 
 
 import lombok.Data;
 import lombok.Data;
 
 

+ 1 - 1
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/entity/GatewayLog.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/entity/GatewayLog.java

@@ -1,4 +1,4 @@
-package cn.qinys.wishing.gateway.entity;
+package cn.qinys.platform.gateway.entity;
 
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;

+ 3 - 3
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/filter/AccessLogFilter.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/filter/AccessLogFilter.java

@@ -1,7 +1,7 @@
-package cn.qinys.wishing.gateway.filter;
+package cn.qinys.platform.gateway.filter;
 
 
-import cn.qinys.wishing.gateway.entity.GatewayLog;
-import cn.qinys.wishing.gateway.msgsender.IMessageService;
+import cn.qinys.platform.gateway.entity.GatewayLog;
+import cn.qinys.platform.gateway.msgsender.IMessageService;
 import com.alibaba.nacos.common.utils.StringUtils;
 import com.alibaba.nacos.common.utils.StringUtils;
 import org.reactivestreams.Publisher;
 import org.reactivestreams.Publisher;
 import org.slf4j.Logger;
 import org.slf4j.Logger;

+ 1 - 1
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/limiter/DiyRedisRateLimiter.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/limiter/DiyRedisRateLimiter.java

@@ -1,4 +1,4 @@
-package cn.qinys.wishing.gateway.limiter;
+package cn.qinys.platform.gateway.limiter;
 
 
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.cloud.gateway.event.FilterArgsEvent;
 import org.springframework.cloud.gateway.event.FilterArgsEvent;

+ 1 - 1
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/limiter/DiyRequestRateLimiterGatewayFilterFactory.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/limiter/DiyRequestRateLimiterGatewayFilterFactory.java

@@ -1,4 +1,4 @@
-package cn.qinys.wishing.gateway.limiter;
+package cn.qinys.platform.gateway.limiter;
 
 
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.cloud.gateway.filter.GatewayFilter;
 import org.springframework.cloud.gateway.filter.GatewayFilter;

+ 2 - 2
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/mapper/GatewayLogMapper.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/mapper/GatewayLogMapper.java

@@ -1,6 +1,6 @@
-package cn.qinys.wishing.gateway.mapper;
+package cn.qinys.platform.gateway.mapper;
 
 
-import cn.qinys.wishing.gateway.entity.GatewayLog;
+import cn.qinys.platform.gateway.entity.GatewayLog;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;

+ 2 - 2
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/msgsender/IMessageService.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/msgsender/IMessageService.java

@@ -1,7 +1,7 @@
-package cn.qinys.wishing.gateway.msgsender;
+package cn.qinys.platform.gateway.msgsender;
 
 
 
 
-import cn.qinys.wishing.gateway.entity.GatewayLog;
+import cn.qinys.platform.gateway.entity.GatewayLog;
 
 
 /**
 /**
  * Create by Tanlie
  * Create by Tanlie

+ 6 - 6
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/msgsender/RabbitmqServiceImpl.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/msgsender/RabbitmqServiceImpl.java

@@ -1,11 +1,11 @@
-package cn.qinys.wishing.gateway.msgsender;
+package cn.qinys.platform.gateway.msgsender;
 
 
 
 
-import cn.qinys.wishing.gateway.constants.GatewayConstants;
-import cn.qinys.wishing.gateway.dto.LoginDTO;
-import cn.qinys.wishing.gateway.entity.GatewayLog;
-import cn.qinys.wishing.gateway.mapper.GatewayLogMapper;
-import cn.qinys.wishing.gateway.utils.RedisUtils;
+import cn.qinys.platform.gateway.constants.GatewayConstants;
+import cn.qinys.platform.gateway.dto.LoginDTO;
+import cn.qinys.platform.gateway.entity.GatewayLog;
+import cn.qinys.platform.gateway.mapper.GatewayLogMapper;
+import cn.qinys.platform.gateway.utils.RedisUtils;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.alibaba.fastjson2.JSONObject;
 import com.alibaba.fastjson2.util.DateUtils;
 import com.alibaba.fastjson2.util.DateUtils;

+ 1 - 1
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/response/UnifyResponse.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/response/UnifyResponse.java

@@ -1,4 +1,4 @@
-package cn.qinys.wishing.gateway.response;
+package cn.qinys.platform.gateway.response;
 
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import org.springframework.core.io.buffer.DataBuffer;
 import org.springframework.core.io.buffer.DataBuffer;

+ 1 - 1
wishing-platform/wishing-gateway/src/main/java/cn/qinys/wishing/gateway/utils/RedisUtils.java → wishing-platform/platform-gateway/src/main/java/cn/qinys/platform/gateway/utils/RedisUtils.java

@@ -1,4 +1,4 @@
-package cn.qinys.wishing.gateway.utils;
+package cn.qinys.platform.gateway.utils;
 
 
 import jakarta.annotation.Resource;
 import jakarta.annotation.Resource;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.core.RedisTemplate;

+ 1 - 1
wishing-platform/wishing-gateway/src/main/resources/application-local.yml → wishing-platform/platform-gateway/src/main/resources/application-local.yml

@@ -6,7 +6,7 @@ spring:
         namespace: a62810f4-be60-4973-8bd0-8199d19526ef
         namespace: a62810f4-be60-4973-8bd0-8199d19526ef
         username: nacos
         username: nacos
         password: h8zG&mehJ#.s7V
         password: h8zG&mehJ#.s7V
-        group: wishing
+        group: wishing-local
 
 
   datasource:
   datasource:
     username: root
     username: root

+ 1 - 1
wishing-platform/wishing-gateway/src/main/resources/application-router.yml → wishing-platform/platform-gateway/src/main/resources/application-router.yml

@@ -10,7 +10,7 @@ spring:
               predicates:
               predicates:
                 - Path=/api/mobile/**
                 - Path=/api/mobile/**
               filters:
               filters:
-                - StripPrefix=2
+                - StripPrefix=0
                 - name: DiyRequestRateLimiter # ip限流
                 - name: DiyRequestRateLimiter # ip限流
                   args:
                   args:
                     redis-rate-limiter.burstCapacity: 200 #令牌桶的容积
                     redis-rate-limiter.burstCapacity: 200 #令牌桶的容积

+ 1 - 1
wishing-platform/wishing-gateway/src/main/resources/application.yml → wishing-platform/platform-gateway/src/main/resources/application.yml

@@ -2,6 +2,6 @@ server:
   port: 8999
   port: 8999
 spring:
 spring:
   application:
   application:
-    name: gateway
+    name: wishing-gateway
   profiles:
   profiles:
     active: router, local
     active: router, local

+ 42 - 0
wishing-platform/platform-service/platform-service-mobile/pom.xml

@@ -0,0 +1,42 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>cn.qinys</groupId>
+        <artifactId>platform-service</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>platform-service-mobile</artifactId>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>cn.qinys</groupId>
+            <artifactId>platform-core-base</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.qinys</groupId>
+            <artifactId>platform-entity-wishing</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+        <!--数据库-->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>

+ 17 - 0
wishing-platform/platform-service/platform-service-mobile/src/main/java/cn/qinys/platform/MobileApplication.java

@@ -0,0 +1,17 @@
+package cn.qinys.platform;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * @author lie tan
+ * @description
+ * @date 2026-05-17 21:40
+ **/
+@SpringBootApplication
+public class MobileApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(MobileApplication.class, args);
+    }
+}

+ 22 - 0
wishing-platform/platform-service/platform-service-mobile/src/main/java/cn/qinys/platform/mobile/controller/TestController.java

@@ -0,0 +1,22 @@
+package cn.qinys.platform.mobile.controller;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author lie tan
+ * @description
+ * @date 2026-05-17 22:12
+ **/
+
+@RestController
+@RequestMapping("/api/mobile/test")
+public class TestController {
+
+
+    @RequestMapping("/ping")
+    public String pong() {
+        return "pong";
+    }
+
+}

+ 23 - 0
wishing-platform/platform-service/platform-service-mobile/src/main/java/cn/qinys/platform/mobile/controller/WishingTreeController.java

@@ -0,0 +1,23 @@
+package cn.qinys.platform.mobile.controller;
+
+import cn.qinys.platform.base.response.UnifyResponse;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author lie tan
+ * @description
+ * @date 2026-05-17 22:25
+ **/
+
+@RestController
+@RequestMapping("/api/mobile/wishingtree")
+public class WishingTreeController {
+
+    @RequestMapping("/ping")
+    public UnifyResponse<String> pong() {
+
+        return new UnifyResponse<>("wishingtree pong");
+    }
+
+}

+ 41 - 0
wishing-platform/platform-service/platform-service-mobile/src/main/resources/application-local.yml

@@ -0,0 +1,41 @@
+logging:
+  level:
+    com.ctsi.platform: debug
+spring:
+  cloud:
+    nacos:
+      discovery:
+        server-addr: 192.168.1.7:8848
+        namespace: a62810f4-be60-4973-8bd0-8199d19526ef
+        username: nacos
+        password: h8zG&mehJ#.s7V
+        group: wishing-local
+
+  data:
+    redis:
+      host: 192.168.1.7
+      port: 6379
+      password: "XinchanR@2022###"
+      database: 3
+
+  datasource:
+    username: root
+    password: "@@qinys12346.."
+    url: jdbc:mysql://192.168.1.7:3306/xxglgj_db?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
+    driver-class-name: com.mysql.cj.jdbc.Driver
+
+mybatis-plus:
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    map-underscore-to-camel-case: true
+  mapper-locations: classpath*:com/ctsi/platform/mobile/*/mapper/xml/*.xml
+  global-config:
+    db-config:
+      logic-delete-field: deleted
+      logic-delete-value: 1
+      logic-not-delete-value: 0
+
+system:
+  base-url: https://wish.qinys.cn/dgapi/mobile/ext/file/
+  file-directory: /server/file/
+

+ 20 - 0
wishing-platform/platform-service/platform-service-mobile/src/main/resources/application.yml

@@ -0,0 +1,20 @@
+server:
+  port: 8003
+spring:
+  jackson:
+    time-zone: GMT+8
+  servlet:
+    multipart:
+      max-file-size: 50MB
+      max-request-size: 50MB
+
+  application:
+    name: wishing-mobile
+  profiles:
+    active: local
+
+jwt:
+  ignore-urls:
+    - /api/mobile/test/**
+    - /ext/**
+

+ 8 - 3
wishing-platform/wishing-core/wishing-core-base/pom.xml → wishing-platform/platform-service/pom.xml

@@ -3,15 +3,20 @@
     <modelVersion>4.0.0</modelVersion>
     <modelVersion>4.0.0</modelVersion>
     <parent>
     <parent>
         <groupId>cn.qinys</groupId>
         <groupId>cn.qinys</groupId>
-        <artifactId>wishing-core</artifactId>
+        <artifactId>wishing-platform</artifactId>
         <version>1.0.0-SNAPSHOT</version>
         <version>1.0.0-SNAPSHOT</version>
     </parent>
     </parent>
 
 
-    <artifactId>wishing-core-base</artifactId>
+    <artifactId>platform-service</artifactId>
+    <packaging>pom</packaging>
+    <modules>
+        <module>platform-service-mobile</module>
+    </modules>
 
 
-    <name>wishing-core-base</name>
 
 
     <properties>
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
     </properties>
+
+
 </project>
 </project>

+ 5 - 5
wishing-platform/pom.xml

@@ -7,10 +7,10 @@
     <artifactId>wishing-platform</artifactId>
     <artifactId>wishing-platform</artifactId>
     <packaging>pom</packaging>
     <packaging>pom</packaging>
     <modules>
     <modules>
-        <module>wishing-core</module>
-        <module>wishing-entity</module>
-        <module>wishing-gateway</module>
-        <module>wishing-service</module>
+        <module>platform-core</module>
+        <module>platform-entity</module>
+        <module>platform-gateway</module>
+        <module>platform-service</module>
     </modules>
     </modules>
     <version>1.0.0-SNAPSHOT</version>
     <version>1.0.0-SNAPSHOT</version>
     <properties>
     <properties>
@@ -19,7 +19,7 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <spring-cloud.version>2025.0.2</spring-cloud.version>
         <spring-cloud.version>2025.0.2</spring-cloud.version>
         <spring-boot.version>3.5.14</spring-boot.version>
         <spring-boot.version>3.5.14</spring-boot.version>
-        <spring-cloud-alibaba.version>2021.0.4.0</spring-cloud-alibaba.version>
+        <spring-cloud-alibaba.version>2025.0.0.0</spring-cloud-alibaba.version>
         <fastjson-version>2.0.32</fastjson-version>
         <fastjson-version>2.0.32</fastjson-version>
         <mybatis-plus-version>3.5.15</mybatis-plus-version>
         <mybatis-plus-version>3.5.15</mybatis-plus-version>
         <kaptcha.version>2.3.2</kaptcha.version>
         <kaptcha.version>2.3.2</kaptcha.version>

+ 0 - 13
wishing-platform/wishing-core/wishing-core-base/src/main/java/cn/qinys/App.java

@@ -1,13 +0,0 @@
-package cn.qinys;
-
-/**
- * Hello world!
- *
- */
-public class App 
-{
-    public static void main( String[] args )
-    {
-        System.out.println( "Hello World!" );
-    }
-}

+ 0 - 13
wishing-platform/wishing-entity/src/main/java/cn/qinys/App.java

@@ -1,13 +0,0 @@
-package cn.qinys;
-
-/**
- * Hello world!
- *
- */
-public class App 
-{
-    public static void main( String[] args )
-    {
-        System.out.println( "Hello World!" );
-    }
-}

+ 0 - 13
wishing-platform/wishing-service/src/main/java/cn/qinys/App.java

@@ -1,13 +0,0 @@
-package cn.qinys;
-
-/**
- * Hello world!
- *
- */
-public class App 
-{
-    public static void main( String[] args )
-    {
-        System.out.println( "Hello World!" );
-    }
-}

+ 0 - 38
wishing-platform/wishing-service/src/test/java/cn/qinys/AppTest.java

@@ -1,38 +0,0 @@
-package cn.qinys;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest 
-    extends TestCase
-{
-    /**
-     * Create the test case
-     *
-     * @param testName name of the test case
-     */
-    public AppTest( String testName )
-    {
-        super( testName );
-    }
-
-    /**
-     * @return the suite of tests being tested
-     */
-    public static Test suite()
-    {
-        return new TestSuite( AppTest.class );
-    }
-
-    /**
-     * Rigourous Test :-)
-     */
-    public void testApp()
-    {
-        assertTrue( true );
-    }
-}