Browse Source

haha

pull/1/head
马府强 2 years ago
parent
commit
3ca00d8ce3
  1. 7
      demodump/.idea/encodings.xml
  2. 512
      demodump/pom.xml
  3. 46
      demodump/src/main/java/org/example/redislimater/ApiCall.java
  4. 204
      demodump/src/main/java/org/example/redislimater/ApiCallAdvice.java
  5. 719
      demodump/src/main/java/org/example/redislimater/RedisUtils.java
  6. 410
      demodump/src/main/java/org/example/redislimater/StringUtils.java
  7. 23
      demodump/src/main/java/org/example/redislimater/controller/TestController.java
  8. 33
      demodump/src/main/java/org/example/redislimater/exception/ApiCallException.java
  9. 30
      demodump/src/main/java/org/example/redislimater/exception/BusinessException.java
  10. 15
      demodump/src/main/java/org/example/redislimater/exception/DemoModeException.java
  11. 57
      demodump/src/main/java/org/example/redislimater/exception/PGException.java
  12. 63
      demodump/src/main/java/org/example/redislimater/exception/ServiceException.java
  13. 26
      demodump/src/main/java/org/example/redislimater/exception/UtilException.java
  14. 98
      demodump/src/main/java/org/example/redislimater/exception/base/BaseException.java
  15. 20
      demodump/src/main/java/org/example/redislimater/exception/file/FileException.java
  16. 16
      demodump/src/main/java/org/example/redislimater/exception/file/FileNameLengthLimitExceededException.java
  17. 16
      demodump/src/main/java/org/example/redislimater/exception/file/FileSizeLimitExceededException.java
  18. 83
      demodump/src/main/java/org/example/redislimater/exception/file/InvalidExtensionException.java
  19. 34
      demodump/src/main/java/org/example/redislimater/exception/job/TaskException.java
  20. 16
      demodump/src/main/java/org/example/redislimater/exception/user/CaptchaException.java
  21. 16
      demodump/src/main/java/org/example/redislimater/exception/user/RoleBlockedException.java
  22. 16
      demodump/src/main/java/org/example/redislimater/exception/user/UserBlockedException.java
  23. 16
      demodump/src/main/java/org/example/redislimater/exception/user/UserDeleteException.java
  24. 19
      demodump/src/main/java/org/example/redislimater/exception/user/UserException.java
  25. 16
      demodump/src/main/java/org/example/redislimater/exception/user/UserNotExistsException.java
  26. 16
      demodump/src/main/java/org/example/redislimater/exception/user/UserPasswordNotMatchException.java
  27. 16
      demodump/src/main/java/org/example/redislimater/exception/user/UserPasswordRetryLimitCountException.java
  28. 16
      demodump/src/main/java/org/example/redislimater/exception/user/UserPasswordRetryLimitExceedException.java
  29. 88
      demodump/src/main/java/org/example/redislimater/utils/CharsetKit.java
  30. 1001
      demodump/src/main/java/org/example/redislimater/utils/Convert.java
  31. 63
      demodump/src/main/java/org/example/redislimater/utils/ErrorCodeEnum.java
  32. 196
      demodump/src/main/java/org/example/redislimater/utils/IpUtils.java
  33. 27
      demodump/src/main/java/org/example/redislimater/utils/MessageUtils.java
  34. 44
      demodump/src/main/java/org/example/redislimater/utils/Recode.java
  35. 93
      demodump/src/main/java/org/example/redislimater/utils/StrFormatter.java
  36. 146
      demodump/src/main/java/org/example/redislimater/utils/spring/SpringUtils.java
  37. BIN
      demodump/target/classes/org/example/function/BranchHandle.class
  38. BIN
      demodump/target/classes/org/example/function/PresentOrElseHandler.class
  39. BIN
      demodump/target/classes/org/example/function/ThrowExceptionFunction.class
  40. BIN
      demodump/target/classes/org/example/function/VUtils.class
  41. BIN
      demodump/target/classes/org/example/redislimater/ApiCall.class
  42. BIN
      demodump/target/classes/org/example/redislimater/ApiCallAdvice.class
  43. BIN
      demodump/target/classes/org/example/redislimater/RedisUtils.class
  44. BIN
      demodump/target/classes/org/example/redislimater/StringUtils.class
  45. BIN
      demodump/target/classes/org/example/redislimater/controller/TestController.class
  46. BIN
      demodump/target/classes/org/example/redislimater/exception/ApiCallException.class
  47. BIN
      demodump/target/classes/org/example/redislimater/exception/BusinessException.class
  48. BIN
      demodump/target/classes/org/example/redislimater/exception/DemoModeException.class
  49. BIN
      demodump/target/classes/org/example/redislimater/exception/PGException.class
  50. BIN
      demodump/target/classes/org/example/redislimater/exception/ServiceException.class
  51. BIN
      demodump/target/classes/org/example/redislimater/exception/UtilException.class
  52. BIN
      demodump/target/classes/org/example/redislimater/exception/base/BaseException.class
  53. BIN
      demodump/target/classes/org/example/redislimater/exception/file/FileException.class
  54. BIN
      demodump/target/classes/org/example/redislimater/exception/file/FileNameLengthLimitExceededException.class
  55. BIN
      demodump/target/classes/org/example/redislimater/exception/file/FileSizeLimitExceededException.class
  56. BIN
      demodump/target/classes/org/example/redislimater/exception/file/InvalidExtensionException$InvalidFlashExtensionException.class
  57. BIN
      demodump/target/classes/org/example/redislimater/exception/file/InvalidExtensionException$InvalidImageExtensionException.class
  58. BIN
      demodump/target/classes/org/example/redislimater/exception/file/InvalidExtensionException$InvalidMediaExtensionException.class
  59. BIN
      demodump/target/classes/org/example/redislimater/exception/file/InvalidExtensionException$InvalidVideoExtensionException.class
  60. BIN
      demodump/target/classes/org/example/redislimater/exception/file/InvalidExtensionException.class
  61. BIN
      demodump/target/classes/org/example/redislimater/exception/job/TaskException$Code.class
  62. BIN
      demodump/target/classes/org/example/redislimater/exception/job/TaskException.class
  63. BIN
      demodump/target/classes/org/example/redislimater/exception/user/CaptchaException.class
  64. BIN
      demodump/target/classes/org/example/redislimater/exception/user/RoleBlockedException.class
  65. BIN
      demodump/target/classes/org/example/redislimater/exception/user/UserBlockedException.class
  66. BIN
      demodump/target/classes/org/example/redislimater/exception/user/UserDeleteException.class
  67. BIN
      demodump/target/classes/org/example/redislimater/exception/user/UserException.class
  68. BIN
      demodump/target/classes/org/example/redislimater/exception/user/UserNotExistsException.class
  69. BIN
      demodump/target/classes/org/example/redislimater/exception/user/UserPasswordNotMatchException.class
  70. BIN
      demodump/target/classes/org/example/redislimater/exception/user/UserPasswordRetryLimitCountException.class
  71. BIN
      demodump/target/classes/org/example/redislimater/exception/user/UserPasswordRetryLimitExceedException.class
  72. BIN
      demodump/target/classes/org/example/redislimater/utils/CharsetKit.class
  73. BIN
      demodump/target/classes/org/example/redislimater/utils/Convert.class
  74. BIN
      demodump/target/classes/org/example/redislimater/utils/ErrorCodeEnum.class
  75. BIN
      demodump/target/classes/org/example/redislimater/utils/IpUtils.class
  76. BIN
      demodump/target/classes/org/example/redislimater/utils/MessageUtils.class
  77. BIN
      demodump/target/classes/org/example/redislimater/utils/Recode.class
  78. BIN
      demodump/target/classes/org/example/redislimater/utils/StrFormatter.class
  79. BIN
      demodump/target/classes/org/example/redislimater/utils/spring/SpringUtils.class
  80. BIN
      demodump/target/classes/org/example/strategy/Eclipse.class
  81. BIN
      demodump/target/classes/org/example/strategy/IDEA.class
  82. BIN
      demodump/target/classes/org/example/strategy/Program.class
  83. BIN
      demodump/target/classes/org/example/strategy/Programmer.class
  84. BIN
      demodump/target/demodump-1.0-SNAPSHOT.jar
  85. 5
      demodump/target/maven-archiver/pom.properties
  86. 47
      demodump/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  87. 42
      demodump/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  88. 1
      demodump/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
  89. 1
      demodump/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
  90. BIN
      demodump/target/test-classes/org/example/Test.class

7
demodump/.idea/encodings.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

512
demodump/pom.xml

