malei05 4 tygodni temu
commit
a304251768
100 zmienionych plików z 4891 dodań i 0 usunięć
  1. 8 0
      .idea/.gitignore
  2. 33 0
      .idea/compiler.xml
  3. 3 0
      .idea/dictionaries/maleeeei.xml
  4. 37 0
      .idea/encodings.xml
  5. 30 0
      .idea/jarRepositories.xml
  6. 22 0
      .idea/misc.xml
  7. 6 0
      .idea/vcs.xml
  8. 349 0
      pom.xml
  9. 260 0
      yyc-common-bom/pom.xml
  10. 75 0
      yyc-common-core/pom.xml
  11. 44 0
      yyc-common-core/src/main/java/net/yyc/common/core/config/JacksonConfig.java
  12. 41 0
      yyc-common-core/src/main/java/net/yyc/common/core/config/MessageSourceConfig.java
  13. 36 0
      yyc-common-core/src/main/java/net/yyc/common/core/config/RestTemplateConfig.java
  14. 87 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/CacheConstants.java
  15. 102 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/CommonConstants.java
  16. 21 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/PaginationConstants.java
  17. 216 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/SecurityConstants.java
  18. 43 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/ServiceNameConstants.java
  19. 32 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/CommonFlag.java
  20. 36 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/DictTypeEnum.java
  21. 81 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/LoginTypeEnum.java
  22. 41 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/MenuTypeEnum.java
  23. 51 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/ProcessStatusEnum.java
  24. 51 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/ResourceTypeEnum.java
  25. 36 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/StyleTypeEnum.java
  26. 61 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/TaskStatusEnum.java
  27. 31 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/UpmsState.java
  28. 32 0
      yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/UpmsType.java
  29. 136 0
      yyc-common-core/src/main/java/net/yyc/common/core/entity/BaseMap.java
  30. 38 0
      yyc-common-core/src/main/java/net/yyc/common/core/entity/CommonColour.java
  31. 49 0
      yyc-common-core/src/main/java/net/yyc/common/core/exception/BizException.java
  32. 49 0
      yyc-common-core/src/main/java/net/yyc/common/core/exception/CheckedException.java
  33. 37 0
      yyc-common-core/src/main/java/net/yyc/common/core/exception/ValidateCodeException.java
  34. 52 0
      yyc-common-core/src/main/java/net/yyc/common/core/jackson/HnqzJavaTimeModule.java
  35. 60 0
      yyc-common-core/src/main/java/net/yyc/common/core/sensitive/Sensitive.java
  36. 109 0
      yyc-common-core/src/main/java/net/yyc/common/core/sensitive/SensitiveSerialize.java
  37. 69 0
      yyc-common-core/src/main/java/net/yyc/common/core/sensitive/SensitiveTypeEnum.java
  38. 213 0
      yyc-common-core/src/main/java/net/yyc/common/core/util/Base64Utils.java
  39. 113 0
      yyc-common-core/src/main/java/net/yyc/common/core/util/ClassUtils.java
  40. 171 0
      yyc-common-core/src/main/java/net/yyc/common/core/util/DesensitizedUtils.java
  41. 57 0
      yyc-common-core/src/main/java/net/yyc/common/core/util/HttpUtils.java
  42. 70 0
      yyc-common-core/src/main/java/net/yyc/common/core/util/Ip2Region.java
  43. 80 0
      yyc-common-core/src/main/java/net/yyc/common/core/util/R.java
  44. 127 0
      yyc-common-core/src/main/java/net/yyc/common/core/util/SpringContextHolder.java
  45. 252 0
      yyc-common-core/src/main/java/net/yyc/common/core/util/WebUtils.java
  46. 5 0
      yyc-common-core/src/main/resources/META-INF/spring.factories
  47. 10 0
      yyc-common-core/src/main/resources/banner.txt
  48. 0 0
      yyc-common-core/src/main/resources/i18n/messages_zh_CN.properties
  49. BIN
      yyc-common-core/src/main/resources/lib/beetroot-0.0.6.jar
  50. BIN
      yyc-common-core/src/main/resources/lib/ip2region.xdb
  51. BIN
      yyc-common-core/src/main/resources/xdb/ip2region.xdb
  52. 5 0
      yyc-common-core/target/classes/META-INF/spring.factories
  53. 10 0
      yyc-common-core/target/classes/banner.txt
  54. 0 0
      yyc-common-core/target/classes/i18n/messages_zh_CN.properties
  55. BIN
      yyc-common-core/target/classes/lib/beetroot-0.0.6.jar
  56. BIN
      yyc-common-core/target/classes/lib/ip2region.xdb
  57. BIN
      yyc-common-core/target/classes/xdb/ip2region.xdb
  58. 3 0
      yyc-common-core/target/maven-archiver/pom.properties
  59. 40 0
      yyc-common-core/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  60. 35 0
      yyc-common-core/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  61. 36 0
      yyc-common-datasource/pom.xml
  62. 59 0
      yyc-common-datasource/src/main/java/net/yyc/common/datasource/DynamicDataSourceAutoConfiguration.java
  63. 24 0
      yyc-common-datasource/src/main/java/net/yyc/common/datasource/annotation/EnableDynamicDataSource.java
  64. 43 0
      yyc-common-datasource/src/main/java/net/yyc/common/datasource/config/DruidDataSourceProperties.java
  65. 81 0
      yyc-common-datasource/src/main/java/net/yyc/common/datasource/config/JdbcDynamicDataSourceProvider.java
  66. 61 0
      yyc-common-datasource/src/main/java/net/yyc/common/datasource/config/LastParamDsProcessor.java
  67. 36 0
      yyc-common-datasource/src/main/java/net/yyc/common/datasource/support/DataSourceConstants.java
  68. 43 0
      yyc-common-datasource/target/classes/META-INF/spring-configuration-metadata.json
  69. 7 0
      yyc-common-datasource/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  70. 6 0
      yyc-common-datasource/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  71. 49 0
      yyc-common-ding/pom.xml
  72. 47 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/DingAutoConfiguration.java
  73. 25 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/config/DingConfig.java
  74. 28 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/CommonNotify.java
  75. 46 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/CommonRequest.java
  76. 38 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/CommonResponse.java
  77. 34 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployAccountQueryRequest.java
  78. 10 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployAccountQueryResponse.java
  79. 14 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployAccountQueryResult.java
  80. 14 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployAccountQueryResultItem.java
  81. 19 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckNotify.java
  82. 13 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckNotifyData.java
  83. 13 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckNotifyDataItem.java
  84. 41 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckRequest.java
  85. 10 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckResponse.java
  86. 14 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckResult.java
  87. 18 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckResultItem.java
  88. 41 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployFreelancesQueryRequest.java
  89. 10 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployFreelancesQueryResponse.java
  90. 13 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployFreelancesQueryResult.java
  91. 16 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployFreelancesQueryResultItem.java
  92. 19 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayNotify.java
  93. 19 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayNotifyData.java
  94. 21 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayNotifyDataItem.java
  95. 69 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayRequest.java
  96. 79 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayRequestV2.java
  97. 82 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayRequestV3.java
  98. 10 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayResponse.java
  99. 14 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayResult.java
  100. 14 0
      yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayResultSuccessItem.java

+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 33 - 0
.idea/compiler.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <profile default="true" name="Default" enabled="true" />
+      <profile name="Maven default annotation processors profile" enabled="true">
+        <sourceOutputDir name="target/generated-sources/annotations" />
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
+        <outputRelativeToContentRoot value="true" />
+        <module name="yyc-common-taxhelper" />
+        <module name="yyc-common-feign" />
+        <module name="yyc-common-oss" />
+        <module name="yyc-common-qcc" />
+        <module name="yyc-common-sequence" />
+        <module name="yyc-common-security" />
+        <module name="yyc-common-gateway" />
+        <module name="yyc-common-mq" />
+        <module name="yyc-common-datasource" />
+        <module name="yyc-common-gray" />
+        <module name="yyc-common-job" />
+        <module name="yyc-common-core" />
+        <module name="yyc-common-ding" />
+        <module name="yyc-common-sentinel" />
+      </profile>
+    </annotationProcessing>
+    <bytecodeTargetLevel>
+      <module name="yyc-auth" target="1.5" />
+      <module name="yyc-common" target="1.5" />
+      <module name="yyc-common-data" target="1.5" />
+      <module name="yyc-common-log" target="1.5" />
+    </bytecodeTargetLevel>
+  </component>
+</project>

+ 3 - 0
.idea/dictionaries/maleeeei.xml

@@ -0,0 +1,3 @@
+<component name="ProjectDictionaryState">
+  <dictionary name="maleeeei" />
+</component>

+ 37 - 0
.idea/encodings.xml

@@ -0,0 +1,37 @@
+<?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" />
+    <file url="file://$PROJECT_DIR$/yyc-common-bom/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-bom/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-core/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-core/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-datasource/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-datasource/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-ding/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-ding/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-feign/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-feign/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-gateway/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-gateway/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-gray/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-gray/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-job/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-job/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-mq/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-mq/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-oss/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-oss/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-qcc/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-qcc/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-security/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-security/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-sentinel/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-sentinel/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-sequence/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-sequence/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-taxhelper/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/yyc-common-taxhelper/src/main/resources" charset="UTF-8" />
+  </component>
+</project>

+ 30 - 0
.idea/jarRepositories.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Central Repository" />
+      <option name="url" value="https://repo.maven.apache.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="yaoyi" />
+      <option name="name" value="yaoyi" />
+      <option name="url" value="https://artifact.yaoyi.net/repository/maven-public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Central Repository" />
+      <option name="url" value="https://artifact.yaoyi.net/repository/maven-public/" />
+    </remote-repository>
+  </component>
+</project>

+ 22 - 0
.idea/misc.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="MavenProjectsManager">
+    <option name="originalFiles">
+      <list>
+        <option value="$PROJECT_DIR$/pom.xml" />
+      </list>
+    </option>
+    <option name="ignoredFiles">
+      <set>
+        <option value="$PROJECT_DIR$/yyc-auth/pom.xml" />
+        <option value="$PROJECT_DIR$/yyc-common-data/pom.xml" />
+        <option value="$PROJECT_DIR$/yyc-common-log/pom.xml" />
+        <option value="$PROJECT_DIR$/yyc-common/pom.xml" />
+      </set>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="java21" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

+ 349 - 0
pom.xml

@@ -0,0 +1,349 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<groupId>net.yyc.common</groupId>
+	<artifactId>yyc-common-parent</artifactId>
+	<version>1.0.0-SNAPSHOT</version>
+	<name>yyc-common-parent</name>
+	<packaging>pom</packaging>
+
+	<organization>
+		<name>pig4cloud</name>
+		<url>https://www.pig4cloud.com</url>
+	</organization>
+
+	<properties>
+		<spring-boot.version>2.3.12.RELEASE</spring-boot.version>
+		<spring-cloud.version>Hoxton.SR8</spring-cloud.version>
+		<spring-cloud-alibaba.version>2.2.1.RELEASE</spring-cloud-alibaba.version>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<maven.compiler.source>1.8</maven.compiler.source>
+		<maven.compiler.target>1.8</maven.compiler.target>
+		<maven.compiler.version>3.8.1</maven.compiler.version>
+		<spring.checkstyle.version>0.0.22</spring.checkstyle.version>
+		<git.commit.version>2.2.5</git.commit.version>
+		<spring-boot-admin.version>2.2.3</spring-boot-admin.version>
+		<hutool.version>5.7.7</hutool.version>
+		<kaptcha.version>1.2.0</kaptcha.version>
+		<velocity.version>1.7</velocity.version>
+		<lcn.version>4.1.0</lcn.version>
+		<jasypt.version>2.1.1</jasypt.version>
+		<ttl.version>2.11.4</ttl.version>
+		<aws.version>1.11.543</aws.version>
+		<xxl.job.version>2.2.0</xxl.job.version>
+		<activiti.version>5.22.0</activiti.version>
+		<docker.registry>172.17.0.111</docker.registry>
+		<docker.host>http://172.17.0.111:2375</docker.host>
+		<docker.namespace>library</docker.namespace>
+		<docker.username>admin</docker.username>
+		<docker.password>Harbor12345</docker.password>
+		<docker.plugin.version>0.32.0</docker.plugin.version>
+		<!--  默认忽略docker构建 -->
+		<docker.skip>true</docker.skip>
+		<!-- 移除 itextpdf 8.x 属性,因为它需要 Java 11+ -->
+		<!-- 使用与 Java 1.8 兼容的版本 -->
+		<itextpdf5.version>5.5.13.3</itextpdf5.version>
+	</properties>
+
+	<modules>
+		<module>yyc-common-bom</module>
+		<module>yyc-common-core</module>
+		<module>yyc-common-datasource</module>
+		<module>yyc-common-feign</module>
+		<module>yyc-common-gateway</module>
+		<module>yyc-common-gray</module>
+		<module>yyc-common-job</module>
+		<module>yyc-common-oss</module>
+		<module>yyc-common-security</module>
+		<module>yyc-common-sentinel</module>
+		<module>yyc-common-sequence</module>
+		<!--<module>yyc-common-swagger</module>-->
+		<!--<module>yyc-common-transaction</module>-->
+		<module>yyc-common-ding</module>
+		<module>yyc-common-taxhelper</module>
+		<module>yyc-common-qcc</module>
+		<module>yyc-common-mq</module>
+	</modules>
+
+	<dependencies>
+		<!--配置文件处理器-->
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-configuration-processor</artifactId>
+			<optional>true</optional>
+		</dependency>
+		<!--jasypt配置文件加解密-->
+		<dependency>
+			<groupId>com.github.ulisesbocchio</groupId>
+			<artifactId>jasypt-spring-boot-starter</artifactId>
+			<version>${jasypt.version}</version>
+		</dependency>
+		<!--监控-->
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-actuator</artifactId>
+		</dependency>
+		<!--监控客户端-->
+		<dependency>
+			<groupId>de.codecentric</groupId>
+			<artifactId>spring-boot-admin-starter-client</artifactId>
+			<version>${spring-boot-admin.version}</version>
+		</dependency>
+		<!--Lombok-->
+		<dependency>
+			<groupId>org.projectlombok</groupId>
+			<artifactId>lombok</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<!--测试依赖-->
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-test</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<!--文件存储-->
+		<dependency>
+			<groupId>io.minio</groupId>
+			<artifactId>minio</artifactId>
+			<version>7.1.0</version>
+		</dependency>
+	</dependencies>
+
+	<dependencyManagement>
+		<dependencies>
+			<!--hnqz 公共版本定义-->
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-bom</artifactId>
+				<version>${project.version}</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+			<!--spring boot 公共版本定义-->
+			<dependency>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-dependencies</artifactId>
+				<version>${spring-boot.version}</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+			<!--spring cloud 公共版本定义-->
+			<dependency>
+				<groupId>org.springframework.cloud</groupId>
+				<artifactId>spring-cloud-dependencies</artifactId>
+				<version>${spring-cloud.version}</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+			<!--spring cloud alibaba-->
+			<dependency>
+				<groupId>com.alibaba.cloud</groupId>
+				<artifactId>spring-cloud-alibaba-dependencies</artifactId>
+				<version>${spring-cloud-alibaba.version}</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+			<!--web 模块-->
+			<dependency>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-starter-web</artifactId>
+				<version>${spring-boot.version}</version>
+				<exclusions>
+					<!--排除tomcat依赖-->
+					<exclusion>
+						<artifactId>spring-boot-starter-tomcat</artifactId>
+						<groupId>org.springframework.boot</groupId>
+					</exclusion>
+				</exclusions>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+
+	<build>
+		<finalName>${project.name}</finalName>
+		<resources>
+			<resource>
+				<directory>src/main/resources</directory>
+				<filtering>true</filtering>
+			</resource>
+		</resources>
+		<pluginManagement>
+			<plugins>
+				<!--spring boot 默认插件-->
+				<plugin>
+					<groupId>org.springframework.boot</groupId>
+					<artifactId>spring-boot-maven-plugin</artifactId>
+					<version>${spring-boot.version}</version>
+					<executions>
+						<execution>
+							<goals>
+								<goal>repackage</goal>
+							</goals>
+						</execution>
+					</executions>
+				</plugin>
+				<!-- 配置跳过测试 -->
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-surefire-plugin</artifactId>
+					<version>2.22.2</version>
+					<configuration>
+						<skipTests>true</skipTests>
+					</configuration>
+				</plugin>
+				<!--maven  docker 打包插件 -->
+				<plugin>
+					<groupId>io.fabric8</groupId>
+					<artifactId>docker-maven-plugin</artifactId>
+					<version>${docker.plugin.version}</version>
+					<configuration>
+						<dockerHost>${docker.host}</dockerHost>
+						<registry>${docker.registry}</registry>
+						<authConfig>
+							<push>
+								<username>${docker.username}</username>
+								<password>${docker.password}</password>
+							</push>
+						</authConfig>
+						<images>
+							<image>
+								<name>${docker.registry}/${docker.namespace}/${project.name}:${project.version}</name>
+								<build>
+									<dockerFile>${project.basedir}/Dockerfile</dockerFile>
+								</build>
+							</image>
+						</images>
+					</configuration>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+		<plugins>
+			<!--代码格式插件,默认使用spring 规则-->
+			<plugin>
+				<groupId>io.spring.javaformat</groupId>
+				<artifactId>spring-javaformat-maven-plugin</artifactId>
+				<version>${spring.checkstyle.version}</version>
+			</plugin>
+			<!--代码编译指定版本插件-->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>${maven.compiler.version}</version>
+				<configuration>
+					<target>${maven.compiler.target}</target>
+					<source>${maven.compiler.source}</source>
+					<encoding>UTF-8</encoding>
+					<skip>false</skip>
+				</configuration>
+			</plugin>
+			<plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>3.1.0</version>
+            </plugin>
+			<!--打包关联最新 git commit 信息插件-->
+			<plugin>
+				<groupId>pl.project13.maven</groupId>
+				<artifactId>git-commit-id-plugin</artifactId>
+				<version>${git.commit.version}</version>
+			</plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>3.1.0</version>
+            </plugin>
+		</plugins>
+	</build>
+
+	<distributionManagement>
+		<repository>
+			<id>yaoyi</id>
+			<name>yaoyi</name>
+			<url>https://artifact.yaoyi.net/repository/maven-releases/</url>
+		</repository>
+		<snapshotRepository>
+			<id>yaoyi</id>
+			<name>yaoyi</name>
+			<url>https://artifact.yaoyi.net/repository/maven-snapshots/</url>
+		</snapshotRepository>
+	</distributionManagement>
+
+	<repositories>
+		<repository>
+			<id>yaoyi</id>
+			<name>yaoyi</name>
+			<url>https://artifact.yaoyi.net/repository/maven-public/</url>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+			<snapshots>
+				<enabled>true</enabled>
+				<updatePolicy>always</updatePolicy>
+			</snapshots>
+		</repository>
+	</repositories>
+
+	<pluginRepositories>
+		<pluginRepository>
+			<id>yaoyi</id>
+			<name>yaoyi</name>
+			<url>https://artifact.yaoyi.net/repository/maven-public/</url>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+			<snapshots>
+				<enabled>true</enabled>
+				<updatePolicy>always</updatePolicy>
+			</snapshots>
+		</pluginRepository>
+	</pluginRepositories>
+
+
+	<profiles>
+		<profile>
+			<id>dev</id>
+			<properties>
+				<profiles.active>dev</profiles.active>
+			</properties>
+			<activation>
+				<activeByDefault>true</activeByDefault>
+			</activation>
+		</profile>
+		<profile>
+			<id>pre</id>
+			<properties>
+				<profiles.active>pre</profiles.active>
+			</properties>
+		</profile>
+
+        <profile>
+            <id>pre1</id>
+			<properties>
+				<profiles.active>pre1</profiles.active>
+			</properties>
+        </profile>
+
+		<profile>
+			<id>demo</id>
+			<properties>
+				<profiles.active>demo</profiles.active>
+			</properties>
+		</profile>
+
+		<profile>
+			<id>prod</id>
+			<properties>
+				<profiles.active>prod</profiles.active>
+			</properties>
+		</profile>
+
+		<profile>
+			<id>luoxin</id>
+			<properties>
+				<profiles.active>luoxin</profiles.active>
+			</properties>
+		</profile>
+	</profiles>
+</project>