@ -7,6 +7,45 @@
<groupId>org.example</groupId>
<artifactId>demodump</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<!--版本号-->
<pangu.version>1.0.0</pangu.version>
<!--编码-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!--jdk版本-->
<java.version>1.8</java.version>
<!--三方版本-->
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<shiro.version>1.6.0</shiro.version>
<thymeleaf.extras.shiro.version>2.0.0</thymeleaf.extras.shiro.version>
<mybatis.boot.version>1.3.2</mybatis.boot.version>
<druid.version>1.1.22</druid.version>
<bitwalker.version>1.19</bitwalker.version>
<kaptcha.version>2.3.2</kaptcha.version>
<swagger.version>2.9.2</swagger.version>
<swagger-bootstrap-ui.version>1.8.9</swagger-bootstrap-ui.version>
<pagehelper.boot.version>1.2.5</pagehelper.boot.version>
<fastjson.version>1.2.73</fastjson.version>
<oshi.version>5.2.5</oshi.version>
<jna.version>5.5.0</jna.version>
<commons.io.version>2.5</commons.io.version>
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<poi.version>3.17</poi.version>
<velocity.version>1.7</velocity.version>
<webmagic.version>0.7.3</webmagic.version>
<qiniu-java-sdk.version>[7.2.0, 7.2.99]</qiniu-java-sdk.version>
<bcprov-jdk15on.version>1.67</bcprov-jdk15on.version>
<gson.version>2.8.6</gson.version>
<spring-data-redis.version>2.1.3.RELEASE</spring-data-redis.version>
<netty-all.version>4.0.24.Final</netty-all.version>
<commons-pool2.version>2.9.0</commons-pool2.version>
<weixin-java.version>4.0.0</weixin-java.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
@ -15,6 +54,50 @@
<version>5.3.23</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-aop -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>5.3.22</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.73</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!--集成redis-->
<!--springboot中的redis依赖-->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>2.1.3.RELEASE</version>
</dependency>
<!-- io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<!--文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
@ -24,6 +107,435 @@
</dependency>
<!--阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!--验证码 -->
<dependency>
<groupId>com.github.penggle</groupId>
<artifactId>kaptcha</artifactId>
<version>${kaptcha.version}</version>
</dependency>
<!--Shiro核心框架 -->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>${shiro.version}</version>
</dependency>
<!-- Shiro使用Srping框架 -->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>${shiro.version}</version>
</dependency>
<!-- Shiro使用EhCache缓存框架 -->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-ehcache</artifactId>
<version>${shiro.version}</version>
</dependency>
<!-- thymeleaf模板引擎和shiro框架的整合 -->
<dependency>
<groupId>com.github.theborakompanioni</groupId>
<artifactId>thymeleaf-extras-shiro</artifactId>
<version>${thymeleaf.extras.shiro.version}</version>
</dependency>
<!-- SpringWeb模块 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<!--常用工具类 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!-- 解析客户端操作系统、浏览器等 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${bitwalker.version}</version>
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.boot.version}</version>
</dependency>
<!--集成redis Lettuce -->
<!--springboot中的redis依赖-->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>${spring-data-redis.version}</version>
</dependency>
<!-- lettuce pool 缓存连接池-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>${commons-pool2.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty-all.version}</version>
</dependency>
<!-- 获取系统信息 -->
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>${oshi.version}</version>
</dependency>
<!-- swagger2-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- swagger2-UI-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>${swagger-bootstrap-ui.version}</version>
</dependency>
<!--io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!--文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<!--velocity代码生成使用模板 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>${velocity.version}</version>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- webmagic -->
<dependency>
<groupId>us.codecraft</groupId>
<artifactId>webmagic-core</artifactId>
<version>${webmagic.version}</version>
</dependency>
<dependency>
<groupId>us.codecraft</groupId>
<artifactId>webmagic-extension</artifactId>
<version>${webmagic.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>${bcprov-jdk15on.version}</version>
</dependency>
<!-- gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
</dependencies>
<!-- &lt;!&ndash; 依赖声明 &ndash;&gt;-->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.1.17.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- &lt;!&ndash;集成redis Lettuce &ndash;&gt;-->
<!-- &lt;!&ndash;springboot中的redis依赖&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.data</groupId>-->
<!-- <artifactId>spring-data-redis</artifactId>-->
<!-- <version>2.1.3.RELEASE</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; lettuce pool 缓存连接池&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.apache.commons</groupId>-->
<!-- <artifactId>commons-pool2</artifactId>-->
<!-- <version>${commons-pool2.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.netty</groupId>-->
<!-- <artifactId>netty-all</artifactId>-->
<!-- <version>${netty-all.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 获取系统信息 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.github.oshi</groupId>-->
<!-- <artifactId>oshi-core</artifactId>-->
<!-- <version>${oshi.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>net.java.dev.jna</groupId>-->
<!-- <artifactId>jna</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>net.java.dev.jna</groupId>-->
<!-- <artifactId>jna-platform</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; swagger2&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>io.springfox</groupId>-->
<!-- <artifactId>springfox-swagger2</artifactId>-->
<!-- <version>${swagger.version}</version>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>io.swagger</groupId>-->
<!-- <artifactId>swagger-annotations</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <groupId>io.swagger</groupId>-->
<!-- <artifactId>swagger-models</artifactId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; swagger2-UI&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>io.springfox</groupId>-->
<!-- <artifactId>springfox-swagger-ui</artifactId>-->
<!-- <version>${swagger.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.github.xiaoymin</groupId>-->
<!-- <artifactId>swagger-bootstrap-ui</artifactId>-->
<!-- <version>${swagger-bootstrap-ui.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash;io常用工具类 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>commons-io</groupId>-->
<!-- <artifactId>commons-io</artifactId>-->
<!-- <version>${commons.io.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash;文件上传工具类 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>commons-fileupload</groupId>-->
<!-- <artifactId>commons-fileupload</artifactId>-->
<!-- <version>${commons.fileupload.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; excel工具 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi-ooxml</artifactId>-->
<!-- <version>${poi.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash;velocity代码生成使用模板 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.apache.velocity</groupId>-->
<!-- <artifactId>velocity</artifactId>-->
<!-- <version>${velocity.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 阿里JSON解析器 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>fastjson</artifactId>-->
<!-- <version>${fastjson.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; webmagic &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>us.codecraft</groupId>-->
<!-- <artifactId>webmagic-core</artifactId>-->
<!-- <version>${webmagic.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>us.codecraft</groupId>-->
<!-- <artifactId>webmagic-extension</artifactId>-->
<!-- <version>${webmagic.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash;七牛云的sdk&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.qiniu</groupId>-->
<!-- <artifactId>qiniu-java-sdk</artifactId>-->
<!-- <version>${qiniu-java-sdk.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.bouncycastle</groupId>-->
<!-- <artifactId>bcprov-jdk15on</artifactId>-->
<!-- <version>${bcprov-jdk15on.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; gson &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.google.code.gson</groupId>-->
<!-- <artifactId>gson</artifactId>-->
<!-- <version>${gson.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 微信支付&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.github.binarywang</groupId>-->
<!-- <artifactId>weixin-java-pay</artifactId>-->
<!-- <version>${weixin-java.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 微信公众号&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.github.binarywang</groupId>-->
<!-- <artifactId>weixin-java-mp</artifactId>-->
<!-- <version>${weixin-java.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 微信小程序&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.github.binarywang</groupId>-->
<!-- <artifactId>weixin-java-miniapp</artifactId>-->
<!-- <version>${weixin-java.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 定时任务&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.pangu</groupId>-->
<!-- <artifactId>pangu-quartz</artifactId>-->
<!-- <version>${pangu.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 代码生成&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.pangu</groupId>-->
<!-- <artifactId>pangu-generator</artifactId>-->
<!-- <version>${pangu.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 爬虫&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.pangu</groupId>-->
<!-- <artifactId>pangu-webmagic</artifactId>-->
<!-- <version>${pangu.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 核心模块&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.pangu</groupId>-->
<!-- <artifactId>pangu-framework</artifactId>-->
<!-- <version>${pangu.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 系统模块&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.pangu</groupId>-->
<!-- <artifactId>pangu-core</artifactId>-->
<!-- <version>${pangu.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 通用工具&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.pangu</groupId>-->
<!-- <artifactId>pangu-common</artifactId>-->
<!-- <version>${pangu.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; api模块 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.pangu</groupId>-->
<!-- <artifactId>pangu-api</artifactId>-->
<!-- <version>${pangu.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; api dto模块 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.pangu</groupId>-->
<!-- <artifactId>pangu-dto</artifactId>-->
<!-- <version>${pangu.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 支付模块 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.pangu</groupId>-->
<!-- <artifactId>pangu-pay</artifactId>-->
<!-- <version>${pangu.version}</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 微信模块 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.pangu</groupId>-->
<!-- <artifactId>pangu-wechat</artifactId>-->
<!-- <version>${pangu.version}</version>-->
<!-- </dependency>-->
<!-- </dependencies>-->
<!-- </dependencyManagement>-->
</project>

46
demodump/src/main/java/org/example/redislimater/ApiCall.java

@ -0,0 +1,46 @@
/*
* Copyright (C), 2019-2020 dingyong
* FileName: ApiCall
* Author: dingyong
* Date: 2021/1/22
* Description: //描述
* History: //修改记录
* <author> <time> <version> <desc>
* 修改人姓名 修改时间 版本号 描述
*/
package org.example.redislimater;
import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;
/**
* @author dingyong
* @Description: 接口调用监控及限流
* 限制每个ip对每个方法的访问限制加上时间限制
* @Date 2021/1/22
* @see [相关类/方法]可选
* @since [产品/模块版本] 可选
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ApiCall {
/**
* 单位时间内能访问多少次默认不限次
* @return 调用次数
*/
long limitCount() default 1000000000;
/**
* 多长时间内限制默认 60
* @return 时间
*/
long time() default 60;
/**
* 时间类型默认毫秒
* @return 时间类型
*/
TimeUnit timeUnit() default TimeUnit.MILLISECONDS ;
}

204
demodump/src/main/java/org/example/redislimater/ApiCallAdvice.java

@ -0,0 +1,204 @@
/*
* Copyright (C), 2019-2020 dingyong
* FileName: ApiCallAdvice
* Author: dingyong
* Date: 2021/1/22
* Description: //描述
* History: //修改记录
* <author> <time> <version> <desc>
* 修改人姓名 修改时间 版本号 描述
*/
package org.example.redislimater;
import com.alibaba.fastjson.JSON;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.aspectj.lang.reflect.MethodSignature;
import org.example.redislimater.exception.ApiCallException;
import org.example.redislimater.exception.BusinessException;
import org.example.redislimater.utils.IpUtils;
import org.example.redislimater.utils.Recode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.concurrent.TimeUnit;
/**
* @author dingyong
* @Description: 接口调用情况监控<br/>
* 1监控单个接口一天内的调用次数<br/>
* 2如果抛出异常则记录异常信息及发生时间<br/>
* 3对单个IP进行限流每天对每个接口的调用次数有限<br/>
* @Date 2021/1/22
* @see [相关类/方法]可选
* @since [产品/模块版本] 可选
*/
@Aspect
@Component
public class ApiCallAdvice {
private static final Logger interfaceLog = LoggerFactory.getLogger("interfaceLog");
@Resource
private RedisUtils redisUtils;
private static final String FORMAT_PATTERN_DAY = "yyyy-MM-dd";
private static final String FORMAT_PATTERN_MILLS = "yyyy-MM-dd HH:mm:ss:SSS";
// 配置织入点
@Pointcut("@annotation(org.example.redislimater.ApiCall)")
public void apiCall()
{
}
/**
*
* @param pjp
* @return
*/
@Around(value = "apiCall())")
public Object requestLimitAround(ProceedingJoinPoint pjp) {
MethodSignature methodSignature = (MethodSignature)pjp.getSignature();
ApiCall apiCall = methodSignature.getMethod().getAnnotation(ApiCall.class);
// 限制访问次数
long limitCount = apiCall.limitCount();
// 获取 request , 然后获取访问 ip
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String requestIp = IpUtils.getIpAddr(request);
if(StringUtils.isEmpty(requestIp)) {
interfaceLog.error("execute api {} error, ip is empty",methodSignature.getMethod().getName());
throw new ApiCallException(Recode.IP_ERROR.getCode(),Recode.IP_ERROR.getDesc());
}
//获取uri
String uri = request.getRequestURI();
String key = "API_LIMIT:" + uri + "_" + requestIp +"_";
int size = redisUtils.keys(key + "*").size();
if( size > limitCount ){
interfaceLog.error("execute api {} error, ip exceed max call limit!, IP is {}",methodSignature.getMethod().getName(),requestIp);
throw new ApiCallException(Recode.LIMIT_ERROR.getCode(),Recode.LIMIT_ERROR.getDesc());
}
// 将访问存进缓存
redisUtils.set(key+System.currentTimeMillis(), "1", apiCall.time(), apiCall.timeUnit());
//获取传入目标方法的参数
Object[] args = pjp.getArgs();
try {
// 执行访问并返回数据
//方法参数
String param;
if (args.length == 1){
param = JSON.toJSONString(args[0]);
}else{
param = Arrays.toString(pjp.getArgs());
}
//耗时
long beginTime = System.nanoTime();
//执行结果
Object result = pjp.proceed(args);
long endTime =System.nanoTime();
String resultJson = JSON.toJSONString(result);
//日志打印
interfaceLog.info("execute api : {},param: {},result:{},cost:{}ms",
methodSignature.getMethod().getName(),param,resultJson,(endTime-beginTime)/1000000);
return result;
} catch (Throwable throwable) {
//throwable.printStackTrace();
//interfaceLog.error("execute api:{}error, cause by {}", methodSignature.getMethod().getName(),throwable.getMessage());
interfaceLog.error("execute api:{}error, cause by {}, ip is{}", methodSignature.getMethod().getName(),throwable.getMessage(),requestIp);
throw new BusinessException("系统异常");
}
}
/**
* 真正执行业务操作前先进行总的限流的验证
* 限制维度为一天内单个IP的访问次数
* key = URI + IP + date精确到天
* value = 调用次数
*/
@Before("apiCall()")
public void before() {
// 接收到请求,记录请求内容
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
//获取请求的request
HttpServletRequest request = attributes.getRequest();
String uri = request.getRequestURI();
String date = dateFormat(FORMAT_PATTERN_DAY);
String ip = IpUtils.getIpAddr(request);
if (StringUtils.isEmpty(ip)) {
interfaceLog.error("execute uri {} error, Unauthorized access!ip cannot empty!",uri);
throw new ApiCallException(Recode.IP_ERROR.getCode(),Recode.IP_ERROR.getDesc());
}
// URI+IP+日期 构成以天为维度的key
String ipKey = "API_LIMIT_DAY:"+uri + "_" + ip + "_" + date;
if (redisUtils.hasKey(ipKey)) {
if (Integer.parseInt(redisUtils.get(ipKey).toString()) > 10000) {
interfaceLog.error("execute uri {} error, exceed max call limit!,IP is :{}",uri,ip);
throw new ApiCallException(Recode.LIMIT_ERROR.getCode(),Recode.LIMIT_ERROR.getDesc());
}
redisUtils.incr(ipKey, 1);
} else {
redisUtils.set(ipKey, 1, 1L, TimeUnit.DAYS);
}
}
/**
* 如果有返回结果代表一次调用则对应接口的调用次数加一统计维度为天
* Redis使用Hash结构
* key = URI
* key = date 精确到天
* value = 调用次数
*/
@AfterReturning("apiCall()")
public void afterReturning() {
// 接收到请求,记录请求内容
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
//获取请求的request
HttpServletRequest request = attributes.getRequest();
String uri = request.getRequestURI();
String date = dateFormat(FORMAT_PATTERN_DAY);
if (redisUtils.hasKey(uri)) {
redisUtils.boundHashOpsIncrement(uri,date, 1);
} else {
redisUtils.boundHashOpsPut(uri,date, 1);
}
}
/**
* 如果调用抛出异常则缓存异常信息Redis使用Hash结构
* key = URI + _exception
* key = time (精确到毫秒的时间)
* value = exception 异常信息
*
* @param ex 异常信息
*/
@AfterThrowing(value = "apiCall()", throwing = "ex")
public void afterThrowing(Exception ex) {
//ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
// HttpServletRequest request = attributes.getRequest();
//String uri = request.getRequestURI() + "_exception";
//String time = dateFormat(FORMAT_PATTERN_MILLS);
//redisTemplate.boundHashOps(uri).put(time, exception);
interfaceLog.error("execute api error, cause by {}",ex.getMessage());
}
private String dateFormat(String pattern) {
SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);
return dateFormat.format(new Date());
}
}

719
demodump/src/main/java/org/example/redislimater/RedisUtils.java

@ -0,0 +1,719 @@
/*
* Copyright (C), 2019-2020 dingyong
* FileName: RedisUtils
* Author: dingyong
* Date: 2020/10/7
* Description: //描述
* History: //修改记录
* <author> <time> <version> <desc>
* 修改人姓名 修改时间 版本号 描述
*/
package org.example.redislimater;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.RedisStringCommands;
import org.springframework.data.redis.connection.ReturnType;
import org.springframework.data.redis.core.*;
import org.springframework.data.redis.core.types.Expiration;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.nio.charset.Charset;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
* @author dingyong
* @Description: redis工具类
* @Date 2020/10/7
* @see [相关类/方法]可选
* @since [产品/模块版本] 可选
*/
@Component
public class RedisUtils {
@Autowired
private RedisTemplate<String, Object> redisTemplate;
//因为spring自动注入管理了bean容器,直接用@Autowired取即可
@Autowired
private StringRedisTemplate stringRedisTemplate;
public RedisUtils(RedisTemplate<String, Object> redisTemplate) {
this.redisTemplate = redisTemplate;
}
/**
* 指定缓存失效时间
* @param key
* @param time 时间()
* @return
*/
public boolean expire(String key,long time){
try {
if(time>0){
redisTemplate.expire(key, time, TimeUnit.SECONDS);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 根据key 获取过期时间
* @param key 不能为null
* @return 时间() 返回0代表为永久有效
*/
public long getExpire(String key){
return redisTemplate.getExpire(key,TimeUnit.SECONDS);
}
/**
* 判断key是否存在
* @param key
* @return true 存在 false不存在
*/
public boolean hasKey(String key){
try {
return redisTemplate.hasKey(key);
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 删除缓存
* @param key 可以传一个值 或多个
*/
@SuppressWarnings("unchecked")
public void del(String ... key){
if(key!=null&&key.length>0){
if(key.length==1){
redisTemplate.delete(key[0]);
}else{
redisTemplate.delete(CollectionUtils.arrayToList(key));
}
}
}
//============================String=============================
/**
* 普通缓存获取
* @param key
* @return
*/
public Object get(String key){
return key==null?null:redisTemplate.opsForValue().get(key);
}
/**
* 普通缓存放入
* @param key
* @param value
* @return true成功 false失败
*/
public boolean set(String key,Object value) {
try {
redisTemplate.opsForValue().set(key, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 普通缓存放入并设置时间
* @param key
* @param value
* @param time 时间() time要大于0 如果time小于等于0 将设置无限期
* @return true成功 false 失败
*/
public boolean set(String key,Object value,long time){
try {
if(time>0){
redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
}else{
set(key, value);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 普通缓存放入并设置时间
* @param key
* @param value
* @param time 时间() time要大于0 如果time小于等于0 将设置无限期
* @return true成功 false 失败
*/
public boolean set(String key,Object value,long time,TimeUnit timeUnit){
try {
if(time>0){
redisTemplate.opsForValue().set(key, value, time, timeUnit);
}else{
set(key, value);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public Boolean lock(String key,String value, Long timeout, TimeUnit timeUnit) {
Boolean lockStat = stringRedisTemplate.execute((RedisCallback<Boolean>) connection ->
connection.set(key.getBytes(Charset.forName("UTF-8")), value.getBytes(Charset.forName("UTF-8")),
Expiration.from(timeout, timeUnit), RedisStringCommands.SetOption.SET_IF_ABSENT));
return lockStat;
}
public Boolean unLock(String key,String value) {
String script = "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1]) else return 0 end";
boolean unLockStat = stringRedisTemplate.execute((RedisCallback<Boolean>) connection ->
connection.eval(script.getBytes(), ReturnType.BOOLEAN, 1,
key.getBytes(Charset.forName("UTF-8")), value.getBytes(Charset.forName("UTF-8"))));
return unLockStat;
}
/*
public boolean tryLock(String key,String value,long expire){
boolean result;
RedisConnectionFactory factory = redisTemplate.getConnectionFactory();
assert factory != null;
RedisConnection conn = factory.getConnection();
try {
result = conn.set(key.getBytes(Charset.forName("UTF-8")), value.getBytes(Charset.forName("UTF-8")),
Expiration.from(expire, TimeUnit.MILLISECONDS), RedisStringCommands.SetOption.SET_IF_ABSENT);
} finally {
RedisConnectionUtils.releaseConnection(conn, factory);
}
return result;
}
public void execDelLuaScript(String key, String value,String script){
byte[][] keysAndArgs = new byte[2][];
keysAndArgs[0] = key.getBytes(Charset.forName("UTF-8"));
keysAndArgs[1] = value.getBytes(Charset.forName("UTF-8"));
RedisConnectionFactory factory = redisTemplate.getConnectionFactory();
RedisConnection conn = factory.getConnection();
try {
conn.scriptingCommands().eval(script.getBytes(Charset.forName("UTF-8")), ReturnType.INTEGER, 1, keysAndArgs);
} finally {
RedisConnectionUtils.releaseConnection(conn, factory);
}
}
*/
/**
* 递增
* @param key
* @param delta 要增加几(大于0)
* @return
*/
public long incr(String key, long delta){
if(delta<0){
throw new RuntimeException("递增因子必须大于0");
}
return redisTemplate.opsForValue().increment(key, delta);
}
/**
* 递减
* @param key
* @param delta 要减少几(小于0)
* @return
*/
public long decr(String key, long delta){
if(delta<0){
throw new RuntimeException("递减因子必须大于0");
}
return redisTemplate.opsForValue().increment(key, -delta);
}
//================================Map=================================
/**
* HashGet
* @param key 不能为null
* @param item 不能为null
* @return
*/
public Object hget(String key,String item){
return redisTemplate.opsForHash().get(key, item);
}
/**
* 获取hashKey对应的所有键值
* @param key
* @return 对应的多个键值
*/
public Map<Object,Object> hmget(String key){
return redisTemplate.opsForHash().entries(key);
}
/**
* HashSet
* @param key
* @param map 对应多个键值
* @return true 成功 false 失败
*/
public boolean hmset(String key, Map<String,Object> map){
try {
redisTemplate.opsForHash().putAll(key, map);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* HashSet 并设置时间
* @param key
* @param map 对应多个键值
* @param time 时间()
* @return true成功 false失败
*/
public boolean hmset(String key, Map<String,Object> map, long time){
try {
redisTemplate.opsForHash().putAll(key, map);
if(time>0){
expire(key, time);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 向一张hash表中放入数据,如果不存在将创建
* @param key
* @param item
* @param value
* @return true 成功 false失败
*/
public boolean hset(String key,String item,Object value) {
try {
redisTemplate.opsForHash().put(key, item, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 向一张hash表中放入数据,如果不存在将创建
* @param key
* @param item
* @param value
* @param time 时间() 注意:如果已存在的hash表有时间,这里将会替换原有的时间
* @return true 成功 false失败
*/
public boolean hset(String key,String item,Object value,long time) {
try {
redisTemplate.opsForHash().put(key, item, value);
if(time>0){
expire(key, time);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 删除hash表中的值
* @param key 不能为null
* @param item 可以使多个 不能为null
*/
public void hdel(String key, Object... item){
redisTemplate.opsForHash().delete(key,item);
}
/**
* 判断hash表中是否有该项的值
* @param key 不能为null
* @param item 不能为null
* @return true 存在 false不存在
*/
public boolean hHasKey(String key, String item){
return redisTemplate.opsForHash().hasKey(key, item);
}
/**
* hash递增 如果不存在,就会创建一个 并把新增后的值返回
* @param key
* @param item
* @param by 要增加几(大于0)
* @return
*/
public double hincr(String key, String item,double by){
return redisTemplate.opsForHash().increment(key, item, by);
}
/**
* hash递减
* @param key
* @param item
* @param by 要减少记(小于0)
*/
public double hdecr(String key, String item,double by){
return redisTemplate.opsForHash().increment(key, item,-by);
}
//============================set=============================
/**
* 根据key获取Set中的所有值
* @param key
* @return
*/
public Set<Object> sGet(String key){
try {
return redisTemplate.opsForSet().members(key);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 根据value从一个set中查询,是否存在
* @param key
* @param value
* @return true 存在 false不存在
*/
public boolean sHasKey(String key,Object value){
try {
return redisTemplate.opsForSet().isMember(key, value);
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 将数据放入set缓存
* @param key
* @param values 可以是多个
* @return 成功个数
*/
public long sSet(String key, Object...values) {
try {
return redisTemplate.opsForSet().add(key, values);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 将set数据放入缓存
* @param key
* @param time 时间()
* @param values 可以是多个
* @return 成功个数
*/
public long sSetAndTime(String key,long time,Object...values) {
try {
Long count = redisTemplate.opsForSet().add(key, values);
if(time>0) {
expire(key, time);
}
return count;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 获取set缓存的长度
* @param key
* @return
*/
public long sGetSetSize(String key){
try {
return redisTemplate.opsForSet().size(key);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 移除值为value的
* @param key
* @param values 可以是多个
* @return 移除的个数
*/
public long setRemove(String key, Object ...values) {
try {
Long count = redisTemplate.opsForSet().remove(key, values);
return count;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
//===============================list=================================
/**
* 获取list缓存的内容
* @param key
* @param start 开始
* @param end 结束 0 -1代表所有值
* @return
*/
public List<Object> lGet(String key, long start, long end){
try {
return redisTemplate.opsForList().range(key, start, end);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 获取list缓存的长度
* @param key
* @return
*/
public long lGetListSize(String key){
try {
return redisTemplate.opsForList().size(key);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 通过索引 获取list中的值
* @param key
* @param index 索引 index>=0时 0 表头1 第二个元素依次类推index<0时-1表尾-2倒数第二个元素依次类推
* @return
*/
public Object lGetIndex(String key,long index){
try {
return redisTemplate.opsForList().index(key, index);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 将list放入缓存
* @param key
* @param value
* @return
*/
public boolean lSet(String key, Object value) {
try {
redisTemplate.opsForList().rightPush(key, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 将list放入缓存
* @param key
* @param value
* @param time 时间()
* @return
*/
public boolean lSet(String key, Object value, long time) {
try {
redisTemplate.opsForList().rightPush(key, value);
if (time > 0) {
expire(key, time);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 将list放入缓存
* @param key
* @param value
* @return
*/
public boolean lSet(String key, List<Object> value) {
try {
redisTemplate.opsForList().rightPushAll(key, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 将list放入缓存
* @param key
* @param value
* @param time 时间()
* @return
*/
public boolean lSet(String key, List<Object> value, long time) {
try {
redisTemplate.opsForList().rightPushAll(key, value);
if (time > 0) {
expire(key, time);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 根据索引修改list中的某条数据
* @param key
* @param index 索引
* @param value
* @return
*/
public boolean lUpdateIndex(String key, long index,Object value) {
try {
redisTemplate.opsForList().set(key, index, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 移除N个值为value
* @param key
* @param count 移除多少个
* @param value
* @return 移除的个数
*/
public long lRemove(String key,long count,Object value) {
try {
Long remove = redisTemplate.opsForList().remove(key, count, value);
return remove;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 模糊查询获取key值
* @param pattern
* @return
*/
public Set keys(String pattern){
return redisTemplate.keys(pattern);
}
/**
* 使用Redis的消息队列
* @param channel
* @param message 消息内容
*/
public void convertAndSend(String channel, Object message){
redisTemplate.convertAndSend(channel,message);
}
/**
* 根据起始结束序号遍历Redis中的list
* @param listKey
* @param start 起始序号
* @param end 结束序号
* @return
*/
public List<Object> rangeList(String listKey, long start, long end) {
//绑定操作
BoundListOperations<String, Object> boundValueOperations = redisTemplate.boundListOps(listKey);
//查询数据
return boundValueOperations.range(start, end);
}
/**
* 弹出右边的值 --- 并且移除这个值
* @param listKey
*/
public Object rifhtPop(String listKey){
//绑定操作
BoundListOperations<String, Object> boundValueOperations = redisTemplate.boundListOps(listKey);
return boundValueOperations.rightPop();
}
//=========BoundListOperations 用法 End============
public void incrementStar(String starIdKey,String fansId,Integer supportValue){
try {
redisTemplate.opsForZSet().add(starIdKey,fansId,supportValue);
} catch (Exception e) {
return;
}
}
public List<Map<String,Object>> getIncrementStar(String starIdKey){
Set<ZSetOperations.TypedTuple<Object>> typedTuples = redisTemplate.opsForZSet()
.reverseRangeByScoreWithScores(starIdKey, 0, 99999, 0, 100);//只取前100条
int index = 0;
List<Map<String,Object>> rank = new ArrayList<>();
for(ZSetOperations.TypedTuple typle:typedTuples){
Map<String, Object> map = new HashMap<>();
map.put("fansId",typle.getValue());
map.put("count",typle.getScore().intValue());
map.put("rank",++index);
rank.add(map);
}
return rank;
}
public void boundHashOpsIncrement(String var,String var1, long var2){
redisTemplate.boundHashOps(var).increment(var1, var2);
}
public void boundHashOpsPut(String var,String var1, long var2){
redisTemplate.boundHashOps(var).put(var1, var2);
}
/**
* 次数限制
* @param key key
* @param limitSeconds key有效期
* @param limitTimes 限制次数
* @return -1表示超过限制
*/
public Long limitIncr(final String key, final int limitSeconds, final int limitTimes) {
if(StringUtils.isEmpty(key)) {
return 0L;
}
Long ret = 1L;
if (!redisTemplate.hasKey(key)) {
redisTemplate.opsForValue().increment(key, 1);
redisTemplate.expire(key, limitSeconds, TimeUnit.SECONDS);
return ret;
}
ret = redisTemplate.opsForValue().increment(key, 1);
return ret > limitTimes ? -1L : ret;
}
}

410
demodump/src/main/java/org/example/redislimater/StringUtils.java

@ -0,0 +1,410 @@
package org.example.redislimater;
import org.example.redislimater.utils.StrFormatter;
import java.util.Collection;
import java.util.Map;
/**
* 字符串工具类
*
* @author pangu
*/
public class StringUtils extends org.apache.commons.lang3.StringUtils
{
/** 空字符串 */
private static final String NULLSTR = "";
/** 下划线 */
private static final char SEPARATOR = '_';
/**
* 获取参数不为空值
*
* @param value defaultValue 要判断的value
* @return value 返回值
*/
public static <T> T nvl(T value, T defaultValue)
{
return value != null ? value : defaultValue;
}
/**
* * 判断一个Collection是否为空 包含ListSetQueue
*
* @param coll 要判断的Collection
* @return true为空 false非空
*/
public static boolean isEmpty(Collection<?> coll)
{
return isNull(coll) || coll.isEmpty();
}
/**
* * 判断一个Collection是否非空包含ListSetQueue
*
* @param coll 要判断的Collection
* @return true非空 false
*/
public static boolean isNotEmpty(Collection<?> coll)
{
return !isEmpty(coll);
}
/**
* * 判断一个对象数组是否为空
*
* @param objects 要判断的对象数组
** @return true为空 false非空
*/
public static boolean isEmpty(Object[] objects)
{
return isNull(objects) || (objects.length == 0);
}
/**
* * 判断一个对象数组是否非空
*
* @param objects 要判断的对象数组
* @return true非空 false
*/
public static boolean isNotEmpty(Object[] objects)
{
return !isEmpty(objects);
}
/**
* * 判断一个Map是否为空
*
* @param map 要判断的Map
* @return true为空 false非空
*/
public static boolean isEmpty(Map<?, ?> map)
{
return isNull(map) || map.isEmpty();
}
/**
* * 判断一个Map是否为空
*
* @param map 要判断的Map
* @return true非空 false
*/
public static boolean isNotEmpty(Map<?, ?> map)
{
return !isEmpty(map);
}
/**
* * 判断一个字符串是否为空串
*
* @param str String
* @return true为空 false非空
*/
public static boolean isEmpty(String str)
{
return isNull(str) || NULLSTR.equals(str.trim());
}
/**
* * 判断一个字符串是否为非空串
*
* @param str String
* @return true非空串 false空串
*/
public static boolean isNotEmpty(String str)
{
return !isEmpty(str);
}
/**
* * 判断一个对象是否为空
*
* @param object Object
* @return true为空 false非空
*/
public static boolean isNull(Object object)
{
return object == null;
}
/**
* * 判断一个对象是否非空
*
* @param object Object
* @return true非空 false
*/
public static boolean isNotNull(Object object)
{
return !isNull(object);
}
/**
* * 判断一个对象是否是数组类型Java基本型别的数组
*
* @param object 对象
* @return true是数组 false不是数组
*/
public static boolean isArray(Object object)
{
return isNotNull(object) && object.getClass().isArray();
}
/**
* 去空格
*/
public static String trim(String str)
{
return (str == null ? "" : str.trim());
}
/**
* 截取字符串
*
* @param str 字符串
* @param start 开始
* @return 结果
*/
public static String substring(final String str, int start)
{
if (str == null)
{
return NULLSTR;
}
if (start < 0)
{
start = str.length() + start;
}
if (start < 0)
{
start = 0;
}
if (start > str.length())
{
return NULLSTR;
}
return str.substring(start);
}
/**
* 截取字符串
*
* @param str 字符串
* @param start 开始
* @param end 结束
* @return 结果
*/
public static String substring(final String str, int start, int end)
{
if (str == null)
{
return NULLSTR;
}
if (end < 0)
{
end = str.length() + end;
}
if (start < 0)
{
start = str.length() + start;
}
if (end > str.length())
{
end = str.length();
}
if (start > end)
{
return NULLSTR;
}
if (start < 0)
{
start = 0;
}
if (end < 0)
{
end = 0;
}
return str.substring(start, end);
}
/**
* 格式化文本, {} 表示占位符<br>
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
* 如果想输出 {} 使用 \\转义 { 即可如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
* <br>
* 通常使用format("this is {} for {}", "a", "b") -> this is a for b<br>
* 转义{} format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
* 转义\ format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
*
* @param template 文本模板被替换的部分用 {} 表示
* @param params 参数值
* @return 格式化后的文本
*/
public static String format(String template, Object... params)
{
if (isEmpty(params) || isEmpty(template))
{
return template;
}
return StrFormatter.format(template, params);
}
/**
* 下划线转驼峰命名
*/
public static String toUnderScoreCase(String str)
{
if (str == null)
{
return null;
}
StringBuilder sb = new StringBuilder();
// 前置字符是否大写
boolean preCharIsUpperCase = true;
// 当前字符是否大写
boolean curreCharIsUpperCase = true;
// 下一字符是否大写
boolean nexteCharIsUpperCase = true;
for (int i = 0; i < str.length(); i++)
{
char c = str.charAt(i);
if (i > 0)
{
preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
}
else
{
preCharIsUpperCase = false;
}
curreCharIsUpperCase = Character.isUpperCase(c);
if (i < (str.length() - 1))
{
nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
}
if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase)
{
sb.append(SEPARATOR);
}
else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase)
{
sb.append(SEPARATOR);
}
sb.append(Character.toLowerCase(c));
}
return sb.toString();
}
/**
* 是否包含字符串
*
* @param str 验证字符串
* @param strs 字符串组
* @return 包含返回true
*/
public static boolean inStringIgnoreCase(String str, String... strs)
{
if (str != null && strs != null)
{
for (String s : strs)
{
if (str.equalsIgnoreCase(trim(s)))
{
return true;
}
}
}
return false;
}
/**
* 将下划线大写方式命名的字符串转换为驼峰式如果转换前的下划线大写方式命名的字符串为空则返回空字符串 例如HELLO_WORLD->HelloWorld
*
* @param name 转换前的下划线大写方式命名的字符串
* @return 转换后的驼峰式命名的字符串
*/
public static String convertToCamelCase(String name)
{
StringBuilder result = new StringBuilder();
// 快速检查
if (name == null || name.isEmpty())
{
// 没必要转换
return "";
}
else if (!name.contains("_"))
{
// 不含下划线,仅将首字母大写
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
// 用下划线将原始字符串分割
String[] camels = name.split("_");
for (String camel : camels)
{
// 跳过原始字符串中开头、结尾的下换线或双重下划线
if (camel.isEmpty())
{
continue;
}
// 首字母大写
result.append(camel.substring(0, 1).toUpperCase());
result.append(camel.substring(1).toLowerCase());
}
return result.toString();
}
/**
* 驼峰式命名法
* 例如user_name->userName
*/
public static String toCamelCase(String s)
{
if (s == null)
{
return null;
}
if (s.indexOf(SEPARATOR) == -1)
{
return s;
}
s = s.toLowerCase();
StringBuilder sb = new StringBuilder(s.length());
boolean upperCase = false;
for (int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
if (c == SEPARATOR)
{
upperCase = true;
}
else if (upperCase)
{
sb.append(Character.toUpperCase(c));
upperCase = false;
}
else
{
sb.append(c);
}
}
return sb.toString();
}
@SuppressWarnings("unchecked")
public static <T> T cast(Object obj)
{
return (T) obj;
}
}

23
demodump/src/main/java/org/example/redislimater/controller/TestController.java

@ -0,0 +1,23 @@
package org.example.redislimater.controller;
import org.example.redislimater.ApiCall;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.TimeUnit;
@RestController
@RequestMapping("/api/cricle")
@Validated
public class TestController {
@ApiCall(time = 1,limitCount = 100,timeUnit = TimeUnit.SECONDS)
@GetMapping("/queryAllCricles")
public String queryAllCricles(String req)
{
return null;
}
}

33
demodump/src/main/java/org/example/redislimater/exception/ApiCallException.java

@ -0,0 +1,33 @@
/*
* Copyright (C), 2019-2020 dingyong
* FileName: ApiCallException
* Author: dingyong
* Date: 2021/1/22
* Description: //描述
* History: //修改记录
* <author> <time> <version> <desc>
* 修改人姓名 修改时间 版本号 描述
*/
package org.example.redislimater.exception;
/**
* @author dingyong
* @Description: TODO
* @Date 2021/1/22
* @see [相关类/方法]可选
* @since [产品/模块版本] 可选
*/
public class ApiCallException extends RuntimeException {
private static final long serialVersionUID = 4721703562003091668L;
private final Integer errorCode;
public ApiCallException(int errorCode, String message) {
super(message);
this.errorCode = errorCode;
}
public Integer getErrorCode() {
return errorCode;
}
}

30
demodump/src/main/java/org/example/redislimater/exception/BusinessException.java

@ -0,0 +1,30 @@
package org.example.redislimater.exception;
/**
* 业务异常
*
* @author pangu
*/
public class BusinessException extends RuntimeException
{
private static final long serialVersionUID = 1L;
protected final String message;
public BusinessException(String message)
{
this.message = message;
}
public BusinessException(String message, Throwable e)
{
super(message, e);
this.message = message;
}
@Override
public String getMessage()
{
return message;
}
}

15
demodump/src/main/java/org/example/redislimater/exception/DemoModeException.java

@ -0,0 +1,15 @@
package org.example.redislimater.exception;
/**
* 演示模式异常
*
* @author pangu
*/
public class DemoModeException extends RuntimeException
{
private static final long serialVersionUID = 1L;
public DemoModeException()
{
}
}

57
demodump/src/main/java/org/example/redislimater/exception/PGException.java

@ -0,0 +1,57 @@
/*
* Copyright (C), 2019-2020 dingyong
* FileName: PGException
* Author: dingyong
* Date: 2020/12/8
* Description: //描述
* History: //修改记录
* <author> <time> <version> <desc>
* 修改人姓名 修改时间 版本号 描述
*/
package org.example.redislimater.exception;
import com.alibaba.fastjson.JSON;
/**
* @author dingyong
* @Description: TODO
* @Date 2020/12/8
* @see [相关类/方法]可选
* @since [产品/模块版本] 可选
*/
public class PGException extends RuntimeException{
private static final long serialVersionUID = 8368117911051585269L;
private final String errorCode;
public PGException(String errorCode) {
super();
this.errorCode = errorCode;
}
public PGException(String errorCode, String message) {
super(message);
this.errorCode = errorCode;
}
public PGException(String errorCode, Throwable cause) {
super(cause);
this.errorCode = errorCode;
}
public PGException(String errorCode, String message, Throwable cause) {
super(message, cause);
this.errorCode = errorCode;
}
public String getErrorCode() {
return errorCode;
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}

63
demodump/src/main/java/org/example/redislimater/exception/ServiceException.java

@ -0,0 +1,63 @@
/*
* Copyright (C), 2019-2020 dingyong
* FileName: ServiceException
* Author: dingyong
* Date: 2020/12/7
* Description: //描述
* History: //修改记录
* <author> <time> <version> <desc>
* 修改人姓名 修改时间 版本号 描述
*/
package org.example.redislimater.exception;
import org.example.redislimater.utils.ErrorCodeEnum;
/**
* @author dingyong
* @Description: TODO
* @Date 2020/12/7
* @see [相关类/方法]可选
* @since [产品/模块版本] 可选
*/
public class ServiceException extends RuntimeException {
private String code;
public ServiceException(String code, String message) {
super(message);
this.code = code;
}
public ServiceException(String code, Throwable ex) {
super(ex);
this.code = code;
}
public ServiceException(String code, String message, Throwable ex) {
super(message, ex);
this.code = code;
}
public ServiceException(ErrorCodeEnum code) {
super(code.getValue());
this.code = code.getCode();
}
public ServiceException(ErrorCodeEnum code, String message) {
super(message);
this.code = code.getCode();
}
public ServiceException(ErrorCodeEnum code, Throwable ex) {
this(code);
}
public ServiceException(ErrorCodeEnum code, String message, Throwable ex) {
super(message, ex);
this.code = code.getCode();
}
public String getCode() {
return this.code;
}
}

26
demodump/src/main/java/org/example/redislimater/exception/UtilException.java

@ -0,0 +1,26 @@
package org.example.redislimater.exception;
/**
* 工具类异常
*
* @author pangu
*/
public class UtilException extends RuntimeException
{
private static final long serialVersionUID = 8247610319171014183L;
public UtilException(Throwable e)
{
super(e.getMessage(), e);
}
public UtilException(String message)
{
super(message);
}
public UtilException(String message, Throwable throwable)
{
super(message, throwable);
}
}

98
demodump/src/main/java/org/example/redislimater/exception/base/BaseException.java

@ -0,0 +1,98 @@
package org.example.redislimater.exception.base;
import org.example.redislimater.utils.MessageUtils;
import org.springframework.util.StringUtils;
/**
* 基础异常
*
* @author pangu
*/
public class BaseException extends RuntimeException
{
private static final long serialVersionUID = 1L;
/**
* 所属模块
*/
private String module;
/**
* 错误码
*/
private String code;
/**
* 错误码对应的参数
*/
private Object[] args;
/**
* 错误消息
*/
private String defaultMessage;
public BaseException(String module, String code, Object[] args, String defaultMessage)
{
this.module = module;
this.code = code;
this.args = args;
this.defaultMessage = defaultMessage;
}
public BaseException(String module, String code, Object[] args)
{
this(module, code, args, null);
}
public BaseException(String module, String defaultMessage)
{
this(module, null, null, defaultMessage);
}
public BaseException(String code, Object[] args)
{
this(null, code, args, null);
}
public BaseException(String defaultMessage)
{
this(null, null, null, defaultMessage);
}
@Override
public String getMessage()
{
String message = null;
if (!StringUtils.isEmpty(code))
{
message = MessageUtils.message(code, args);
}
if (message == null)
{
message = defaultMessage;
}
return message;
}
public String getModule()
{
return module;
}
public String getCode()
{
return code;
}
public Object[] getArgs()
{
return args;
}
public String getDefaultMessage()
{
return defaultMessage;
}
}

20
demodump/src/main/java/org/example/redislimater/exception/file/FileException.java

@ -0,0 +1,20 @@
package org.example.redislimater.exception.file;
import org.example.redislimater.exception.base.BaseException;
/**
* 文件信息异常类
*
* @author pangu
*/
public class FileException extends BaseException
{
private static final long serialVersionUID = 1L;
public FileException(String code, Object[] args)
{
super("file", code, args, null);
}
}

16
demodump/src/main/java/org/example/redislimater/exception/file/FileNameLengthLimitExceededException.java

@ -0,0 +1,16 @@
package org.example.redislimater.exception.file;
/**
* 文件名称超长限制异常类
*
* @author pangu
*/
public class FileNameLengthLimitExceededException extends FileException
{
private static final long serialVersionUID = 1L;
public FileNameLengthLimitExceededException(int defaultFileNameLength)
{
super("upload.filename.exceed.length", new Object[] { defaultFileNameLength });
}
}

16
demodump/src/main/java/org/example/redislimater/exception/file/FileSizeLimitExceededException.java

@ -0,0 +1,16 @@
package org.example.redislimater.exception.file;
/**
* 文件名大小限制异常类
*
* @author pangu
*/
public class FileSizeLimitExceededException extends FileException
{
private static final long serialVersionUID = 1L;
public FileSizeLimitExceededException(long defaultMaxSize)
{
super("upload.exceed.maxSize", new Object[] { defaultMaxSize });
}
}

83
demodump/src/main/java/org/example/redislimater/exception/file/InvalidExtensionException.java

@ -0,0 +1,83 @@
package org.example.redislimater.exception.file;
import org.apache.commons.fileupload.FileUploadException;
import java.util.Arrays;
/**
* 文件上传 误异常类
*
* @author pangu
*/
public class InvalidExtensionException extends FileUploadException
{
private static final long serialVersionUID = 1L;
private String[] allowedExtension;
private String extension;
private String filename;
public InvalidExtensionException(String[] allowedExtension, String extension, String filename)
{
super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString(allowedExtension) + "]");
this.allowedExtension = allowedExtension;
this.extension = extension;
this.filename = filename;
}
public String[] getAllowedExtension()
{
return allowedExtension;
}
public String getExtension()
{
return extension;
}
public String getFilename()
{
return filename;
}
public static class InvalidImageExtensionException extends InvalidExtensionException
{
private static final long serialVersionUID = 1L;
public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename)
{
super(allowedExtension, extension, filename);
}
}
public static class InvalidFlashExtensionException extends InvalidExtensionException
{
private static final long serialVersionUID = 1L;
public InvalidFlashExtensionException(String[] allowedExtension, String extension, String filename)
{
super(allowedExtension, extension, filename);
}
}
public static class InvalidMediaExtensionException extends InvalidExtensionException
{
private static final long serialVersionUID = 1L;
public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename)
{
super(allowedExtension, extension, filename);
}
}
public static class InvalidVideoExtensionException extends InvalidExtensionException
{
private static final long serialVersionUID = 1L;
public InvalidVideoExtensionException(String[] allowedExtension, String extension, String filename)
{
super(allowedExtension, extension, filename);
}
}
}

34
demodump/src/main/java/org/example/redislimater/exception/job/TaskException.java

@ -0,0 +1,34 @@
package org.example.redislimater.exception.job;
/**
* 计划策略异常
*
* @author pangu
*/
public class TaskException extends Exception
{
private static final long serialVersionUID = 1L;
private Code code;
public TaskException(String msg, Code code)
{
this(msg, code, null);
}
public TaskException(String msg, Code code, Exception nestedEx)
{
super(msg, nestedEx);
this.code = code;
}
public Code getCode()
{
return code;
}
public enum Code
{
TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE
}
}

16
demodump/src/main/java/org/example/redislimater/exception/user/CaptchaException.java

@ -0,0 +1,16 @@
package org.example.redislimater.exception.user;
/**
* 验证码错误异常类
*
* @author pangu
*/
public class CaptchaException extends UserException
{
private static final long serialVersionUID = 1L;
public CaptchaException()
{
super("user.jcaptcha.error", null);
}
}

16
demodump/src/main/java/org/example/redislimater/exception/user/RoleBlockedException.java

@ -0,0 +1,16 @@
package org.example.redislimater.exception.user;
/**
* 角色锁定异常类
*
* @author pangu
*/
public class RoleBlockedException extends UserException
{
private static final long serialVersionUID = 1L;
public RoleBlockedException()
{
super("role.blocked", null);
}
}

16
demodump/src/main/java/org/example/redislimater/exception/user/UserBlockedException.java

@ -0,0 +1,16 @@
package org.example.redislimater.exception.user;
/**
* 用户锁定异常类
*
* @author pangu
*/
public class UserBlockedException extends UserException
{
private static final long serialVersionUID = 1L;
public UserBlockedException()
{
super("user.blocked", null);
}
}

16
demodump/src/main/java/org/example/redislimater/exception/user/UserDeleteException.java

@ -0,0 +1,16 @@
package org.example.redislimater.exception.user;
/**
* 用户账号已被删除
*
* @author pangu
*/
public class UserDeleteException extends UserException
{
private static final long serialVersionUID = 1L;
public UserDeleteException()
{
super("user.password.delete", null);
}
}

19
demodump/src/main/java/org/example/redislimater/exception/user/UserException.java

@ -0,0 +1,19 @@
package org.example.redislimater.exception.user;
import org.example.redislimater.exception.base.BaseException;
/**
* 用户信息异常类
*
* @author pangu
*/
public class UserException extends BaseException
{
private static final long serialVersionUID = 1L;
public UserException(String code, Object[] args)
{
super("user", code, args, null);
}
}

16
demodump/src/main/java/org/example/redislimater/exception/user/UserNotExistsException.java

@ -0,0 +1,16 @@
package org.example.redislimater.exception.user;
/**
* 用户不存在异常类
*
* @author pangu
*/
public class UserNotExistsException extends UserException
{
private static final long serialVersionUID = 1L;
public UserNotExistsException()
{
super("user.not.exists", null);
}
}

16
demodump/src/main/java/org/example/redislimater/exception/user/UserPasswordNotMatchException.java

@ -0,0 +1,16 @@
package org.example.redislimater.exception.user;
/**
* 用户密码不正确或不符合规范异常类
*
* @author pangu
*/
public class UserPasswordNotMatchException extends UserException
{
private static final long serialVersionUID = 1L;
public UserPasswordNotMatchException()
{
super("user.password.not.match", null);
}
}

16
demodump/src/main/java/org/example/redislimater/exception/user/UserPasswordRetryLimitCountException.java

@ -0,0 +1,16 @@
package org.example.redislimater.exception.user;
/**
* 用户错误记数异常类
*
* @author pangu
*/
public class UserPasswordRetryLimitCountException extends UserException
{
private static final long serialVersionUID = 1L;
public UserPasswordRetryLimitCountException(int retryLimitCount)
{
super("user.password.retry.limit.count", new Object[] { retryLimitCount });
}
}

16
demodump/src/main/java/org/example/redislimater/exception/user/UserPasswordRetryLimitExceedException.java

@ -0,0 +1,16 @@
package org.example.redislimater.exception.user;
/**
* 用户错误最大次数异常类
*
* @author pangu
*/
public class UserPasswordRetryLimitExceedException extends UserException
{
private static final long serialVersionUID = 1L;
public UserPasswordRetryLimitExceedException(int retryLimitCount)
{
super("user.password.retry.limit.exceed", new Object[] { retryLimitCount });
}
}

88
demodump/src/main/java/org/example/redislimater/utils/CharsetKit.java

@ -0,0 +1,88 @@
package org.example.redislimater.utils;
import org.example.redislimater.StringUtils;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
/**
* 字符集工具类
*
* @author pangu
*/
public class CharsetKit
{
/** ISO-8859-1 */
public static final String ISO_8859_1 = "ISO-8859-1";
/** UTF-8 */
public static final String UTF_8 = "UTF-8";
/** GBK */
public static final String GBK = "GBK";
/** ISO-8859-1 */
public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
/** UTF-8 */
public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
/** GBK */
public static final Charset CHARSET_GBK = Charset.forName(GBK);
/**
* 转换为Charset对象
*
* @param charset 字符集为空则返回默认字符集
* @return Charset
*/
public static Charset charset(String charset)
{
return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
}
/**
* 转换字符串的字符集编码
*
* @param source 字符串
* @param srcCharset 源字符集默认ISO-8859-1
* @param destCharset 目标字符集默认UTF-8
* @return 转换后的字符集
*/
public static String convert(String source, String srcCharset, String destCharset)
{
return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
}
/**
* 转换字符串的字符集编码
*
* @param source 字符串
* @param srcCharset 源字符集默认ISO-8859-1
* @param destCharset 目标字符集默认UTF-8
* @return 转换后的字符集
*/
public static String convert(String source, Charset srcCharset, Charset destCharset)
{
if (null == srcCharset)
{
srcCharset = StandardCharsets.ISO_8859_1;
}
if (null == destCharset)
{
srcCharset = StandardCharsets.UTF_8;
}
if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset))
{
return source;
}
return new String(source.getBytes(srcCharset), destCharset);
}
/**
* @return 系统字符集编码
*/
public static String systemCharset()
{
return Charset.defaultCharset().name();
}
}

1001
demodump/src/main/java/org/example/redislimater/utils/Convert.java

File diff suppressed because it is too large

63
demodump/src/main/java/org/example/redislimater/utils/ErrorCodeEnum.java

@ -0,0 +1,63 @@
/*
* Copyright (C), 2019-2020 dingyong
* FileName: ErrorCodeEnum
* Author: dingyong
* Date: 2020/12/7
* Description: //描述
* History: //修改记录
* <author> <time> <version> <desc>
* 修改人姓名 修改时间 版本号 描述
*/
package org.example.redislimater.utils;
/**
* @author dingyong
* @Description: TODO
* @Date 2020/12/7
* @see [相关类/方法]可选
* @since [产品/模块版本] 可选
*/
public enum ErrorCodeEnum {
SYSTOM_ERROR("100001","系统错误"),
ERROR_200001("200001","接收数据失败"),
PARAM_ERROR("200002","参数不正确"),
USER_NOT_EXIST("300001","用户不存在或者密码错误"),
USER_FORBID_ERROR("300003","账号已被禁用,请与管理员联系"),
// 系统错误
UNKNOWN("500","系统内部错误,请联系管理员"),
PATH_NOT_FOUND("404","路径不存在,请检查路径"),
NO_AUTH("403","没有权限,请联系管理员"),
DUPLICATE_KEY("501","数据库中已存在该记录"),
TOKEN_GENERATOR_ERROR("502","token生成失败"),
NO_UUID("503","uuid为空"),
SQL_ILLEGAL("504","sql非法"),
//用户权限错误
INVALID_TOKEN("1001","token不合法"),
//七牛OSS错误
OSS_CONFIG_ERROR("10050","七牛配置信息错误"),
OSS_UPLOAD_ERROR("10051","OSSBookNote上传失败"),
;
private String code;
private String value;
ErrorCodeEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return this.code;
}
public String getValue() {
return this.value;
}
}

196
demodump/src/main/java/org/example/redislimater/utils/IpUtils.java

@ -0,0 +1,196 @@
package org.example.redislimater.utils;
import org.example.redislimater.StringUtils;
import javax.servlet.http.HttpServletRequest;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
* 获取IP方法
*
* @author pangu
*/
public class IpUtils
{
public static String getIpAddr(HttpServletRequest request)
{
if (request == null)
{
return "unknown";
}
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
{
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
{
ip = request.getHeader("X-Forwarded-For");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
{
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
{
ip = request.getHeader("X-Real-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
{
ip = request.getRemoteAddr();
}
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
}
public static boolean internalIp(String ip)
{
byte[] addr = textToNumericFormatV4(ip);
return internalIp(addr) || "127.0.0.1".equals(ip);
}
private static boolean internalIp(byte[] addr)
{
if (StringUtils.isNull(addr) || addr.length < 2)
{
return true;
}
final byte b0 = addr[0];
final byte b1 = addr[1];
// 10.x.x.x/8
final byte SECTION_1 = 0x0A;
// 172.16.x.x/12
final byte SECTION_2 = (byte) 0xAC;
final byte SECTION_3 = (byte) 0x10;
final byte SECTION_4 = (byte) 0x1F;
// 192.168.x.x/16
final byte SECTION_5 = (byte) 0xC0;
final byte SECTION_6 = (byte) 0xA8;
switch (b0)
{
case SECTION_1:
return true;
case SECTION_2:
if (b1 >= SECTION_3 && b1 <= SECTION_4)
{
return true;
}
case SECTION_5:
switch (b1)
{
case SECTION_6:
return true;
}
default:
return false;
}
}
/**
* 将IPv4地址转换成字节
*
* @param text IPv4地址
* @return byte 字节
*/
public static byte[] textToNumericFormatV4(String text)
{
if (text.length() == 0)
{
return null;
}
byte[] bytes = new byte[4];
String[] elements = text.split("\\.", -1);
try
{
long l;
int i;
switch (elements.length)
{
case 1:
l = Long.parseLong(elements[0]);
if ((l < 0L) || (l > 4294967295L)) {
return null;
}
bytes[0] = (byte) (int) (l >> 24 & 0xFF);
bytes[1] = (byte) (int) ((l & 0xFFFFFF) >> 16 & 0xFF);
bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
bytes[3] = (byte) (int) (l & 0xFF);
break;
case 2:
l = Integer.parseInt(elements[0]);
if ((l < 0L) || (l > 255L)) {
return null;
}
bytes[0] = (byte) (int) (l & 0xFF);
l = Integer.parseInt(elements[1]);
if ((l < 0L) || (l > 16777215L)) {
return null;
}
bytes[1] = (byte) (int) (l >> 16 & 0xFF);
bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
bytes[3] = (byte) (int) (l & 0xFF);
break;
case 3:
for (i = 0; i < 2; ++i)
{
l = Integer.parseInt(elements[i]);
if ((l < 0L) || (l > 255L)) {
return null;
}
bytes[i] = (byte) (int) (l & 0xFF);
}
l = Integer.parseInt(elements[2]);
if ((l < 0L) || (l > 65535L)) {
return null;
}
bytes[2] = (byte) (int) (l >> 8 & 0xFF);
bytes[3] = (byte) (int) (l & 0xFF);
break;
case 4:
for (i = 0; i < 4; ++i)
{
l = Integer.parseInt(elements[i]);
if ((l < 0L) || (l > 255L)) {
return null;
}
bytes[i] = (byte) (int) (l & 0xFF);
}
break;
default:
return null;
}
}
catch (NumberFormatException e)
{
return null;
}
return bytes;
}
public static String getHostIp()
{
try
{
return InetAddress.getLocalHost().getHostAddress();
}
catch (UnknownHostException e)
{
}
return "127.0.0.1";
}
public static String getHostName()
{
try
{
return InetAddress.getLocalHost().getHostName();
}
catch (UnknownHostException e)
{
}
return "未知";
}
}

27
demodump/src/main/java/org/example/redislimater/utils/MessageUtils.java

@ -0,0 +1,27 @@
package org.example.redislimater.utils;
import org.example.redislimater.utils.spring.SpringUtils;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
/**
* 获取i18n资源文件
*
* @author pangu
*/
public class MessageUtils
{
/**
* 根据消息键和参数 获取消息 委托给spring messageSource
*
* @param code 消息键
* @param args 参数
* @return 获取国际化翻译值
*/
public static String message(String code, Object... args)
{
MessageSource messageSource = SpringUtils.getBean(MessageSource.class);
return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
}
}

44
demodump/src/main/java/org/example/redislimater/utils/Recode.java

@ -0,0 +1,44 @@
/*
* Copyright (C), 2019-2020 dingyong
* FileName: Recode
* Author: dingyong
* Date: 2020/12/5
* Description: //描述
* History: //修改记录
* <author> <time> <version> <desc>
* 修改人姓名 修改时间 版本号 描述
*/
package org.example.redislimater.utils;
/**
* @author dingyong
* @Description: TODO
* @Date 2020/12/5
* @see [相关类/方法]可选
* @since [产品/模块版本] 可选
*/
public enum Recode {
SUCCESS(200,"成功"),
FAILUR(500,"失败"),
EMPTY(600,"空"),
LIMIT_ERROR(100001,"err:100001 访问失败!超过访问限制!"),
IP_ERROR(100002,"err:100002 IP为空 非法操作"),
PARAM_ERROR(100004,"err:100004 参数错误"),
CHOU_JIANG_LIMIT(100003,"抽奖次数不够"),;
private Integer code;
private String desc;
Recode(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public String getDesc() {
return desc;
}
}

93
demodump/src/main/java/org/example/redislimater/utils/StrFormatter.java

@ -0,0 +1,93 @@
package org.example.redislimater.utils;
import org.example.redislimater.StringUtils;
/**
* 字符串格式化
*
* @author pangu
*/
public class StrFormatter
{
public static final String EMPTY_JSON = "{}";
public static final char C_BACKSLASH = '\\';
public static final char C_DELIM_START = '{';
public static final char C_DELIM_END = '}';
/**
* 格式化字符串<br>
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
* 如果想输出 {} 使用 \\转义 { 即可如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
* <br>
* 通常使用format("this is {} for {}", "a", "b") -> this is a for b<br>
* 转义{} format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
* 转义\ format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
*
* @param strPattern 字符串模板
* @param argArray 参数列表
* @return 结果
*/
public static String format(final String strPattern, final Object... argArray)
{
if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray))
{
return strPattern;
}
final int strPatternLength = strPattern.length();
// 初始化定义好的长度以获得更好的性能
StringBuilder sbuf = new StringBuilder(strPatternLength + 50);
int handledPosition = 0;
int delimIndex;// 占位符所在位置
for (int argIndex = 0; argIndex < argArray.length; argIndex++)
{
delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
if (delimIndex == -1)
{
if (handledPosition == 0)
{
return strPattern;
}
else
{ // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
sbuf.append(strPattern, handledPosition, strPatternLength);
return sbuf.toString();
}
}
else
{
if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH)
{
if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH)
{
// 转义符之前还有一个转义符,占位符依旧有效
sbuf.append(strPattern, handledPosition, delimIndex - 1);
sbuf.append(Convert.utf8Str(argArray[argIndex]));
handledPosition = delimIndex + 2;
}
else
{
// 占位符被转义
argIndex--;
sbuf.append(strPattern, handledPosition, delimIndex - 1);
sbuf.append(C_DELIM_START);
handledPosition = delimIndex + 1;
}
}
else
{
// 正常占位符
sbuf.append(strPattern, handledPosition, delimIndex);
sbuf.append(Convert.utf8Str(argArray[argIndex]));
handledPosition = delimIndex + 2;
}
}
}
// 加入最后一个占位符后所有的字符
sbuf.append(strPattern, handledPosition, strPattern.length());
return sbuf.toString();
}
}

146
demodump/src/main/java/org/example/redislimater/utils/spring/SpringUtils.java

@ -0,0 +1,146 @@
package org.example.redislimater.utils.spring;
import org.example.redislimater.StringUtils;
import org.springframework.aop.framework.AopContext;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* spring工具类 方便在非spring管理环境中获取bean
*
* @author pangu
*/
@Component
public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware
{
/** Spring应用上下文环境 */
private static ConfigurableListableBeanFactory beanFactory;
private static ApplicationContext applicationContext;
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
{
SpringUtils.beanFactory = beanFactory;
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
SpringUtils.applicationContext = applicationContext;
}
/**
* 获取对象
*
* @param name
* @return Object 一个以所给名字注册的bean的实例
* @throws BeansException
*
*/
@SuppressWarnings("unchecked")
public static <T> T getBean(String name) throws BeansException
{
return (T) beanFactory.getBean(name);
}
/**
* 获取类型为requiredType的对象
*
* @param clz
* @return
* @throws BeansException
*
*/
public static <T> T getBean(Class<T> clz) throws BeansException
{
T result = (T) beanFactory.getBean(clz);
return result;
}
/**
* 如果BeanFactory包含一个与所给名称匹配的bean定义则返回true
*
* @param name
* @return boolean
*/
public static boolean containsBean(String name)
{
return beanFactory.containsBean(name);
}
/**
* 判断以给定名字注册的bean定义是一个singleton还是一个prototype 如果与给定名字相应的bean定义没有被找到将会抛出一个异常NoSuchBeanDefinitionException
*
* @param name
* @return boolean
* @throws NoSuchBeanDefinitionException
*
*/
public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException
{
return beanFactory.isSingleton(name);
}
/**
* @param name
* @return Class 注册对象的类型
* @throws NoSuchBeanDefinitionException
*
*/
public static Class<?> getType(String name) throws NoSuchBeanDefinitionException
{
return beanFactory.getType(name);
}
/**
* 如果给定的bean名字在bean定义中有别名则返回这些别名
*
* @param name
* @return
* @throws NoSuchBeanDefinitionException
*
*/
public static String[] getAliases(String name) throws NoSuchBeanDefinitionException
{
return beanFactory.getAliases(name);
}
/**
* 获取aop代理对象
*
* @param invoker
* @return
*/
@SuppressWarnings("unchecked")
public static <T> T getAopProxy(T invoker)
{
return (T) AopContext.currentProxy();
}
/**
* 获取当前的环境配置无配置返回null
*
* @return 当前的环境配置
*/
public static String[] getActiveProfiles()
{
return applicationContext.getEnvironment().getActiveProfiles();
}
/**
* 获取当前的环境配置当有多个环境配置时只获取第一个
*
* @return 当前的环境配置
*/
public static String getActiveProfile()
{
final String[] activeProfiles = getActiveProfiles();
return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null;
}
}

BIN
demodump/target/classes/org/example/function/BranchHandle.class

Binary file not shown.

BIN
demodump/target/classes/org/example/function/PresentOrElseHandler.class

Binary file not shown.

BIN
demodump/target/classes/org/example/function/ThrowExceptionFunction.class

Binary file not shown.

BIN
demodump/target/classes/org/example/function/VUtils.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/ApiCall.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/ApiCallAdvice.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/RedisUtils.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/StringUtils.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/controller/TestController.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/ApiCallException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/BusinessException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/DemoModeException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/PGException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/ServiceException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/UtilException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/base/BaseException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/file/FileException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/file/FileNameLengthLimitExceededException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/file/FileSizeLimitExceededException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/file/InvalidExtensionException$InvalidFlashExtensionException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/file/InvalidExtensionException$InvalidImageExtensionException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/file/InvalidExtensionException$InvalidMediaExtensionException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/file/InvalidExtensionException$InvalidVideoExtensionException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/file/InvalidExtensionException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/job/TaskException$Code.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/job/TaskException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/user/CaptchaException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/user/RoleBlockedException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/user/UserBlockedException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/user/UserDeleteException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/user/UserException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/user/UserNotExistsException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/user/UserPasswordNotMatchException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/user/UserPasswordRetryLimitCountException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/exception/user/UserPasswordRetryLimitExceedException.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/utils/CharsetKit.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/utils/Convert.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/utils/ErrorCodeEnum.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/utils/IpUtils.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/utils/MessageUtils.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/utils/Recode.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/utils/StrFormatter.class

Binary file not shown.

BIN
demodump/target/classes/org/example/redislimater/utils/spring/SpringUtils.class

Binary file not shown.

BIN
demodump/target/classes/org/example/strategy/Eclipse.class

Binary file not shown.

BIN
demodump/target/classes/org/example/strategy/IDEA.class

Binary file not shown.

BIN
demodump/target/classes/org/example/strategy/Program.class

Binary file not shown.

BIN
demodump/target/classes/org/example/strategy/Programmer.class

Binary file not shown.

BIN
demodump/target/demodump-1.0-SNAPSHOT.jar

Binary file not shown.

5
demodump/target/maven-archiver/pom.properties

@ -0,0 +1,5 @@
#Generated by Maven
#Wed Dec 21 00:45:43 CST 2022
version=1.0-SNAPSHOT
groupId=org.example
artifactId=demodump

47
demodump/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@ -0,0 +1,47 @@
org\example\redislimater\exception\ApiCallException.class
org\example\redislimater\exception\user\UserBlockedException.class
org\example\redislimater\exception\user\CaptchaException.class
org\example\redislimater\utils\spring\SpringUtils.class
org\example\redislimater\exception\file\FileSizeLimitExceededException.class
org\example\redislimater\exception\file\InvalidExtensionException$InvalidMediaExtensionException.class
org\example\redislimater\exception\user\UserPasswordRetryLimitExceedException.class
org\example\redislimater\StringUtils.class
org\example\redislimater\utils\MessageUtils.class
org\example\redislimater\exception\user\UserDeleteException.class
org\example\redislimater\exception\file\InvalidExtensionException$InvalidFlashExtensionException.class
org\example\redislimater\exception\user\RoleBlockedException.class
org\example\redislimater\RedisUtils.class
org\example\redislimater\exception\job\TaskException.class
org\example\redislimater\exception\PGException.class
org\example\redislimater\exception\file\InvalidExtensionException$InvalidVideoExtensionException.class
org\example\redislimater\exception\ServiceException.class
org\example\function\VUtils.class
org\example\function\PresentOrElseHandler.class
org\example\redislimater\utils\IpUtils.class
org\example\redislimater\ApiCallAdvice.class
org\example\redislimater\exception\base\BaseException.class
org\example\redislimater\ApiCall.class
org\example\redislimater\utils\ErrorCodeEnum.class
org\example\strategy\Program.class
org\example\function\BranchHandle.class
org\example\redislimater\exception\DemoModeException.class
org\example\redislimater\exception\user\UserPasswordNotMatchException.class
org\example\redislimater\utils\Convert.class
org\example\redislimater\exception\file\InvalidExtensionException$InvalidImageExtensionException.class
org\example\redislimater\exception\user\UserPasswordRetryLimitCountException.class
org\example\redislimater\exception\user\UserException.class
org\example\strategy\IDEA.class
org\example\redislimater\exception\user\UserNotExistsException.class
org\example\strategy\Programmer.class
org\example\redislimater\utils\CharsetKit.class
org\example\redislimater\exception\BusinessException.class
org\example\redislimater\exception\file\FileException.class
org\example\redislimater\exception\file\InvalidExtensionException.class
org\example\redislimater\utils\StrFormatter.class
org\example\function\ThrowExceptionFunction.class
org\example\redislimater\exception\job\TaskException$Code.class
org\example\redislimater\exception\UtilException.class
org\example\strategy\Eclipse.class
org\example\redislimater\exception\file\FileNameLengthLimitExceededException.class
org\example\redislimater\controller\TestController.class
org\example\redislimater\utils\Recode.class

42
demodump/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@ -0,0 +1,42 @@
D:\demodump\src\main\java\org\example\function\BranchHandle.java
D:\demodump\src\main\java\org\example\redislimater\exception\user\CaptchaException.java
D:\demodump\src\main\java\org\example\redislimater\utils\IpUtils.java
D:\demodump\src\main\java\org\example\redislimater\utils\MessageUtils.java
D:\demodump\src\main\java\org\example\redislimater\exception\ServiceException.java
D:\demodump\src\main\java\org\example\function\VUtils.java
D:\demodump\src\main\java\org\example\redislimater\exception\user\UserDeleteException.java
D:\demodump\src\main\java\org\example\redislimater\exception\UtilException.java
D:\demodump\src\main\java\org\example\redislimater\exception\job\TaskException.java
D:\demodump\src\main\java\org\example\redislimater\exception\ApiCallException.java
D:\demodump\src\main\java\org\example\redislimater\exception\BusinessException.java
D:\demodump\src\main\java\org\example\redislimater\exception\user\RoleBlockedException.java
D:\demodump\src\main\java\org\example\redislimater\exception\file\FileException.java
D:\demodump\src\main\java\org\example\redislimater\utils\CharsetKit.java
D:\demodump\src\main\java\org\example\redislimater\exception\PGException.java
D:\demodump\src\main\java\org\example\redislimater\exception\user\UserPasswordRetryLimitCountException.java
D:\demodump\src\main\java\org\example\redislimater\exception\base\BaseException.java
D:\demodump\src\main\java\org\example\redislimater\exception\user\UserPasswordNotMatchException.java
D:\demodump\src\main\java\org\example\redislimater\exception\user\UserBlockedException.java
D:\demodump\src\main\java\org\example\redislimater\StringUtils.java
D:\demodump\src\main\java\org\example\redislimater\utils\Convert.java
D:\demodump\src\main\java\org\example\redislimater\ApiCallAdvice.java
D:\demodump\src\main\java\org\example\redislimater\utils\spring\SpringUtils.java
D:\demodump\src\main\java\org\example\strategy\Eclipse.java
D:\demodump\src\main\java\org\example\redislimater\exception\file\FileNameLengthLimitExceededException.java
D:\demodump\src\main\java\org\example\redislimater\exception\file\InvalidExtensionException.java
D:\demodump\src\main\java\org\example\redislimater\utils\Recode.java
D:\demodump\src\main\java\org\example\strategy\Program.java
D:\demodump\src\main\java\org\example\redislimater\exception\DemoModeException.java
D:\demodump\src\main\java\org\example\redislimater\RedisUtils.java
D:\demodump\src\main\java\org\example\redislimater\utils\StrFormatter.java
D:\demodump\src\main\java\org\example\redislimater\ApiCall.java
D:\demodump\src\main\java\org\example\redislimater\controller\TestController.java
D:\demodump\src\main\java\org\example\redislimater\exception\user\UserPasswordRetryLimitExceedException.java
D:\demodump\src\main\java\org\example\redislimater\exception\user\UserNotExistsException.java
D:\demodump\src\main\java\org\example\redislimater\exception\user\UserException.java
D:\demodump\src\main\java\org\example\strategy\IDEA.java
D:\demodump\src\main\java\org\example\function\ThrowExceptionFunction.java
D:\demodump\src\main\java\org\example\function\PresentOrElseHandler.java
D:\demodump\src\main\java\org\example\strategy\Programmer.java
D:\demodump\src\main\java\org\example\redislimater\exception\file\FileSizeLimitExceededException.java
D:\demodump\src\main\java\org\example\redislimater\utils\ErrorCodeEnum.java

1
demodump/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst

@ -0,0 +1 @@
org\example\Test.class

1
demodump/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst

@ -0,0 +1 @@
D:\demodump\src\test\java\org\example\Test.java

BIN
demodump/target/test-classes/org/example/Test.class

Binary file not shown.
Loading…
Cancel
Save