+ 260 - 0
yyc-common-bom/pom.xml

@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<artifactId>pigx-cloud-dependencies-parent</artifactId>
+		<groupId>com.pig4cloud</groupId>
+		<version>Hoxton.SR5</version>
+		<relativePath/>
+	</parent>
+
+	<groupId>net.yyc.common</groupId>
+	<artifactId>yyc-common-bom</artifactId>
+	<packaging>pom</packaging>
+	<version>1.0.0-SNAPSHOT</version>
+	<description>hnqz 公共版本控制</description>
+
+	<properties>
+		<yyc.common.version>1.0.0-SNAPSHOT</yyc.common.version>
+		<mybatis-plus.version>3.3.2</mybatis-plus.version>
+		<dynamic-ds.version>3.0.0</dynamic-ds.version>
+		<druid.version>1.1.22</druid.version>
+		<mysql.connector.version>8.0.20</mysql.connector.version>
+		<mp.weixin.version>3.7.0</mp.weixin.version>
+		<ijpay.version>1.2.0</ijpay.version>
+		<groovy.version>3.0.3</groovy.version>
+		<security.oauth.version>2.3.6.RELEASE</security.oauth.version>
+		<fastjson.version>1.2.83</fastjson.version>
+		<aliyun.version>3.0.52.ALL</aliyun.version>
+		<commons-io.version>2.8.0</commons-io.version>
+		<itext.version>5.5.13.2</itext.version>
+		<maven.deploy.skip>true</maven.deploy.skip>
+	</properties>
+
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-core</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-gateway</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-gray</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-datasource</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-job</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-oss</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-ding</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-qcc</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-security</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-sentinel</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-feign</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-sequence</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<!--<dependency>-->
+			<!--	<groupId>net.yyc.common</groupId>-->
+			<!--	<artifactId>yyc-common-swagger</artifactId>-->
+			<!--	<version>${yyc.common.version}</version>-->
+			<!--</dependency>-->
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-taxhelper</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>net.yyc.common</groupId>
+				<artifactId>yyc-common-mq</artifactId>
+				<version>${yyc.common.version}</version>
+			</dependency>
+			<!--<dependency>-->
+			<!--	<groupId>net.yyc.common</groupId>-->
+			<!--	<artifactId>yyc-common-transaction</artifactId>-->
+			<!--	<version>${yyc.common.version}</version>-->
+			<!--mybatis plus extension,包含了mybatis plus core-->
+			<dependency>
+				<groupId>com.baomidou</groupId>
+				<artifactId>mybatis-plus-extension</artifactId>
+				<version>${mybatis-plus.version}</version>
+			</dependency>
+			<!--mybatis-->
+			<dependency>
+				<groupId>com.baomidou</groupId>
+				<artifactId>mybatis-plus-boot-starter</artifactId>
+				<version>${mybatis-plus.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.baomidou</groupId>
+				<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+				<version>${dynamic-ds.version}</version>
+			</dependency>
+			<!-- druid 连接池 -->
+			<dependency>
+				<groupId>com.alibaba</groupId>
+				<artifactId>druid-spring-boot-starter</artifactId>
+				<version>${druid.version}</version>
+			</dependency>
+			<!--mysql 驱动-->
+			<dependency>
+				<groupId>mysql</groupId>
+				<artifactId>mysql-connector-java</artifactId>
+				<version>${mysql.connector.version}</version>
+			</dependency>
+			<!--fastjson-->
+			<dependency>
+				<groupId>com.alibaba</groupId>
+				<artifactId>fastjson</artifactId>
+				<version>${fastjson.version}</version>
+			</dependency>
+			<!--&lt;!&ndash;swagger 最新依赖内置版本&ndash;&gt;-->
+			<!--<dependency>-->
+			<!--	<groupId>io.swagger</groupId>-->
+			<!--	<artifactId>swagger-models</artifactId>-->
+			<!--	<version>${swagger.core.version}</version>-->
+			<!--</dependency>-->
+			<!--<dependency>-->
+			<!--	<groupId>io.swagger</groupId>-->
+			<!--	<artifactId>swagger-annotations</artifactId>-->
+			<!--	<version>${swagger.core.version}</version>-->
+			<!--</dependency>-->
+			<!-- io -->
+			<dependency>
+				<groupId>commons-io</groupId>
+				<artifactId>commons-io</artifactId>
+				<version>${commons-io.version}</version>
+			</dependency>
+			<!--微信依赖-->
+			<dependency>
+				<groupId>com.github.binarywang</groupId>
+				<artifactId>weixin-java-mp</artifactId>
+				<version>${mp.weixin.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.github.binarywang</groupId>
+				<artifactId>weixin-java-common</artifactId>
+				<version>${mp.weixin.version}</version>
+			</dependency>
+			<!--支付相关SDK-->
+			<dependency>
+				<groupId>com.github.javen205</groupId>
+				<artifactId>IJPay</artifactId>
+				<version>${ijpay.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.alipay.sdk</groupId>
+				<artifactId>alipay-sdk-java</artifactId>
+				<version>${aliyun.version}</version>
+			</dependency>
+			<!--定义groovy 版本-->
+			<dependency>
+				<groupId>org.codehaus.groovy</groupId>
+				<artifactId>groovy</artifactId>
+				<version>${groovy.version}</version>
+			</dependency>
+			<!--稳定版本,替代spring security bom内置-->
+			<dependency>
+				<groupId>org.springframework.security.oauth</groupId>
+				<artifactId>spring-security-oauth2</artifactId>
+				<version>${security.oauth.version}</version>
+			</dependency>
+			<!--pdf文档处理-->
+			<dependency>
+				<groupId>com.itextpdf</groupId>
+				<artifactId>itextpdf</artifactId>
+				<version>${itext.version}</version>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+
+	<build>
+		<plugins>
+			<!--避免和parent bom坐标不一致 -->
+			<plugin>
+				<groupId>com.pig4cloud.plugin</groupId>
+				<artifactId>spring-cloud-maven-plugin</artifactId>
+				<version>1.1.1</version>
+				<executions>
+					<execution>
+						<phase>package</phase>
+						<goals>
+							<goal>info</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<!-- nothing to do, but we need this to run docker:build form project root -->
+			<plugin>
+				<groupId>io.fabric8</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+				<version>0.32.0</version>
+				<configuration>
+					<skip>true</skip>
+				</configuration>
+			</plugin>
+			<!--代码格式插件,默认使用spring 规则-->
+			<plugin>
+				<groupId>io.spring.javaformat</groupId>
+				<artifactId>spring-javaformat-maven-plugin</artifactId>
+				<version>0.0.22</version>
+			</plugin>
+		</plugins>
+	</build>
+
+	<pluginRepositories>
+		<pluginRepository>
+			<id>yaoyi</id>
+			<name>yaoyi</name>
+			<url>https://artifact.yaoyi.net/repository/maven-public/</url>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+			<snapshots>
+				<enabled>true</enabled>
+				<updatePolicy>always</updatePolicy>
+			</snapshots>
+		</pluginRepository>
+	</pluginRepositories>
+</project>

+ 75 - 0
yyc-common-core/pom.xml

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>net.yyc.common</groupId>
+        <artifactId>yyc-common-parent</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>yyc-common-core</artifactId>
+    <packaging>jar</packaging>
+
+    <description>hnqz 公共工具类核心包</description>
+
+
+    <dependencies>
+        <dependency>
+            <!--ip归属(离线)-->
+            <groupId>org.lionsoul</groupId>
+            <artifactId>ip2region</artifactId>
+            <version>2.7.0</version>
+        </dependency>
+        <!--hutool-->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>${hutool.version}</version>
+        </dependency>
+        <!--server-api-->
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+        </dependency>
+        <!--hibernate-validator-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
+        <!--json模块-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-json</artifactId>
+        </dependency>
+        <!--TTL-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>transmittable-thread-local</artifactId>
+            <version>${ttl.version}</version>
+        </dependency>
+        <!-- commons-beanutils -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.9.4</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-extension</artifactId>
+        </dependency>
+    </dependencies>
+</project>

+ 44 - 0
yyc-common-core/src/main/java/net/yyc/common/core/config/JacksonConfig.java

@@ -0,0 +1,44 @@
+package net.yyc.common.core.config;
+
+import cn.hutool.core.date.DatePattern;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import net.yyc.common.core.jackson.HnqzJavaTimeModule;
+import org.springframework.boot.autoconfigure.AutoConfigureBefore;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
+import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.Locale;
+import java.util.TimeZone;
+
+/**
+ * JacksonConfig 配置时间转换规则
+ * {@link HnqzJavaTimeModule}、默认时区等
+ *
+ * @author L.cm
+ * @author hnqz
+ * @author lishangbu
+ * @date 2020-06-15
+ */
+@Configuration
+@ConditionalOnClass(ObjectMapper.class)
+@AutoConfigureBefore(JacksonAutoConfiguration.class)
+public class JacksonConfig {
+
+	private static final String ASIA_SHANGHAI = "Asia/Shanghai";
+
+	@Bean
+	@ConditionalOnMissingBean
+	public Jackson2ObjectMapperBuilderCustomizer customizer() {
+		return builder -> {
+			builder.locale(Locale.CHINA);
+			builder.timeZone(TimeZone.getTimeZone(ASIA_SHANGHAI));
+			builder.simpleDateFormat(DatePattern.NORM_DATETIME_PATTERN);
+			builder.modules(new HnqzJavaTimeModule());
+		};
+	}
+
+}

+ 41 - 0
yyc-common-core/src/main/java/net/yyc/common/core/config/MessageSourceConfig.java

@@ -0,0 +1,41 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.core.config;
+
+import org.springframework.context.MessageSource;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.support.ReloadableResourceBundleMessageSource;
+
+/**
+ * @author hnqz
+ * @date 2018/11/14
+ * <p>
+ * 国际化配置
+ */
+@Configuration
+public class MessageSourceConfig {
+
+	@Bean
+	public MessageSource messageSource() {
+		ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
+		messageSource.setBasename("classpath:i18n/messages");
+		return messageSource;
+	}
+
+}

+ 36 - 0
yyc-common-core/src/main/java/net/yyc/common/core/config/RestTemplateConfig.java

@@ -0,0 +1,36 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.core.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * @author hnqz
+ * @date 2018/8/16 RestTemplate
+ */
+@Configuration
+public class RestTemplateConfig {
+
+	@Bean
+	public RestTemplate restTemplate() {
+		return new RestTemplate();
+	}
+
+}

+ 87 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/CacheConstants.java

@@ -0,0 +1,87 @@
+package net.yyc.common.core.constant;
+
+/**
+ * @author hnqz
+ * @date 2019-04-28
+ * <p>
+ * 缓存的key 常量
+ */
+public interface CacheConstants {
+
+	/**
+	 * 全局缓存,在缓存名称上加上该前缀表示该缓存不区分租户,比如:
+	 * <p/>
+	 * {@code @Cacheable(value = CacheConstants.GLOBALLY+CacheConstants.MENU_DETAILS, key = "#roleId  + '_menu'", unless = "#result == null")}
+	 */
+	String GLOBALLY = "gl:";
+
+	/**
+	 * 验证码前缀
+	 */
+	String DEFAULT_CODE_KEY = "DEFAULT_CODE_KEY:";
+
+	/**
+	 * 菜单信息缓存
+	 */
+	String MENU_DETAILS = "menu_details";
+
+	/**
+	 * 用户信息缓存
+	 */
+	String USER_DETAILS = "user_details";
+
+	/**
+	 * 字典信息缓存
+	 */
+	String DICT_DETAILS = "dict_details";
+
+	/**
+	 * oauth 客户端信息
+	 */
+	String CLIENT_DETAILS_KEY = "hnqz_oauth:client:details";
+
+	/**
+	 * spring boot admin 事件key
+	 */
+	String EVENT_KEY = "event_key";
+
+	/**
+	 * 路由存放
+	 */
+	String ROUTE_KEY = "gateway_route_key";
+
+	/**
+	 * redis reload 事件
+	 */
+	String ROUTE_REDIS_RELOAD_TOPIC = "gateway_redis_route_reload_topic";
+
+	/**
+	 * 内存reload 时间
+	 */
+	String ROUTE_JVM_RELOAD_TOPIC = "gateway_jvm_route_reload_topic";
+
+	/**
+	 * 公众号 reload
+	 */
+	String MP_REDIS_RELOAD_TOPIC = "mp_redis_reload_topic";
+
+	/**
+	 * 支付 reload 事件
+	 */
+	String PAY_REDIS_RELOAD_TOPIC = "pay_redis_reload_topic";
+
+	/**
+	 * 参数缓存
+	 */
+	String PARAMS_DETAILS = "params_details";
+
+	/**
+	 * 租户缓存 (不区分租户)
+	 */
+	String TENANT_DETAILS = GLOBALLY + "tenant_details";
+
+	/**
+	 * 忘记密码前缀
+	 */
+	String FORGET_PASSWORD = "forget_password";
+}

+ 102 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/CommonConstants.java

@@ -0,0 +1,102 @@
+/*
+ *
+ *      Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the pig4cloud.com developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: hnqz
+ *
+ */
+
+package net.yyc.common.core.constant;
+
+/**
+ * @author hnqz
+ * @date 2017/10/29
+ */
+public interface CommonConstants {
+
+	/**
+	 * header 中租户ID
+	 */
+	String TENANT_ID = "TENANT-ID";
+
+	/**
+	 * header 中版本信息
+	 */
+	String VERSION = "VERSION";
+
+	/**
+	 * 租户ID
+	 */
+	Integer TENANT_ID_1 = 1;
+
+	/**
+	 * 删除
+	 */
+	String STATUS_DEL = "1";
+
+	/**
+	 * 正常
+	 */
+	String STATUS_NORMAL = "0";
+
+	/**
+	 * 锁定
+	 */
+	String STATUS_LOCK = "9";
+
+	/**
+	 * 菜单树根节点
+	 */
+	Integer MENU_TREE_ROOT_ID = -1;
+
+	/**
+	 * 编码
+	 */
+	String UTF8 = "UTF-8";
+
+	/**
+	 * 前端工程名
+	 */
+	String FRONT_END_PROJECT = "hnqz-ui";
+
+	/**
+	 * 后端工程名
+	 */
+	String BACK_END_PROJECT = "hnqz";
+
+	/**
+	 * 公共参数
+	 */
+	String PIG_PUBLIC_PARAM_KEY = "PIG_PUBLIC_PARAM_KEY";
+
+	/**
+	 * 成功标记
+	 */
+	Integer SUCCESS = 0;
+
+	/**
+	 * 失败标记
+	 */
+	Integer FAIL = 1;
+
+	/**
+	 * 默认存储bucket
+	 */
+	String BUCKET_NAME = "hnqz";
+
+	/**
+	 * 滑块验证码
+	 */
+	String IMAGE_CODE_TYPE = "blockPuzzle";
+}

+ 21 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/PaginationConstants.java

@@ -0,0 +1,21 @@
+package net.yyc.common.core.constant;
+
+/**
+ * 分页相关的参数
+ *
+ * @author lishangbu
+ * @date 2018/11/22
+ */
+public interface PaginationConstants {
+
+	/**
+	 * 当前页
+	 */
+	String CURRENT = "current";
+
+	/**
+	 * 每页大小
+	 */
+	String SIZE = "size";
+
+}

+ 216 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/SecurityConstants.java

@@ -0,0 +1,216 @@
+/*
+ *
+ *      Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the pig4cloud.com developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: hnqz
+ *
+ */
+
+package net.yyc.common.core.constant;
+
+/**
+ * @author hnqz
+ * @date 2017-12-18
+ */
+public interface SecurityConstants {
+
+	/**
+	 * 刷新
+	 */
+	String REFRESH_TOKEN = "refresh_token";
+
+	/**
+	 * 验证码有效期
+	 */
+	int CODE_TIME = 300;
+
+	/**
+	 * 验证码长度
+	 */
+	String CODE_SIZE = "4";
+
+	/**
+	 * 角色前缀
+	 */
+	String ROLE = "ROLE_";
+
+	/**
+	 * 前缀
+	 */
+	String PIGX_PREFIX = "hnqz_";
+
+	/**
+	 * oauth 相关前缀
+	 */
+	String OAUTH_PREFIX = "oauth:";
+
+	/**
+	 * 项目的license
+	 */
+	String PIGX_LICENSE = "made by hnqz";
+
+	/**
+	 * 内部
+	 */
+	String FROM_IN = "Y";
+
+	/**
+	 * 标志
+	 */
+	String FROM = "from";
+
+	/**
+	 * OAUTH URL
+	 */
+	String OAUTH_TOKEN_URL = "/oauth/token";
+
+	/**
+	 * 手机号登录URL
+	 */
+	String SMS_TOKEN_URL = "/mobile/token/sms";
+
+	/**
+	 * 社交登录URL
+	 */
+	String SOCIAL_TOKEN_URL = "/mobile/token/social";
+
+	/**
+	 * 自定义登录URL
+	 */
+	String MOBILE_TOKEN_URL = "/mobile/token/*";
+
+	/**
+	 * 微信获取OPENID
+	 */
+	String WX_AUTHORIZATION_CODE_URL = "https://api.weixin.qq.com/sns/oauth2/access_token"
+			+ "?appid=%s&secret=%s&code=%s&grant_type=authorization_code";
+
+	/**
+	 * 微信小程序OPENID
+	 */
+	String MINI_APP_AUTHORIZATION_CODE_URL = "https://api.weixin.qq.com/sns/jscode2session"
+			+ "?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code";
+
+	/**
+	 * 码云获取token
+	 */
+	String GITEE_AUTHORIZATION_CODE_URL = "https://gitee.com/oauth/token?grant_type="
+			+ "authorization_code&code=%S&client_id=%s&redirect_uri=" + "%s&client_secret=%s";
+
+	/**
+	 * 开源中国获取token
+	 */
+	String OSC_AUTHORIZATION_CODE_URL = "https://www.oschina.net/action/openapi/token";
+
+	/**
+	 * 码云获取用户信息
+	 */
+	String GITEE_USER_INFO_URL = "https://gitee.com/api/v5/user?access_token=%s";
+
+	/**
+	 * 开源中国用户信息
+	 */
+	String OSC_USER_INFO_URL = "https://www.oschina.net/action/openapi/user?access_token=%s&dataType=json";
+
+	/**
+	 * {bcrypt} 加密的特征码
+	 */
+	String BCRYPT = "{bcrypt}";
+
+	/**
+	 * sys_oauth_client_details 表的字段,不包括client_id、client_secret
+	 */
+	String CLIENT_FIELDS = "client_id, CONCAT('{noop}',client_secret) as client_secret, resource_ids, scope, "
+			+ "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
+			+ "refresh_token_validity, additional_information, autoapprove";
+
+	/**
+	 * JdbcClientDetailsService 查询语句
+	 */
+	String BASE_FIND_STATEMENT = "select " + CLIENT_FIELDS + " from sys_oauth_client_details";
+
+	/**
+	 * 按条件client_id 查询
+	 */
+	String DEFAULT_SELECT_STATEMENT = BASE_FIND_STATEMENT + " where client_id = ? and del_flag = 0 and tenant_id = %s";
+
+	/**
+	 * 资源服务器默认bean名称
+	 */
+	String RESOURCE_SERVER_CONFIGURER = "resourceServerConfigurerAdapter";
+
+	/**
+	 * 客户端模式
+	 */
+	String CLIENT_CREDENTIALS = "client_credentials";
+
+	/**
+	 * 用户ID字段
+	 */
+	String DETAILS_USER_ID = "id";
+
+	/**
+	 * 用户名
+	 */
+	String DETAILS_USERNAME = "username";
+
+	/**
+	 * 用户基本信息
+	 */
+	String DETAILS_USER = "user_info";
+
+	/**
+	 * 用户名phone
+	 */
+	String DETAILS_PHONE = "phone";
+
+	/**
+	 * 头像
+	 */
+	String DETAILS_AVATAR = "avatar";
+
+	/**
+	 * 用户部门字段
+	 */
+	String DETAILS_DEPT_ID = "deptId";
+
+	/**
+	 * 租户ID 字段
+	 */
+	String DETAILS_TENANT_ID = "tenantId";
+
+	/**
+	 * 协议字段
+	 */
+	String DETAILS_LICENSE = "license";
+
+	/**
+	 * 激活字段 兼容外围系统接入
+	 */
+	String ACTIVE = "active";
+
+	/**
+	 * AES 加密
+	 */
+	String AES = "aes";
+
+
+	String USERINFO_PLATID="platId";
+
+	String USERINFO_DRUGENTID="drugEntId";
+
+	String USERINFO_ROLES="roles";
+
+	String USERINFO_REALNAME = "realname";
+}

+ 43 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/ServiceNameConstants.java

@@ -0,0 +1,43 @@
+/*
+ *
+ *      Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the pig4cloud.com developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: hnqz
+ *
+ */
+
+package net.yyc.common.core.constant;
+
+/**
+ * @author hnqz
+ * @date 2018年06月22日16:41:01 服务名称
+ */
+public interface ServiceNameConstants {
+
+	/**
+	 * 认证中心
+	 */
+	String AUTH_SERVICE = "hnqz-auth";
+
+	/**
+	 * UMPS模块
+	 */
+	String UPMS_SERVICE = "hnqz-upms-biz";
+
+	/**
+	 * 分布式事务协调服务
+	 */
+	String TX_MANAGER = "hnqz-tx-manager";
+
+}

+ 32 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/CommonFlag.java

@@ -0,0 +1,32 @@
+package net.yyc.common.core.constant.enums;
+
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 通用标记
+ *
+ * @author jimmy
+ * @version 1.0.0
+ * @date 2022-08-15 15:08
+ */
+public class CommonFlag {
+
+	@Getter
+	@AllArgsConstructor
+	public enum OptFlag {
+		OK("OK", 0, "正常"),
+		LOCKED("LOCKED", 1, "锁定"),
+		DELETED("DELETED", 9, "删除");
+
+		private final String type;
+
+		@EnumValue
+		private final Integer code;
+
+		private final String description;
+
+
+	}
+}

+ 36 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/DictTypeEnum.java

@@ -0,0 +1,36 @@
+package net.yyc.common.core.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author hnqz
+ * @date 2019-05-16
+ * <p>
+ * 字典类型
+ */
+@Getter
+@AllArgsConstructor
+public enum DictTypeEnum {
+
+	/**
+	 * 字典类型-系统内置(不可修改)
+	 */
+	SYSTEM("1", "系统内置"),
+
+	/**
+	 * 字典类型-业务类型
+	 */
+	BIZ("0", "业务类");
+
+	/**
+	 * 类型
+	 */
+	private String type;
+
+	/**
+	 * 描述
+	 */
+	private String description;
+
+}

+ 81 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/LoginTypeEnum.java

@@ -0,0 +1,81 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.core.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author hnqz
+ * @date 2018/8/15 社交登录类型
+ */
+@Getter
+@AllArgsConstructor
+public enum LoginTypeEnum {
+
+	/**
+	 * 账号密码登录
+	 */
+	PWD("PWD", "账号密码登录"),
+
+	/**
+	 * 验证码登录
+	 */
+	SMS("SMS", "验证码登录"),
+
+	/**
+	 * QQ登录
+	 */
+	QQ("QQ", "QQ登录"),
+
+	/**
+	 * 微信登录
+	 */
+	WECHAT("WX", "微信登录"),
+
+	/**
+	 * 微信小程序
+	 */
+	MINI_APP("MINI", "微信小程序"),
+
+	/**
+	 * 码云登录
+	 */
+	GITEE("GITEE", "码云登录"),
+
+	/**
+	 * 开源中国登录
+	 */
+	OSC("OSC", "开源中国登录"),
+
+	/**
+	 * 税邦云
+	 */
+	TAX_HELPER("TAXHELPER", "税邦云");
+
+	/**
+	 * 类型
+	 */
+	private String type;
+
+	/**
+	 * 描述
+	 */
+	private String description;
+
+}

+ 41 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/MenuTypeEnum.java

@@ -0,0 +1,41 @@
+package net.yyc.common.core.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author hnqz
+ * @date 2020-02-17
+ * <p>
+ * 菜单类型
+ */
+@Getter
+@AllArgsConstructor
+public enum MenuTypeEnum {
+
+	/**
+	 * 左侧菜单
+	 */
+	LEFT_MENU("0", "left"),
+
+	/**
+	 * 顶部菜单
+	 */
+	TOP_MENU("2", "top"),
+
+	/**
+	 * 按钮
+	 */
+	BUTTON("1", "button");
+
+	/**
+	 * 类型
+	 */
+	private String type;
+
+	/**
+	 * 描述
+	 */
+	private String description;
+
+}

+ 51 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/ProcessStatusEnum.java

@@ -0,0 +1,51 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.core.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author hnqz
+ * @date 2018/9/30 流程状态
+ */
+@Getter
+@AllArgsConstructor
+public enum ProcessStatusEnum {
+
+	/**
+	 * 图片资源
+	 */
+	ACTIVE("active", "图片资源"),
+
+	/**
+	 * xml资源
+	 */
+	SUSPEND("suspend", "xml资源");
+
+	/**
+	 * 类型
+	 */
+	private final String status;
+
+	/**
+	 * 描述
+	 */
+	private final String description;
+
+}

+ 51 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/ResourceTypeEnum.java

@@ -0,0 +1,51 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.core.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author hnqz
+ * @date 2018/9/30 资源类型
+ */
+@Getter
+@AllArgsConstructor
+public enum ResourceTypeEnum {
+
+	/**
+	 * 图片资源
+	 */
+	IMAGE("image", "图片资源"),
+
+	/**
+	 * xml资源
+	 */
+	XML("xml", "xml资源");
+
+	/**
+	 * 类型
+	 */
+	private final String type;
+
+	/**
+	 * 描述
+	 */
+	private final String description;
+
+}

+ 36 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/StyleTypeEnum.java

@@ -0,0 +1,36 @@
+package net.yyc.common.core.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author hnqz
+ * @date 2020-01-19
+ * <p>
+ * 前端类型类型
+ */
+@Getter
+@AllArgsConstructor
+public enum StyleTypeEnum {
+
+	/**
+	 * 前端类型-avue 风格
+	 */
+	AVUE("0", "avue 风格"),
+
+	/**
+	 * 前端类型-element 风格
+	 */
+	ELEMENT("1", "element 风格");
+
+	/**
+	 * 类型
+	 */
+	private String style;
+
+	/**
+	 * 描述
+	 */
+	private String description;
+
+}

+ 61 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/TaskStatusEnum.java

@@ -0,0 +1,61 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.core.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author hnqz
+ * @date 2018/9/30 流程状态
+ */
+@Getter
+@AllArgsConstructor
+public enum TaskStatusEnum {
+
+	/**
+	 * 未提交
+	 */
+	UNSUBMIT("0", "未提交"),
+
+	/**
+	 * 审核中
+	 */
+	CHECK("1", "审核中"),
+
+	/**
+	 * 已完成
+	 */
+	COMPLETED("2", "已完成"),
+
+	/**
+	 * 驳回
+	 */
+	OVERRULE("9", "驳回");
+
+	/**
+	 * 类型
+	 */
+	private final String status;
+
+	/**
+	 * 描述
+	 */
+	private final String description;
+
+}

+ 31 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/UpmsState.java

@@ -0,0 +1,31 @@
+package net.yyc.common.core.constant.enums;
+
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import lombok.AccessLevel;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+/**
+ * UPMS 状态
+ *
+ * @author jimmy
+ * @version 1.0.0
+ * @date 2023-10-16 14:34
+ */
+@NoArgsConstructor(access = AccessLevel.NONE)
+public final class UpmsState {
+
+	@Getter
+	@AllArgsConstructor
+	public enum QuizState {
+		CREATE("CREATE", "未发布"),
+		RELEASE("RELEASE", "收集中"),
+		STOP("STOP", "停止发布");
+
+
+		@EnumValue
+		private String state;
+		private String description;
+	}
+}

+ 32 - 0
yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/UpmsType.java

@@ -0,0 +1,32 @@
+package net.yyc.common.core.constant.enums;
+
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import lombok.AccessLevel;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+/**
+ * UPMS类型枚举
+ *
+ * @author jimmy
+ * @version 1.0.0
+ * @date 2023-10-16 14:31
+ */
+@NoArgsConstructor(access = AccessLevel.NONE)
+public final class UpmsType {
+
+	@Getter
+	@AllArgsConstructor
+	public enum QuizSourceType {
+
+		BLANK("BLK", "空白创建"),
+		TEMPLATE("TMP", "模板");
+
+		@EnumValue
+		private String type;
+
+		private String description;
+
+	}
+}

+ 136 - 0
yyc-common-core/src/main/java/net/yyc/common/core/entity/BaseMap.java

@@ -0,0 +1,136 @@
+package net.yyc.common.core.entity;
+
+import cn.hutool.core.util.ObjectUtil;
+import lombok.NoArgsConstructor;
+import org.apache.commons.beanutils.ConvertUtils;
+
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+/**
+ * 自定义Map
+ */
+@NoArgsConstructor
+public class BaseMap extends HashMap<String, Object> {
+
+	public BaseMap(Map<String, Object> map) {
+        this.putAll(map);
+    }
+
+    @Override
+    public BaseMap put(String key, Object value) {
+        super.put(key, Optional.ofNullable(value).orElse(""));
+        return this;
+    }
+
+    public BaseMap add(String key, Object value) {
+        super.put(key, Optional.ofNullable(value).orElse(""));
+        return this;
+    }
+
+    @SuppressWarnings("unchecked")
+    public <T> T get(String key) {
+        Object obj = super.get(key);
+        if (ObjectUtil.isNotEmpty(obj)) {
+            return (T) obj;
+        } else {
+            return null;
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public Boolean getBoolean(String key) {
+        Object obj = super.get(key);
+        if (ObjectUtil.isNotEmpty(obj)) {
+            return Boolean.valueOf(obj.toString());
+        } else {
+            return false;
+        }
+    }
+
+    public Long getLong(String key) {
+        Object v = get(key);
+        if (ObjectUtil.isNotEmpty(v)) {
+            return new Long(v.toString());
+        }
+        return null;
+    }
+
+    public Long[] getLongs(String key) {
+        Object v = get(key);
+        if (ObjectUtil.isNotEmpty(v)) {
+            return (Long[]) v;
+        }
+        return null;
+    }
+
+    public List<Long> getListLong(String key) {
+        List<String> list = get(key);
+        if (ObjectUtil.isNotEmpty(list)) {
+            return list.stream().map(e -> new Long(e)).collect(Collectors.toList());
+        } else {
+            return null;
+        }
+    }
+
+    public Long[] getLongIds(String key) {
+        Object ids = get(key);
+        if (ObjectUtil.isNotEmpty(ids)) {
+            return (Long[]) ConvertUtils.convert(ids.toString().split(","), Long.class);
+        } else {
+            return null;
+        }
+    }
+
+
+    public Integer getInt(String key, Integer def) {
+        Object v = get(key);
+        if (ObjectUtil.isNotEmpty(v)) {
+            return Integer.parseInt(v.toString());
+        } else {
+            return def;
+        }
+    }
+
+    public Integer getInt(String key) {
+        Object v = get(key);
+        if (ObjectUtil.isNotEmpty(v)) {
+            return Integer.parseInt(v.toString());
+        } else {
+            return 0;
+        }
+    }
+
+    public BigDecimal getBigDecimal(String key) {
+        Object v = get(key);
+        if (ObjectUtil.isNotEmpty(v)) {
+            return new BigDecimal(v.toString());
+        }
+        return new BigDecimal("0");
+    }
+
+
+    @SuppressWarnings("unchecked")
+    public <T> T get(String key, T def) {
+        Object obj = super.get(key);
+        if (ObjectUtil.isEmpty(obj)) {
+            return def;
+        }
+        return (T) obj;
+    }
+
+    public static BaseMap toBaseMap(Map<String, Object> obj) {
+        BaseMap map = new BaseMap();
+        map.putAll(obj);
+        return map;
+    }
+
+
+    public Object getStr(String username) {
+        return get(username);
+    }
+}

+ 38 - 0
yyc-common-core/src/main/java/net/yyc/common/core/entity/CommonColour.java

@@ -0,0 +1,38 @@
+package net.yyc.common.core.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 通用颜色
+ *
+ * @author jimmy
+ * @version 1.0.0
+ * @date 2023-06-05 19:40
+ */
+@Data
+public class CommonColour implements Serializable {
+
+    private static final long serialVersionUID = 2309656570997581153L;
+
+    /**
+     * r
+     */
+    private Integer r;
+
+    /**
+     * g
+     */
+    private Integer g;
+
+    /**
+     * b
+     */
+    private Integer b;
+
+    /**
+     * 十六进制
+     */
+    private String hex;
+}

+ 49 - 0
yyc-common-core/src/main/java/net/yyc/common/core/exception/BizException.java

@@ -0,0 +1,49 @@
+/*
+ *
+ *      Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the pig4cloud.com developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: hnqz
+ *
+ */
+
+package net.yyc.common.core.exception;
+
+import lombok.NoArgsConstructor;
+
+/**
+ * @author hnqz
+ * @date 😴2018年06月22日16:21:57
+ */
+@NoArgsConstructor
+public class BizException extends RuntimeException {
+
+	private static final long serialVersionUID = 1L;
+
+	public BizException(String message) {
+		super(message);
+	}
+
+	public BizException(Throwable cause) {
+		super(cause);
+	}
+
+	public BizException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public BizException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+		super(message, cause, enableSuppression, writableStackTrace);
+	}
+
+}

+ 49 - 0
yyc-common-core/src/main/java/net/yyc/common/core/exception/CheckedException.java

@@ -0,0 +1,49 @@
+/*
+ *
+ *      Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the pig4cloud.com developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: hnqz
+ *
+ */
+
+package net.yyc.common.core.exception;
+
+import lombok.NoArgsConstructor;
+
+/**
+ * @author hnqz
+ * @date 😴2018年06月22日16:21:57
+ */
+@NoArgsConstructor
+public class CheckedException extends RuntimeException {
+
+	private static final long serialVersionUID = 1L;
+
+	public CheckedException(String message) {
+		super(message);
+	}
+
+	public CheckedException(Throwable cause) {
+		super(cause);
+	}
+
+	public CheckedException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public CheckedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+		super(message, cause, enableSuppression, writableStackTrace);
+	}
+
+}

+ 37 - 0
yyc-common-core/src/main/java/net/yyc/common/core/exception/ValidateCodeException.java

@@ -0,0 +1,37 @@
+/*
+ *
+ *      Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the pig4cloud.com developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: hnqz
+ *
+ */
+
+package net.yyc.common.core.exception;
+
+/**
+ * @author hnqz
+ * @date 2018年06月22日16:22:15
+ */
+public class ValidateCodeException extends RuntimeException {
+
+	private static final long serialVersionUID = -7285211528095468156L;
+
+	public ValidateCodeException() {
+	}
+
+	public ValidateCodeException(String msg) {
+		super(msg);
+	}
+
+}

+ 52 - 0
yyc-common-core/src/main/java/net/yyc/common/core/jackson/HnqzJavaTimeModule.java

@@ -0,0 +1,52 @@
+package net.yyc.common.core.jackson;
+
+import cn.hutool.core.date.DatePattern;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.datatype.jsr310.PackageVersion;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * java 8 时间默认序列化
+ *
+ * @author L.cm
+ * @author lishanbu
+ */
+public class HnqzJavaTimeModule extends SimpleModule {
+
+	public HnqzJavaTimeModule() {
+		super(PackageVersion.VERSION);
+
+		// ======================= 时间序列化规则 ===============================
+		// yyyy-MM-dd HH:mm:ss
+		this.addSerializer(LocalDateTime.class,
+				new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
+		// yyyy-MM-dd
+		this.addSerializer(LocalDate.class,
+				new LocalDateSerializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
+		// HH:mm:ss
+		this.addSerializer(LocalTime.class,
+				new LocalTimeSerializer(DateTimeFormatter.ofPattern(DatePattern.NORM_TIME_PATTERN)));
+
+		// ======================= 时间反序列化规则 ==============================
+		// yyyy-MM-dd HH:mm:ss
+		this.addDeserializer(LocalDateTime.class,
+				new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
+		// yyyy-MM-dd
+		this.addDeserializer(LocalDate.class,
+				new LocalDateDeserializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
+		// HH:mm:ss
+		this.addDeserializer(LocalTime.class,
+				new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DatePattern.NORM_TIME_PATTERN)));
+	}
+
+}

+ 60 - 0
yyc-common-core/src/main/java/net/yyc/common/core/sensitive/Sensitive.java

@@ -0,0 +1,60 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.core.sensitive;
+
+import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 对象脱敏注解
+ *
+ * @author mayee
+ * @version v1.0
+ **/
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+@JacksonAnnotationsInside
+@JsonSerialize(using = SensitiveSerialize.class)
+public @interface Sensitive {
+
+	/**
+	 * 脱敏数据类型, 非Customer时, 将忽略 refixNoMaskLen 和 suffixNoMaskLen 和 maskStr
+	 */
+	SensitiveTypeEnum type() default SensitiveTypeEnum.CUSTOMER;
+
+	/**
+	 * 前置不需要打码的长度
+	 */
+	int prefixNoMaskLen() default 0;
+
+	/**
+	 * 后置不需要打码的长度
+	 */
+	int suffixNoMaskLen() default 0;
+
+	/**
+	 * 用什么打码
+	 */
+	String maskStr() default "*";
+
+}

+ 109 - 0
yyc-common-core/src/main/java/net/yyc/common/core/sensitive/SensitiveSerialize.java

@@ -0,0 +1,109 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.core.sensitive;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.BeanProperty;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.ser.ContextualSerializer;
+import net.yyc.common.core.util.DesensitizedUtils;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+
+import java.io.IOException;
+import java.util.Objects;
+
+/**
+ * @author hnqz
+ * @date 2019-08-13
+ * <p>
+ * 脱敏序列化
+ */
+@NoArgsConstructor
+@AllArgsConstructor
+public class SensitiveSerialize extends JsonSerializer<String> implements ContextualSerializer {
+
+	private SensitiveTypeEnum type;
+
+	private Integer prefixNoMaskLen;
+
+	private Integer suffixNoMaskLen;
+
+	private String maskStr;
+
+	@Override
+	public void serialize(final String origin, final JsonGenerator jsonGenerator,
+			final SerializerProvider serializerProvider) throws IOException {
+		switch (type) {
+		case CHINESE_NAME:
+			jsonGenerator.writeString(DesensitizedUtils.chineseName(origin));
+			break;
+		case ID_CARD:
+			jsonGenerator.writeString(DesensitizedUtils.idCardNum(origin));
+			break;
+		case FIXED_PHONE:
+			jsonGenerator.writeString(DesensitizedUtils.fixedPhone(origin));
+			break;
+		case MOBILE_PHONE:
+			jsonGenerator.writeString(DesensitizedUtils.mobilePhone(origin));
+			break;
+		case ADDRESS:
+			jsonGenerator.writeString(DesensitizedUtils.address(origin));
+			break;
+		case EMAIL:
+			jsonGenerator.writeString(DesensitizedUtils.email(origin));
+			break;
+		case BANK_CARD:
+			jsonGenerator.writeString(DesensitizedUtils.bankCard(origin));
+			break;
+		case PASSWORD:
+			jsonGenerator.writeString(DesensitizedUtils.password(origin));
+			break;
+		case KEY:
+			jsonGenerator.writeString(DesensitizedUtils.key(origin));
+			break;
+		case CUSTOMER:
+			jsonGenerator.writeString(DesensitizedUtils.desValue(origin, prefixNoMaskLen, suffixNoMaskLen, maskStr));
+			break;
+		default:
+			throw new IllegalArgumentException("Unknow sensitive type enum " + type);
+		}
+	}
+
+	@Override
+	public JsonSerializer<?> createContextual(final SerializerProvider serializerProvider,
+			final BeanProperty beanProperty) throws JsonMappingException {
+		if (beanProperty != null) {
+			if (Objects.equals(beanProperty.getType().getRawClass(), String.class)) {
+				Sensitive sensitive = beanProperty.getAnnotation(Sensitive.class);
+				if (sensitive == null) {
+					sensitive = beanProperty.getContextAnnotation(Sensitive.class);
+				}
+				if (sensitive != null) {
+					return new SensitiveSerialize(sensitive.type(), sensitive.prefixNoMaskLen(),
+							sensitive.suffixNoMaskLen(), sensitive.maskStr());
+				}
+			}
+			return serializerProvider.findValueSerializer(beanProperty.getType(), beanProperty);
+		}
+		return serializerProvider.findNullValueSerializer(null);
+	}
+
+}

+ 69 - 0
yyc-common-core/src/main/java/net/yyc/common/core/sensitive/SensitiveTypeEnum.java

@@ -0,0 +1,69 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.core.sensitive;
+
+/**
+ * 敏感信息枚举类
+ *
+ * @author mayee
+ * @version v1.0
+ **/
+public enum SensitiveTypeEnum {
+
+	/**
+	 * 自定义
+	 */
+	CUSTOMER,
+	/**
+	 * 用户名, 刘*华, 徐*
+	 */
+	CHINESE_NAME,
+	/**
+	 * 身份证号, 110110********1234
+	 */
+	ID_CARD,
+	/**
+	 * 座机号, ****1234
+	 */
+	FIXED_PHONE,
+	/**
+	 * 手机号, 176****1234
+	 */
+	MOBILE_PHONE,
+	/**
+	 * 地址, 北京********
+	 */
+	ADDRESS,
+	/**
+	 * 电子邮件, s*****o@xx.com
+	 */
+	EMAIL,
+	/**
+	 * 银行卡, 622202************1234
+	 */
+	BANK_CARD,
+	/**
+	 * 密码, 永远是 ******, 与长度无关
+	 */
+	PASSWORD,
+	/**
+	 * 密钥, 永远是 ******, 与长度无关
+	 */
+	KEY
+
+}

+ 213 - 0
yyc-common-core/src/main/java/net/yyc/common/core/util/Base64Utils.java

@@ -0,0 +1,213 @@
+package net.yyc.common.core.util;
+
+import lombok.experimental.UtilityClass;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.IOUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+
+/**
+ * {@code Base64Utils}
+ * <p>
+ * base64工具类
+ *
+ * @author Hengchen.Sun
+ * @version 1.0.0
+ * @date 2022/03/08 14:42
+ */
+@UtilityClass
+public class Base64Utils {
+
+    /**
+     * 把图片转换为 Base64 编码的字符串
+     * 图片的格式为 data:image/png;base64,iVBORw0KGgoAAAA...
+     *
+     * @param imagePath 图片的路径
+     * @return 返回图片的 Base64 编码的字符串
+     * @throws IOException 异常
+     */
+    public static String encodeImage(String imagePath) throws IOException {
+
+        String suffix = FilenameUtils.getExtension(imagePath).toLowerCase();
+        byte[] content = FileUtils.readFileToByteArray(new File(imagePath));
+        return String.format("data:image/%s;base64,%s", suffix, Base64.encodeBase64String(content));
+    }
+
+    /**
+     * 把图片转换为 Base64 编码的字符串
+     * 图片的格式为 data:image/png;base64,iVBORw0KGgoAAAA...
+     *
+     * @param uri 图片的路径
+     * @return 返回图片的 Base64 编码的字符串
+     * @throws IOException 异常
+     */
+    public static String encodeImageWithPrefix(URI uri) throws IOException {
+
+        String suffix = FilenameUtils.getExtension(uri.toString()).toLowerCase();
+        byte[] content = IOUtils.toByteArray(uri);
+        return String.format("data:image/%s;base64,%s", suffix, encodeImage(uri));
+    }
+
+    /**
+     * 把图片转换为 Base64 编码的字符串
+     * 图片的格式为 iVBORw0KGgoAAAA...
+     *
+     * @param uri 图片的路径
+     * @return 返回图片的 Base64 编码的字符串
+     * @throws IOException 异常
+     */
+    public static String encodeImage(URI uri) throws IOException {
+
+        byte[] content = IOUtils.toByteArray(uri);
+        return  Base64.encodeBase64String(content);
+    }
+
+
+    /**
+     * 把视频转换为 Base64 编码的字符串
+     * 图片的格式为 data:video/mp4;base64,iVBORw0KGgoAAAA...
+     *
+     * @param videoPath 视频的路径
+     * @return 返回图片的 Base64 编码的字符串
+     * @throws IOException 异常
+     */
+    public static String encodeVideo(String videoPath) throws IOException {
+
+        String suffix = FilenameUtils.getExtension(videoPath).toLowerCase();
+        byte[] content = FileUtils.readFileToByteArray(new File(videoPath));
+        return String.format("data:video/%s;base64,%s", suffix, Base64.encodeBase64String(content));
+    }
+
+    /**
+     * 把视频转换为 Base64 编码的字符串
+     * 图片的格式为 data:video/mp4;base64,iVBORw0KGgoAAAA...
+     *
+     * @param file 视频
+     * @return 返回图片的 Base64 编码的字符串
+     * @throws IOException 异常
+     */
+    public static String encodeVideo(File file) throws IOException {
+
+        String suffix = FilenameUtils.getExtension(file.getAbsolutePath()).toLowerCase();
+        byte[] content = FileUtils.readFileToByteArray(file);
+        return String.format("data:video/%s;base64,%s", suffix, Base64.encodeBase64String(content));
+    }
+
+    /**
+     * 把视频转换为 Base64 编码的字符串
+     * 图片的格式含前缀为 data:video/mp4;base64,iVBORw0KGgoAAAA...
+     * 图片的格式不含前缀为 iVBORw0KGgoAAAA...
+     *
+     * @param file          视频
+     * @param containPrefix 是否包含前缀
+     * @return 返回图片的 Base64 编码的字符串
+     * @throws IOException 异常
+     */
+    public static String encodeVideo(File file, Boolean containPrefix) throws IOException {
+        byte[] content = FileUtils.readFileToByteArray(file);
+
+        if (containPrefix) {
+            String suffix = FilenameUtils.getExtension(file.getAbsolutePath()).toLowerCase();
+            return String.format("data:video/%s;base64,%s", suffix, Base64.encodeBase64String(content));
+
+        }
+
+        return Base64.encodeBase64String(content);
+    }
+
+    /**
+     * 把视频转换为 Base64 编码的字符串
+     * 图片的格式为 data:video/mp4;base64,iVBORw0KGgoAAAA...
+     *
+     * @param uri 视频的路径
+     * @return 返回图片的 Base64 编码的字符串
+     * @throws IOException 异常
+     */
+    public static String encodeVideo(URI uri) throws IOException {
+
+        String suffix = FilenameUtils.getExtension(uri.toString()).toLowerCase();
+        byte[] content = IOUtils.toByteArray(uri);
+        return String.format("data:video/%s;base64,%s", suffix, Base64.encodeBase64String(content));
+    }
+
+    /**
+     * 把视频转换为 Base64 编码的字符串
+     * 图片的格式包含前缀为 data:video/mp4;base64,iVBORw0KGgoAAAA...
+     * 图片的格式不含前缀为 iVBORw0KGgoAAAA...
+     *
+     * @param uri 视频的路径
+     * @return 返回图片的 Base64 编码的字符串
+     * @throws IOException 异常
+     */
+    public static String encodeVideo(URI uri, Boolean containPrefix) throws IOException {
+
+        byte[] content = IOUtils.toByteArray(uri);
+
+        if (containPrefix) {
+            String suffix = FilenameUtils.getExtension(uri.toString()).toLowerCase();
+            return String.format("data:video/%s;base64,%s", suffix, Base64.encodeBase64String(content));
+        }
+
+        return Base64.encodeBase64String(content);
+    }
+
+    /**
+     * 把pdf转换为 Base64 编码的字符串
+     * 格式为 data:application/pdf;base64,iVBORw0KGgoAAAA...
+     *
+     * @param pdfPath pdf的路径
+     * @return 返回图片的 Base64 编码的字符串
+     * @throws IOException 异常
+     */
+    public static String encodePDFWithPrefix(String pdfPath) throws IOException {
+
+        return String.format("data:application/pdf;base64,%s", encodePDF(pdfPath));
+    }
+
+    /**
+     * 把pdf转换为 Base64 编码的字符串
+     * 格式为 iVBORw0KGgoAAAA...
+     *
+     * @param pdfPath pdf的路径
+     * @return 返回图片的 Base64 编码的字符串
+     * @throws IOException 异常
+     */
+    public static String encodePDF(String pdfPath) throws IOException {
+
+        byte[] content = FileUtils.readFileToByteArray(new File(pdfPath));
+        return Base64.encodeBase64String(content);
+    }
+
+    /**
+     * 把pdf转换为 Base64 编码的字符串
+     * 格式为 data:application/pdf;base64,iVBORw0KGgoAAAA...
+     *
+     * @param uri pdf路径
+     * @return 返回图片的 Base64 编码的字符串
+     * @throws IOException 异常
+     */
+    public static String encodePDFWhithPrefix(URI uri) throws IOException {
+
+        return String.format("data:application/pdf;base64,%s", encodePDF(uri));
+    }
+
+    /**
+     * 把pdf转换为 Base64 编码的字符串
+     * 格式为 iVBORw0KGgoAAAA...
+     *
+     * @param uri pdf路径
+     * @return 返回图片的 Base64 编码的字符串
+     * @throws IOException 异常
+     */
+    public static String encodePDF(URI uri) throws IOException {
+
+        byte[] content = IOUtils.toByteArray(uri);
+        return Base64.encodeBase64String(content);
+    }
+
+
+}

+ 113 - 0
yyc-common-core/src/main/java/net/yyc/common/core/util/ClassUtils.java

@@ -0,0 +1,113 @@
+/*
+ *
+ *      Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the pig4cloud.com developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: hnqz
+ *
+ */
+
+package net.yyc.common.core.util;
+
+import lombok.experimental.UtilityClass;
+import org.springframework.core.BridgeMethodResolver;
+import org.springframework.core.DefaultParameterNameDiscoverer;
+import org.springframework.core.MethodParameter;
+import org.springframework.core.ParameterNameDiscoverer;
+import org.springframework.core.annotation.AnnotatedElementUtils;
+import org.springframework.core.annotation.SynthesizingMethodParameter;
+import org.springframework.web.method.HandlerMethod;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+/**
+ * 类工具类
+ *
+ * @author L.cm
+ */
+@UtilityClass
+public class ClassUtils extends org.springframework.util.ClassUtils {
+
+	private final ParameterNameDiscoverer PARAMETERNAMEDISCOVERER = new DefaultParameterNameDiscoverer();
+
+	/**
+	 * 获取方法参数信息
+	 * @param constructor 构造器
+	 * @param parameterIndex 参数序号
+	 * @return {MethodParameter}
+	 */
+	public MethodParameter getMethodParameter(Constructor<?> constructor, int parameterIndex) {
+		MethodParameter methodParameter = new SynthesizingMethodParameter(constructor, parameterIndex);
+		methodParameter.initParameterNameDiscovery(PARAMETERNAMEDISCOVERER);
+		return methodParameter;
+	}
+
+	/**
+	 * 获取方法参数信息
+	 * @param method 方法
+	 * @param parameterIndex 参数序号
+	 * @return {MethodParameter}
+	 */
+	public MethodParameter getMethodParameter(Method method, int parameterIndex) {
+		MethodParameter methodParameter = new SynthesizingMethodParameter(method, parameterIndex);
+		methodParameter.initParameterNameDiscovery(PARAMETERNAMEDISCOVERER);
+		return methodParameter;
+	}
+
+	/**
+	 * 获取Annotation
+	 * @param method Method
+	 * @param annotationType 注解类
+	 * @param <A> 泛型标记
+	 * @return {Annotation}
+	 */
+	public <A extends Annotation> A getAnnotation(Method method, Class<A> annotationType) {
+		Class<?> targetClass = method.getDeclaringClass();
+		// The method may be on an interface, but we need attributes from the target
+		// class.
+		// If the target class is null, the method will be unchanged.
+		Method specificMethod = ClassUtils.getMostSpecificMethod(method, targetClass);
+		// If we are dealing with method with generic parameters, find the original
+		// method.
+		specificMethod = BridgeMethodResolver.findBridgedMethod(specificMethod);
+		// 先找方法,再找方法上的类
+		A annotation = AnnotatedElementUtils.findMergedAnnotation(specificMethod, annotationType);
+		;
+		if (null != annotation) {
+			return annotation;
+		}
+		// 获取类上面的Annotation,可能包含组合注解,故采用spring的工具类
+		return AnnotatedElementUtils.findMergedAnnotation(specificMethod.getDeclaringClass(), annotationType);
+	}
+
+	/**
+	 * 获取Annotation
+	 * @param handlerMethod HandlerMethod
+	 * @param annotationType 注解类
+	 * @param <A> 泛型标记
+	 * @return {Annotation}
+	 */
+	public <A extends Annotation> A getAnnotation(HandlerMethod handlerMethod, Class<A> annotationType) {
+		// 先找方法,再找方法上的类
+		A annotation = handlerMethod.getMethodAnnotation(annotationType);
+		if (null != annotation) {
+			return annotation;
+		}
+		// 获取类上面的Annotation,可能包含组合注解,故采用spring的工具类
+		Class<?> beanType = handlerMethod.getBeanType();
+		return AnnotatedElementUtils.findMergedAnnotation(beanType, annotationType);
+	}
+
+}

+ 171 - 0
yyc-common-core/src/main/java/net/yyc/common/core/util/DesensitizedUtils.java

@@ -0,0 +1,171 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.core.util;
+
+import cn.hutool.core.util.StrUtil;
+
+/**
+ * 脱敏工具类
+ *
+ * @author mayee
+ * @version v1.0
+ **/
+public class DesensitizedUtils {
+
+	/**
+	 * 对字符串进行脱敏操作
+	 * @param origin 原始字符串
+	 * @param prefixNoMaskLen 左侧需要保留几位明文字段
+	 * @param suffixNoMaskLen 右侧需要保留几位明文字段
+	 * @param maskStr 用于遮罩的字符串, 如'*'
+	 * @return 脱敏后结果
+	 */
+	public static String desValue(String origin, int prefixNoMaskLen, int suffixNoMaskLen, String maskStr) {
+		if (origin == null) {
+			return null;
+		}
+
+		StringBuilder sb = new StringBuilder();
+		for (int i = 0, n = origin.length(); i < n; i++) {
+			if (i < prefixNoMaskLen) {
+				sb.append(origin.charAt(i));
+				continue;
+			}
+			if (i > (n - suffixNoMaskLen - 1)) {
+				sb.append(origin.charAt(i));
+				continue;
+			}
+			sb.append(maskStr);
+		}
+		return sb.toString();
+	}
+
+	/**
+	 * 【中文姓名】只显示最后一个汉字,其他隐藏为星号,比如:**梦
+	 * @param fullName 姓名
+	 * @return 结果
+	 */
+	public static String chineseName(String fullName) {
+		if (fullName == null) {
+			return null;
+		}
+		return desValue(fullName, 0, 1, "*");
+	}
+
+	/**
+	 * 【身份证号】显示前六位, 四位,其他隐藏。共计18位或者15位,比如:340304*******1234
+	 * @param id 身份证号码
+	 * @return 结果
+	 */
+	public static String idCardNum(String id) {
+		return desValue(id, 6, 4, "*");
+	}
+
+	/**
+	 * 【固定电话】后四位,其他隐藏,比如 ****1234
+	 * @param num 固定电话
+	 * @return 结果
+	 */
+	public static String fixedPhone(String num) {
+		return desValue(num, 0, 4, "*");
+	}
+
+	/**
+	 * 【手机号码】前三位,后四位,其他隐藏,比如135****6810
+	 * @param num 手机号码
+	 * @return 结果
+	 */
+	public static String mobilePhone(String num) {
+		return desValue(num, 3, 4, "*");
+	}
+
+	/**
+	 * 【地址】只显示到地区,不显示详细地址,比如:北京市海淀区****
+	 * @param address 地址
+	 * @return 结果
+	 */
+	public static String address(String address) {
+		return desValue(address, 6, 0, "*");
+	}
+
+	/**
+	 * 【电子邮箱 邮箱前缀仅显示第一个字母,前缀其他隐藏,用星号代替,@及后面的地址显示,比如:d**@126.com
+	 * @param email 电子邮箱
+	 * @return 结果
+	 */
+	public static String email(String email) {
+		if (email == null) {
+			return null;
+		}
+		int index = StrUtil.indexOf(email, '@');
+		if (index <= 1) {
+			return email;
+		}
+		String preEmail = desValue(email.substring(0, index), 1, 0, "*");
+		return preEmail + email.substring(index);
+
+	}
+
+	/**
+	 * 【银行卡号】前六位,后四位,其他用星号隐藏每位1个星号,比如:622260**********1234
+	 * @param cardNum 银行卡号
+	 * @return 结果
+	 */
+	public static String bankCard(String cardNum) {
+		return desValue(cardNum, 6, 4, "*");
+	}
+
+	/**
+	 * 【密码】密码的全部字符都用*代替,比如:******
+	 * @param password 密码
+	 * @return 结果
+	 */
+	public static String password(String password) {
+		if (password == null) {
+			return null;
+		}
+		return "******";
+	}
+
+	/**
+	 * 【密钥】密钥除了最后三位,全部都用*代替,比如:***xdS 脱敏后长度为6,如果明文长度不足三位,则按实际长度显示,剩余位置补*
+	 * @param key 密钥
+	 * @return 结果
+	 */
+	public static String key(String key) {
+		if (key == null) {
+			return null;
+		}
+		int viewLength = 6;
+		StringBuilder tmpKey = new StringBuilder(desValue(key, 0, 3, "*"));
+		if (tmpKey.length() > viewLength) {
+			return tmpKey.substring(tmpKey.length() - viewLength);
+		}
+		else if (tmpKey.length() < viewLength) {
+			int buffLength = viewLength - tmpKey.length();
+			for (int i = 0; i < buffLength; i++) {
+				tmpKey.insert(0, "*");
+			}
+			return tmpKey.toString();
+		}
+		else {
+			return tmpKey.toString();
+		}
+	}
+
+}

+ 57 - 0
yyc-common-core/src/main/java/net/yyc/common/core/util/HttpUtils.java

@@ -0,0 +1,57 @@
+package net.yyc.common.core.util;
+
+import cn.hutool.core.util.CharUtil;
+import cn.hutool.core.util.StrUtil;
+import lombok.experimental.UtilityClass;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * http 工具类 获取请求中的参数
+ *
+ * @author show
+ * @date 14:23 2019/5/29
+ */
+@UtilityClass
+public class HttpUtils {
+
+
+    /**
+     * 获取请求IP地址
+     *
+     * @param request
+     * @return
+     */
+    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();
+        }
+        //"***.***.***.***".length() = 15
+        if (StrUtil.isNotBlank(ip) && ip.length() > 15) {
+            if (ip.indexOf(CharUtil.COMMA) > 0) {
+                ip = ip.substring(0, ip.indexOf(","));
+            }
+        }
+        // 处理获取多个ip地址情况 nginx多层代理会出现多个ip 第一个为真实ip地址
+        return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
+    }
+
+
+}

+ 70 - 0
yyc-common-core/src/main/java/net/yyc/common/core/util/Ip2Region.java

@@ -0,0 +1,70 @@
+package net.yyc.common.core.util;
+
+import org.apache.commons.io.FileUtils;
+import org.lionsoul.ip2region.xdb.Searcher;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Ip工具类
+ *
+ * @author jimmy
+ * @version 1.0.0
+ * @date 2022-12-21 14:41
+ */
+public final class Ip2Region {
+
+    private static final Logger log = LoggerFactory.getLogger(Ip2Region.class);
+
+    /**
+     * 搜索器
+     */
+    private Searcher searcher;
+
+    /**
+     * 从 dbPath 加载整个 xdb 到内存。
+     */
+    public Ip2Region() {
+
+        try {
+            byte[] cBuff = Searcher.loadContentFromFile("/ip2region.xdb");
+            searcher = Searcher.newWithBuffer(cBuff);
+        } catch (IOException e) {
+            log.warn("从dbPath加载整个xdb到内存失败", e);
+        }
+    }
+
+    /**
+     * 获取IP属地
+     * <p>
+     * 格式为:[province]·[city]
+     * </p>
+     *
+     * @param remoteIp 远程IP
+     * @return IP属地
+     */
+    public String toRegion(final String remoteIp) throws RuntimeException {
+
+        try {
+
+            // 查询IP属地
+            long sTime = System.nanoTime();
+            String search = searcher.search(remoteIp);
+            long cost = TimeUnit.NANOSECONDS.toMicros(System.nanoTime() - sTime);
+            log.info("{region: {}, ioCount: {}, took: {} μs}", search, searcher.getIOCount(), cost);
+
+            // 封装为固定格式[province]·[city]
+            search = search.replace("|0", "").replace("0|", "");
+            String[] split = search.split("\\|");
+            return (split.length == 2) ? split[0] + "·" + split[1] : split[1] + "·" + split[2];
+
+        } catch (Exception e) {
+            log.error("获取IP属地失败", e);
+            throw new RuntimeException(e.getMessage());
+        }
+    }
+
+}

+ 80 - 0
yyc-common-core/src/main/java/net/yyc/common/core/util/R.java

@@ -0,0 +1,80 @@
+package net.yyc.common.core.util;
+
+import net.yyc.common.core.constant.CommonConstants;
+import lombok.*;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * 响应信息主体
+ *
+ * @param <T>
+ * @author hnqz
+ */
+@Builder
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+@Accessors(chain = true)
+public class R<T> implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	@Getter
+	@Setter
+	private int code;
+
+	@Getter
+	@Setter
+	private String msg;
+
+	@Getter
+	@Setter
+	private T data;
+
+	public boolean isSuccess() {
+		return this.code == CommonConstants.SUCCESS;
+	}
+
+	public static <T> R<T> ok() {
+		return restResult(null, CommonConstants.SUCCESS, null);
+	}
+
+	public static <T> R<T> ok(T data) {
+		return restResult(data, CommonConstants.SUCCESS, null);
+	}
+
+	public static <T> R<T> ok(T data, String msg) {
+		return restResult(data, CommonConstants.SUCCESS, msg);
+	}
+
+	public static <T> R<T> failed() {
+		return restResult(null, CommonConstants.FAIL, null);
+	}
+
+	public static <T> R<T> failed(String msg) {
+		return restResult(null, CommonConstants.FAIL, msg);
+	}
+
+	public static <T> R<T> failed(T data) {
+		return restResult(data, CommonConstants.FAIL, null);
+	}
+
+	public static <T> R<T> failed(T data, String msg) {
+		return restResult(data, CommonConstants.FAIL, msg);
+	}
+
+	public static <T> R<T> failed(T data, int code, String msg) {
+		return restResult(data, code, msg);
+	}
+
+	private static <T> R<T> restResult(T data, int code, String msg) {
+		R<T> apiResult = new R<>();
+		apiResult.setCode(code);
+		apiResult.setData(data);
+		apiResult.setMsg(msg);
+		return apiResult;
+	}
+
+}

+ 127 - 0
yyc-common-core/src/main/java/net/yyc/common/core/util/SpringContextHolder.java

@@ -0,0 +1,127 @@
+/*
+ *
+ *      Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the pig4cloud.com developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: hnqz
+ *
+ */
+
+package net.yyc.common.core.util;
+
+import cn.hutool.core.util.StrUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author hnqz
+ * @date 2018/6/27 Spring 工具类
+ */
+@Slf4j
+@Service
+@Lazy(false)
+public class SpringContextHolder implements ApplicationContextAware, DisposableBean {
+
+	private static ApplicationContext applicationContext = null;
+
+	/**
+	 * 取得存储在静态变量中的ApplicationContext.
+	 */
+	public static ApplicationContext getApplicationContext() {
+		return applicationContext;
+	}
+
+	/**
+	 * 实现ApplicationContextAware接口, 注入Context到静态变量中.
+	 */
+	@Override
+	public void setApplicationContext(ApplicationContext applicationContext) {
+		SpringContextHolder.applicationContext = applicationContext;
+	}
+
+	/**
+	 * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型.
+	 */
+	@SuppressWarnings("unchecked")
+	public static <T> T getBean(String name) {
+		return (T) applicationContext.getBean(name);
+	}
+
+	/**
+	 * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型.
+	 */
+	public static <T> T getBean(Class<T> requiredType) {
+		return applicationContext.getBean(requiredType);
+	}
+
+	/**
+	 * 清除SpringContextHolder中的ApplicationContext为Null.
+	 */
+	public static void clearHolder() {
+		if (log.isDebugEnabled()) {
+			log.debug("清除SpringContextHolder中的ApplicationContext:" + applicationContext);
+		}
+		applicationContext = null;
+	}
+
+	/**
+	 * 发布事件
+	 * @param event
+	 */
+	public static void publishEvent(ApplicationEvent event) {
+		if (applicationContext == null) {
+			return;
+		}
+		applicationContext.publishEvent(event);
+	}
+
+	/**
+	 * 实现DisposableBean接口, 在Context关闭时清理静态变量.
+	 */
+	@Override
+	public void destroy() {
+		SpringContextHolder.clearHolder();
+	}
+
+	/**
+	 * 从静态变量ApplicationContext中取得Bean, 自动转型为所赋值对象的类型.
+	 */
+	public static <T> T getHandler(String name, Class<T> cls) {
+		T t = null;
+		if (StrUtil.isNotBlank(name)) {
+			checkApplicationContext();
+			try {
+				t = applicationContext.getBean(name, cls);
+			} catch (Exception e) {
+				log.error("####################" + name + "未定义");
+			}
+		}
+		return t;
+	}
+
+	/**
+	 * 检查
+	 */
+	private static void checkApplicationContext() {
+		if (applicationContext == null) {
+			throw new IllegalStateException("applicaitonContext未注入,请在applicationContext.xml中定义SpringContextHolder");
+		}
+	}
+
+
+}

+ 252 - 0
yyc-common-core/src/main/java/net/yyc/common/core/util/WebUtils.java

@@ -0,0 +1,252 @@
+/*
+ *
+ *      Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the pig4cloud.com developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: hnqz
+ *
+ */
+
+package net.yyc.common.core.util;
+
+import cn.hutool.core.codec.Base64;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
+import net.yyc.common.core.exception.CheckedException;
+import lombok.experimental.UtilityClass;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.MediaType;
+import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+import org.springframework.web.method.HandlerMethod;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.nio.charset.StandardCharsets;
+import java.util.Optional;
+
+/**
+ * Miscellaneous utilities for web applications.
+ *
+ * @author L.cm
+ */
+@Slf4j
+@UtilityClass
+public class WebUtils extends org.springframework.web.util.WebUtils {
+
+	private final String BASIC_ = "Basic ";
+
+	private final String UNKNOWN = "unknown";
+
+	/**
+	 * 判断是否ajax请求 spring ajax 返回含有 ResponseBody 或者 RestController注解
+	 * @param handlerMethod HandlerMethod
+	 * @return 是否ajax请求
+	 */
+	public boolean isBody(HandlerMethod handlerMethod) {
+		ResponseBody responseBody = ClassUtils.getAnnotation(handlerMethod, ResponseBody.class);
+		return responseBody != null;
+	}
+
+	/**
+	 * 读取cookie
+	 * @param name cookie name
+	 * @return cookie value
+	 */
+	public String getCookieVal(String name) {
+		HttpServletRequest request = WebUtils.getRequest();
+		Assert.notNull(request, "request from RequestContextHolder is null");
+		return getCookieVal(request, name);
+	}
+
+	/**
+	 * 读取cookie
+	 * @param request HttpServletRequest
+	 * @param name cookie name
+	 * @return cookie value
+	 */
+	public String getCookieVal(HttpServletRequest request, String name) {
+		Cookie cookie = getCookie(request, name);
+		return cookie != null ? cookie.getValue() : null;
+	}
+
+	/**
+	 * 清除 某个指定的cookie
+	 * @param response HttpServletResponse
+	 * @param key cookie key
+	 */
+	public void removeCookie(HttpServletResponse response, String key) {
+		setCookie(response, key, null, 0);
+	}
+
+	/**
+	 * 设置cookie
+	 * @param response HttpServletResponse
+	 * @param name cookie name
+	 * @param value cookie value
+	 * @param maxAgeInSeconds maxage
+	 */
+	public void setCookie(HttpServletResponse response, String name, String value, int maxAgeInSeconds) {
+		Cookie cookie = new Cookie(name, value);
+		cookie.setPath("/");
+		cookie.setMaxAge(maxAgeInSeconds);
+		cookie.setHttpOnly(true);
+		response.addCookie(cookie);
+	}
+
+	/**
+	 * 获取 HttpServletRequest
+	 * @return {HttpServletRequest}
+	 */
+	public HttpServletRequest getRequest() {
+		try {
+			RequestAttributes requestAttributes = RequestContextHolder.currentRequestAttributes();
+			return ((ServletRequestAttributes) requestAttributes).getRequest();
+		}
+		catch (IllegalStateException e) {
+			return null;
+		}
+	}
+
+	/**
+	 * 获取 HttpServletResponse
+	 * @return {HttpServletResponse}
+	 */
+	public HttpServletResponse getResponse() {
+		return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
+	}
+
+	/**
+	 * 返回json
+	 * @param response HttpServletResponse
+	 * @param result 结果对象
+	 */
+	public void renderJson(HttpServletResponse response, Object result) {
+		renderJson(response, result, MediaType.APPLICATION_JSON_VALUE);
+	}
+
+	/**
+	 * 返回json
+	 * @param response HttpServletResponse
+	 * @param result 结果对象
+	 * @param contentType contentType
+	 */
+	public void renderJson(HttpServletResponse response, Object result, String contentType) {
+		response.setCharacterEncoding("UTF-8");
+		response.setContentType(contentType);
+		try (PrintWriter out = response.getWriter()) {
+			out.append(JSONUtil.toJsonStr(result));
+		}
+		catch (IOException e) {
+			log.error(e.getMessage(), e);
+		}
+	}
+
+	/**
+	 * 获取ip
+	 * @return {String}
+	 */
+	public String getIP() {
+		return getIP(WebUtils.getRequest());
+	}
+
+	/**
+	 * 获取ip
+	 * @param request HttpServletRequest
+	 * @return {String}
+	 */
+	public String getIP(HttpServletRequest request) {
+		Assert.notNull(request, "HttpServletRequest is null");
+		String ip = request.getHeader("X-Requested-For");
+		if (StrUtil.isBlank(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+			ip = request.getHeader("X-Forwarded-For");
+		}
+		if (StrUtil.isBlank(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+			ip = request.getHeader("Proxy-Client-IP");
+		}
+		if (StrUtil.isBlank(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+			ip = request.getHeader("WL-Proxy-Client-IP");
+		}
+		if (StrUtil.isBlank(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+			ip = request.getHeader("HTTP_CLIENT_IP");
+		}
+		if (StrUtil.isBlank(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+			ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+		}
+		if (StrUtil.isBlank(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+			ip = request.getRemoteAddr();
+		}
+		return StrUtil.isBlank(ip) ? null : ip.split(",")[0];
+	}
+
+	/**
+	 * 解析 client id
+	 * @param header
+	 * @param defVal
+	 * @return 如果解析失败返回默认值
+	 */
+	public String extractClientId(String header, final String defVal) {
+
+		if (header == null || !header.startsWith(BASIC_)) {
+			log.debug("请求头中client信息为空: {}", header);
+			return defVal;
+		}
+		byte[] base64Token = header.substring(6).getBytes(StandardCharsets.UTF_8);
+		byte[] decoded;
+		try {
+			decoded = Base64.decode(base64Token);
+		}
+		catch (IllegalArgumentException e) {
+			log.debug("Failed to decode basic authentication token: {}", header);
+			return defVal;
+		}
+
+		String token = new String(decoded, StandardCharsets.UTF_8);
+
+		int delim = token.indexOf(":");
+
+		if (delim == -1) {
+			log.debug("Invalid basic authentication token: {}", header);
+			return defVal;
+		}
+		return token.substring(0, delim);
+	}
+
+	/**
+	 * 从请求头中解析 client id
+	 * @param header
+	 * @return
+	 */
+	public Optional<String> extractClientId(String header) {
+		return Optional.ofNullable(extractClientId(header, null));
+	}
+
+	/**
+	 * 从request 获取CLIENT_ID
+	 * @return
+	 */
+	public String getClientId(String header) {
+		String clientId = extractClientId(header, null);
+		if (clientId == null) {
+			throw new CheckedException("Invalid basic authentication token");
+		}
+		return clientId;
+	}
+
+}

+ 5 - 0
yyc-common-core/src/main/resources/META-INF/spring.factories

@@ -0,0 +1,5 @@
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+  net.yyc.common.core.config.JacksonConfig,\
+  net.yyc.common.core.config.MessageSourceConfig,\
+  net.yyc.common.core.config.RestTemplateConfig,\
+  net.yyc.common.core.util.SpringContextHolder

+ 10 - 0
yyc-common-core/src/main/resources/banner.txt

@@ -0,0 +1,10 @@
+${AnsiColor.BRIGHT_YELLOW}
+
+██╗   ██╗ █████╗  ██████╗     ██╗   ██╗██╗    ██╗   ██╗██╗   ██╗███╗   ██╗
+╚██╗ ██╔╝██╔══██╗██╔═══██╗    ╚██╗ ██╔╝██║    ╚██╗ ██╔╝██║   ██║████╗  ██║
+ ╚████╔╝ ███████║██║   ██║     ╚████╔╝ ██║     ╚████╔╝ ██║   ██║██╔██╗ ██║
+  ╚██╔╝  ██╔══██║██║   ██║      ╚██╔╝  ██║      ╚██╔╝  ██║   ██║██║╚██╗██║
+   ██║   ██║  ██║╚██████╔╝       ██║   ██║       ██║   ╚██████╔╝██║ ╚████║
+   ╚═╝   ╚═╝  ╚═╝ ╚═════╝        ╚═╝   ╚═╝       ╚═╝    ╚═════╝ ╚═╝  ╚═══╝
+
+                           https://www.yaoyi.net

+ 0 - 0
yyc-common-core/src/main/resources/i18n/messages_zh_CN.properties


BIN
yyc-common-core/src/main/resources/lib/beetroot-0.0.6.jar


BIN
yyc-common-core/src/main/resources/lib/ip2region.xdb


BIN
yyc-common-core/src/main/resources/xdb/ip2region.xdb


+ 5 - 0
yyc-common-core/target/classes/META-INF/spring.factories

@@ -0,0 +1,5 @@
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+  net.yyc.common.core.config.JacksonConfig,\
+  net.yyc.common.core.config.MessageSourceConfig,\
+  net.yyc.common.core.config.RestTemplateConfig,\
+  net.yyc.common.core.util.SpringContextHolder

+ 10 - 0
yyc-common-core/target/classes/banner.txt

@@ -0,0 +1,10 @@
+${AnsiColor.BRIGHT_YELLOW}
+
+██╗   ██╗ █████╗  ██████╗     ██╗   ██╗██╗    ██╗   ██╗██╗   ██╗███╗   ██╗
+╚██╗ ██╔╝██╔══██╗██╔═══██╗    ╚██╗ ██╔╝██║    ╚██╗ ██╔╝██║   ██║████╗  ██║
+ ╚████╔╝ ███████║██║   ██║     ╚████╔╝ ██║     ╚████╔╝ ██║   ██║██╔██╗ ██║
+  ╚██╔╝  ██╔══██║██║   ██║      ╚██╔╝  ██║      ╚██╔╝  ██║   ██║██║╚██╗██║
+   ██║   ██║  ██║╚██████╔╝       ██║   ██║       ██║   ╚██████╔╝██║ ╚████║
+   ╚═╝   ╚═╝  ╚═╝ ╚═════╝        ╚═╝   ╚═╝       ╚═╝    ╚═════╝ ╚═╝  ╚═══╝
+
+                           https://www.yaoyi.net

+ 0 - 0
yyc-common-core/target/classes/i18n/messages_zh_CN.properties


BIN
yyc-common-core/target/classes/lib/beetroot-0.0.6.jar


BIN
yyc-common-core/target/classes/lib/ip2region.xdb


BIN
yyc-common-core/target/classes/xdb/ip2region.xdb


+ 3 - 0
yyc-common-core/target/maven-archiver/pom.properties

@@ -0,0 +1,3 @@
+artifactId=yyc-common-core
+groupId=net.yyc.common
+version=1.0.0-SNAPSHOT

+ 40 - 0
yyc-common-core/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1,40 @@
+net/yyc/common/core/config/MessageSourceConfig.class
+net/yyc/common/core/exception/BizException.class
+net/yyc/common/core/constant/enums/UpmsType$QuizSourceType.class
+net/yyc/common/core/constant/enums/MenuTypeEnum.class
+net/yyc/common/core/util/SpringContextHolder.class
+net/yyc/common/core/constant/CacheConstants.class
+net/yyc/common/core/constant/enums/UpmsType.class
+net/yyc/common/core/util/R.class
+net/yyc/common/core/util/R$RBuilder.class
+net/yyc/common/core/constant/enums/CommonFlag$OptFlag.class
+net/yyc/common/core/constant/enums/ResourceTypeEnum.class
+net/yyc/common/core/exception/CheckedException.class
+net/yyc/common/core/util/WebUtils.class
+net/yyc/common/core/util/Base64Utils.class
+net/yyc/common/core/jackson/HnqzJavaTimeModule.class
+net/yyc/common/core/constant/enums/UpmsState.class
+net/yyc/common/core/sensitive/SensitiveTypeEnum.class
+net/yyc/common/core/sensitive/SensitiveSerialize$1.class
+net/yyc/common/core/constant/enums/LoginTypeEnum.class
+net/yyc/common/core/constant/CommonConstants.class
+net/yyc/common/core/util/HttpUtils.class
+net/yyc/common/core/config/RestTemplateConfig.class
+net/yyc/common/core/sensitive/Sensitive.class
+net/yyc/common/core/constant/SecurityConstants.class
+net/yyc/common/core/constant/enums/CommonFlag.class
+net/yyc/common/core/constant/enums/TaskStatusEnum.class
+net/yyc/common/core/exception/ValidateCodeException.class
+net/yyc/common/core/util/DesensitizedUtils.class
+net/yyc/common/core/util/Ip2Region.class
+net/yyc/common/core/sensitive/SensitiveSerialize.class
+net/yyc/common/core/constant/enums/UpmsState$QuizState.class
+net/yyc/common/core/constant/ServiceNameConstants.class
+net/yyc/common/core/constant/enums/DictTypeEnum.class
+net/yyc/common/core/constant/enums/ProcessStatusEnum.class
+net/yyc/common/core/util/ClassUtils.class
+net/yyc/common/core/config/JacksonConfig.class
+net/yyc/common/core/entity/CommonColour.class
+net/yyc/common/core/constant/PaginationConstants.class
+net/yyc/common/core/constant/enums/StyleTypeEnum.class
+net/yyc/common/core/entity/BaseMap.class

+ 35 - 0
yyc-common-core/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1,35 @@
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/TaskStatusEnum.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/StyleTypeEnum.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/util/R.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/config/MessageSourceConfig.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/util/HttpUtils.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/exception/CheckedException.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/ServiceNameConstants.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/CommonFlag.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/MenuTypeEnum.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/PaginationConstants.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/util/Base64Utils.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/util/WebUtils.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/exception/ValidateCodeException.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/UpmsState.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/ResourceTypeEnum.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/util/ClassUtils.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/UpmsType.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/config/JacksonConfig.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/CacheConstants.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/CommonConstants.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/util/Ip2Region.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/util/DesensitizedUtils.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/entity/CommonColour.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/LoginTypeEnum.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/sensitive/SensitiveSerialize.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/util/SpringContextHolder.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/ProcessStatusEnum.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/SecurityConstants.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/exception/BizException.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/config/RestTemplateConfig.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/sensitive/SensitiveTypeEnum.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/entity/BaseMap.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/constant/enums/DictTypeEnum.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/sensitive/Sensitive.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-core/src/main/java/net/yyc/common/core/jackson/HnqzJavaTimeModule.java

+ 36 - 0
yyc-common-datasource/pom.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<artifactId>yyc-common-parent</artifactId>
+		<groupId>net.yyc.common</groupId>
+		<version>1.0.0-SNAPSHOT</version>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+
+	<groupId>net.yyc.common</groupId>
+	<artifactId>yyc-common-datasource</artifactId>
+
+	<packaging>jar</packaging>
+
+	<description>hnqz 动态切换数据源</description>
+
+	<dependencies>
+		<dependency>
+			<groupId>net.yyc.common</groupId>
+			<artifactId>yyc-common-core</artifactId>
+		</dependency>
+		<!--mybatis-->
+		<dependency>
+			<groupId>com.baomidou</groupId>
+			<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+		</dependency>
+		<!-- druid 连接池 -->
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>druid-spring-boot-starter</artifactId>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+</project>

+ 59 - 0
yyc-common-datasource/src/main/java/net/yyc/common/datasource/DynamicDataSourceAutoConfiguration.java

@@ -0,0 +1,59 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.datasource;
+
+import com.baomidou.dynamic.datasource.processor.DsProcessor;
+import com.baomidou.dynamic.datasource.provider.DynamicDataSourceProvider;
+import net.yyc.common.datasource.config.DruidDataSourceProperties;
+import net.yyc.common.datasource.config.JdbcDynamicDataSourceProvider;
+import net.yyc.common.datasource.config.LastParamDsProcessor;
+import lombok.AllArgsConstructor;
+import org.jasypt.encryption.StringEncryptor;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @author hnqz
+ * @date 2020-02-06
+ * <p>
+ * 动态数据源切换配置
+ */
+@Configuration
+@AllArgsConstructor
+@AutoConfigureAfter(DataSourceAutoConfiguration.class)
+@EnableConfigurationProperties(DruidDataSourceProperties.class)
+public class DynamicDataSourceAutoConfiguration {
+
+	private final StringEncryptor stringEncryptor;
+
+	private final DruidDataSourceProperties properties;
+
+	@Bean
+	public DynamicDataSourceProvider dynamicDataSourceProvider() {
+		return new JdbcDynamicDataSourceProvider(stringEncryptor, properties);
+	}
+
+	@Bean
+	public DsProcessor dsProcessor() {
+		return new LastParamDsProcessor();
+	}
+
+}

+ 24 - 0
yyc-common-datasource/src/main/java/net/yyc/common/datasource/annotation/EnableDynamicDataSource.java

@@ -0,0 +1,24 @@
+package net.yyc.common.datasource.annotation;
+
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
+import net.yyc.common.datasource.DynamicDataSourceAutoConfiguration;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.context.annotation.Import;
+
+import java.lang.annotation.*;
+
+/**
+ * @author Lucky
+ * @date 2019-05-18
+ * <p>
+ * 开启动态数据源
+ */
+@Target({ ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@Inherited
+@EnableAutoConfiguration(exclude = { DruidDataSourceAutoConfigure.class })
+@Import(DynamicDataSourceAutoConfiguration.class)
+public @interface EnableDynamicDataSource {
+
+}

+ 43 - 0
yyc-common-datasource/src/main/java/net/yyc/common/datasource/config/DruidDataSourceProperties.java

@@ -0,0 +1,43 @@
+package net.yyc.common.datasource.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author hnqz
+ * @date 2019-05-14
+ * <p>
+ * 参考DruidDataSourceWrapper
+ */
+@Data
+@Component
+@ConfigurationProperties("spring.datasource.druid")
+public class DruidDataSourceProperties {
+
+	/**
+	 * 数据源用户名
+	 */
+	private String username;
+
+	/**
+	 * 数据源密码
+	 */
+	private String password;
+
+	/**
+	 * jdbcurl
+	 */
+	private String url;
+
+	/**
+	 * 数据源驱动
+	 */
+	private String driverClassName;
+
+	/**
+	 * 查询数据源的SQL
+	 */
+	private String queryDsSql = "select * from gen_datasource_conf where del_flag = 0";
+
+}

+ 81 - 0
yyc-common-datasource/src/main/java/net/yyc/common/datasource/config/JdbcDynamicDataSourceProvider.java

@@ -0,0 +1,81 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.datasource.config;
+
+import com.baomidou.dynamic.datasource.provider.AbstractJdbcDataSourceProvider;
+import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty;
+import net.yyc.common.datasource.support.DataSourceConstants;
+import org.jasypt.encryption.StringEncryptor;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author hnqz
+ * @date 2020/2/6
+ * <p>
+ * 从数据源中获取 配置信息
+ */
+public class JdbcDynamicDataSourceProvider extends AbstractJdbcDataSourceProvider {
+
+	private final DruidDataSourceProperties properties;
+
+	private final StringEncryptor stringEncryptor;
+
+	public JdbcDynamicDataSourceProvider(StringEncryptor stringEncryptor, DruidDataSourceProperties properties) {
+		super(properties.getDriverClassName(), properties.getUrl(), properties.getUsername(), properties.getPassword());
+		this.stringEncryptor = stringEncryptor;
+		this.properties = properties;
+	}
+
+	/**
+	 * 执行语句获得数据源参数
+	 * @param statement 语句
+	 * @return 数据源参数
+	 * @throws SQLException sql异常
+	 */
+	@Override
+	protected Map<String, DataSourceProperty> executeStmt(Statement statement) throws SQLException {
+		ResultSet rs = statement.executeQuery(properties.getQueryDsSql());
+
+		Map<String, DataSourceProperty> map = new HashMap<>(8);
+		while (rs.next()) {
+			String name = rs.getString(DataSourceConstants.DS_NAME);
+			String username = rs.getString(DataSourceConstants.DS_USER_NAME);
+			String password = rs.getString(DataSourceConstants.DS_USER_PWD);
+			String url = rs.getString(DataSourceConstants.DS_JDBC_URL);
+			DataSourceProperty property = new DataSourceProperty();
+			property.setUsername(username);
+			property.setPassword(stringEncryptor.decrypt(password));
+			property.setUrl(url);
+			map.put(name, property);
+		}
+
+		// 添加默认主数据源
+		DataSourceProperty property = new DataSourceProperty();
+		property.setUsername(properties.getUsername());
+		property.setPassword(properties.getPassword());
+		property.setUrl(properties.getUrl());
+		map.put(DataSourceConstants.DS_MASTER, property);
+		return map;
+	}
+
+}

+ 61 - 0
yyc-common-datasource/src/main/java/net/yyc/common/datasource/config/LastParamDsProcessor.java

@@ -0,0 +1,61 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.datasource.config;
+
+import com.baomidou.dynamic.datasource.processor.DsProcessor;
+import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
+import org.aopalliance.intercept.MethodInvocation;
+
+/**
+ * @author hnqz
+ * @date 2020/2/6
+ * <p>
+ * 参数数据源解析 @DS("#last)
+ */
+public class LastParamDsProcessor extends DsProcessor {
+
+	private static final String LAST_PREFIX = "#last";
+
+	/**
+	 * 抽象匹配条件 匹配才会走当前执行器否则走下一级执行器
+	 * @param key DS注解里的内容
+	 * @return 是否匹配
+	 */
+	@Override
+	public boolean matches(String key) {
+		if (key.startsWith(LAST_PREFIX)) {
+			// https://github.com/baomidou/dynamic-datasource-spring-boot-starter/issues/213
+			DynamicDataSourceContextHolder.clear();
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * 抽象最终决定数据源
+	 * @param invocation 方法执行信息
+	 * @param key DS注解里的内容
+	 * @return 数据源名称
+	 */
+	@Override
+	public String doDetermineDatasource(MethodInvocation invocation, String key) {
+		Object[] arguments = invocation.getArguments();
+		return String.valueOf(arguments[arguments.length - 1]);
+	}
+
+}

+ 36 - 0
yyc-common-datasource/src/main/java/net/yyc/common/datasource/support/DataSourceConstants.java

@@ -0,0 +1,36 @@
+package net.yyc.common.datasource.support;
+
+/**
+ * @author hnqz
+ * @date 2019-04-01
+ * <p>
+ * 数据源相关常量
+ */
+public interface DataSourceConstants {
+
+	/**
+	 * 数据源名称
+	 */
+	String DS_NAME = "name";
+
+	/**
+	 * 默认数据源(master)
+	 */
+	String DS_MASTER = "master";
+
+	/**
+	 * jdbcurl
+	 */
+	String DS_JDBC_URL = "url";
+
+	/**
+	 * 用户名
+	 */
+	String DS_USER_NAME = "username";
+
+	/**
+	 * 密码
+	 */
+	String DS_USER_PWD = "password";
+
+}

+ 43 - 0
yyc-common-datasource/target/classes/META-INF/spring-configuration-metadata.json

@@ -0,0 +1,43 @@
+{
+  "groups": [
+    {
+      "name": "spring.datasource.druid",
+      "type": "net.yyc.common.datasource.config.DruidDataSourceProperties",
+      "sourceType": "net.yyc.common.datasource.config.DruidDataSourceProperties"
+    }
+  ],
+  "properties": [
+    {
+      "name": "spring.datasource.druid.driver-class-name",
+      "type": "java.lang.String",
+      "description": "数据源驱动",
+      "sourceType": "net.yyc.common.datasource.config.DruidDataSourceProperties"
+    },
+    {
+      "name": "spring.datasource.druid.password",
+      "type": "java.lang.String",
+      "description": "数据源密码",
+      "sourceType": "net.yyc.common.datasource.config.DruidDataSourceProperties"
+    },
+    {
+      "name": "spring.datasource.druid.query-ds-sql",
+      "type": "java.lang.String",
+      "description": "查询数据源的SQL",
+      "sourceType": "net.yyc.common.datasource.config.DruidDataSourceProperties",
+      "defaultValue": "select * from gen_datasource_conf where del_flag = 0"
+    },
+    {
+      "name": "spring.datasource.druid.url",
+      "type": "java.lang.String",
+      "description": "jdbcurl",
+      "sourceType": "net.yyc.common.datasource.config.DruidDataSourceProperties"
+    },
+    {
+      "name": "spring.datasource.druid.username",
+      "type": "java.lang.String",
+      "description": "数据源用户名",
+      "sourceType": "net.yyc.common.datasource.config.DruidDataSourceProperties"
+    }
+  ],
+  "hints": []
+}

+ 7 - 0
yyc-common-datasource/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1,7 @@
+net/yyc/common/datasource/config/JdbcDynamicDataSourceProvider.class
+META-INF/spring-configuration-metadata.json
+net/yyc/common/datasource/config/LastParamDsProcessor.class
+net/yyc/common/datasource/support/DataSourceConstants.class
+net/yyc/common/datasource/annotation/EnableDynamicDataSource.class
+net/yyc/common/datasource/DynamicDataSourceAutoConfiguration.class
+net/yyc/common/datasource/config/DruidDataSourceProperties.class

+ 6 - 0
yyc-common-datasource/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1,6 @@
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-datasource/src/main/java/net/yyc/common/datasource/config/JdbcDynamicDataSourceProvider.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-datasource/src/main/java/net/yyc/common/datasource/config/DruidDataSourceProperties.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-datasource/src/main/java/net/yyc/common/datasource/support/DataSourceConstants.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-datasource/src/main/java/net/yyc/common/datasource/annotation/EnableDynamicDataSource.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-datasource/src/main/java/net/yyc/common/datasource/DynamicDataSourceAutoConfiguration.java
+/Users/maleeeei/Projects/yyc/yyc-common-parent/yyc-common-datasource/src/main/java/net/yyc/common/datasource/config/LastParamDsProcessor.java

+ 49 - 0
yyc-common-ding/pom.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<artifactId>yyc-common-parent</artifactId>
+		<groupId>net.yyc.common</groupId>
+		<version>1.0.0-SNAPSHOT</version>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+
+	<artifactId>yyc-common-ding</artifactId>
+	<packaging>jar</packaging>
+
+	<properties>
+		<fastjson.version>1.2.83</fastjson.version>
+	</properties>
+
+
+	<dependencies>
+		<!--hutool-->
+		<dependency>
+			<groupId>net.yyc.common</groupId>
+			<artifactId>yyc-common-core</artifactId>
+		</dependency>
+
+		<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>2.8.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.httpcomponents</groupId>
+			<artifactId>httpclient</artifactId>
+			<version>4.5.3</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>fastjson</artifactId>
+			<version>${fastjson.version}</version>
+		</dependency>
+
+	</dependencies>
+
+
+</project>

+ 47 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/DingAutoConfiguration.java

@@ -0,0 +1,47 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.ding;
+
+import net.yyc.common.ding.service.DingService;
+import lombok.AllArgsConstructor;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+
+/**
+ * aws 自动配置类
+ *
+ * @author hnqz
+ * @author 858695266
+ */
+@AllArgsConstructor
+//@EnableConfigurationProperties({ DingConfig.class })
+public class DingAutoConfiguration {
+
+//	private final DingConfig config;
+
+	@Bean
+	@ConditionalOnMissingBean(DingService.class)
+//	@ConditionalOnProperty(name = "ding.enable", havingValue = "true", matchIfMissing = true)
+	public DingService dingService() {
+		return new DingService();
+	}
+
+
+}

+ 25 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/config/DingConfig.java

@@ -0,0 +1,25 @@
+package net.yyc.common.ding.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ *  人力家配置
+ *
+ * @author zhangwt
+ * @since 1.0
+ */
+@Data
+//@ConfigurationProperties( prefix = "ding.master")
+public class DingConfig {
+    /**
+     * appId
+     */
+    private String appId;
+    private String appSecret;
+    private String queryUrl;
+    private String rsaPublicKey;
+
+
+}

+ 28 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/CommonNotify.java

@@ -0,0 +1,28 @@
+package net.yyc.common.ding.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+import lombok.Getter;
+
+/**
+ * 公共请求参数
+ *
+ * @author zhangwt
+ * @since 1.0
+ */
+@Data
+public class CommonNotify {
+
+	/**
+	 * sign
+	 */
+	protected String sign;
+
+	/**
+	 * data
+	 */
+	protected String data;
+
+
+
+}

+ 46 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/CommonRequest.java

@@ -0,0 +1,46 @@
+package net.yyc.common.ding.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import net.yyc.common.ding.sign.AccessSign;
+import lombok.Getter;
+
+/**
+ * 公共请求参数
+ *
+ * @author zhangwt
+ * @since 1.0
+ */
+public abstract class CommonRequest {
+
+	/**
+	 * token数据
+	 */
+	@Getter
+	@JsonIgnore
+	protected AccessSign sign;
+
+	/**
+	 * 查询地址
+	 */
+	@Getter
+	@JsonIgnore
+	protected String queryUrl;
+
+	/**
+	 * uri
+	 */
+	@Getter
+	@JsonIgnore
+	protected String uri;
+
+	/**
+	 * uri
+	 */
+	@Getter
+	@JsonIgnore
+	protected String body;
+
+
+
+
+}

+ 38 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/CommonResponse.java

@@ -0,0 +1,38 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+/**
+ * 公共请求参数
+ *
+ * @author zhangwt
+ * @since 1.0
+ */
+@Data
+public abstract class CommonResponse {
+	/**
+	 * 业务码
+	 */
+	private String code;
+
+	/**
+	 * 信息
+	 */
+	private String msg;
+
+
+
+	private Boolean success;
+
+	/**
+	 * 是否成功
+	 *
+	 * @param
+	 * @return
+	 * @author jimmy.zhang
+	 * @since 1.0
+	 */
+	public boolean isSuccess() {
+		return "200".equals(this.code)&&success;
+	}
+}

+ 34 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployAccountQueryRequest.java

@@ -0,0 +1,34 @@
+package net.yyc.common.ding.entity;
+
+
+import net.yyc.common.ding.config.DingConfig;
+import net.yyc.common.ding.sign.AccessSign;
+import net.yyc.common.ding.utils.SignUtils;
+import lombok.Data;
+
+import java.util.HashMap;
+
+@Data
+public class EmployAccountQueryRequest extends CommonRequest{
+
+	private static final String PATH = "/oapi/v1/employ/account/query";
+
+	public EmployAccountQueryRequest(
+			DingConfig config) {
+
+		String serviceSign = null;
+		try {
+			//签名
+			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(),
+					"POST", new HashMap<>(), new byte[0]);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		this.body = "";
+		this.sign = new AccessSign(config.getAppId(),serviceSign);
+		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
+	}
+
+
+}

+ 10 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployAccountQueryResponse.java

@@ -0,0 +1,10 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+@Data
+public class EmployAccountQueryResponse extends CommonResponse {
+
+	private EmployAccountQueryResult data;
+
+}

+ 14 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployAccountQueryResult.java

@@ -0,0 +1,14 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class EmployAccountQueryResult {
+
+
+	private List<EmployAccountQueryResultItem> accountList;
+
+
+}

+ 14 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployAccountQueryResultItem.java

@@ -0,0 +1,14 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+@Data
+public class EmployAccountQueryResultItem {
+
+
+	private String amount;
+	private String accountName;
+	private String accountNo;
+
+
+}

+ 19 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckNotify.java

@@ -0,0 +1,19 @@
+package net.yyc.common.ding.entity;
+
+
+import lombok.Data;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@Getter
+@Setter
+public class EmployCheckNotify {
+
+	private EmployCheckNotifyData data;
+
+	private String sign;
+
+
+}

+ 13 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckNotifyData.java

@@ -0,0 +1,13 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class EmployCheckNotifyData {
+
+	private String callbackType;
+
+	private List<EmployCheckNotifyDataItem> freelancesResult;
+}

+ 13 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckNotifyDataItem.java

@@ -0,0 +1,13 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+@Data
+public class EmployCheckNotifyDataItem {
+
+	private String name;
+	private String mobile;
+	private String idCard;
+	private Integer status;
+	private String remark;
+}

+ 41 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckRequest.java

@@ -0,0 +1,41 @@
+package net.yyc.common.ding.entity;
+
+
+import net.yyc.common.ding.config.DingConfig;
+import net.yyc.common.ding.sign.AccessSign;
+import net.yyc.common.ding.utils.JsonUtils;
+import net.yyc.common.ding.utils.SignUtils;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class EmployCheckRequest extends CommonRequest{
+
+	private static final String PATH = "/oapi/v1/employ/freelances/check";
+
+	public EmployCheckRequest(
+			DingConfig config,
+			List list) {
+
+		Map<String,Object> map = new HashMap<>();
+		map.put("freelances",list);
+		String bodyStr = JsonUtils.serializer(map);
+		String serviceSign = null;
+		try {
+			//签名
+			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(),
+					"POST", new HashMap<>(), bodyStr.getBytes());
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		this.body = bodyStr;
+		this.sign = new AccessSign(config.getAppId(),serviceSign);
+		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
+	}
+
+
+}

+ 10 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckResponse.java

@@ -0,0 +1,10 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+@Data
+public class EmployCheckResponse extends CommonResponse {
+
+	private EmployCheckResult data;
+
+}

+ 14 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckResult.java

@@ -0,0 +1,14 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class EmployCheckResult {
+
+
+	private List<EmployCheckResultItem> freelancesResult;
+
+
+}

+ 18 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployCheckResultItem.java

@@ -0,0 +1,18 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class EmployCheckResultItem {
+
+
+	private String name;
+	private String mobile;
+	private String idCard;
+	private Integer checkStatus;
+	private String checkRemark;
+
+
+}

+ 41 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployFreelancesQueryRequest.java

@@ -0,0 +1,41 @@
+package net.yyc.common.ding.entity;
+
+
+import net.yyc.common.ding.config.DingConfig;
+import net.yyc.common.ding.sign.AccessSign;
+import net.yyc.common.ding.utils.JsonUtils;
+import net.yyc.common.ding.utils.SignUtils;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Data
+public class EmployFreelancesQueryRequest extends CommonRequest{
+
+	private static final String PATH = "/oapi/v1/employ/freelances/payResult";
+
+	public EmployFreelancesQueryRequest(DingConfig config, String statementNo) {
+
+
+		Map<String, Object> map = new HashMap<>();
+		map.put("statementNo", statementNo);
+		String bodyStr = JsonUtils.serializer(map);
+
+		this.body = bodyStr;
+		String serviceSign = null;
+		try {
+			//签名
+			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(),
+					"POST", new HashMap<>(), body.getBytes());
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		this.body = bodyStr;
+		this.sign = new AccessSign(config.getAppId(),serviceSign);
+		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
+	}
+
+
+}

+ 10 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployFreelancesQueryResponse.java

@@ -0,0 +1,10 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+@Data
+public class EmployFreelancesQueryResponse extends CommonResponse {
+
+	private EmployFreelancesQueryResult data;
+
+}

+ 13 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployFreelancesQueryResult.java

@@ -0,0 +1,13 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class EmployFreelancesQueryResult {
+
+	private List<EmployFreelancesQueryResultItem> payResult;
+
+
+}

+ 16 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployFreelancesQueryResultItem.java

@@ -0,0 +1,16 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+@Data
+public class EmployFreelancesQueryResultItem {
+
+
+	private String name;
+	private String mobile;
+	private String idCard;
+	private Integer payStatus;
+	private String failReason;
+
+
+}

+ 19 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayNotify.java

@@ -0,0 +1,19 @@
+package net.yyc.common.ding.entity;
+
+
+import lombok.Data;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+
+@Getter
+@Setter
+@Slf4j
+public class EmployPayNotify {
+
+
+	private EmployPayNotifyData data;
+
+	private String sign;
+
+}

+ 19 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayNotifyData.java

@@ -0,0 +1,19 @@
+package net.yyc.common.ding.entity;
+
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.List;
+
+@Getter
+@Setter
+@Slf4j
+public class EmployPayNotifyData {
+
+	private String callbackType;
+	private String statementNo;
+	private List<EmployPayNotifyDataItem> freelancesPayResult;
+
+}

+ 21 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayNotifyDataItem.java

@@ -0,0 +1,21 @@
+package net.yyc.common.ding.entity;
+
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+
+@Getter
+@Setter
+@Slf4j
+public class EmployPayNotifyDataItem {
+
+	private String name;
+	private String mobile;
+	private String idCard;
+	private Integer settlementStatus;
+	private String remark;
+	private String settlementTime;
+
+
+}

+ 69 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayRequest.java

@@ -0,0 +1,69 @@
+package net.yyc.common.ding.entity;
+
+
+import net.yyc.common.ding.config.DingConfig;
+import net.yyc.common.ding.sign.AccessSign;
+import net.yyc.common.ding.utils.JsonUtils;
+import net.yyc.common.ding.utils.SignUtils;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Data
+@Deprecated
+public class EmployPayRequest extends CommonRequest {
+
+	private static final String PATH = "/oapi/v1/employ/freelances/pay";
+
+
+	/**
+	 * bizType
+	 *	79 软件开发服务
+	 66 信息系统服务
+	 77 技术咨询划服务
+	 30 市场推广服务
+	 70 其他咨询服务
+	 203 现场辅助服务
+	 **/
+
+	/**
+	 * @param config
+	 * @param subjectName
+	 * @param statementNo
+	 * @param statementName
+	 * @param bizType
+	 * @param list
+	 */
+	public EmployPayRequest(
+			DingConfig config,
+			String subjectName,
+			String statementNo,
+			String statementName,
+			Integer bizType,
+			List list) {
+
+		Map<String, Object> map = new HashMap<>();
+		map.put("subjectName", subjectName);
+		map.put("statementNo", statementNo);
+		map.put("statementName", statementName);
+		map.put("bizType", bizType);
+		map.put("freelances", list);
+		String bodyStr = JsonUtils.serializer(map);
+		String serviceSign = null;
+		try {
+			//签名
+			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(),
+					"POST", new HashMap<>(), bodyStr.getBytes());
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		this.body = bodyStr;
+		this.sign = new AccessSign(config.getAppId(), serviceSign);
+		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
+	}
+
+
+}

+ 79 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayRequestV2.java

@@ -0,0 +1,79 @@
+package net.yyc.common.ding.entity;
+
+
+import net.yyc.common.ding.config.DingConfig;
+import net.yyc.common.ding.sign.AccessSign;
+import net.yyc.common.ding.utils.JsonUtils;
+import net.yyc.common.ding.utils.SignUtils;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Data
+@Deprecated
+public class EmployPayRequestV2 extends CommonRequest {
+
+	private static final String PATH = "/oapi/v2/employ/freelances/pay";
+
+	private static String[] statementTaskDescArr = {"通过不定时客户拜访,调查及了解客户信息及所需方向,根据所需定向推广业务管理系统",
+			"推广业务管理系统,使受众知晓及分享本系统",
+			"通过现有信息做推广任务,使客户了解要本产品【业务管理系统】信息",
+			"通过不同的方式推广业务管理系统、提升产品知名度,建立品牌形象"
+	};
+
+
+	/**
+	 * bizType
+	 *	79 软件开发服务
+	 66 信息系统服务
+	 77 技术咨询划服务
+	 30 市场推广服务
+	 70 其他咨询服务
+	 203 现场辅助服务
+	 **/
+
+	/**
+	 * @param config
+	 * @param subjectName
+	 * @param statementNo
+	 * @param statementName
+	 * @param bizType
+	 * @param list
+	 */
+	public EmployPayRequestV2(
+			DingConfig config,
+			String subjectName,
+			String statementNo,
+			String statementName,
+			Integer bizType,
+			List list) {
+
+		Map<String, Object> map = new HashMap<>();
+		map.put("subjectName", subjectName);
+		map.put("statementNo", statementNo);
+		map.put("statementName", statementName);
+		map.put("bizType", bizType);
+
+		int idx = (int) (Math.random() * 4);
+
+		map.put("statementTaskDesc",statementTaskDescArr[idx]);
+		map.put("statementTaskSettlementRules","完成不同任务获得不同任务积分,根据不同任务给与0~30000积分,每个积分兑换0.5~2元,按次数结算");
+		map.put("freelances", list);
+		String bodyStr = JsonUtils.serializer(map);
+		String serviceSign = null;
+		try {
+			//签名
+			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(),
+					"POST", new HashMap<>(), bodyStr.getBytes());
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		this.body = bodyStr;
+		this.sign = new AccessSign(config.getAppId(), serviceSign);
+		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
+	}
+
+}

+ 82 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayRequestV3.java

@@ -0,0 +1,82 @@
+package net.yyc.common.ding.entity;
+
+
+import cn.hutool.core.date.DatePattern;
+import net.yyc.common.ding.config.DingConfig;
+import net.yyc.common.ding.sign.AccessSign;
+import net.yyc.common.ding.utils.JsonUtils;
+import net.yyc.common.ding.utils.SignUtils;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class EmployPayRequestV3 extends CommonRequest {
+
+	private static final String PATH = "/oapi/v3/employ/freelances/pay";
+
+	private static String[] statementTaskDescArr = {"通过不定时客户拜访,调查及了解客户信息及所需方向,根据所需定向推广业务管理系统",
+			"推广业务管理系统,使受众知晓及分享本系统",
+			"通过现有信息做推广任务,使客户了解要本产品【业务管理系统】信息",
+			"通过不同的方式推广业务管理系统、提升产品知名度,建立品牌形象"
+	};
+
+	/**
+	 * bizType
+	 *	79 软件开发服务
+	 *	66 信息系统服务
+	 *	77 技术咨询划服务
+	 *	30 市场推广服务
+	 *	70 其他咨询服务
+	 *	203 现场辅助服务
+	 * @param config
+	 * @param subjectName 结算主体
+	 * @param statementNo 结算单id
+	 * @param statementName 结算单名称
+	 * @param bizType 业务类型
+	 * @param taskStartTime 任务开始时间
+	 * @param taskEndTime 任务结束时间
+	 * @param list
+	 */
+	public EmployPayRequestV3(
+			DingConfig config,
+			String subjectName,
+			String statementNo,
+			String statementName,
+			Integer bizType,
+			List list,
+			LocalDateTime taskStartTime,
+			LocalDateTime taskEndTime) {
+
+		Map<String, Object> map = new HashMap<>();
+		map.put("subjectName", subjectName);
+		map.put("statementNo", statementNo);
+		map.put("statementName", statementName);
+		map.put("bizType", bizType);
+		int idx = (int) (Math.random() * 4);
+		map.put("statementTaskDesc", statementTaskDescArr[idx]);
+		map.put("statementTaskSettlementRules", "完成不同任务获得不同任务积分,根据不同任务给与0~30000积分,每个积分兑换0.5~2元,按次数结算");
+		map.put("freelances", list);
+		map.put("taskStartTime", DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN).format(taskStartTime));
+		map.put("taskEndTime", DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN).format(taskEndTime));
+
+		String bodyStr = JsonUtils.serializer(map);
+		String serviceSign = null;
+
+		try {
+			//签名
+			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(), "POST", new HashMap<>(), bodyStr.getBytes());
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		this.body = bodyStr;
+		this.sign = new AccessSign(config.getAppId(), serviceSign);
+		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
+	}
+
+}

+ 10 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayResponse.java

@@ -0,0 +1,10 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+@Data
+public class EmployPayResponse extends CommonResponse {
+
+	private EmployPayResult data;
+
+}

+ 14 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayResult.java

@@ -0,0 +1,14 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class EmployPayResult {
+
+	private List<EmployPayResultSuccessItem> successResult;
+	private List<EmployPayResultfailItem> failResult;
+
+
+}

+ 14 - 0
yyc-common-ding/src/main/java/net/yyc/common/ding/entity/EmployPayResultSuccessItem.java

@@ -0,0 +1,14 @@
+package net.yyc.common.ding.entity;
+
+import lombok.Data;
+
+@Data
+public class EmployPayResultSuccessItem {
+
+
+	private String name;
+	private String mobile;
+	private String idCard;
+
+
+}

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików