diff --git a/LICENSE.txt b/LICENSE similarity index 98% rename from LICENSE.txt rename to LICENSE index 27494c7e0e5b512d8285df3504b7cb22cd6338f4..9bb15cd759ccc1c77bdd020a435dfe5126cb2cef 100644 --- a/LICENSE.txt +++ b/LICENSE @@ -15,7 +15,7 @@ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the + "control" means (properties) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2023 xingge + Copyright 2023 akuanbushichengxuyuan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/api-stat/api-stat-common/pom.xml b/api-stat/api-stat-common/pom.xml deleted file mode 100644 index 095fe655ee8be00d8730228ffc88dd8a6cb9bc19..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-common/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - 4.0.0 - - - com.example - api-stat - ${revision} - - - - api-stat-common - - api-stat-common - api统计common - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-aop - - - org.aspectj - aspectjweaver - - - org.springframework.boot - spring-boot-starter-data-redis - - - com.alibaba - fastjson - ${fastjson.version} - - - org.springframework.boot - spring-boot-starter-mail - - - net.bytebuddy - byte-buddy-agent - - - com.github.oshi - oshi-core - ${oshi-core.version} - - - com.example - damai-redis-framework - ${revision} - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${jdk.version} - ${jdk.version} - ${project.build.sourceEncoding} - - - - - - diff --git a/api-stat/api-stat-common/src/main/java/com/damai/constant/ApiStatConstant.java b/api-stat/api-stat-common/src/main/java/com/damai/constant/ApiStatConstant.java deleted file mode 100644 index 87214d57ed8654490683ac734f53d08a2e348747..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-common/src/main/java/com/damai/constant/ApiStatConstant.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.damai.constant; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-09-28 - **/ -public class ApiStatConstant { - - public final static String METHOD_DATA_SPLIT = ":"; - - public final static String CONTROLLER = "controller"; - - public final static String SERVICE = "service"; - - public final static String DAO = "dao"; - - public final static String MAPPER = "mapper"; - - public final static String FEIGN = "com.sun.proxy.$Proxy"; - - public final static String SPRING_APPLICATION_NAME = "spring.application.name"; - - public final static String API_SPLIT = "/"; - - public final static String REDIS_DATA_SAVE_LUA_PATH = "lua/redis_data_save.lua"; - - public final static String PLATFORM_NOTICE= "platform_notice"; -} diff --git a/api-stat/api-stat-common/src/main/java/com/damai/enums/MethodLevel.java b/api-stat/api-stat-common/src/main/java/com/damai/enums/MethodLevel.java deleted file mode 100644 index c971ee5ef48015bf8ae96aadb166ca6aef502edf..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-common/src/main/java/com/damai/enums/MethodLevel.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.damai.enums; - - -public enum MethodLevel { - CONTROLLER, - SERVICE, - DAO, - FEIGN, - OTHER_TYPE; -} diff --git a/api-stat/api-stat-common/src/main/java/com/damai/enums/PlatformType.java b/api-stat/api-stat-common/src/main/java/com/damai/enums/PlatformType.java deleted file mode 100644 index 431e73cac378b22f17f12da316422bf221633150..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-common/src/main/java/com/damai/enums/PlatformType.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.damai.enums; - -/** - * @program: cook-frame - * @description: - * @author: lk - * @create: 2023-10-07 - **/ -public enum PlatformType { - - DingDing, - WeCom, - FeiShu, - Email -} diff --git a/api-stat/api-stat-common/src/main/java/com/damai/structure/MethodData.java b/api-stat/api-stat-common/src/main/java/com/damai/structure/MethodData.java deleted file mode 100644 index 857cf4a82f4fc5bf9266a780575f04ab66ebc33a..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-common/src/main/java/com/damai/structure/MethodData.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.damai.structure; - - -import com.damai.enums.MethodLevel; -import lombok.Data; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.Objects; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-09-28 - **/ -@Data -public class MethodData { - - private String id; - - private String className; - - private String methodName; - - private Integer argumentCount; - - private MethodLevel methodLevel; - - private BigDecimal executeTime; - - private String api; - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof MethodData)) { - return false; - } - MethodData that = (MethodData) o; - return getId().equals(that.getId()) && getClassName().equals(that.getClassName()) && getMethodName().equals(that.getMethodName()) && Objects.equals(getArgumentCount(), that.getArgumentCount()) && getMethodLevel() == that.getMethodLevel() && Objects.equals(getExecuteTime(), that.getExecuteTime()) && Objects.equals(getApi(), that.getApi()); - } - - @Override - public int hashCode() { - return Objects.hash(getId(), getClassName(), getMethodName(), getArgumentCount(), getMethodLevel(), getExecuteTime(), getApi()); - } - - public BigDecimal getExecuteTime() { - return executeTime != null ? executeTime.setScale(2, RoundingMode.HALF_UP) : null; - } -} diff --git a/api-stat/api-stat-common/src/main/java/com/damai/structure/MethodDetailData.java b/api-stat/api-stat-common/src/main/java/com/damai/structure/MethodDetailData.java deleted file mode 100644 index 4f914947c41822081089a53d12d820d0c1a6fb02..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-common/src/main/java/com/damai/structure/MethodDetailData.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.damai.structure; - -import com.damai.enums.MethodLevel; -import lombok.Data; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -@Data -public class MethodDetailData { - - private String id; - - private String className; - - private String methodName; - - private Integer argumentCount; - - private MethodLevel methodLevel; - - private BigDecimal executeTime; - - private String api; - - private BigDecimal avgExecuteTime = new BigDecimal("0"); - - private BigDecimal maxExecuteTime = new BigDecimal("0"); - - private BigDecimal minExecuteTime = new BigDecimal("0"); - - private Long exceptionCount = 0L; - - private List childrenMethodList = new ArrayList<>(); - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof MethodDetailData)) { - return false; - } - MethodDetailData that = (MethodDetailData) o; - return getId().equals(that.getId()) && getClassName().equals(that.getClassName()) && getMethodName().equals(that.getMethodName()) && Objects.equals(getArgumentCount(), that.getArgumentCount()) && getMethodLevel() == that.getMethodLevel() && Objects.equals(getExecuteTime(), that.getExecuteTime()) && Objects.equals(getApi(), that.getApi()) && Objects.equals(getAvgExecuteTime(), that.getAvgExecuteTime()) && Objects.equals(getMaxExecuteTime(), that.getMaxExecuteTime()) && Objects.equals(getMinExecuteTime(), that.getMinExecuteTime()) && Objects.equals(getExceptionCount(), that.getExceptionCount()) && Objects.equals(getChildrenMethodList(), that.getChildrenMethodList()); - } - - @Override - public int hashCode() { - return Objects.hash(getId(), getClassName(), getMethodName(), getArgumentCount(), getMethodLevel(), getExecuteTime(), getApi(), getAvgExecuteTime(), getMaxExecuteTime(), getMinExecuteTime(), getExceptionCount(), getChildrenMethodList()); - } - - public BigDecimal getExecuteTime() { - return executeTime != null ? executeTime.setScale(2, RoundingMode.HALF_UP) : null; - } - - public BigDecimal getAvgExecuteTime() { - return avgExecuteTime != null ? avgExecuteTime.setScale(2, RoundingMode.HALF_UP) : null; - } - - public BigDecimal getMaxExecuteTime() { - return maxExecuteTime != null ? maxExecuteTime.setScale(2, RoundingMode.HALF_UP) : null; - } - - public BigDecimal getMinExecuteTime() { - return minExecuteTime != null ? minExecuteTime.setScale(2, RoundingMode.HALF_UP) : null; - } -} diff --git a/api-stat/api-stat-common/src/main/java/com/damai/structure/MethodHierarchyTransfer.java b/api-stat/api-stat-common/src/main/java/com/damai/structure/MethodHierarchyTransfer.java deleted file mode 100644 index 06e8e937bb559a59e5f82353b6f987f1c7f3bb74..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-common/src/main/java/com/damai/structure/MethodHierarchyTransfer.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.damai.structure; - -import lombok.Data; - -import java.lang.reflect.Parameter; -import java.util.Arrays; -import java.util.Objects; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-09-28 - **/ -@Data -public class MethodHierarchyTransfer { - - private MethodData currentMethodData; - - private MethodData parentMethodData; - - private boolean exceptionFlag; - - Parameter[] names; - - Object[] values; - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof MethodHierarchyTransfer)) { - return false; - } - MethodHierarchyTransfer that = (MethodHierarchyTransfer) o; - return isExceptionFlag() == that.isExceptionFlag() && getCurrentMethodData().equals(that.getCurrentMethodData()) && getParentMethodData().equals(that.getParentMethodData()) && Arrays.equals(getNames(), that.getNames()) && Arrays.equals(getValues(), that.getValues()); - } - - @Override - public int hashCode() { - int result = Objects.hash(getCurrentMethodData(), getParentMethodData(), isExceptionFlag()); - result = 31 * result + Arrays.hashCode(getNames()); - result = 31 * result + Arrays.hashCode(getValues()); - return result; - } -} diff --git a/api-stat/api-stat-common/src/main/java/com/damai/structure/MethodNoticeData.java b/api-stat/api-stat-common/src/main/java/com/damai/structure/MethodNoticeData.java deleted file mode 100644 index b33b28c501587dec1596028a02e2e0bceed021dd..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-common/src/main/java/com/damai/structure/MethodNoticeData.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.damai.structure; - -import lombok.Data; - -import java.math.BigDecimal; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-08 - **/ -@Data -public class MethodNoticeData { - - private Integer argumentCount; - - private String api; - - private BigDecimal avgExecuteTime = new BigDecimal("0"); -} diff --git a/api-stat/api-stat-example/.gitignore b/api-stat/api-stat-example/.gitignore deleted file mode 100644 index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/** -!**/src/test/** - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ - -### VS Code ### -.vscode/ diff --git a/api-stat/api-stat-example/api-stat-example-cloud/.gitignore b/api-stat/api-stat-example/api-stat-example-cloud/.gitignore deleted file mode 100644 index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/** -!**/src/test/** - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ - -### VS Code ### -.vscode/ diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/.gitignore b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/.gitignore deleted file mode 100644 index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/** -!**/src/test/** - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ - -### VS Code ### -.vscode/ diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/mvnw b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/mvnw deleted file mode 100644 index ea8c82873dced8ffc5a5cc73e370c24dec37260b..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-mybatisplus --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/mvnw.cmd b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/mvnw.cmd deleted file mode 100644 index c8d43372c986d97911cdc21bd87e0cbe3d83bdda..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM https://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/pom.xml b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/pom.xml deleted file mode 100644 index b5a244819af57f5fec895c580c0ef9010653fc64..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/pom.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - 4.0.0 - - - com.example - api-stat-example-cloud - ${revision} - - - - api-stat-example-cloud-consumer-service - - api-stat-example-cloud-consumer-service - 消费者服务 - - - 1.8 - UTF-8 - UTF-8 - - - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-logging - - - - - org.springframework.boot - spring-boot-starter-validation - - - com.example - damai-service-common - ${revision} - - - com.example - api-stat-example-cloud-feign-client - ${revision} - - - com.example - api-stat-reported-cloud-service - ${revision} - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - io.github.openfeign - feign-okhttp - - - org.springframework.cloud - spring-cloud-starter-netflix-hystrix - - - com.example - damai-service-hystrix - ${revision} - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-discovery - - - - com.alibaba.nacos - nacos-common - ${nacos.version} - - - - org.springframework.boot - spring-boot-starter-actuator - - - com.github.ulisesbocchio - jasypt-spring-boot-starter - ${jasypt.version} - - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot.version} - - com.damai.ProviderApplication - - - - repackage - - repackage - - - - - - - - diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/java/com/damai/ConsumerApplication.java b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/java/com/damai/ConsumerApplication.java deleted file mode 100644 index 96634c01182aff113fe82239b6af971988784160..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/java/com/damai/ConsumerApplication.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.damai; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.hystrix.EnableHystrix; -import org.springframework.cloud.openfeign.EnableFeignClients; - - -@EnableDiscoveryClient -@EnableFeignClients -@EnableHystrix -@SpringBootApplication -public class ConsumerApplication { - - public static void main(String[] args) { - SpringApplication.run(ConsumerApplication.class, args); - } - -} diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/java/com/damai/controller/ConsumerController.java b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/java/com/damai/controller/ConsumerController.java deleted file mode 100644 index e5fc271ef31290ff472648925cfe1ce3829bd44e..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/java/com/damai/controller/ConsumerController.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.damai.controller; - -import com.damai.common.ApiResponse; -import com.damai.dto.InfoDto; -import com.damai.service.ConsumerService; -import com.damai.vo.InfoVo; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.validation.Valid; - -/** - * @program: cook-frame - * @description: - * @author: 星哥 - * @create: 2023-04-17 - **/ -@RestController -@RequestMapping("/consumer") -@Api(tags = "consumer", description = "消费者") -public class ConsumerController { - - @Autowired - private ConsumerService consumerService; - - @ApiOperation(value = "查询信息") - @PostMapping(value = "/getInfo") - public ApiResponse getInfo(@Valid @RequestBody InfoDto infoDto) { - return consumerService.getInfo(infoDto); - } -} diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/java/com/damai/service/ConsumerService.java b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/java/com/damai/service/ConsumerService.java deleted file mode 100644 index 0903f69020cdb1e031319818cd56620101cf5b93..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/java/com/damai/service/ConsumerService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.damai.service; - -import com.damai.client.ProviderClient; -import com.damai.common.ApiResponse; -import com.damai.dto.InfoDto; -import com.damai.vo.InfoVo; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * @program: cook-frame - * @description: - * @author: 星哥 - * @create: 2023-04-17 - **/ -@Service -@Slf4j -public class ConsumerService { - - @Autowired - private ProviderClient providerClient; - - public ApiResponse getInfo(final InfoDto infoDto) { - return providerClient.getInfo(infoDto); - } -} diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/resources/bootstrap.yml b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/resources/bootstrap.yml deleted file mode 100644 index ca1df50e77538ef86ab7caac00110c83e02b1ffd..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,26 +0,0 @@ -#服务端口 -server: - port: 5083 -# 应用名称 -spring: - application: - name: consumer-service - main: - allow-bean-definition-overriding: true - redis: - database: 0 - host: www.cookframe.com - port: 6379 - password: ENC(+XH73TopLBEg6H9u0f5FE9csF+oN15Gz) - timeout: 3000 - cloud: - nacos: - discovery: - server-addr: www.cookframe.com:8848 -api-stat: - pointcut: execution(* com.example..*.*(..)) - enable: true -jasypt: - encryptor: - password: bgtjkjl!%^sdc - algorithm: PBEWithMD5AndDES \ No newline at end of file diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/resources/log4j2.xml b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/resources/log4j2.xml deleted file mode 100644 index 74caa21343e4b694eb6b0730b39aa04589eab470..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-consumer-service/src/main/resources/log4j2.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - . - consumer-service - local - log - [consumer-service] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n - UTF-8 - com.damai - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/.gitignore b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/.gitignore deleted file mode 100644 index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/** -!**/src/test/** - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ - -### VS Code ### -.vscode/ diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/pom.xml b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/pom.xml deleted file mode 100644 index 8174fdf031b10438b63927c7874fd687fc6df3ee..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - - - com.example - api-stat-example-cloud - ${revision} - - - - api-stat-example-cloud-feign-client - - api-stat-example-cloud-feign-client - rpc - - - 1.8 - UTF-8 - UTF-8 - - - - - com.example - damai-common - ${revision} - - - com.example - damai-service-common - ${revision} - true - - - org.springframework.boot - spring-boot-starter-validation - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - io.github.openfeign - feign-okhttp - - - diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/src/main/java/com/damai/client/ProviderClient.java b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/src/main/java/com/damai/client/ProviderClient.java deleted file mode 100644 index 5e38c7615ffe89ec14f3eb85f392f3ad9226ef98..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/src/main/java/com/damai/client/ProviderClient.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.damai.client; - -import com.damai.common.ApiResponse; -import com.damai.dto.InfoDto; -import com.damai.vo.InfoVo; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.PostMapping; - -/** - * @program: cook-frame - * @description: - * @author: 星哥 - * @create: 2023-04-17 - **/ -@Component -@FeignClient(value = "provider-service",fallback = ProviderClientFallback.class) -public interface ProviderClient { - - @PostMapping("/provider/getInfo") - ApiResponse getInfo(InfoDto infoDto); -} diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/src/main/java/com/damai/client/ProviderClientFallback.java b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/src/main/java/com/damai/client/ProviderClientFallback.java deleted file mode 100644 index 22ce520d9f9557aab33d136b7f12e5560b665863..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/src/main/java/com/damai/client/ProviderClientFallback.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.damai.client; - -import com.damai.common.ApiResponse; -import com.damai.dto.InfoDto; -import com.damai.enums.BaseCode; -import com.damai.vo.InfoVo; -import org.springframework.stereotype.Component; - -/** - * @program: cook-frame - * @description: - * @author: 星哥 - * @create: 2023-04-17 - **/ -@Component -public class ProviderClientFallback implements ProviderClient { - - @Override - public ApiResponse getInfo(final InfoDto dto) { - return ApiResponse.error(BaseCode.SYSTEM_ERROR); - } -} diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/src/main/java/com/damai/vo/InfoVo.java b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/src/main/java/com/damai/vo/InfoVo.java deleted file mode 100644 index 39c78bfc4be3074cd648fcf5a7c0dca931cfe77a..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/src/main/java/com/damai/vo/InfoVo.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.damai.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@ApiModel(value="InfoVo", description ="信息数据") -@Data -public class InfoVo { - - @ApiModelProperty(name ="id", dataType ="String", value ="id", required =true) - private String id; - - @ApiModelProperty(name ="name", dataType ="String", value ="名称", required =true) - private String name; - - @ApiModelProperty(name ="code", dataType ="String", value ="code码", required =true) - private String code; -} \ No newline at end of file diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/.gitignore b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/.gitignore deleted file mode 100644 index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/** -!**/src/test/** - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ - -### VS Code ### -.vscode/ diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/mvnw b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/mvnw deleted file mode 100644 index ea8c82873dced8ffc5a5cc73e370c24dec37260b..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-mybatisplus --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/mvnw.cmd b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/mvnw.cmd deleted file mode 100644 index c8d43372c986d97911cdc21bd87e0cbe3d83bdda..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM https://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/pom.xml b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/pom.xml deleted file mode 100644 index cc8f77d4122260f9b2d0cc3c1228743b9b65c641..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/pom.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - 4.0.0 - - - com.example - api-stat-example-cloud - ${revision} - - - - api-stat-example-cloud-provider-service - - api-stat-example-cloud-provider-service - 提供者服务 - - - 1.8 - UTF-8 - UTF-8 - - - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-logging - - - - - org.springframework.boot - spring-boot-starter-validation - - - com.example - damai-service-common - ${revision} - - - com.example - api-stat-example-cloud-feign-client - ${revision} - - - com.example - api-stat-reported-cloud-service - ${revision} - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - io.github.openfeign - feign-okhttp - - - org.springframework.cloud - spring-cloud-starter-netflix-hystrix - - - com.example - damai-service-hystrix - ${revision} - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-discovery - - - - com.alibaba.nacos - nacos-common - ${nacos.version} - - - - org.springframework.boot - spring-boot-starter-actuator - - - com.github.ulisesbocchio - jasypt-spring-boot-starter - ${jasypt.version} - - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot.version} - - com.damai.ProviderApplication - - - - repackage - - repackage - - - - - - - - diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/ProviderApplication.java b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/ProviderApplication.java deleted file mode 100644 index cd5f2e770b0d3ea864a7c9ba94e7968e39f52931..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/ProviderApplication.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.damai; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.hystrix.EnableHystrix; -import org.springframework.cloud.openfeign.EnableFeignClients; - - -@EnableDiscoveryClient -@EnableFeignClients -@EnableHystrix -@SpringBootApplication -public class ProviderApplication { - - public static void main(String[] args) { - SpringApplication.run(ProviderApplication.class, args); - } - -} diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/controller/ProviderController.java b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/controller/ProviderController.java deleted file mode 100644 index 11bb16a64dca153b2b0d7ae1718d65a903e40984..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/controller/ProviderController.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.damai.controller; - - -import com.damai.common.ApiResponse; -import com.damai.dto.InfoDto; -import com.damai.service.ProviderService; -import com.damai.vo.InfoVo; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.validation.Valid; - -/** - * @program: cook-frame - * @description: - * @author: 星哥 - * @create: 2023-04-17 - **/ -@RestController -@RequestMapping("/provider") -@Api(tags = "provider", description = "提供者") -public class ProviderController { - - @Autowired - private ProviderService providerService; - - @ApiOperation(value = "查询信息") - @PostMapping(value = "/getInfo") - public ApiResponse getInfo(@Valid @RequestBody InfoDto infoDto) { - return ApiResponse.ok(providerService.getInfo(infoDto)); - } -} diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/dao/ProviderDato.java b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/dao/ProviderDato.java deleted file mode 100644 index 30bc80d32b03ced4dd20262933e293baa52ae963..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/dao/ProviderDato.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.damai.dao; - -import com.damai.dto.InfoDto; -import com.damai.vo.InfoVo; -import org.springframework.stereotype.Repository; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-12 - **/ -@Repository -public class ProviderDato { - - public InfoVo getInfo(InfoDto infoDto){ - InfoVo infoVo = new InfoVo(); - infoVo.setId(infoDto.getCode() + "111"); - infoVo.setCode(infoDto.getCode()); - infoVo.setName("测试"); - return infoVo; - } -} diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/entity/Department.java b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/entity/Department.java deleted file mode 100644 index 6a195727dbcaf49d3e3f5979dfcc488979808389..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/entity/Department.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.damai.entity; - -import lombok.Data; - -import java.util.Date; - -/** - * @program: cook-frame - * @description: - * @author: 星哥 - * @create: 2023-06-05 - **/ - -@Data -public class Department { - - private String id; - - private String name; - - private String typeCode; - - private Date createTime; - - private Integer status; -} diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/service/ProviderService.java b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/service/ProviderService.java deleted file mode 100644 index 23b07c10e4768b2dc55ad228b5860170bae7cb02..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/java/com/damai/service/ProviderService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.damai.service; - -import com.damai.dao.ProviderDato; -import com.damai.dto.InfoDto; -import com.damai.vo.InfoVo; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * @program: cook-frame - * @description: - * @author: 星哥 - * @create: 2023-04-17 - **/ -@Service -@Slf4j -public class ProviderService { - - @Autowired - private ProviderDato providerDato; - - public InfoVo getInfo(InfoDto infoDto){ - return providerDato.getInfo(infoDto); - } -} diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/resources/bootstrap.yml b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/resources/bootstrap.yml deleted file mode 100644 index 8fcc1e3815397685100406e4a99cd63117b9cd4b..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,26 +0,0 @@ -#服务端口 -server: - port: 5082 -# 应用名称 -spring: - application: - name: provider-service - main: - allow-bean-definition-overriding: true - redis: - database: 0 - host: www.cookframe.com - port: 6379 - password: ENC(+XH73TopLBEg6H9u0f5FE9csF+oN15Gz) - timeout: 3000 - cloud: - nacos: - discovery: - server-addr: www.cookframe.com:8848 -api-stat: - pointcut: execution(* com.example..*.*(..)) - enable: true -jasypt: - encryptor: - password: bgtjkjl!%^sdc - algorithm: PBEWithMD5AndDES \ No newline at end of file diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/resources/log4j2.xml b/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/resources/log4j2.xml deleted file mode 100644 index e82a118dd599d943ae46df50e42380014c9d6ace..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-provider-service/src/main/resources/log4j2.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - . - provider-service - local - log - [provider-service] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n - UTF-8 - com.damai - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/api-stat/api-stat-example/api-stat-example-cloud/pom.xml b/api-stat/api-stat-example/api-stat-example-cloud/pom.xml deleted file mode 100644 index 827ce40539ff0cb3008f9f4084289c90766a55c1..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-cloud/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - 4.0.0 - - - com.example - api-stat-example - ${revision} - - - api-stat-example-cloud - api-stat-example-cloud - api-stat-example-cloud - pom - - - api-stat-example-cloud-feign-client - api-stat-example-cloud-consumer-service - api-stat-example-cloud-provider-service - - - diff --git a/api-stat/api-stat-example/api-stat-example-single-service/.gitignore b/api-stat/api-stat-example/api-stat-example-single-service/.gitignore deleted file mode 100644 index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-single-service/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/** -!**/src/test/** - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ - -### VS Code ### -.vscode/ diff --git a/api-stat/api-stat-example/api-stat-example-single-service/pom.xml b/api-stat/api-stat-example/api-stat-example-single-service/pom.xml deleted file mode 100644 index d6c49a08e05c05083205ae7f6e5b01b411a6d104..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-single-service/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - 4.0.0 - - - com.example - api-stat-example - ${revision} - - - - api-stat-example-single-service - - api-stat-example-single-service - api单体服务示例 - - - 1.8 - UTF-8 - UTF-8 - 6.2.2 - - - - - org.springframework.boot - spring-boot-starter-web - - - com.example - api-stat-reported-single-service - ${revision} - - - diff --git a/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/ExampleSingleApplication.java b/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/ExampleSingleApplication.java deleted file mode 100644 index 85f8e2ee7fa5fd336f8a0a8c9789547833f92088..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/ExampleSingleApplication.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.damai; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - - - -@SpringBootApplication -public class ExampleSingleApplication { - - public static void main(String[] args) { - SpringApplication.run(ExampleSingleApplication.class, args); - } - -} diff --git a/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/controller/ExampleSingleController.java b/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/controller/ExampleSingleController.java deleted file mode 100644 index da28b33dffb98850bb3ca9b011839ad7e2c1b2cc..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/controller/ExampleSingleController.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.damai.controller; - -import com.damai.service.ExampleSingleService; -import com.damai.util.Time; -import com.damai.vo.UserVo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-08 - **/ -@RestController -@RequestMapping(value = "/exampleSingle") -public class ExampleSingleController { - - @Autowired - private ExampleSingleService exampleSingleService; - - @RequestMapping(value = "/getUser") - public UserVo getUser(String userId){ - Time.simulationTime(); - return exampleSingleService.getUser(userId); - } -} diff --git a/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/dao/ExampleSingleDao.java b/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/dao/ExampleSingleDao.java deleted file mode 100644 index f90dfe4b9c650dd43b5f8dba9b1749e5a69fc984..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/dao/ExampleSingleDao.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.damai.dao; - -import com.damai.util.Time; -import com.damai.vo.UserVo; -import org.springframework.stereotype.Repository; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-08 - **/ -@Repository -public class ExampleSingleDao { - - public UserVo getUser(String userId){ - Time.simulationTime(); - UserVo userVo = new UserVo(); - userVo.setUserId(userId); - userVo.setName("张三"); - return userVo; - } -} diff --git a/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/service/ExampleSingleService.java b/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/service/ExampleSingleService.java deleted file mode 100644 index d2bee9afded00b3527a6ff06ec4b02d8cb5a24b8..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/service/ExampleSingleService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.damai.service; - -import com.damai.dao.ExampleSingleDao; -import com.damai.util.Time; -import com.damai.vo.UserVo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-08 - **/ -@Service -public class ExampleSingleService { - - @Autowired - private ExampleSingleDao exampleSingleDao; - - public UserVo getUser(String userId){ - Time.simulationTime(); - return exampleSingleDao.getUser(userId); - } -} diff --git a/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/util/Time.java b/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/util/Time.java deleted file mode 100644 index 4a234fca2d1499e51c145e17eef5808427b76f9c..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/util/Time.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.damai.util; - -import java.util.Random; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-08 - **/ -public class Time { - - public static void simulationTime() { - Random random = new Random(); - int sleepTime = random.nextInt(2000); - try { - Thread.sleep(sleepTime); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } -} diff --git a/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/vo/UserVo.java b/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/vo/UserVo.java deleted file mode 100644 index 8a721f7bca50bd8d11ad9b228e15cfe86fb40505..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-single-service/src/main/java/com/damai/vo/UserVo.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.damai.vo; - -import lombok.Data; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-08 - **/ -@Data -public class UserVo { - - private String userId; - - private String name; -} diff --git a/api-stat/api-stat-example/api-stat-example-single-service/src/main/resources/application.yml b/api-stat/api-stat-example/api-stat-example-single-service/src/main/resources/application.yml deleted file mode 100644 index 357f9b7d94b75d014d091354fe7f37153e4f0004..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/api-stat-example-single-service/src/main/resources/application.yml +++ /dev/null @@ -1,15 +0,0 @@ -#服务端口 -server: - port: 6660 -# 应用名称 -spring: - application: - name: example-sing-service - redis: - host: www.cookframe.com - port: 6379 - password: qaz123 - database: 0 -api-stat: - pointcut: execution(* com.example..*.*(..)) - enable: true \ No newline at end of file diff --git a/api-stat/api-stat-example/pom.xml b/api-stat/api-stat-example/pom.xml deleted file mode 100644 index 24e1de238be563263d41dab43b9bcb5c3ca5d1e5..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-example/pom.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - 4.0.0 - - - com.example - api-stat - ${revision} - - - api-stat-example - api-stat-example - api-stat-example - pom - - - api-stat-example-single-service - api-stat-example-cloud - - - diff --git a/api-stat/api-stat-reported/.gitignore b/api-stat/api-stat-reported/.gitignore deleted file mode 100644 index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/** -!**/src/test/** - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ - -### VS Code ### -.vscode/ diff --git a/api-stat/api-stat-reported/api-stat-reported-cloud-service/.gitignore b/api-stat/api-stat-reported/api-stat-reported-cloud-service/.gitignore deleted file mode 100644 index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-cloud-service/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/** -!**/src/test/** - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ - -### VS Code ### -.vscode/ diff --git a/api-stat/api-stat-reported/api-stat-reported-cloud-service/src/main/java/com/damai/common/impl/ApiStatCloudServiceCommon.java b/api-stat/api-stat-reported/api-stat-reported-cloud-service/src/main/java/com/damai/common/impl/ApiStatCloudServiceCommon.java deleted file mode 100644 index cae4c9a8d1453d85c23e4d3e0a20cab6881a0d78..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-cloud-service/src/main/java/com/damai/common/impl/ApiStatCloudServiceCommon.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.damai.common.impl; - -import com.damai.common.ApiStatCommon; -import com.damai.enums.MethodLevel; -import org.aopalliance.intercept.MethodInvocation; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.stereotype.Controller; -import org.springframework.stereotype.Repository; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RestController; - -import static com.damai.constant.ApiStatConstant.*; -import static com.damai.constant.ApiStatConstant.MAPPER; - -public class ApiStatCloudServiceCommon extends ApiStatCommon { - @Override - public MethodLevel getMethodLevel(MethodInvocation pjp) { - Class targetClass = pjp.getThis().getClass(); - if (targetClass.getAnnotation(Controller.class) != null || targetClass.getAnnotation(RestController.class) != null) { - return MethodLevel.CONTROLLER; - } else if (targetClass.getAnnotation(Service.class) != null) { - return MethodLevel.SERVICE; - } else if (targetClass.getAnnotation(Repository.class) != null) { - return MethodLevel.DAO; - } else if (targetClass.getAnnotation(FeignClient.class) != null) { - return MethodLevel.FEIGN; - } else if (targetClass.getName().contains(FEIGN)) { - return MethodLevel.FEIGN; - } - String className = pjp.getMethod().getDeclaringClass().getName().toLowerCase(); - if (className.contains(CONTROLLER)) { - return MethodLevel.CONTROLLER; - } else if (className.contains(SERVICE)) { - return MethodLevel.SERVICE; - } else if (className.contains(DAO) || className.contains(MAPPER)) { - return MethodLevel.DAO; - } else if (className.contains(FEIGN)) { - return MethodLevel.FEIGN; - } else { - return MethodLevel.OTHER_TYPE; - } - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-cloud-service/src/main/java/com/damai/config/ApiStatCloudAutoConfig.java b/api-stat/api-stat-reported/api-stat-reported-cloud-service/src/main/java/com/damai/config/ApiStatCloudAutoConfig.java deleted file mode 100644 index a575d12cea7bbb89fd237d83725c7da806fbe539..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-cloud-service/src/main/java/com/damai/config/ApiStatCloudAutoConfig.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.damai.config; - -import com.damai.common.ApiStatCommon; -import com.damai.common.impl.ApiStatCloudServiceCommon; -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.autoconfigure.AutoConfigureBefore; -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; - -@Slf4j -@Data -@EnableConfigurationProperties(ApiStatProperties.class) -@ConditionalOnProperty(value = "api-stat.enable",havingValue = "true") -@AutoConfigureBefore(ApiStatAutoConfig.class) -public class ApiStatCloudAutoConfig { - - @Bean - @ConditionalOnMissingBean - public ApiStatCommon ApiStatSingleServiceCommon(){ - return new ApiStatCloudServiceCommon(); - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/.gitignore b/api-stat/api-stat-reported/api-stat-reported-single-service/.gitignore deleted file mode 100644 index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/** -!**/src/test/** - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ - -### VS Code ### -.vscode/ diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/pom.xml b/api-stat/api-stat-reported/api-stat-reported-single-service/pom.xml deleted file mode 100644 index 47f520a0874cb9ec9da1f7908fbb99d930ddc353..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - 4.0.0 - - - com.example - api-stat-reported - ${revision} - - - - api-stat-reported-single-service - - api-stat-reported-single-service - api单体服务统计 - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-aop - - - org.aspectj - aspectjweaver - - - org.springframework.boot - spring-boot-starter-data-redis - - - com.alibaba - fastjson - ${fastjson.version} - - - org.springframework.boot - spring-boot-starter-mail - - - net.bytebuddy - byte-buddy-agent - - - com.github.oshi - oshi-core - ${oshi-core.version} - - - com.example - damai-redis-framework - ${revision} - - - com.example - api-stat-common - ${revision} - - - - diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/ApiStatThreadPool.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/ApiStatThreadPool.java deleted file mode 100644 index 7867a4ef4b00dd4702dd5d2125d314d02b6f46a1..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/ApiStatThreadPool.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.damai; - -import java.util.concurrent.*; - -public class ApiStatThreadPool { - - private ThreadPoolExecutor threadPoolExecutor = null; - - public ApiStatThreadPool(){ - threadPoolExecutor = new ThreadPoolExecutor( - Runtime.getRuntime().availableProcessors() + 1, - Runtime.getRuntime().availableProcessors() * 2, - 60, - TimeUnit.SECONDS, - new ArrayBlockingQueue<>(1000)); - } - - public void execute(Runnable runnable){ - threadPoolExecutor.execute(runnable); - } - - public Future submit(Callable task){ - return threadPoolExecutor.submit(task); - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/MethodDataStackHolder.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/MethodDataStackHolder.java deleted file mode 100644 index 37a30c1f908219fdbc5ccc79d2947f0dd62dd041..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/MethodDataStackHolder.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.damai; - -import com.damai.structure.MethodData; - -import java.util.Stack; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-09-28 - **/ -public class MethodDataStackHolder { - - private final ThreadLocal> threadLocal; - - public MethodDataStackHolder(){ - threadLocal = new ThreadLocal<>(); - } - - public void putMethodData(MethodData methodData) { - Stack stack = null; - if (threadLocal.get() == null) { - stack = new Stack<>(); - }else { - stack = threadLocal.get(); - } - stack.add(methodData); - threadLocal.set(stack); - } - - public Stack getMethodData() { - return threadLocal.get(); - } - - public void remove() { - Stack stack = threadLocal.get(); - if (stack==null) { - return; - } - stack.pop(); - if (stack.isEmpty()) { - threadLocal.remove(); - } - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/common/ApiStatCommon.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/common/ApiStatCommon.java deleted file mode 100644 index 3f134daa252429f90e5ec1cde14cb876e6a79c2d..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/common/ApiStatCommon.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.damai.common; - - -import com.damai.enums.MethodLevel; -import org.aopalliance.intercept.MethodInvocation; -import org.springframework.context.EnvironmentAware; -import org.springframework.core.env.Environment; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestMapping; - -import java.lang.reflect.Method; - -import static com.damai.constant.ApiStatConstant.API_SPLIT; -import static com.damai.constant.ApiStatConstant.SPRING_APPLICATION_NAME; - -public abstract class ApiStatCommon implements EnvironmentAware { - - protected Environment environment; - - public String getApplicationName(){ - return environment.getProperty(SPRING_APPLICATION_NAME); - } - - public String getApi(MethodInvocation methodInvocation) { - Class targetClass = methodInvocation.getThis().getClass(); - String[] controllerClassApi = getControllerClassApi(targetClass); - StringBuilder api = new StringBuilder(getApplicationName()); - if (controllerClassApi != null && controllerClassApi.length > 0) { - if (!controllerClassApi[0].startsWith(API_SPLIT)) { - api.append(API_SPLIT); - } - api.append(controllerClassApi[0]); - } - String[] controllerMethodApi = getControllerMethodApi(methodInvocation.getMethod()); - if (controllerMethodApi == null || controllerMethodApi.length == 0) { - return null; - } - if (!controllerMethodApi[0].startsWith(API_SPLIT)) { - api.append(API_SPLIT); - } - api.append(controllerMethodApi[0]); - return api.toString(); - } - - public String[] getControllerClassApi(Class controllerClass) { - RequestMapping requestMapping = controllerClass.getAnnotation(RequestMapping.class); - if (requestMapping != null) { - return requestMapping.value(); - } - PostMapping postMapping = controllerClass.getAnnotation(PostMapping.class); - if (postMapping != null) { - return postMapping.value(); - } - GetMapping getMapping = controllerClass.getAnnotation(GetMapping.class); - if (getMapping != null) { - return getMapping.value(); - } - PutMapping putMapping = controllerClass.getAnnotation(PutMapping.class); - if (putMapping != null) { - return putMapping.value(); - } - DeleteMapping deleteMapping = controllerClass.getAnnotation(DeleteMapping.class); - if (deleteMapping != null) { - return deleteMapping.value(); - } - return null; - } - - public String[] getControllerMethodApi(Method method) { - RequestMapping requestMapping = method.getAnnotation(RequestMapping.class); - if (requestMapping != null) { - return requestMapping.value(); - } - PostMapping postMapping = method.getAnnotation(PostMapping.class); - if (postMapping != null) { - return postMapping.value(); - } - GetMapping getMapping = method.getAnnotation(GetMapping.class); - if (getMapping != null) { - return getMapping.value(); - } - PutMapping putMapping = method.getAnnotation(PutMapping.class); - if (putMapping != null) { - return putMapping.value(); - } - DeleteMapping deleteMapping = method.getAnnotation(DeleteMapping.class); - if (deleteMapping != null) { - return deleteMapping.value(); - } - return null; - } - - public abstract MethodLevel getMethodLevel(MethodInvocation pjp); - - @Override - public void setEnvironment(Environment environment) { - this.environment = environment; - } - -} - diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/common/impl/ApiStatSingleServiceCommon.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/common/impl/ApiStatSingleServiceCommon.java deleted file mode 100644 index bfa92351c2e8bf053b5d73fd659cc3440d7208ac..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/common/impl/ApiStatSingleServiceCommon.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.damai.common.impl; - -import com.damai.common.ApiStatCommon; -import com.damai.enums.MethodLevel; -import org.aopalliance.intercept.MethodInvocation; -import org.springframework.stereotype.Controller; -import org.springframework.stereotype.Repository; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RestController; - -import static com.damai.constant.ApiStatConstant.*; - -public class ApiStatSingleServiceCommon extends ApiStatCommon { - @Override - public MethodLevel getMethodLevel(MethodInvocation pjp) { - Class targetClass = pjp.getThis().getClass(); - if (targetClass.getAnnotation(Controller.class) != null || targetClass.getAnnotation(RestController.class) != null) { - return MethodLevel.CONTROLLER; - } else if (targetClass.getAnnotation(Service.class) != null) { - return MethodLevel.SERVICE; - } else if (targetClass.getAnnotation(Repository.class) != null) { - return MethodLevel.DAO; - } - String className = pjp.getMethod().getDeclaringClass().getName().toLowerCase(); - if (className.contains(CONTROLLER)) { - return MethodLevel.CONTROLLER; - } else if (className.contains(SERVICE)) { - return MethodLevel.SERVICE; - } else if (className.contains(DAO) || className.contains(MAPPER)) { - return MethodLevel.DAO; - } else { - return MethodLevel.OTHER_TYPE; - } - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/config/ApiStatAutoConfig.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/config/ApiStatAutoConfig.java deleted file mode 100644 index e7a1bd324d0fe1b83801e5f1b54295db4b859e7c..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/config/ApiStatAutoConfig.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.damai.config; - -import com.damai.ApiStatThreadPool; -import com.damai.common.ApiStatCommon; -import com.damai.common.impl.ApiStatSingleServiceCommon; -import com.damai.event.ApiStatEventHandler; -import com.damai.event.ApiStatEventPush; -import com.damai.handler.ApiStatRunTimeHandler; -import com.damai.redis.RedisCache; -import com.damai.MethodDataStackHolder; -import com.damai.handler.MethodHierarchyTransferHandler; -import com.damai.operate.MethodDataOperate; -import com.damai.operate.MethodHierarchyTransferOperate; -import com.damai.operate.MethodQueueOperate; -import com.damai.save.DataSave; -import com.damai.save.impl.RedisDataSave; -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor; -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; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-09-27 - **/ -@Slf4j -@Data -@EnableConfigurationProperties(ApiStatProperties.class) -@ConditionalOnProperty(value = "api-stat.enable",havingValue = "true") -public class ApiStatAutoConfig { - - @Bean - public ApiStatThreadPool apiStatThreadPool(){ - return new ApiStatThreadPool(); - } - - @Bean - @ConditionalOnMissingBean - public ApiStatCommon ApiStatSingleServiceCommon(){ - return new ApiStatSingleServiceCommon(); - } - - @Bean - public MethodDataStackHolder methodDataStackHolder(){ - return new MethodDataStackHolder(); - } - @Bean - public MethodDataOperate methodDataOperate(MethodDataStackHolder methodDataStackHolder,ApiStatCommon apiStatCommon){ - return new MethodDataOperate(methodDataStackHolder,apiStatCommon); - } - - @Bean - public MethodHierarchyTransferOperate methodHierarchyTransferOperate(){ - return new MethodHierarchyTransferOperate(); - } - - @Bean - public MethodQueueOperate methodQueueOperate(MethodHierarchyTransferHandler methodHierarchyTransferHandler,ApiStatProperties apiStatProperties){ - return new MethodQueueOperate(methodHierarchyTransferHandler,apiStatProperties); - } - - @Bean - public DataSave dataSave(RedisCache redisCache,ApiStatProperties apiStatProperties,ApiStatCommon apiStatCommon){ - return new RedisDataSave(redisCache,apiStatProperties,apiStatCommon); - } - - @Bean - public MethodHierarchyTransferHandler methodHierarchyTransferHandler(DataSave dataSave){ - return new MethodHierarchyTransferHandler(dataSave); - } - - @Bean - public AspectJExpressionPointcutAdvisor apiStatAdvisor(ApiStatProperties apiStatProperties, MethodDataOperate methodDataOperate, - MethodDataStackHolder methodDataStackHolder, - MethodHierarchyTransferOperate methodHierarchyTransferOperate, - MethodQueueOperate methodQueueOperate) { - AspectJExpressionPointcutAdvisor advisor = new AspectJExpressionPointcutAdvisor(); - advisor.setExpression(apiStatProperties.getPointcut()); - advisor.setAdvice(new ApiStatRunTimeHandler(methodDataOperate,methodDataStackHolder, - methodHierarchyTransferOperate,methodQueueOperate)); - return advisor; - } - - @Bean - public ApiStatEventPush apiStatEventPush(){ - return new ApiStatEventPush(); - } - - @Bean - public ApiStatEventHandler apiStatEventHandler(MethodQueueOperate methodQueueOperate){ - return new ApiStatEventHandler(methodQueueOperate); - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/config/ApiStatProperties.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/config/ApiStatProperties.java deleted file mode 100644 index 7d6659ac8413af0223a21d878951f1409874a3dd..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/config/ApiStatProperties.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.damai.config; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; - -import java.util.Map; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-09-27 - **/ -@Data -@ConfigurationProperties(prefix = ApiStatProperties.prefix) -public class ApiStatProperties { - - public static final String prefix = "api-stat"; - - private boolean enable; - - private String pointcut; - - private Integer queueSize = 5000; - - private Map noReported; -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/event/ApiStatEvent.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/event/ApiStatEvent.java deleted file mode 100644 index ed6d828655dbea3c131a551495af3ad3474b01fd..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/event/ApiStatEvent.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.damai.event; - -import org.springframework.context.ApplicationEvent; - -/** - * @program: - * @description: - * @author: - * @create: 2023-10-03 - **/ -public class ApiStatEvent extends ApplicationEvent { - /** - * Create a new {@code ApplicationEvent}. - * - * @param source the object on which the event initially occurred or with - * which the event is associated (never {@code null}) - */ - public ApiStatEvent(final Object source) { - super(source); - } -} \ No newline at end of file diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/event/ApiStatEventHandler.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/event/ApiStatEventHandler.java deleted file mode 100644 index 8b01cf1022e301cf8e5743d14fc45765611fbedd..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/event/ApiStatEventHandler.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.damai.event; - -import com.damai.operate.MethodQueueOperate; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.context.ApplicationListener; - -@AllArgsConstructor -@Slf4j -public class ApiStatEventHandler implements ApplicationListener { - - private final MethodQueueOperate methodQueueOperate; - - - @Override - public void onApplicationEvent(ApiStatEvent event) { - new Thread(() -> { - try { - log.info("take method queue..."); - methodQueueOperate.takeTask(); - }catch (Exception e) { - log.error("take method queue error",e); - } - }).start(); - } - -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/event/ApiStatEventPush.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/event/ApiStatEventPush.java deleted file mode 100644 index 73f172f0a6526b24b3191bfaed59ea21f0abe119..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/event/ApiStatEventPush.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.damai.event; - -import org.springframework.boot.context.event.ApplicationStartedEvent; -import org.springframework.context.ApplicationListener; - -/** - * @program: - * @description: - * @author: 星哥 - * @create: 2023-04-24 - **/ - -public class ApiStatEventPush implements ApplicationListener { - - @Override - public void onApplicationEvent(final ApplicationStartedEvent event) { - event.getApplicationContext().publishEvent(new ApiStatEvent(this)); - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/handler/ApiStatRunTimeHandler.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/handler/ApiStatRunTimeHandler.java deleted file mode 100644 index 286a6710b392cd38cdcd5f26cbe4a9604efa1c14..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/handler/ApiStatRunTimeHandler.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.damai.handler; - -import com.damai.MethodDataStackHolder; -import com.damai.operate.MethodDataOperate; -import com.damai.operate.MethodHierarchyTransferOperate; -import com.damai.operate.MethodQueueOperate; -import com.damai.structure.MethodData; -import com.damai.structure.MethodHierarchyTransfer; - -import lombok.AllArgsConstructor; -import org.aopalliance.intercept.MethodInterceptor; -import org.aopalliance.intercept.MethodInvocation; - -import java.math.BigDecimal; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-09-27 - **/ -@AllArgsConstructor -public class ApiStatRunTimeHandler implements MethodInterceptor { - - private final MethodDataOperate methodDataOperate; - - private final MethodDataStackHolder methodDataStackHolder; - - private final MethodHierarchyTransferOperate methodHierarchyTransferOperate; - - private final MethodQueueOperate methodQueueOperate; - - @Override - public Object invoke(final MethodInvocation methodInvocation) throws Throwable { - Object obj; - long start = System.currentTimeMillis(); - MethodData parentMethodData = methodDataOperate.getParentMethodData(); - MethodHierarchyTransfer methodHierarchyTransfer; - boolean exceptionFlag = false; - MethodData currentMethodData; - currentMethodData = methodDataOperate.getCurrentMethodData(methodInvocation); - try { - methodDataStackHolder.putMethodData(currentMethodData); - obj = methodInvocation.proceed(); - } catch (Throwable t) { - exceptionFlag = true; - throw t; - } finally { - long end = System.currentTimeMillis(); - currentMethodData.setExecuteTime(new BigDecimal(end - start)); - methodHierarchyTransfer = methodHierarchyTransferOperate.getMethodHierarchyTransfer(methodInvocation,parentMethodData, - currentMethodData,exceptionFlag); - methodQueueOperate.add(methodHierarchyTransfer); - methodDataStackHolder.remove(); - } - return obj; - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/handler/MethodHierarchyTransferHandler.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/handler/MethodHierarchyTransferHandler.java deleted file mode 100644 index 53840e0a81d91a62093349faefdaccf05e1e63af..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/handler/MethodHierarchyTransferHandler.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.damai.handler; - -import com.damai.save.DataSave; -import com.damai.structure.MethodHierarchyTransfer; -import lombok.AllArgsConstructor; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-09-28 - **/ -@AllArgsConstructor -public class MethodHierarchyTransferHandler{ - - private final DataSave dataSave; - - public void consumer(MethodHierarchyTransfer methodHierarchyTransfer){ - dataSave.save(methodHierarchyTransfer); - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/operate/MethodDataOperate.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/operate/MethodDataOperate.java deleted file mode 100644 index c649b6791e22f541ac4b94c2a2b4c4d8f1df651a..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/operate/MethodDataOperate.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.damai.operate; - -import com.damai.enums.MethodLevel; -import com.damai.MethodDataStackHolder; -import com.damai.structure.MethodData; -import com.damai.common.ApiStatCommon; -import lombok.AllArgsConstructor; -import org.aopalliance.intercept.MethodInvocation; - -import java.util.Stack; - -import static com.damai.constant.ApiStatConstant.METHOD_DATA_SPLIT; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-09-28 - **/ -@AllArgsConstructor -public class MethodDataOperate { - - private final MethodDataStackHolder methodDataStackHolder; - - private final ApiStatCommon apiStatCommon; - - - public MethodData getParentMethodData() { - Stack stack = methodDataStackHolder.getMethodData(); - if (stack == null) { - return null; - } - return stack.peek(); - } - - public MethodData getCurrentMethodData(MethodInvocation methodInvocation) { - String className = methodInvocation.getMethod().getDeclaringClass().getName(); - String methodName = methodInvocation.getMethod().getName(); - MethodData methodData = new MethodData(); - methodData.setId(apiStatCommon.getApplicationName() + METHOD_DATA_SPLIT + className + METHOD_DATA_SPLIT + methodName); - methodData.setClassName(className); - methodData.setMethodName(methodName); - methodData.setMethodLevel(apiStatCommon.getMethodLevel(methodInvocation)); - if (methodData.getMethodLevel()== MethodLevel.CONTROLLER) { - methodData.setApi(apiStatCommon.getApi(methodInvocation)); - } - return methodData; - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/operate/MethodHierarchyTransferOperate.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/operate/MethodHierarchyTransferOperate.java deleted file mode 100644 index 2cf238e87fa2d9d452e563d21bdd0abb18e784aa..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/operate/MethodHierarchyTransferOperate.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.damai.operate; - -import com.damai.structure.MethodData; -import com.damai.structure.MethodHierarchyTransfer; -import org.aopalliance.intercept.MethodInvocation; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-09-28 - **/ -public class MethodHierarchyTransferOperate { - - public MethodHierarchyTransfer getMethodHierarchyTransfer(MethodInvocation methodInvocation, MethodData parentMethodData, - MethodData currentMethodData, boolean exceptionFlag) { - MethodHierarchyTransfer methodHierarchyTransfer = new MethodHierarchyTransfer(); - methodHierarchyTransfer.setCurrentMethodData(currentMethodData); - methodHierarchyTransfer.setParentMethodData(parentMethodData); - methodHierarchyTransfer.setNames(methodInvocation.getMethod().getParameters()); - methodHierarchyTransfer.setValues(methodInvocation.getArguments()); - methodHierarchyTransfer.setExceptionFlag(exceptionFlag); - return methodHierarchyTransfer; - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/operate/MethodQueueOperate.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/operate/MethodQueueOperate.java deleted file mode 100644 index 1e916d63c1c1c14bd681d1bbe8eb19c9fdc0e778..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/operate/MethodQueueOperate.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.damai.operate; - - -import com.alibaba.fastjson.JSON; -import com.damai.config.ApiStatProperties; -import com.damai.handler.MethodHierarchyTransferHandler; -import com.damai.structure.MethodHierarchyTransfer; -import lombok.extern.slf4j.Slf4j; - -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.BlockingQueue; - -@Slf4j -public class MethodQueueOperate { - - private final BlockingQueue blockingQueue; - - private final MethodHierarchyTransferHandler methodHierarchyTransferHandler; - - - public MethodQueueOperate(MethodHierarchyTransferHandler methodHierarchyTransferHandler,ApiStatProperties apiStatProperties){ - this.blockingQueue = new ArrayBlockingQueue<>(apiStatProperties.getQueueSize()); - this.methodHierarchyTransferHandler = methodHierarchyTransferHandler; - } - - public void add(MethodHierarchyTransfer methodHierarchyTransfer) { - boolean result = blockingQueue.offer(methodHierarchyTransfer); - if (!result) { - log.warn("blockingQueue offer fail methodHierarchyTransfer : {}", JSON.toJSONString(methodHierarchyTransfer)); - } - } - - - public void takeTask() { - for(;;) { - try { - MethodHierarchyTransfer methodHierarchyTransfer = blockingQueue.take(); - methodHierarchyTransferHandler.consumer(methodHierarchyTransfer); - } catch (Exception e) { - log.error("consumer task error",e); - } - } - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/save/DataSave.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/save/DataSave.java deleted file mode 100644 index 8139ff15ccfda8d7a32073cbfe0fd913c81d425e..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/save/DataSave.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.damai.save; - -import com.damai.structure.MethodHierarchyTransfer; - -public interface DataSave { - - void save(MethodHierarchyTransfer methodHierarchyTransfer); -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/save/impl/RedisDataSave.java b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/save/impl/RedisDataSave.java deleted file mode 100644 index 9097dac7ebdf9f8b8a2e1d2e950be8666d786d43..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/java/com/damai/save/impl/RedisDataSave.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.damai.save.impl; - - -import com.alibaba.fastjson.JSON; -import com.damai.common.ApiStatCommon; -import com.damai.config.ApiStatProperties; -import com.damai.core.RedisKeyEnum; -import com.damai.core.StringUtil; -import com.damai.enums.MethodLevel; -import com.damai.redis.RedisCache; -import com.damai.redis.RedisKeyWrap; -import com.damai.save.DataSave; -import com.damai.structure.MethodData; -import com.damai.structure.MethodDetailData; -import com.damai.structure.MethodHierarchyTransfer; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeanUtils; -import org.springframework.core.io.ClassPathResource; -import org.springframework.data.redis.core.script.DefaultRedisScript; -import org.springframework.scripting.support.ResourceScriptSource; -import org.springframework.util.AntPathMatcher; -import org.springframework.util.PathMatcher; - -import javax.annotation.PostConstruct; -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static com.damai.constant.ApiStatConstant.REDIS_DATA_SAVE_LUA_PATH; - -@Slf4j -public class RedisDataSave implements DataSave { - - private final RedisCache redisCache; - - private final ApiStatProperties apiStatProperties; - - private final ApiStatCommon apiStatCommon; - - private final PathMatcher matcher = new AntPathMatcher(); - - private DefaultRedisScript redisScript; - - public RedisDataSave(RedisCache redisCache,ApiStatProperties apiStatProperties,ApiStatCommon apiStatCommon){ - this.redisCache = redisCache; - this.apiStatProperties = apiStatProperties; - this.apiStatCommon = apiStatCommon; - } - - @PostConstruct - public void init(){ - try { - redisScript = new DefaultRedisScript(); - redisScript.setScriptSource(new ResourceScriptSource(new ClassPathResource(REDIS_DATA_SAVE_LUA_PATH))); - redisScript.setResultType(String.class); - } catch (Exception e) { - log.error("redisScript init lua error",e); - } - } - - @Override - public void save(MethodHierarchyTransfer methodHierarchyTransfer) { - MethodData currentMethodData = methodHierarchyTransfer.getCurrentMethodData(); - MethodData parentMethodData = methodHierarchyTransfer.getParentMethodData(); - BigDecimal executeTime = addMethodDetail(currentMethodData,methodHierarchyTransfer.isExceptionFlag()); - if (currentMethodData.getMethodLevel() == MethodLevel.CONTROLLER) { - addControllerSortedSet(currentMethodData,apiStatProperties,executeTime); - } - - addChildren(parentMethodData,currentMethodData); - } - - public BigDecimal addMethodDetail(MethodData methodData,boolean exceptionFlag){ - if (methodData == null) { - return null; - } - String oldMethodDetailIdRelKey = RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_METHOD_DETAIL, methodData.getId()).getRelKey(); - List keys = Stream.of(oldMethodDetailIdRelKey).collect(Collectors.toList()); - String[] parameters = new String[]{JSON.toJSONString(methodData),exceptionFlag ? "1" : "0"}; - String avgExecuteTime = (String)redisCache.getInstance().execute(redisScript, keys, parameters); - return new BigDecimal(avgExecuteTime); - } - - public boolean checkNoReported(MethodData methodData,ApiStatProperties apiStatProperties){ - - Map noReported = apiStatProperties.getNoReported(); - String[] apis = null; - if (!Objects.isNull(noReported)) { - apis = noReported.get(apiStatCommon.getApplicationName()); - } - if (!Objects.isNull(apis)) { - for (String api : apis) { - if (StringUtil.isNotEmpty(methodData.getApi()) && matcher.match(api,methodData.getApi())) { - return true; - } - } - } - return false; - } - - public void addControllerSortedSet(MethodData methodData,ApiStatProperties apiStatProperties,BigDecimal executeTime){ - if (methodData == null) { - return; - } - if (checkNoReported(methodData,apiStatProperties)) { - return; - } - MethodDetailData methodDetailData = new MethodDetailData(); - BeanUtils.copyProperties(methodData,methodDetailData); - methodDetailData.setExecuteTime(null); - methodDetailData.setExceptionCount(0L); - redisCache.addForZSet(RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_CONTROLLER_SORTED_SET),methodDetailData,executeTime.doubleValue()); - } - - public void addChildren(MethodData parentMethodData,MethodData currentMethodData){ - if (parentMethodData == null || currentMethodData == null) { - return; - } - if (parentMethodData.getMethodLevel() == MethodLevel.CONTROLLER) { - redisCache.addForSet(RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_CONTROLLER_CHILDREN_SET,parentMethodData.getId()),currentMethodData.getId()); - } else if (parentMethodData.getMethodLevel() == MethodLevel.SERVICE) { - redisCache.addForSet(RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_SERVICE_CHILDREN_SET,parentMethodData.getId()),currentMethodData.getId()); - } - } -} diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/resources/lua/redis_data_save.lua b/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/resources/lua/redis_data_save.lua deleted file mode 100644 index 184ab56c4cbcf5ce958f00f350022f7d6880707a..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/resources/lua/redis_data_save.lua +++ /dev/null @@ -1,48 +0,0 @@ -local oldMethodDetailIdRelKey = KEYS[1] -local methodDataStr = ARGV[1] -local methodData = cjson.decode(methodDataStr) -local exceptionFlag = tonumber(ARGV[2]) -local oldMethodDetailDataStr = '' -local newAvgExecuteTime = '' - - -if (redis.call('exists', oldMethodDetailIdRelKey) == 0) then - local oldMethodDetailData = { - id = methodData.id, - className = methodData.className, - methodName = methodData.methodName, - argumentCount = methodData.argumentCount, - methodLevel = methodData.methodLevel, - executeTime = methodData.executeTime, - api = methodData.api, - avgExecuteTime = methodData.executeTime, - maxExecuteTime = methodData.executeTime, - minExecuteTime = methodData.executeTime - } - oldMethodDetailDataStr = cjson.encode(oldMethodDetailData) - newAvgExecuteTime = oldMethodDetailData.avgExecuteTime -else - oldMethodDetailDataStr = redis.call('get',oldMethodDetailIdRelKey) - local oldMethodDetailData = cjson.decode(oldMethodDetailDataStr) - local avg1 = tonumber(methodData.executeTime) - local avg2 = tonumber(oldMethodDetailData.avgExecuteTime) - newAvgExecuteTime = (avg1 + avg2) / 2 - oldMethodDetailData.avgExecuteTime = newAvgExecuteTime - - local newMaxExecuteTime = oldMethodDetailData.maxExecuteTime - if (methodData.executeTime > newMaxExecuteTime) then - newMaxExecuteTime = methodData.executeTime - end - local newMinExecuteTime = oldMethodDetailData.minExecuteTime - if (methodData.executeTime < newMinExecuteTime) then - newMinExecuteTime = methodData.executeTime - end - oldMethodDetailData.maxExecuteTime = newMaxExecuteTime - oldMethodDetailData.minExecuteTime = newMinExecuteTime - if (exceptionFlag == 1) then - oldMethodDetailData.exceptionCount = oldMethodDetailData.exceptionCount + 1 - end - oldMethodDetailDataStr = cjson.encode(oldMethodDetailData) -end -redis.call('set',oldMethodDetailIdRelKey,oldMethodDetailDataStr) -return tostring(newAvgExecuteTime) \ No newline at end of file diff --git a/api-stat/api-stat-reported/pom.xml b/api-stat/api-stat-reported/pom.xml deleted file mode 100644 index f0a2d12b6f6be2fefe3773c566097f9a096057d4..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-reported/pom.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - 4.0.0 - - - com.example - api-stat - ${revision} - - - api-stat-reported - api-stat-reported - api-stat-reported - pom - - - api-stat-reported-single-service - api-stat-reported-cloud-service - - - diff --git a/api-stat/api-stat-system/.gitignore b/api-stat/api-stat-system/.gitignore deleted file mode 100644 index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/** -!**/src/test/** - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ - -### VS Code ### -.vscode/ diff --git a/api-stat/api-stat-system/pom.xml b/api-stat/api-stat-system/pom.xml deleted file mode 100644 index 7af9180530b7a704430a8dcae53dfa274b8bcdc6..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/pom.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - 4.0.0 - - - com.example - api-stat - ${revision} - - - - api-stat-system - - api-stat-system - api统计后台管理 - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-aop - - - com.alibaba - fastjson - ${fastjson.version} - - - org.springframework.boot - spring-boot-starter-mail - - - net.bytebuddy - byte-buddy-agent - - - com.github.oshi - oshi-core - ${oshi-core.version} - - - org.springframework.boot - spring-boot-starter-validation - - - com.example - damai-service-common - ${revision} - - - com.example - damai-redis-framework - ${revision} - - - com.example - api-stat-common - ${revision} - - - com.example - damai-service-lock-framework - ${revision} - - - - - diff --git a/api-stat/api-stat-system/src/main/java/com/damai/ApiStatSystemApplication.java b/api-stat/api-stat-system/src/main/java/com/damai/ApiStatSystemApplication.java deleted file mode 100644 index 70cead7c1b9eb8a81395f297d5cdcc2eced6f864..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/ApiStatSystemApplication.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.damai; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.scheduling.annotation.EnableScheduling; - -@EnableScheduling -@SpringBootApplication -public class ApiStatSystemApplication { - - public static void main(String[] args) { - SpringApplication.run(ApiStatSystemApplication.class, args); - } - -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/controller/ApiStatSystemController.java b/api-stat/api-stat-system/src/main/java/com/damai/controller/ApiStatSystemController.java deleted file mode 100644 index 98d095aec99a49880869b47fbefbce7c322b819f..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/controller/ApiStatSystemController.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.damai.controller; - - -import com.damai.common.ApiResponse; -import com.damai.dto.MethodChainDto; -import com.damai.dto.PageDto; -import com.damai.notice.ApiStatNotice; -import com.damai.service.ApiStatSystemService; -import com.damai.structure.MethodDetailData; -import com.damai.vo.PageVo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.validation.Valid; -import java.util.List; - -import static com.damai.constant.ApiStatConstant.PLATFORM_NOTICE; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-09-27 - **/ -@RestController -public class ApiStatSystemController { - - @Autowired - private ApiStatSystemService apiStatSystemService; - - @Autowired - private ApiStatNotice apiStatNotice; - - @PostMapping(value = "/getControllerMethods") - public ApiResponse> getControllerMethods(){ - return ApiResponse.ok(apiStatSystemService.getControllerMethods()); - } - - @PostMapping(value = "/getControllerMethodsPage") - public ApiResponse> getControllerMethodsPage(@Valid @RequestBody PageDto pageDto){ - return ApiResponse.ok(apiStatSystemService.getControllerMethodsPage(pageDto)); - } - - @PostMapping(value = "/getMethodChainList") - public ApiResponse getMethodChainList(@Valid @RequestBody MethodChainDto methodChainDto){ - return ApiResponse.ok(apiStatSystemService.getMethodChainList(methodChainDto)); - } - - @RequestMapping(value = "/notice") - public ApiResponse notice(){ - apiStatNotice.notice(PLATFORM_NOTICE); - return ApiResponse.ok(); - } - -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/dto/MethodChainDto.java b/api-stat/api-stat-system/src/main/java/com/damai/dto/MethodChainDto.java deleted file mode 100644 index 74ce2b55e00f6f6aab49b094c8b8e3821ffb19f9..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/dto/MethodChainDto.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.damai.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-07 - **/ -@Data -@ApiModel(value="MethodChainDto", description ="MethodChainDto") -public class MethodChainDto { - - @ApiModelProperty(name ="methodDetailDataId", dataType ="String", value ="MethodDetailDataId", required =true) - @NotBlank - private String methodDetailDataId; -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/dto/PageDto.java b/api-stat/api-stat-system/src/main/java/com/damai/dto/PageDto.java deleted file mode 100644 index 67a4268f60f4d9b0543fe64a74f0dfc7a0c8a4ac..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/dto/PageDto.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.damai.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -@Data -@ApiModel(value="PageDto", description ="PageDto") -public class PageDto { - - @ApiModelProperty(name ="pageNo", dataType ="Long", value ="当前页码", required =true) - @NotNull - private Long pageNo; - - @ApiModelProperty(name ="pageSize", dataType ="Long", value ="页数大小", required =true) - @NotNull - private Long pageSize; -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/info/PageInfo.java b/api-stat/api-stat-system/src/main/java/com/damai/info/PageInfo.java deleted file mode 100644 index 4dc5480ec768165c2d2ce957c81a3b77594847d4..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/info/PageInfo.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.damai.info; - -import lombok.Data; - -@Data -public class PageInfo { - - private Long pageNo; - - private Long pageSize; - - private Long totalRecord; - - private Long pageTotal; - - private Long start; - - private Long end; -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/notice/ApiStatNotice.java b/api-stat/api-stat-system/src/main/java/com/damai/notice/ApiStatNotice.java deleted file mode 100644 index 135016eee8b10735a5e886ff3c98797a0425e476..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/notice/ApiStatNotice.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.damai.notice; - -import cn.hutool.core.collection.CollectionUtil; -import com.damai.core.RedisKeyEnum; -import com.damai.notice.config.ApiStatNoticeProperties; -import com.damai.redis.RedisCache; -import com.damai.redis.RedisKeyWrap; -import com.damai.servicelock.annotion.ServiceLock; -import com.damai.structure.MethodDetailData; -import com.damai.structure.MethodNoticeData; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.data.redis.core.ZSetOperations.TypedTuple; - -import java.math.BigDecimal; -import java.util.List; -import java.util.Set; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -import static com.damai.core.DistributedLockConstants.API_STAT_LOCK; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-07 - **/ -@Slf4j -@AllArgsConstructor -public class ApiStatNotice { - - private final ApiStatNoticeProperties apiStatNoticeProperties; - - private final RedisCache redisCache; - - private final List platformList; - - @ServiceLock(name = API_STAT_LOCK,keys = {"#platformNotice"},waitTime = 0L) - public void notice(String platformNotice){ - log.info("schedule task {}",platformNotice); - try { - Boolean exist = redisCache.hasKey(RedisKeyWrap.createRedisKey(RedisKeyEnum.PLATFORM_NOTICE_FLAG)); - if (exist) { - return; - } - redisCache.set(RedisKeyWrap.createRedisKey(RedisKeyEnum.PLATFORM_NOTICE_FLAG),platformNotice,23L, TimeUnit.HOURS); - if (CollectionUtil.isEmpty(platformList)) { - log.warn("platform empty"); - return; - } - List methodDetailDataList = getMethodDetailDataListStr(); - if (CollectionUtil.isEmpty(methodDetailDataList)) { - log.warn("method detail data empty"); - return; - } - for (final Platform platform : platformList) { - platform.sendMessage(methodDetailDataList); - } - }catch (Exception e) { - log.error("schedule task {} error",platformNotice,e); - } - } - public List getMethodDetailDataListStr(){ - Set> set = redisCache.rangeByScoreWithScoreForZSet(RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_CONTROLLER_SORTED_SET), - apiStatNoticeProperties.getMin(), apiStatNoticeProperties.getMax(), apiStatNoticeProperties.getStart(), apiStatNoticeProperties.getEnd(), MethodDetailData.class); - return set.stream().map(typedTuple -> { - Double score = typedTuple.getScore(); - MethodDetailData value = typedTuple.getValue(); - MethodNoticeData methodNoticeData = new MethodNoticeData(); - methodNoticeData.setApi(value.getApi()); - methodNoticeData.setArgumentCount(value.getArgumentCount()); - methodNoticeData.setAvgExecuteTime(new BigDecimal(String.valueOf(score))); - return methodNoticeData; - }).collect(Collectors.toList()); - } -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/notice/Platform.java b/api-stat/api-stat-system/src/main/java/com/damai/notice/Platform.java deleted file mode 100644 index b98d8d1d8709536b3a0508a14e0eb339ac8c82c2..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/notice/Platform.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.damai.notice; - -import com.alibaba.fastjson.JSON; -import com.damai.notice.config.ApiStatNoticeProperties; -import com.damai.structure.MethodNoticeData; -import lombok.AllArgsConstructor; - -import java.util.List; - -/** - * @program: cook-frame - * @description: - * @author: lk - * @create: 2023-10-07 - **/ -@AllArgsConstructor -public abstract class Platform { - - protected final ApiStatNoticeProperties apiStatNoticeProperties; - - private final String REL_MESSAGE_TEMPLATE = "获得执行时间耗时在%s和%s之间,从第%s开始获取%s的记录为:%s"; - - public void sendMessage(List methodNoticeDataList) { - String relMessage = String.format(REL_MESSAGE_TEMPLATE, apiStatNoticeProperties.getMin(), apiStatNoticeProperties.getMax(), - apiStatNoticeProperties.getStart(), apiStatNoticeProperties.getEnd(), JSON.toJSONString(methodNoticeDataList)); - sendRelMessage(relMessage); - } - public abstract void sendRelMessage(String content); -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/notice/config/ApiStatNoticeAutoConfig.java b/api-stat/api-stat-system/src/main/java/com/damai/notice/config/ApiStatNoticeAutoConfig.java deleted file mode 100644 index f5c3568ce37944e642ab88c4fd215d34eaba5ed5..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/notice/config/ApiStatNoticeAutoConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.damai.notice.config; - -import com.damai.notice.ApiStatNotice; -import com.damai.notice.Platform; -import com.damai.redis.RedisCache; -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Bean; - -import java.util.List; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-07 - **/ -@Slf4j -@Data -@EnableConfigurationProperties(ApiStatNoticeProperties.class) -@ConditionalOnProperty(value = "api.enable",havingValue = "true") -public class ApiStatNoticeAutoConfig { - - @Bean - public List platformList(ApiStatNoticeProperties apiStatNoticeProperties){ - PlatformRegistry platformRegistry = new PlatformRegistry(apiStatNoticeProperties); - return platformRegistry.createPlatforms(); - } - - @Bean - public ApiStatNotice apiStatNotice(ApiStatNoticeProperties apiStatNoticeProperties, RedisCache redisCache, List platformList){ - return new ApiStatNotice(apiStatNoticeProperties,redisCache,platformList); - } - -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/notice/config/ApiStatNoticeProperties.java b/api-stat/api-stat-system/src/main/java/com/damai/notice/config/ApiStatNoticeProperties.java deleted file mode 100644 index 5a87651196dae7d2732dc45cb29f09e4847a1470..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/notice/config/ApiStatNoticeProperties.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.damai.notice.config; - -import com.damai.enums.PlatformType; -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; - -import java.util.List; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-07 - **/ -@Data -@ConfigurationProperties(prefix = ApiStatNoticeProperties.prefix) -public class ApiStatNoticeProperties { - - public static final String prefix = "api"; - - private Integer start = 0; - - private Integer end = 10; - - private Double min = 0.00; - - private Double max = 999999.00; - - private boolean enable; - - private List platformTypes; - - private PlatformAddressProperties platformAddress; -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/notice/config/PlatformAddressProperties.java b/api-stat/api-stat-system/src/main/java/com/damai/notice/config/PlatformAddressProperties.java deleted file mode 100644 index d2f71c14930e6b057c8673e7f389e0e21d8365f3..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/notice/config/PlatformAddressProperties.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.damai.notice.config; - -import lombok.Data; - -import java.util.List; - -@Data -public class PlatformAddressProperties { - - /** - * 钉钉 - */ - public String dingDingWebhook; - - /** - * 企业微信 - */ - public String weComWebhook; - - /** - * 飞书 - */ - public String feiShuWebhook; - - /** - * 邮件 - */ - private List emails; -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/notice/config/PlatformRegistry.java b/api-stat/api-stat-system/src/main/java/com/damai/notice/config/PlatformRegistry.java deleted file mode 100644 index 61d997cbf517e73334d671bd072520e2c183ec5d..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/notice/config/PlatformRegistry.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.damai.notice.config; - -import com.damai.enums.PlatformType; -import com.damai.exception.DaMaiFrameException; -import com.damai.notice.Platform; -import com.damai.notice.impl.DingDingPlatform; -import com.damai.notice.impl.EmailPlatform; -import com.damai.notice.impl.FeiShuPlatform; -import com.damai.notice.impl.WeComPlatform; -import lombok.AllArgsConstructor; -import org.springframework.util.CollectionUtils; - -import java.util.ArrayList; -import java.util.List; - -import static com.damai.enums.BaseCode.MESSAGE_PLATFORM_NOT_EXIST; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-07 - **/ -@AllArgsConstructor -public class PlatformRegistry { - - private final ApiStatNoticeProperties apiStatNoticeProperties; - - public List createPlatforms(){ - List platformTypes = apiStatNoticeProperties.getPlatformTypes(); - if (CollectionUtils.isEmpty(platformTypes)) { - return null; - } - List list = new ArrayList<>(); - for (final PlatformType platformType : platformTypes) { - list.add(createPlatform(platformType,apiStatNoticeProperties)); - } - return list; - } - - public Platform createPlatform(PlatformType platformType,ApiStatNoticeProperties apiStatNoticeProperties){ - switch (platformType) { - case DingDing: - return new DingDingPlatform(apiStatNoticeProperties); - case WeCom: - return new WeComPlatform(apiStatNoticeProperties); - case FeiShu: - return new FeiShuPlatform(apiStatNoticeProperties); - case Email: - return new EmailPlatform(apiStatNoticeProperties); - default: - throw new DaMaiFrameException(MESSAGE_PLATFORM_NOT_EXIST); - } - } -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/notice/impl/DingDingPlatform.java b/api-stat/api-stat-system/src/main/java/com/damai/notice/impl/DingDingPlatform.java deleted file mode 100644 index 0296902ac54ef41afa9e2ec1d7b71e24ed50691e..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/notice/impl/DingDingPlatform.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.damai.notice.impl; - -import cn.hutool.http.HttpUtil; -import com.alibaba.fastjson.JSONObject; -import com.damai.core.StringUtil; -import com.damai.notice.config.ApiStatNoticeProperties; -import com.damai.notice.Platform; -import com.damai.notice.config.PlatformAddressProperties; -import lombok.extern.slf4j.Slf4j; - -import java.util.Optional; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-07 - **/ -@Slf4j -public class DingDingPlatform extends Platform { - - public DingDingPlatform(final ApiStatNoticeProperties apiStatNoticeProperties) { - super(apiStatNoticeProperties); - } - - /** - * ... - * */ - @Override - public void sendRelMessage(final String content) { - String dingDingWebhook = Optional.ofNullable(apiStatNoticeProperties.getPlatformAddress()).map(PlatformAddressProperties::getDingDingWebhook).orElse(null); - if (StringUtil.isEmpty(dingDingWebhook)) { - return; - } - log.info("dingTalk send message : {}",content); - JSONObject message = new JSONObject(); - message.put("msgtype","text"); - JSONObject text = new JSONObject(); - text.put("content",content); - message.put("text",text); - - JSONObject at = new JSONObject(); - at.put("isAtAll",true); - message.put("at",at); - String result = HttpUtil.post(dingDingWebhook,message.toJSONString()); - log.info("dingTalk send message result : {}",result); - } -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/notice/impl/EmailPlatform.java b/api-stat/api-stat-system/src/main/java/com/damai/notice/impl/EmailPlatform.java deleted file mode 100644 index 6dd3f0cb7274bfe7927e4d08231e72186e0a04f1..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/notice/impl/EmailPlatform.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.damai.notice.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.extra.mail.MailUtil; -import com.damai.notice.Platform; -import com.damai.notice.config.ApiStatNoticeProperties; -import com.damai.notice.config.PlatformAddressProperties; -import lombok.extern.slf4j.Slf4j; - -import java.util.List; -import java.util.Optional; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-07 - **/ -@Slf4j -public class EmailPlatform extends Platform { - - private final String SUBJECT = "API耗时通知"; - - public EmailPlatform(final ApiStatNoticeProperties apiStatNoticeProperties) { - super(apiStatNoticeProperties); - } - - @Override - public void sendRelMessage(final String content) { - List emails = Optional.ofNullable(apiStatNoticeProperties.getPlatformAddress()).map(PlatformAddressProperties::getEmails).orElse(null); - if (CollectionUtil.isEmpty(emails) || emails.size() == 0) { - return; - } - log.info("email send message : {}",content); - MailUtil.send(emails, SUBJECT, content, false); - } -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/notice/impl/FeiShuPlatform.java b/api-stat/api-stat-system/src/main/java/com/damai/notice/impl/FeiShuPlatform.java deleted file mode 100644 index d9b49b034f7983a065d9909875f12bc5e9495834..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/notice/impl/FeiShuPlatform.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.damai.notice.impl; - -import cn.hutool.http.HttpUtil; -import com.alibaba.fastjson.JSONObject; -import com.damai.core.StringUtil; -import com.damai.notice.config.ApiStatNoticeProperties; -import com.damai.notice.Platform; -import com.damai.notice.config.PlatformAddressProperties; -import lombok.extern.slf4j.Slf4j; - -import java.util.Optional; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-07 - **/ -@Slf4j -public class FeiShuPlatform extends Platform { - - public FeiShuPlatform(final ApiStatNoticeProperties apiStatNoticeProperties) { - super(apiStatNoticeProperties); - } - - /** - * ... - * */ - @Override - public void sendRelMessage(final String content) { - String feiShuWebhook = Optional.ofNullable(apiStatNoticeProperties.getPlatformAddress()).map(PlatformAddressProperties::getFeiShuWebhook).orElse(null); - if (StringUtil.isEmpty(feiShuWebhook)) { - return; - } - log.info("feiShu send message : {}",content); - JSONObject message = new JSONObject(); - message.put("msg_type","text"); - JSONObject contentJson = new JSONObject(); - contentJson.put("text",content+"所有人"); - message.put("content",contentJson); - String result = HttpUtil.post(feiShuWebhook,message.toJSONString()); - log.info("feiShu send message : {}",result); - } -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/notice/impl/WeComPlatform.java b/api-stat/api-stat-system/src/main/java/com/damai/notice/impl/WeComPlatform.java deleted file mode 100644 index d934fc5da5529b908df810bf4573374e13fcb742..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/notice/impl/WeComPlatform.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.damai.notice.impl; - -import cn.hutool.http.HttpUtil; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.damai.core.StringUtil; -import com.damai.notice.config.ApiStatNoticeProperties; -import com.damai.notice.Platform; -import com.damai.notice.config.PlatformAddressProperties; -import lombok.extern.slf4j.Slf4j; - -import java.util.Optional; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-07 - **/ -@Slf4j -public class WeComPlatform extends Platform { - - public WeComPlatform(final ApiStatNoticeProperties apiStatNoticeProperties) { - super(apiStatNoticeProperties); - } - - /** - * ... - * */ - @Override - public void sendRelMessage(final String content) { - String weComWebhook = Optional.ofNullable(apiStatNoticeProperties.getPlatformAddress()).map(PlatformAddressProperties::getWeComWebhook).orElse(null); - if (StringUtil.isEmpty(weComWebhook)) { - return; - } - log.info("weCom send message : {}",content); - JSONObject message = new JSONObject(); - message.put("msgtype","text"); - JSONObject text = new JSONObject(); - text.put("content",content); - JSONArray mentionedList = new JSONArray(); - mentionedList.add("@all"); - text.put("mentioned_list",mentionedList); - message.put("text",text); - String result = HttpUtil.post(weComWebhook,message.toJSONString()); - log.info("weCom send message result : {}",result); - } -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/service/ApiStatSystemService.java b/api-stat/api-stat-system/src/main/java/com/damai/service/ApiStatSystemService.java deleted file mode 100644 index 4605029b5ab2060eca2ce14b0bddf4f0978abe26..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/service/ApiStatSystemService.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.damai.service; - -import com.damai.core.RedisKeyEnum; -import com.damai.dto.MethodChainDto; -import com.damai.dto.PageDto; -import com.damai.redis.RedisCache; -import com.damai.redis.RedisKeyWrap; -import com.damai.structure.MethodDetailData; -import com.damai.vo.PageVo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.ZSetOperations; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -@Service -public class ApiStatSystemService { - - @Autowired - private RedisCache redisCache; - - public List getControllerMethods() { - Set> typedTuples = redisCache.reverseRangeWithScoreForZSet(RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_CONTROLLER_SORTED_SET), 0, -1, MethodDetailData.class); - List list = typedTuples.stream().map(typedTuple -> { - Double score = typedTuple.getScore(); - MethodDetailData methodDetailData = typedTuple.getValue(); - methodDetailData.setExecuteTime(new BigDecimal(String.valueOf(score))); - methodDetailData.setAvgExecuteTime(new BigDecimal(String.valueOf(score))); - return methodDetailData; - }).collect(Collectors.toList()); - return list; - } - - public PageVo getControllerMethodsPage(PageDto pageDto){ -// PageInfo pageInfo = PageUtil.getPageInfo(pageDto, () -> redisCache.sizeForZSet(RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_CONTROLLER_SORTED_SET))); -// Long pageNo = pageInfo.getPageNo(); -// Long pageSize = pageInfo.getPageSize(); -// Long pageTotal = pageInfo.getPageTotal(); -// -// // 计算起始索引和结束索引 -// long start = pageInfo.getStart(); -// long end = pageInfo.getEnd(); -// Set> typedTuples = redisCache.reverseRangeWithScoreForZSet(RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_CONTROLLER_SORTED_SET), start, end, MethodDetailData.class); -// List list = typedTuples.stream().map(typedTuple -> { -// Double score = typedTuple.getScore(); -// MethodDetailData methodDetailData = typedTuple.getValue(); -// methodDetailData.setExecuteTime(new BigDecimal(String.valueOf(score))); -// methodDetailData.setAvgExecuteTime(new BigDecimal(String.valueOf(score))); -// return methodDetailData; -// }).collect(Collectors.toList()); -// PageVo pageVo = new PageVo<>(); -// pageVo.setPageTotal(pageTotal); -// pageVo.setPageNo(pageNo); -// pageVo.setPageSize(pageSize); -// pageVo.setData(list); -// return pageVo; - return null; - } - - public MethodDetailData getMethodChainList(MethodChainDto methodChainDto) { - String methodDetailDataId = methodChainDto.getMethodDetailDataId(); - MethodDetailData controllerMethodDetailData = redisCache.get(RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_METHOD_DETAIL, methodDetailDataId), MethodDetailData.class); - if (controllerMethodDetailData == null) { - return null; - } - Set serviceMethodNameSet = redisCache.membersForSet(RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_CONTROLLER_CHILDREN_SET, methodDetailDataId), String.class); - - List serviceList = new ArrayList<>(); - for (String serviceMethodName : serviceMethodNameSet) { - MethodDetailData serviceMethodDetailData = redisCache.get(RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_METHOD_DETAIL, serviceMethodName), MethodDetailData.class); - if (serviceMethodDetailData == null) { - continue; - } - Set daoMethodNameSet = redisCache.membersForSet(RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_SERVICE_CHILDREN_SET, serviceMethodName), String.class); - - List daoList = new ArrayList<>(); - for (String daoMethodName : daoMethodNameSet) { - MethodDetailData daoMethodDetailData = redisCache.get(RedisKeyWrap.createRedisKey(RedisKeyEnum.API_STAT_METHOD_DETAIL, daoMethodName), MethodDetailData.class); - daoList.add(daoMethodDetailData); - } - serviceMethodDetailData.setChildrenMethodList(daoList); - - serviceList.add(serviceMethodDetailData); - } - controllerMethodDetailData.setChildrenMethodList(serviceList); - return controllerMethodDetailData; - } -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/task/NoticeTask.java b/api-stat/api-stat-system/src/main/java/com/damai/task/NoticeTask.java deleted file mode 100644 index 103a1aa88f34a7517b536102f707a7dcfdca499c..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/task/NoticeTask.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.damai.task; - -import com.damai.notice.ApiStatNotice; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import static com.damai.constant.ApiStatConstant.PLATFORM_NOTICE; - -/** - * @program: cook-frame - * @description: - * @author: k - * @create: 2023-10-12 - **/ -@Component -public class NoticeTask { - - @Autowired - private ApiStatNotice apiStatNotice; - - @Scheduled(cron ="0 0 9 * * ? ") - public void scheduleNotice() { - apiStatNotice.notice(PLATFORM_NOTICE); - } -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/util/PageUtil.java b/api-stat/api-stat-system/src/main/java/com/damai/util/PageUtil.java deleted file mode 100644 index 774e1482136bc1d4a87670d7ed087351679cce4e..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/util/PageUtil.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.damai.util; - -import com.damai.dto.PageDto; -import com.damai.info.PageInfo; - -public class PageUtil { - - public static PageInfo getPageInfo(PageDto pageDto, RecordTotalRun recordTotalRun) { - Long pageNo = pageDto.getPageNo(); - Long pageSize = pageDto.getPageSize(); - Long totalRecord = recordTotalRun.totalRecord(); - - Long pageTotal = totalRecord/pageSize + 1; - - // 计算起始索引和结束索引 - long start = (pageNo - 1) * pageSize; - long end = start + pageSize - 1; - - PageInfo pageInfo = new PageInfo(); - pageInfo.setPageNo(pageNo); - pageInfo.setPageSize(pageSize); - pageInfo.setTotalRecord(totalRecord); - pageInfo.setPageTotal(pageTotal); - pageInfo.setStart(start); - pageInfo.setEnd(end); - return pageInfo; - } -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/util/RecordTotalRun.java b/api-stat/api-stat-system/src/main/java/com/damai/util/RecordTotalRun.java deleted file mode 100644 index 0c664718d6a63012612afb614cdf25ce6b4e85c1..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/util/RecordTotalRun.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.damai.util; - -public interface RecordTotalRun { - - Long totalRecord(); -} diff --git a/api-stat/api-stat-system/src/main/java/com/damai/vo/PageVo.java b/api-stat/api-stat-system/src/main/java/com/damai/vo/PageVo.java deleted file mode 100644 index 42873c9d8529ad0a1093956bd17d8d76d040ba50..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/java/com/damai/vo/PageVo.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.damai.vo; - -import lombok.Data; - -import java.util.List; - -@Data -public class PageVo { - - private Long PageTotal; - - private Long pageNo; - - private Long pageSize; - - private List data; -} diff --git a/api-stat/api-stat-system/src/main/resources/META-INF/spring.factories b/api-stat/api-stat-system/src/main/resources/META-INF/spring.factories deleted file mode 100644 index bcbefcaa4ec6e84b469558371d096ccd9787dca3..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - com.damai.notice.config.ApiStatNoticeAutoConfig \ No newline at end of file diff --git a/api-stat/api-stat-system/src/main/resources/application.yml b/api-stat/api-stat-system/src/main/resources/application.yml deleted file mode 100644 index 6696c389d2c0cde100156c6425a313868199adc6..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/resources/application.yml +++ /dev/null @@ -1,33 +0,0 @@ -#服务端口 -server: - port: 6666 -# 应用名称 -spring: - application: - name: service-case - redis: - host: www.cookframe.com - port: 6379 - password: qaz123 - database: 0 - -logging: - level: - example: - mapper : debug - tracer: trace -redisson: - timeout: 3000 - address: www.cookframe.com - port: 6379 - password: qaz123 - database: 5 - connectionPoolSize: 64 - connectionMinimumIdleSize: 10 - -api: - enable: true - platformTypes: - - DingDing - platformAddress: - dingDingWebhook: https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxx \ No newline at end of file diff --git a/api-stat/api-stat-system/src/main/resources/log4j2.xml b/api-stat/api-stat-system/src/main/resources/log4j2.xml deleted file mode 100644 index e052fcddbf839f8f16353fcaca53d1cb265a3e9d..0000000000000000000000000000000000000000 --- a/api-stat/api-stat-system/src/main/resources/log4j2.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - . - api-stat-system - local - api-stat-system - [api-stat-system] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n - UTF-8 - com.damai - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/api-stat/pom.xml b/api-stat/pom.xml deleted file mode 100644 index 65ba6ec3f233e46b2a746d880cb9f272c76799eb..0000000000000000000000000000000000000000 --- a/api-stat/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 4.0.0 - - - com.example - damai - ${revision} - - - api-stat - api-stat - api-stat - pom - - - api-stat-system - api-stat-common - api-stat-reported - api-stat-example - - - diff --git a/damai-captcha-framework/pom.xml b/damai-captcha-framework/pom.xml index 2a56b7ef3c3779cc385ef50de1792046ac814a57..92b94a82b8a9523fae00077788369419603edd16 100644 --- a/damai-captcha-framework/pom.xml +++ b/damai-captcha-framework/pom.xml @@ -12,7 +12,7 @@ damai-captcha-framework - damai-captcha-framework + captcha-framework 验证码操作封装 diff --git a/damai-captcha-framework/src/main/java/com/damai/service/CaptchaHandle.java b/damai-captcha-framework/src/main/java/com/damai/service/CaptchaHandle.java index ef504baddeaa4fb26297bb1adff1923da9bb124a..19519147628d79c5000186f3be29d92d04cd21a4 100644 --- a/damai-captcha-framework/src/main/java/com/damai/service/CaptchaHandle.java +++ b/damai-captcha-framework/src/main/java/com/damai/service/CaptchaHandle.java @@ -34,6 +34,6 @@ public class CaptchaHandle { assert requestAttributes != null; HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest(); captchaVO.setBrowserInfo(RemoteUtil.getRemoteId(request)); - return captchaService.check(captchaVO); + return captchaService.verification(captchaVO); } } diff --git a/damai-common/src/main/java/com/damai/config/DaMaiCommonAutoConfig.java b/damai-common/src/main/java/com/damai/config/DaMaiCommonAutoConfig.java index 7e8af97e61ba8e177ac56f2858c25acabd579760..7457375a7f0824b7e8423b268254fa94e0c09b21 100644 --- a/damai-common/src/main/java/com/damai/config/DaMaiCommonAutoConfig.java +++ b/damai-common/src/main/java/com/damai/config/DaMaiCommonAutoConfig.java @@ -3,7 +3,6 @@ package com.damai.config; import com.damai.core.PrefixDistinctionNameProperties; import com.damai.core.SpringUtil; import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; /** @@ -11,11 +10,16 @@ import org.springframework.context.annotation.Bean; * @description: 通用配置 * @author: 阿宽不是程序员 **/ -@EnableConfigurationProperties(PrefixDistinctionNameProperties.class) + public class DaMaiCommonAutoConfig { @Bean - public Jackson2ObjectMapperBuilderCustomizer JacksonCustom(){ + public PrefixDistinctionNameProperties prefixDistinctionNameProperties(){ + return new PrefixDistinctionNameProperties(); + } + + @Bean + public Jackson2ObjectMapperBuilderCustomizer jacksonCustom(){ return new JacksonCustom(); } diff --git a/damai-common/src/main/java/com/damai/config/DateJsonDeserializer.java b/damai-common/src/main/java/com/damai/config/DateJsonDeserializer.java index 1b2ca0296ab9c73dee602ad641387fbe98c54e73..4181018d5b4a490facb0740d8ab3a21e309b4aa9 100644 --- a/damai-common/src/main/java/com/damai/config/DateJsonDeserializer.java +++ b/damai-common/src/main/java/com/damai/config/DateJsonDeserializer.java @@ -19,13 +19,15 @@ import java.util.regex.Pattern; * @author: 阿宽不是程序员 **/ public class DateJsonDeserializer extends JsonDeserializer { - private static final List formarts = new ArrayList<>(4); + + private static final Pattern P = Pattern.compile("^[0-9]*"); + private static final List FORMAT = new ArrayList<>(4); static { - formarts.add("yyyy-MM"); - formarts.add("yyyy-MM-dd"); - formarts.add("yyyy-MM-dd HH:mm"); - formarts.add("yyyy-MM-dd HH:mm:ss"); - formarts.add("yyyy/MM/dd HH:mm:ss"); + FORMAT.add("yyyy-MM"); + FORMAT.add("yyyy-MM-dd"); + FORMAT.add("yyyy-MM-dd HH:mm"); + FORMAT.add("yyyy-MM-dd HH:mm:ss"); + FORMAT.add("yyyy/MM/dd HH:mm:ss"); } @Override @@ -42,15 +44,15 @@ public class DateJsonDeserializer extends JsonDeserializer { convertDate = DateUtils.parse(Long.valueOf(str)); }else { if (str.matches("^\\d{4}-\\d{1,2}$")) { - return DateUtils.parse(str, formarts.get(0)); + return DateUtils.parse(str, FORMAT.get(0)); } else if (str.matches("^\\d{4}-\\d{1,2}-\\d{1,2}$")) { - return DateUtils.parse(str, formarts.get(1)); + return DateUtils.parse(str, FORMAT.get(1)); } else if (str.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}$")) { - return DateUtils.parse(str, formarts.get(2)); + return DateUtils.parse(str, FORMAT.get(2)); } else if (str.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}$")) { - return DateUtils.parse(str, formarts.get(3)); + return DateUtils.parse(str, FORMAT.get(3)); } else if (str.matches("^\\d{4}/\\d{1,2}/\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}$")) { - return DateUtils.parse(str, formarts.get(4)); + return DateUtils.parse(str, FORMAT.get(4)); }else { throw new IllegalArgumentException("Invalid boolean value '" + str + "'"); } @@ -67,8 +69,7 @@ public class DateJsonDeserializer extends JsonDeserializer { * @return */ public static boolean isNum(String number) { - Pattern p = Pattern.compile("^[0-9]*"); - Matcher m = p.matcher(number); + Matcher m = P.matcher(number); return m.matches(); } } diff --git a/damai-common/src/main/java/com/damai/config/JacksonCustom.java b/damai-common/src/main/java/com/damai/config/JacksonCustom.java index a1541d1551df5cf0c77f678e0a499b31e2d901c5..59a8db0a603dd626bfdec27963ee7d6cc5cd6efe 100644 --- a/damai-common/src/main/java/com/damai/config/JacksonCustom.java +++ b/damai-common/src/main/java/com/damai/config/JacksonCustom.java @@ -4,6 +4,8 @@ package com.damai.config; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser.Feature; +import com.fasterxml.jackson.core.json.JsonReadFeature; +import com.fasterxml.jackson.core.json.JsonWriteFeature; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; @@ -35,12 +37,10 @@ import java.util.TimeZone; **/ public class JacksonCustom implements Jackson2ObjectMapperBuilderCustomizer, Ordered { - /** 默认日期时间格式 */ + /** + * 默认日期时间格式 + * */ private final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss"; - /** 默认日期格式 */ - private final String dateFormat = "yyyy-MM-dd"; - /** 默认时间格式 */ - private final String timeFormat = "HH:mm:ss"; @Override public void customize(Jackson2ObjectMapperBuilder builder) { @@ -74,10 +74,14 @@ public class JacksonCustom implements Jackson2ObjectMapperBuilderCustomizer, Ord simpleModules[3] = new SimpleModule().addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(dateTimeFormatter)); simpleModules[4] = new SimpleModule().addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(dateTimeFormatter)); //将LocalDate进行格式化和序列化 + //默认日期格式 + String dateFormat = "yyyy-MM-dd"; DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern(dateFormat); simpleModules[5] = new SimpleModule().addSerializer(LocalDate.class, new LocalDateSerializer(dateFormatter)); simpleModules[6] = new SimpleModule().addDeserializer(LocalDate.class, new LocalDateDeserializer(dateFormatter)); //将LocalTime进行格式化和序列化 + //默认时间格式 + String timeFormat = "HH:mm:ss"; DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(timeFormat); simpleModules[7] = new SimpleModule().addSerializer(LocalTime.class, new LocalTimeSerializer(timeFormatter)); simpleModules[8] = new SimpleModule().addDeserializer(LocalTime.class, new LocalTimeDeserializer(timeFormatter)); @@ -89,10 +93,9 @@ public class JacksonCustom implements Jackson2ObjectMapperBuilderCustomizer, Ord //允许有未知的属性 builder.featuresToDisable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); //允许包含不带引号的控制字符 - builder.featuresToEnable(Feature.ALLOW_UNQUOTED_CONTROL_CHARS); - + builder.featuresToEnable(JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS.mappedFeature()); //数字转换为字符串 - builder.featuresToEnable(JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS); + builder.featuresToEnable(JsonWriteFeature.WRITE_NUMBERS_AS_STRINGS.mappedFeature()); } @Override diff --git a/damai-common/src/main/java/com/damai/config/JsonCustomSerializer.java b/damai-common/src/main/java/com/damai/config/JsonCustomSerializer.java index 55ef4b623f212a43aaadc5834826e5f00b35f835..b8c3555abc4a385eedc52a03fc246f7c8e98e578 100644 --- a/damai-common/src/main/java/com/damai/config/JsonCustomSerializer.java +++ b/damai-common/src/main/java/com/damai/config/JsonCustomSerializer.java @@ -2,8 +2,8 @@ package com.damai.config; import cn.hutool.core.date.DateTime; import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.BeanDescription; +import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.SerializationConfig; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.BeanPropertyWriter; @@ -33,80 +33,63 @@ public class JsonCustomSerializer extends BeanSerializerModifier { } public com.fasterxml.jackson.databind.JsonSerializer judgeType(BeanPropertyWriter writer) { - Class clazz = writer.getPropertyType(); - + JavaType javaType = writer.getType(); + Class clazz = javaType.getRawClass(); if (String.class.isAssignableFrom(clazz)) { return new com.fasterxml.jackson.databind.JsonSerializer() { - @Override - public void serialize(Object value, JsonGenerator jgen, SerializerProvider serializers) - throws IOException, JsonProcessingException { - jgen.writeString(""); + public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) + throws IOException { + gen.writeString(""); } - }; } - if (Number.class.isAssignableFrom(clazz)) { return new com.fasterxml.jackson.databind.JsonSerializer() { - @Override - public void serialize(Object value, JsonGenerator jgen, SerializerProvider serializers) + public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException { - jgen.writeString(""); + gen.writeString(""); } - }; } - if (Boolean.class.isAssignableFrom(clazz)) { return new com.fasterxml.jackson.databind.JsonSerializer() { - @Override - public void serialize(Object value, JsonGenerator jgen, SerializerProvider serializers) - throws IOException, JsonProcessingException { - jgen.writeBoolean(false); + public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) + throws IOException { + gen.writeBoolean(false); } - }; } - if (java.util.Date.class.isAssignableFrom(clazz)) { return new com.fasterxml.jackson.databind.JsonSerializer() { - @Override - public void serialize(Object value, JsonGenerator jgen, SerializerProvider serializers) - throws IOException, JsonProcessingException { - jgen.writeString(""); + public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) + throws IOException { + gen.writeString(""); } - }; } if (clazz.equals(DateTime.class)) { return new com.fasterxml.jackson.databind.JsonSerializer() { - @Override - public void serialize(Object value, JsonGenerator jgen, SerializerProvider serializers) - throws IOException, JsonProcessingException { - jgen.writeString(""); + public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) + throws IOException { + gen.writeString(""); } - }; } if (clazz.isArray() || clazz.equals(List.class) || clazz.equals(Set.class)) { return new com.fasterxml.jackson.databind.JsonSerializer() { - @Override - public void serialize(Object value, JsonGenerator jgen, SerializerProvider serializers) + public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException { - jgen.writeStartArray(); - jgen.writeEndArray(); + gen.writeStartArray(); + gen.writeEndArray(); } - }; } - return null; } - } diff --git a/damai-common/src/main/java/com/damai/constant/Constant.java b/damai-common/src/main/java/com/damai/constant/Constant.java index 0eb337e9e396a2aaaf747eef5dbe91a0d5a62d59..d1fcc026f6274d3e7a12189dab7dd3788d2c7f83 100644 --- a/damai-common/src/main/java/com/damai/constant/Constant.java +++ b/damai-common/src/main/java/com/damai/constant/Constant.java @@ -12,14 +12,16 @@ public class Constant { * */ public static final String TRACE_ID = "traceId"; - public static final String MARK_FLAG_TRUE = "true"; + public static final String GRAY_FLAG_TRUE = "true"; - public static final String MARK_FLAG_FALSE = "false"; + public static final String GRAY_FLAG_FALSE = "false"; - public static final String MARK_PARAMETER = "mark"; + public static final String GRAY_PARAMETER = "gray"; public static final String CODE = "code"; + public static final String USER_ID = "userId"; + public static final String JOB_INFO_ID = "jobInfoId"; public static final String JOB_RUN_RECORD_ID = "jobRunRecordId"; @@ -28,4 +30,6 @@ public class Constant { public static final String ALIPAY_NOTIFY_FAILURE_RESULT = "failure"; + public static final String SPRING_INJECT_PREFIX_DISTINCTION_NAME = "${prefix.distinction.name:damai}"; + } diff --git a/damai-common/src/main/java/com/damai/core/PrefixDistinctionNameProperties.java b/damai-common/src/main/java/com/damai/core/PrefixDistinctionNameProperties.java index 80913aa19987ec0d1f61b3c6875ac85d98d8fb42..3b621d60f3658cf33952996eb62d886ce4ffb12b 100644 --- a/damai-common/src/main/java/com/damai/core/PrefixDistinctionNameProperties.java +++ b/damai-common/src/main/java/com/damai/core/PrefixDistinctionNameProperties.java @@ -1,9 +1,9 @@ package com.damai.core; import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.beans.factory.annotation.Value; -import static com.damai.core.PrefixDistinctionNameProperties.PREFIX; +import static com.damai.constant.Constant.SPRING_INJECT_PREFIX_DISTINCTION_NAME; /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 @@ -11,10 +11,8 @@ import static com.damai.core.PrefixDistinctionNameProperties.PREFIX; * @author: 阿宽不是程序员 **/ @Data -@ConfigurationProperties(prefix = PREFIX) public class PrefixDistinctionNameProperties { - public static final String PREFIX = "prefix.distinction"; - - private String name = "damai"; + @Value(SPRING_INJECT_PREFIX_DISTINCTION_NAME) + private String name; } diff --git a/damai-common/src/main/java/com/damai/enums/AlipayTradeStatus.java b/damai-common/src/main/java/com/damai/enums/AlipayTradeStatus.java index 808c1d80ed0bdb5f62af5307a594c73b3d5c4411..9938546d5dc3c42e2e8379ac76760214e844dccc 100644 --- a/damai-common/src/main/java/com/damai/enums/AlipayTradeStatus.java +++ b/damai-common/src/main/java/com/damai/enums/AlipayTradeStatus.java @@ -6,6 +6,9 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum AlipayTradeStatus { + /** + * 支付宝相关信息 + * */ WAIT_BUYER_PAY(1,"wait_buyer_pay","交易创建,等待买家付款"), TRADE_CLOSED(2,"trade_closed","未付款交易超时关闭,或支付完成后全额退款"), diff --git a/damai-common/src/main/java/com/damai/enums/ApiRuleType.java b/damai-common/src/main/java/com/damai/enums/ApiRuleType.java new file mode 100644 index 0000000000000000000000000000000000000000..9cac2fb45233d6d457022983e52b2103e2edbb7e --- /dev/null +++ b/damai-common/src/main/java/com/damai/enums/ApiRuleType.java @@ -0,0 +1,65 @@ +package com.damai.enums; + +/** + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 规则枚举 + * @author: 阿宽不是程序员 + **/ +public enum ApiRuleType { + /** + * 没有规则 + * */ + NO_RULE(0,"没有规则"), + /** + * 普通规则 + * */ + RULE(1,"普通规则"), + /** + * 深度规则 + * */ + DEPTH_RULE(2,"深度规则"), + ; + + private Integer code; + + private String msg; + + ApiRuleType(Integer code, String msg) { + this.code = code; + this.msg = msg; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMsg() { + return this.msg == null ? "" : this.msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public static String getMsg(Integer code) { + for (ApiRuleType re : ApiRuleType.values()) { + if (re.code.intValue() == code.intValue()) { + return re.msg; + } + } + return ""; + } + + public static ApiRuleType getRc(Integer code) { + for (ApiRuleType re : ApiRuleType.values()) { + if (re.code.intValue() == code.intValue()) { + return re; + } + } + return null; + } +} diff --git a/damai-common/src/main/java/com/damai/enums/AreaType.java b/damai-common/src/main/java/com/damai/enums/AreaType.java index 971167c36ff822c3dc2101527a147d8370f2af88..2642a159c79aec4ee0666fdd5934d74d0cbf480f 100644 --- a/damai-common/src/main/java/com/damai/enums/AreaType.java +++ b/damai-common/src/main/java/com/damai/enums/AreaType.java @@ -6,9 +6,18 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum AreaType { + /** + * 省 + * */ PROVINCE(1,"省"), + /** + * 市 + * */ MUNICIPALITIES(2,"市"), + /** + * 区或县 + * */ PREFECTURE(3,"区或县"), ; diff --git a/damai-common/src/main/java/com/damai/enums/BaseCode.java b/damai-common/src/main/java/com/damai/enums/BaseCode.java index cfb957024d516f39a647935907d0fc965cf5511a..d0cfe89b18e40449ab3e0a832466a6c5bffe1fa3 100644 --- a/damai-common/src/main/java/com/damai/enums/BaseCode.java +++ b/damai-common/src/main/java/com/damai/enums/BaseCode.java @@ -6,10 +6,31 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum BaseCode { - + /** + * 基础code码 + * */ SUCCESS(0, "OK"), + SYSTEM_ERROR(-1,"系统异常"), + UID_WORK_ID_ERROR(500,"uid_work_id设置失败"), + + NAME_PASSWORD_ERROR(501,"账号名或登录密码不正确"), + + INITIALIZE_HANDLER_STRATEGY_NOT_EXIST(502,"初始化操作策略不存在"), + + VERIFY_CAPTCHA_ID_NOT_EXIST(503,"校验验证码id不存在"), + + CAPTCHA_TYPE_EMPTY(504,"验证码类型为空"), + + POINT_JSON_EMPTY(505,"点坐标为空"), + + CAPTCHA_TOKEN_JSON_EMPTY(506,"验证码token为空"), + + LOAD_BALANCER_NOT_EXIST(507,"负载均衡器不存在"), + + SERVER_LIST_NOT_EXIST(508,"服务列表不存在"), + RSA_SIGN_ERROR(10000,"res签名验证失败"), RSA_DECRYPT_ERROR(10001,"res解密失败"), @@ -123,12 +144,20 @@ public enum BaseCode { SEAT_PRICE_EMPTY(40026,"座位价格为空"), + SEAT_IS_NOT_NOT_SOLD(40027,"座位不是未售卖"), + DELAY_QUEUE_CLIENT_NOT_EXIST(50001,"延迟队列客户端不存在"), DELAY_QUEUE_MESSAGE_NOT_EXIST(50002,"延迟队列消息不存在"), SEAT_IS_EXIST(50003,"该节目下座位以存在"), + START_DATE_TIME_NOT_EXIST(50004,"开始时间为空"), + + END_DATE_TIME_NOT_EXIST(50005,"结束时间为空"), + + PROGRAM_NOT_ALLOW_CHOOSE_SEAT(50006,"此节目不允许选择座位"), + USER_LOG_IN_STATUS_ERROR(60001,"用户不是登录状态"), USER_LOG_IN(60002,"用户已登录"), @@ -167,6 +196,10 @@ public enum BaseCode { GET_USER_AND_TICKET_USER_ERROR(60019,"获取用户和购票人信息错误"), + TICKET_USER_ID_REPEAT(60020,"购票人id重复"), + + TICKET_USER_COUNT_UNEQUAL_SEAT_COUNT(60021,"购票人数量和要购买的座位数量不相等"), + ORDER_NUMBER_NOT_EXIST(70000,"order_number的值不存在"), USER_ID_NOT_EXIST(70001,"user_id的值不存在"), diff --git a/damai-common/src/main/java/com/damai/enums/BusinessStatus.java b/damai-common/src/main/java/com/damai/enums/BusinessStatus.java index dd0973be7763f8fdef96af544d440035a2e2337b..93b5577cf491f7233c4e7a6a2a3940acbbdaa586 100644 --- a/damai-common/src/main/java/com/damai/enums/BusinessStatus.java +++ b/damai-common/src/main/java/com/damai/enums/BusinessStatus.java @@ -2,11 +2,14 @@ package com.damai.enums; /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 - * @description: 通过状态枚举 + * @description: 通用状态枚举 * @author: 阿宽不是程序员 **/ public enum BusinessStatus { + /** + * 通用状态枚举 + * */ YES(1,"是"), NO(0,"否") ; diff --git a/damai-common/src/main/java/com/damai/enums/CodeType.java b/damai-common/src/main/java/com/damai/enums/CodeType.java new file mode 100644 index 0000000000000000000000000000000000000000..35594d1b438c9a00b4c10d9be628329f9cde18aa --- /dev/null +++ b/damai-common/src/main/java/com/damai/enums/CodeType.java @@ -0,0 +1,73 @@ +package com.damai.enums; + +/** + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 基础数据 code + * @author: 阿宽不是程序员 + **/ +public enum CodeType { + /** + * 支付宝相关信息 + * */ + PC(1,"0001","pc网站"), + + WX_MINI_PROGRAM(2,"0002","微信小程序"), + + ALIPAY_MINI_PROGRAM(3,"0003","支付宝小程序"), + + ; + + private Integer code; + + private String value; + + private String msg; + + CodeType(Integer code, String value, String msg) { + this.code = code; + this.value = value; + this.msg = msg; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMsg() { + return this.msg == null ? "" : this.msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getValue() { + return value; + } + + public void setValue(final String value) { + this.value = value; + } + + public static String getMsg(Integer code) { + for (CodeType re : CodeType.values()) { + if (re.code.intValue() == code.intValue()) { + return re.msg; + } + } + return ""; + } + + public static CodeType getRc(Integer code) { + for (CodeType re : CodeType.values()) { + if (re.code.intValue() == code.intValue()) { + return re; + } + } + return null; + } +} diff --git a/damai-common/src/main/java/com/damai/enums/CompositeCheckType.java b/damai-common/src/main/java/com/damai/enums/CompositeCheckType.java index 1f4313db19a1ba3022816c32c4f0ae7645fb8619..6baa9837e19ca92c857b05a0edd65c9acd5fb621 100644 --- a/damai-common/src/main/java/com/damai/enums/CompositeCheckType.java +++ b/damai-common/src/main/java/com/damai/enums/CompositeCheckType.java @@ -6,8 +6,14 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum CompositeCheckType { + /** + * 组合模式类型 + * */ USER_REGISTER_CHECK(1,"user_register_check","用户注册"), + /** + * 订单创建 + * */ PROGRAM_ORDER_CREATE_CHECK(2,"program_order_create_check","订单创建"), ; diff --git a/damai-common/src/main/java/com/damai/enums/IdType.java b/damai-common/src/main/java/com/damai/enums/IdType.java index e83417f56828e3d237c9000d00a61a721f9488ba..87a06ed95ad328d682f93fe218c466a519a4ba80 100644 --- a/damai-common/src/main/java/com/damai/enums/IdType.java +++ b/damai-common/src/main/java/com/damai/enums/IdType.java @@ -6,6 +6,9 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum IdType { + /** + * 证件类型 + * */ IDENTITY(1, "身份证"), HK_M_TW_PERMIT(2, "港澳台居民居住证"), HKM_PASS(3, "港澳居民来往内地通行证"), diff --git a/damai-common/src/main/java/com/damai/enums/JobInfoMethodCode.java b/damai-common/src/main/java/com/damai/enums/JobInfoMethodCode.java index d299cac7a7b2367ab5a7fcf49e2a7b0dfff1c743..585e5357adfd370412eb6b4973c35bf1346e7ded 100644 --- a/damai-common/src/main/java/com/damai/enums/JobInfoMethodCode.java +++ b/damai-common/src/main/java/com/damai/enums/JobInfoMethodCode.java @@ -6,6 +6,9 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum JobInfoMethodCode { + /** + * job类型 + * */ GET(1, "get方法"), POST(2,"post方法"), diff --git a/damai-common/src/main/java/com/damai/enums/JobRunStatus.java b/damai-common/src/main/java/com/damai/enums/JobRunStatus.java index 36aed48973e7d5ef5ad9d74d9d56929462a9325e..c10812eeeedb3e728d2ba56c3f2d47c4952f4356 100644 --- a/damai-common/src/main/java/com/damai/enums/JobRunStatus.java +++ b/damai-common/src/main/java/com/damai/enums/JobRunStatus.java @@ -6,6 +6,9 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum JobRunStatus { + /** + * job运行状态 + * */ RUN_NEW(1, "新建"), RUN_SUCCESS(2,"执行成功"), diff --git a/damai-common/src/main/java/com/damai/enums/OrderStatus.java b/damai-common/src/main/java/com/damai/enums/OrderStatus.java index 4e6140fbed658b49674c3633a694d0d8a2eb33a4..d3d7b50d2907899d0b26772488dabe4caf1d6863 100644 --- a/damai-common/src/main/java/com/damai/enums/OrderStatus.java +++ b/damai-common/src/main/java/com/damai/enums/OrderStatus.java @@ -6,6 +6,9 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum OrderStatus { + /** + * 订单状态 + * */ NO_PAY(1,"未支付"), CANCEL(2,"已取消"), PAY(3,"已支付"), diff --git a/damai-common/src/main/java/com/damai/enums/PayBillStatus.java b/damai-common/src/main/java/com/damai/enums/PayBillStatus.java index 5a80ab523026bddd43387239b4d487b7a4a9f712..e12a7527da4104cdab1181e34a5ad53600e8ec48 100644 --- a/damai-common/src/main/java/com/damai/enums/PayBillStatus.java +++ b/damai-common/src/main/java/com/damai/enums/PayBillStatus.java @@ -6,6 +6,9 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum PayBillStatus { + /** + * 支付账单状态 + * */ NO_PAY(1,"未支付"), CANCEL(2,"已取消"), PAY(3,"已支付"), diff --git a/damai-common/src/main/java/com/damai/enums/PayBillType.java b/damai-common/src/main/java/com/damai/enums/PayBillType.java index 28669b661be6e93aa98940f0e41d261821c346b5..6cf78b050d74ba748f671a00401733cd35dea0c6 100644 --- a/damai-common/src/main/java/com/damai/enums/PayBillType.java +++ b/damai-common/src/main/java/com/damai/enums/PayBillType.java @@ -6,6 +6,9 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum PayBillType { + /** + * 账单类型 + * */ PROGRAM(1,"节目"), ; diff --git a/damai-common/src/main/java/com/damai/enums/PayChannel.java b/damai-common/src/main/java/com/damai/enums/PayChannel.java index c8eeafeff715e83354c7b173a2e28875b41a23d1..7a28686e8b9c545fce632825d65ac0da46f62f73 100644 --- a/damai-common/src/main/java/com/damai/enums/PayChannel.java +++ b/damai-common/src/main/java/com/damai/enums/PayChannel.java @@ -6,6 +6,9 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum PayChannel { + /** + * 支付渠道 + * */ ALIPAY(1,"alipay","支付宝"), WX(2,"wx","微信"), diff --git a/damai-common/src/main/java/com/damai/enums/RuleStatus.java b/damai-common/src/main/java/com/damai/enums/RuleStatus.java index 62aa3ff33e724a3e5a044923c8ef99633103bbb1..1c5070e4b85b689579ffccadb97bb48d08d32297 100644 --- a/damai-common/src/main/java/com/damai/enums/RuleStatus.java +++ b/damai-common/src/main/java/com/damai/enums/RuleStatus.java @@ -6,6 +6,9 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum RuleStatus { + /** + * 规则状态 + * */ RUN(1,"正常"), STOP(0,"禁用") ; diff --git a/damai-common/src/main/java/com/damai/enums/RuleTimeUnit.java b/damai-common/src/main/java/com/damai/enums/RuleTimeUnit.java index fd33ceb78d6298f4971c4aa5428c69cd46cae0aa..c2720c183cc755fb0c10577be097f1885c7d814f 100644 --- a/damai-common/src/main/java/com/damai/enums/RuleTimeUnit.java +++ b/damai-common/src/main/java/com/damai/enums/RuleTimeUnit.java @@ -6,6 +6,9 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum RuleTimeUnit { + /** + * 规则时间单位 + * */ SECOND(1,"秒"), MINUTE(2,"分钟") ; diff --git a/damai-common/src/main/java/com/damai/enums/SeatType.java b/damai-common/src/main/java/com/damai/enums/SeatType.java index 8d9d2b986b81dae8ec2884a0641403f3d2f02488..bd83e6eff17f465ee6f325af61ee885fba165a27 100644 --- a/damai-common/src/main/java/com/damai/enums/SeatType.java +++ b/damai-common/src/main/java/com/damai/enums/SeatType.java @@ -6,6 +6,9 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum SeatType { + /** + * 座位类型 + * */ GENERAL(1,"通用座位"), ; diff --git a/damai-common/src/main/java/com/damai/enums/SellStatus.java b/damai-common/src/main/java/com/damai/enums/SellStatus.java index 5706a9d4ffd3b44a0d735254d7044808788497ba..dd94759aab644ff41fd6da9941d624a54350c82a 100644 --- a/damai-common/src/main/java/com/damai/enums/SellStatus.java +++ b/damai-common/src/main/java/com/damai/enums/SellStatus.java @@ -6,6 +6,9 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum SellStatus { + /** + * 售卖状态 + * */ NO_SOLD(1,"未售卖"), LOCK(2,"锁定"), SOLD(3,"已售卖"), diff --git a/damai-common/src/main/java/com/damai/enums/Status.java b/damai-common/src/main/java/com/damai/enums/Status.java index d3f4270c9cd6242060b37101942d042bcb326bb9..05c3a416baf61ecd0659016c8d3131888a1dc3f1 100644 --- a/damai-common/src/main/java/com/damai/enums/Status.java +++ b/damai-common/src/main/java/com/damai/enums/Status.java @@ -7,6 +7,9 @@ package com.damai.enums; **/ public enum Status { + /** + * 基础状态 + * */ RUN(1,"正常"), STOP(0,"禁用") ; diff --git a/damai-common/src/main/java/com/damai/enums/TimeType.java b/damai-common/src/main/java/com/damai/enums/TimeType.java index 656b6efc14db64befdc91c8345c8f8b9ef5a6ffa..f8eb4cd3947edc85064c7e995988fb24d6c5f5da 100644 --- a/damai-common/src/main/java/com/damai/enums/TimeType.java +++ b/damai-common/src/main/java/com/damai/enums/TimeType.java @@ -6,8 +6,15 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum TimeType { - WEEK(1,"本周内"), - MONTH(2,"一个月内"), + /** + * 时间类型 + * */ + ALL(0,"全部"), + TODAY(1,"今天"), + TOMORROW(2,"明天"), + WEEK(3,"本周内"), + MONTH(4,"一个月内"), + CALENDAR(5,"按日历"), ; private Integer code; diff --git a/damai-common/src/main/java/com/damai/enums/UserLogStatus.java b/damai-common/src/main/java/com/damai/enums/UserLogStatus.java index cdff82d72f5452b40f20617e72474f1c967610c5..aa774bad65e2d82741153a34f6b7102764a7a170 100644 --- a/damai-common/src/main/java/com/damai/enums/UserLogStatus.java +++ b/damai-common/src/main/java/com/damai/enums/UserLogStatus.java @@ -6,7 +6,11 @@ package com.damai.enums; * @author: 阿宽不是程序员 **/ public enum UserLogStatus { + /** + * 用户登录状态 + * */ IN(1,"登录"), + OUT(0,"退出") ; diff --git a/damai-common/src/main/java/com/damai/enums/VerifyCaptcha.java b/damai-common/src/main/java/com/damai/enums/VerifyCaptcha.java new file mode 100644 index 0000000000000000000000000000000000000000..8c252c60928046dcdcbb7371b55648de5f973820 --- /dev/null +++ b/damai-common/src/main/java/com/damai/enums/VerifyCaptcha.java @@ -0,0 +1,71 @@ +package com.damai.enums; + +/** + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 是否需要校验验证码 + * @author: 阿宽不是程序员 + **/ +public enum VerifyCaptcha { + /** + * 是否需要校验验证码 + * */ + NO(0,"no","不需要"), + + YES(1,"yes","需要"), + + ; + + private Integer code; + + private String value; + + private String msg; + + VerifyCaptcha(Integer code, String value, String msg) { + this.code = code; + this.value = value; + this.msg = msg; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMsg() { + return this.msg == null ? "" : this.msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getValue() { + return value; + } + + public void setValue(final String value) { + this.value = value; + } + + public static String getMsg(Integer code) { + for (VerifyCaptcha re : VerifyCaptcha.values()) { + if (re.code.intValue() == code.intValue()) { + return re.msg; + } + } + return ""; + } + + public static VerifyCaptcha getRc(Integer code) { + for (VerifyCaptcha re : VerifyCaptcha.values()) { + if (re.code.intValue() == code.intValue()) { + return re; + } + } + return null; + } +} diff --git a/damai-common/src/main/java/com/damai/jwt/TokenUtil.java b/damai-common/src/main/java/com/damai/jwt/TokenUtil.java index 3b3a32fc2bde70bb7e1b0b5b442806b8b89acdf6..aca3cac4af9f2ebdceabc7b04ccd2cbe4467d59b 100644 --- a/damai-common/src/main/java/com/damai/jwt/TokenUtil.java +++ b/damai-common/src/main/java/com/damai/jwt/TokenUtil.java @@ -1,5 +1,6 @@ package com.damai.jwt; +import com.alibaba.fastjson.JSONObject; import com.damai.enums.BaseCode; import com.damai.exception.DaMaiFrameException; import io.jsonwebtoken.ExpiredJwtException; @@ -18,37 +19,19 @@ import java.util.Date; @Slf4j public class TokenUtil { - /** - * 指定签名的时候使用的签名算法,也就是header那部分。 - * - */ - private static final SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256; - /** - * 用户登录成功后生成Jwt - * 使用Hs256算法 私匙使用用户密码 - * - * @param id 标识 - * @param info 登录成功的user对象 - * @param ttlMillis jwt过期时间 - * @param tokenSecret 私钥 - * @return - */ + private static final SignatureAlgorithm SIGNATURE_ALGORITHM = SignatureAlgorithm.HS256; + public static String createToken(String id, String info, long ttlMillis, String tokenSecret) { - //生成JWT的时间 + long nowMillis = System.currentTimeMillis(); - //创建一个JwtBuilder,设置jwt的body + JwtBuilder builder = Jwts.builder() - //如果有私有声明,一定要先设置这个自己创建的私有的声明,这个是给builder的claim赋值,一旦写在标准的声明赋值之后,就是覆盖了那些标准的声明的 // .setClaims(claims) - //设置jti(JWT ID):是JWT的唯一标识,根据业务需要,这个可以设置为一个不重复的值,主要用来作为一次性token,从而回避重放攻击。 .setId(id) - //iat: jwt的签发时间 .setIssuedAt(new Date(nowMillis)) - //代表这个JWT的主体,即它的所有人,这个是一个json格式的字符串。 .setSubject(info) - //设置签名使用的签名算法和签名使用的秘钥 - .signWith(signatureAlgorithm, tokenSecret); + .signWith(SIGNATURE_ALGORITHM, tokenSecret); if (ttlMillis >= 0) { //设置过期时间 builder.setExpiration(new Date(nowMillis + ttlMillis)); @@ -56,20 +39,10 @@ public class TokenUtil { return builder.compact(); } - - /** - * Token的解密 - * - * @param token 加密后的token - * @param tokenSecret 私钥 - * @return - */ public static String parseToken(String token, String tokenSecret) { try { return Jwts.parser() - //设置签名的秘钥 .setSigningKey(tokenSecret) - //设置需要解析的jwt .parseClaimsJws(token) .getBody() .getSubject(); @@ -82,18 +55,18 @@ public class TokenUtil { public static void main(String[] args) { - String token_secret = "CSYZWECHAT"; + String tokenSecret = "CSYZWECHAT"; -// JSONObject jSONObject = new JSONObject(); -// jSONObject.put("001key", "001value"); -// jSONObject.put("002key", "001value"); -// + JSONObject jsonObject = new JSONObject(); + jsonObject.put("001key", "001value"); + jsonObject.put("002key", "001value"); -// String token = TokenUtil.createToken("1", jSONObject.toJSONString(), 10000, token_secret); -// System.out.println("token:" + token); + String token1 = TokenUtil.createToken("1", jsonObject.toJSONString(), 10000, tokenSecret); + System.out.println("token:" + token1); + - String token = "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxIiwiaWF0IjoxNjg4NTQyODM3LCJzdWIiOiJ7XCIwMDJrZXlcIjpcIjAwMXZhbHVlXCIsXCIwMDFrZXlcIjpcIjAwMXZhbHVlXCJ9IiwiZXhwIjoxNjg4NTQyODQ3fQ.vIKcAilTn_CR3VYssNE7rBpfuCSCH_RrkmsadLWf664"; - String subject = TokenUtil.parseToken(token, token_secret); + String token2 = "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxIiwiaWF0IjoxNjg4NTQyODM3LCJzdWIiOiJ7XCIwMDJrZXlcIjpcIjAwMXZhbHVlXCIsXCIwMDFrZXlcIjpcIjAwMXZhbHVlXCJ9IiwiZXhwIjoxNjg4NTQyODQ3fQ.vIKcAilTn_CR3VYssNE7rBpfuCSCH_RrkmsadLWf664"; + String subject = TokenUtil.parseToken(token2, tokenSecret); System.out.println("解析token后的值:" + subject); } } \ No newline at end of file diff --git a/damai-common/src/main/java/com/damai/runlistener/CustomEventPublishingRunListener.java b/damai-common/src/main/java/com/damai/runlistener/CustomEventPublishingRunListener.java deleted file mode 100644 index 976e2d2b21f20d5d09d38b6ec561c876c2d9abc7..0000000000000000000000000000000000000000 --- a/damai-common/src/main/java/com/damai/runlistener/CustomEventPublishingRunListener.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.damai.runlistener; - -import com.damai.core.StringUtil; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.SpringApplicationRunListener; -import org.springframework.core.Ordered; -import org.springframework.core.env.ConfigurableEnvironment; - -/** - * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 - * @description: 服务名配置 - * @author: 阿宽不是程序员 - **/ -public class CustomEventPublishingRunListener implements SpringApplicationRunListener, Ordered { - - private static final String SPRING_APPLICATION_NAME = "spring.application.name"; - - private final SpringApplication application; - - private final String[] args; - - public CustomEventPublishingRunListener(SpringApplication application, String[] args){ - this.application = application; - this.args = args; - } - @Override - public int getOrder() { - return 1; - } - - @Override - public void environmentPrepared(ConfigurableEnvironment environment) { - String applicationName = environment.getProperty(SPRING_APPLICATION_NAME); - if (StringUtil.isNotEmpty(applicationName)) { - System.setProperty("applicationName", applicationName); - } - } -} diff --git a/damai-common/src/main/java/com/damai/threadlocal/BaseParameterHolder.java b/damai-common/src/main/java/com/damai/threadlocal/BaseParameterHolder.java index 9b9fa9e84baf95268c50a259f46549f54bf6ba83..37a2d3369483c1976bf697a4a9a216f152dfa0d6 100644 --- a/damai-common/src/main/java/com/damai/threadlocal/BaseParameterHolder.java +++ b/damai-common/src/main/java/com/damai/threadlocal/BaseParameterHolder.java @@ -11,46 +11,46 @@ import java.util.Optional; **/ public class BaseParameterHolder { - private static final ThreadLocal> threadLocalMap = new ThreadLocal<>(); + private static final ThreadLocal> THREAD_LOCAL_MAP = new ThreadLocal<>(); public static void setParameter(String name, String value) { - Map map = threadLocalMap.get(); + Map map = THREAD_LOCAL_MAP.get(); if (map == null) { - map = new HashMap<>(); + map = new HashMap<>(64); } map.put(name, value); - threadLocalMap.set(map); + THREAD_LOCAL_MAP.set(map); } public static String getParameter(String name) { - return Optional.ofNullable(threadLocalMap.get()).map(map -> map.get(name)).orElse(null); + return Optional.ofNullable(THREAD_LOCAL_MAP.get()).map(map -> map.get(name)).orElse(null); } public static void removeParameter(String name) { - Map map = threadLocalMap.get(); + Map map = THREAD_LOCAL_MAP.get(); if (map != null) { map.remove(name); } } public static ThreadLocal> getThreadLocal() { - return threadLocalMap; + return THREAD_LOCAL_MAP; } public static Map getParameterMap() { - Map map = threadLocalMap.get(); + Map map = THREAD_LOCAL_MAP.get(); if (map == null) { - map = new HashMap<>(); + map = new HashMap<>(64); } return map; } public static void setParameterMap(Map map) { - threadLocalMap.set(map); + THREAD_LOCAL_MAP.set(map); } public static void removeParameterMap(){ - threadLocalMap.remove(); + THREAD_LOCAL_MAP.remove(); } } diff --git a/damai-common/src/main/java/com/damai/util/Aes.java b/damai-common/src/main/java/com/damai/util/Aes.java index 227dc7f5265cc5febd563cf95202350154a5d83e..e03b56b423fa3cff435237bce67485575c24f7c6 100644 --- a/damai-common/src/main/java/com/damai/util/Aes.java +++ b/damai-common/src/main/java/com/damai/util/Aes.java @@ -1,6 +1,5 @@ package com.damai.util; -import com.damai.core.StringUtil; import com.damai.enums.BaseCode; import com.damai.exception.DaMaiFrameException; import lombok.extern.slf4j.Slf4j; @@ -10,6 +9,7 @@ import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; @@ -36,7 +36,7 @@ public class Aes { */ public static String encrypt(String key, String initVector, String data) { try { - byte[] bt = encrypt(key.getBytes(ENCODE_UTF_8), initVector.getBytes(ENCODE_UTF_8), data.getBytes(ENCODE_UTF_8)); + byte[] bt = encrypt(key.getBytes(StandardCharsets.UTF_8), initVector.getBytes(StandardCharsets.UTF_8), data.getBytes(StandardCharsets.UTF_8)); String strs = Base64.encode(bt); return strs; }catch (Exception e) { @@ -45,114 +45,115 @@ public class Aes { } - /** - * 根据键值进行解密 - * @param key - * @param initVector - * @param data - * @return - * @throws Exception - */ - public static String decrypt(String key, String initVector, String data){ - try { - if (data == null) { - return null; - } - byte[] buf = Base64.decode(data); - byte[] bt = decrypt(key.getBytes(ENCODE_UTF_8), initVector.getBytes(ENCODE_UTF_8), buf); - return new String(bt, ENCODE_UTF_8); - }catch (Exception e) { - throw new DaMaiFrameException(BaseCode.AES_ERROR); + /** + * 根据键值进行解密 + * @param key + * @param initVector + * @param data + * @return + * @throws Exception + */ + public static String decrypt(String key, String initVector, String data){ + try { + if (data == null) { + return null; } - + byte[] buf = cn.hutool.core.codec.Base64.decode(data); + byte[] bt = decrypt(key.getBytes(StandardCharsets.UTF_8), initVector.getBytes(StandardCharsets.UTF_8), buf); + return new String(bt, StandardCharsets.UTF_8); + }catch (Exception e) { + throw new DaMaiFrameException(BaseCode.AES_ERROR); } + } + + + /** + * 加密 + * @param key + * @param initVector + * @param data + * @return + * @throws Exception + */ + public static byte[] encrypt(byte[] key, byte[] initVector, byte[] data) throws Exception { + // 注意,为了能与 iOS 统一 + // 这里的 key 不可以使用 KeyGenerator、SecureRandom、SecretKey 生成 + IvParameterSpec iv = new IvParameterSpec(initVector); + SecretKeySpec secretkeySpec = new SecretKeySpec(key, AES); - /** - * 加密 - * @param key - * @param initVector - * @param data - * @return - * @throws Exception - */ - public static byte[] encrypt(byte[] key, byte[] initVector, byte[] data) throws Exception { - // 注意,为了能与 iOS 统一 - // 这里的 key 不可以使用 KeyGenerator、SecureRandom、SecretKey 生成 - IvParameterSpec iv = new IvParameterSpec(initVector); - SecretKeySpec skeySpec = new SecretKeySpec(key, AES); - - // 指定加密的算法、工作模式和填充方式 - Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING"); - cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv); - - return cipher.doFinal(data); - } + // 指定加密的算法、工作模式和填充方式 + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING"); + cipher.init(Cipher.ENCRYPT_MODE, secretkeySpec, iv); - /** - * 解密 - * @param key - * @param initVector - * @param data - * @return - * @throws Exception - */ - public static byte[] decrypt(byte[] key, byte[] initVector, byte[] data) throws Exception { - // 注意,为了能与 iOS 统一 - // 这里的 key 不可以使用 KeyGenerator、SecureRandom、SecretKey 生成 - IvParameterSpec iv = new IvParameterSpec(initVector); - SecretKeySpec skeySpec = new SecretKeySpec(key, AES); - - // 指定加密的算法、工作模式和填充方式 - Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING"); - cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv); - - return cipher.doFinal(data); - } + return cipher.doFinal(data); + } + + /** + * 解密 + * @param key + * @param initVector + * @param data + * @return + * @throws Exception + */ + public static byte[] decrypt(byte[] key, byte[] initVector, byte[] data) throws Exception { + // 注意,为了能与 iOS 统一 + // 这里的 key 不可以使用 KeyGenerator、SecureRandom、SecretKey 生成 + IvParameterSpec iv = new IvParameterSpec(initVector); + SecretKeySpec secretkeySpec = new SecretKeySpec(key, AES); - /** - * [使用指定的字符串生成秘钥 - */ - public static String getAesByKey(String key) { - if(StringUtil.isEmpty(key)) { - return key; - } - String resultString = ""; - try { - KeyGenerator kg = KeyGenerator.getInstance("AES"); - kg.init(128, new SecureRandom(key.getBytes())); - SecretKey sk = kg.generateKey(); - byte[] b = sk.getEncoded(); - resultString = byteToHexString(b); - if(StringUtil.isNotEmpty(resultString) && resultString.length() > 16) { - resultString = resultString.substring(16); - } - } catch (NoSuchAlgorithmException e) { - log.error("没有此算法",e); + // 指定加密的算法、工作模式和填充方式 + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING"); + cipher.init(Cipher.DECRYPT_MODE, secretkeySpec, iv); + + return cipher.doFinal(data); + } + + /** + * [使用指定的字符串生成秘钥 + */ + public static String getAesByKey(String key) { + if(StringUtil.isEmpty(key)) { + return key; + } + String resultString = null; + try { + int sixteen = 16; + KeyGenerator kg = KeyGenerator.getInstance("AES"); + kg.init(128, new SecureRandom(key.getBytes())); + SecretKey sk = kg.generateKey(); + byte[] b = sk.getEncoded(); + resultString = byteToHexString(b); + if(StringUtil.isNotEmpty(resultString) && resultString.length() > sixteen) { + resultString = resultString.substring(sixteen); } - return resultString; + } catch (NoSuchAlgorithmException e) { + log.error("没有此算法",e); } - - /** - * byte数组转化为16进制字符串 - * @param bytes - * @return - */ - public static String byteToHexString(byte[] bytes) { - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < bytes.length; i++) { - String strHex=Integer.toHexString(bytes[i]); - if(strHex.length() > 3) { - sb.append(strHex.substring(6)); + return resultString; + } + + /** + * byte数组转化为16进制字符串 + * @param bytes + * @return + */ + public static String byteToHexString(byte[] bytes) { + StringBuilder sb = new StringBuilder(); + for (byte aByte : bytes) { + String strHex = Integer.toHexString(aByte); + if (strHex.length() > 3) { + sb.append(strHex.substring(6)); + } else { + if (strHex.length() < 2) { + sb.append("0").append(strHex); } else { - if(strHex.length() < 2) { - sb.append("0" + strHex); - } else { - sb.append(strHex); - } + sb.append(strHex); } - } - return sb.toString(); + } + } + return sb.toString(); } - } \ No newline at end of file +} \ No newline at end of file diff --git a/damai-common/src/main/java/com/damai/util/Base64.java b/damai-common/src/main/java/com/damai/util/Base64.java index b8b4fa88ea6ca1d964900bc87a133716b31a2479..996cc7e724e26b0d0fb1f1785c285046b8828771 100644 --- a/damai-common/src/main/java/com/damai/util/Base64.java +++ b/damai-common/src/main/java/com/damai/util/Base64.java @@ -1,5 +1,7 @@ package com.damai.util; +import java.util.Arrays; + /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 * @description: base64 @@ -7,48 +9,70 @@ package com.damai.util; **/ public final class Base64 { - private static final int BASELENGTH = 128; - private static final int LOOKUPLENGTH = 64; - private static final int TWENTYFOURBITGROUP = 24; - private static final int EIGHTBIT = 8; - private static final int SIXTEENBIT = 16; - private static final int FOURBYTE = 4; + private static final int BASE_LENGTH = 128; + private static final int LOOKUP_LENGTH = 64; + private static final int TWENTY_FOUR_BIT_GROUP = 24; + private static final int EIGHT_BIT = 8; + private static final int SIXTEEN_BIT = 16; + private static final int FOUR_BYTE = 4; private static final int SIGN = -128; - private static char PAD = '='; - private static byte[] base64Alphabet = new byte[BASELENGTH]; - private static char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH]; + private static final char PAD = '='; + private static final byte[] BASE64_ALPHABET = new byte[BASE_LENGTH]; + private static final char[] LOOKUP_BASE64_ALPHABET = new char[LOOKUP_LENGTH]; + + private static final char A_UPPER_CASE = 'A'; + private static final char A_LOWER_CASE = 'a'; + private static final char Z_UPPER_CASE = 'Z'; + + private static final char Z_LOWER_CASE = 'z'; + + private static final char ZERO = '0'; + + private static final char NINE = '9'; + + private static final int TWENTY_FIVE = 25; + + private static final int TWENTY_SIX = 26; + + private static final int FIFTY_ONE = 51; + + private static final int FIFTY_TWO = 52; + + private static final int SIXTY_ONE = 61; + + private static final byte LOW_FOUR_BITS_MASK = 0xf; + + private static final byte LOW_TWO_BITS_MASK = 0x3; static { - for (int i = 0; i < BASELENGTH; ++i) { - base64Alphabet[i] = -1; - } - for (int i = 'Z'; i >= 'A'; i--) { - base64Alphabet[i] = (byte) (i - 'A'); + Arrays.fill(BASE64_ALPHABET, (byte) -1); + for (int i = Z_UPPER_CASE; i >= A_UPPER_CASE; i--) { + BASE64_ALPHABET[i] = (byte) (i - A_UPPER_CASE); } - for (int i = 'z'; i >= 'a'; i--) { - base64Alphabet[i] = (byte) (i - 'a' + 26); + for (int i = Z_LOWER_CASE; i >= A_LOWER_CASE; i--) { + BASE64_ALPHABET[i] = (byte) (i - A_LOWER_CASE + 26); } - for (int i = '9'; i >= '0'; i--) { - base64Alphabet[i] = (byte) (i - '0' + 52); + for (int i = NINE; i >= ZERO; i--) { + BASE64_ALPHABET[i] = (byte) (i - ZERO + 52); } - base64Alphabet['+'] = 62; - base64Alphabet['/'] = 63; + BASE64_ALPHABET['+'] = 62; + BASE64_ALPHABET['/'] = 63; - for (int i = 0; i <= 25; i++) { - lookUpBase64Alphabet[i] = (char) ('A' + i); + for (int i = 0; i <= TWENTY_FIVE; i++) { + LOOKUP_BASE64_ALPHABET[i] = (char) (A_UPPER_CASE + i); } - for (int i = 26, j = 0; i <= 51; i++, j++) { - lookUpBase64Alphabet[i] = (char) ('a' + j); + for (int i = TWENTY_SIX, j = 0; i <= FIFTY_ONE; i++, j++) { + LOOKUP_BASE64_ALPHABET[i] = (char) (A_LOWER_CASE + j); } - for (int i = 52, j = 0; i <= 61; i++, j++) { - lookUpBase64Alphabet[i] = (char) ('0' + j); + for (int i = FIFTY_TWO, j = 0; i <= SIXTY_ONE; i++, j++) { + LOOKUP_BASE64_ALPHABET[i] = (char) (ZERO + j); } - lookUpBase64Alphabet[62] = (char) '+'; - lookUpBase64Alphabet[63] = (char) '/'; + LOOKUP_BASE64_ALPHABET[62] = '+'; + LOOKUP_BASE64_ALPHABET[63] = '/'; } @@ -61,7 +85,7 @@ public final class Base64 { } private static boolean isData(char octect) { - return (octect < BASELENGTH && base64Alphabet[octect] != -1); + return (octect < BASE_LENGTH && BASE64_ALPHABET[octect] != -1); } /** @@ -77,18 +101,16 @@ public final class Base64 { return null; } - int lengthDataBits = binaryData.length * EIGHTBIT; + int lengthDataBits = binaryData.length * EIGHT_BIT; if (lengthDataBits == 0) { return ""; } - int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP; - int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP; + int fewerThan24bits = lengthDataBits % TWENTY_FOUR_BIT_GROUP; + int numberTriplets = lengthDataBits / TWENTY_FOUR_BIT_GROUP; int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets; - char encodedData[] = null; - - encodedData = new char[numberQuartet * 4]; + char[] encodedData = new char[numberQuartet * 4]; byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0; @@ -110,24 +132,24 @@ public final class Base64 { byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc); - encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; - encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)]; - encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3]; - encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f]; + encodedData[encodedIndex++] = LOOKUP_BASE64_ALPHABET[val1]; + encodedData[encodedIndex++] = LOOKUP_BASE64_ALPHABET[val2 | (k << 4)]; + encodedData[encodedIndex++] = LOOKUP_BASE64_ALPHABET[(l << 2) | val3]; + encodedData[encodedIndex++] = LOOKUP_BASE64_ALPHABET[b3 & 0x3f]; } // form integral number of 6-bit groups - if (fewerThan24bits == EIGHTBIT) { + if (fewerThan24bits == EIGHT_BIT) { b1 = binaryData[dataIndex]; k = (byte) (b1 & 0x03); byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0); - encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; - encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4]; + encodedData[encodedIndex++] = LOOKUP_BASE64_ALPHABET[val1]; + encodedData[encodedIndex++] = LOOKUP_BASE64_ALPHABET[k << 4]; encodedData[encodedIndex++] = PAD; encodedData[encodedIndex++] = PAD; - } else if (fewerThan24bits == SIXTEENBIT) { + } else if (fewerThan24bits == SIXTEEN_BIT) { b1 = binaryData[dataIndex]; b2 = binaryData[dataIndex + 1]; l = (byte) (b2 & 0x0f); @@ -138,116 +160,15 @@ public final class Base64 { byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0); - encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; - encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)]; - encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2]; + encodedData[encodedIndex++] = LOOKUP_BASE64_ALPHABET[val1]; + encodedData[encodedIndex++] = LOOKUP_BASE64_ALPHABET[val2 | (k << 4)]; + encodedData[encodedIndex++] = LOOKUP_BASE64_ALPHABET[l << 2]; encodedData[encodedIndex++] = PAD; } return new String(encodedData); } - /** - * Decodes Base64 data into octects - * - * @param encoded - * string containing Base64 data - * @return Array containind decoded data. - */ - public static byte[] decode(String encoded) { - - if (encoded == null) { - return null; - } - - char[] base64Data = encoded.toCharArray(); - // remove white spaces - int len = removeWhiteSpace(base64Data); - - if (len % FOURBYTE != 0) { - return null;// should be divisible by four - } - - int numberQuadruple = (len / FOURBYTE); - - if (numberQuadruple == 0) { - return new byte[0]; - } - - byte decodedData[] = null; - byte b1 = 0, b2 = 0, b3 = 0, b4 = 0; - char d1 = 0, d2 = 0, d3 = 0, d4 = 0; - - int i = 0; - int encodedIndex = 0; - int dataIndex = 0; - decodedData = new byte[(numberQuadruple) * 3]; - - for (; i < numberQuadruple - 1; i++) { - - if (!isData((d1 = base64Data[dataIndex++])) - || !isData((d2 = base64Data[dataIndex++])) - || !isData((d3 = base64Data[dataIndex++])) - || !isData((d4 = base64Data[dataIndex++]))) { - return null; - }// if found "no data" just return null - - b1 = base64Alphabet[d1]; - b2 = base64Alphabet[d2]; - b3 = base64Alphabet[d3]; - b4 = base64Alphabet[d4]; - - decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); - decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); - decodedData[encodedIndex++] = (byte) (b3 << 6 | b4); - } - - if (!isData((d1 = base64Data[dataIndex++])) - || !isData((d2 = base64Data[dataIndex++]))) { - return null;// if found "no data" just return null - } - - b1 = base64Alphabet[d1]; - b2 = base64Alphabet[d2]; - - d3 = base64Data[dataIndex++]; - d4 = base64Data[dataIndex++]; - if (!isData((d3)) || !isData((d4))) {// Check if they are PAD characters - if (isPad(d3) && isPad(d4)) { - if ((b2 & 0xf) != 0)// last 4 bits should be zero - { - return null; - } - byte[] tmp = new byte[i * 3 + 1]; - System.arraycopy(decodedData, 0, tmp, 0, i * 3); - tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4); - return tmp; - } else if (!isPad(d3) && isPad(d4)) { - b3 = base64Alphabet[d3]; - if ((b3 & 0x3) != 0)// last 2 bits should be zero - { - return null; - } - byte[] tmp = new byte[i * 3 + 2]; - System.arraycopy(decodedData, 0, tmp, 0, i * 3); - tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); - tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); - return tmp; - } else { - return null; - } - } else { // No PAD e.g 3cQl - b3 = base64Alphabet[d3]; - b4 = base64Alphabet[d4]; - decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); - decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); - decodedData[encodedIndex++] = (byte) (b3 << 6 | b4); - - } - - return decodedData; - } - /** * remove WhiteSpace from MIME containing encoded Base64 data. * diff --git a/damai-common/src/main/java/com/damai/util/DateUtils.java b/damai-common/src/main/java/com/damai/util/DateUtils.java index 1c5d3aef1e1821f8863e5c935f7846e2be0b213d..7f7acbf84cd860d09962b47a1191952b3ae1cd1b 100644 --- a/damai-common/src/main/java/com/damai/util/DateUtils.java +++ b/damai-common/src/main/java/com/damai/util/DateUtils.java @@ -112,6 +112,13 @@ public class DateUtils { return parseDateTime(getFormatedDateString(8,FORMAT_SECOND)); } + /** + * 获取北京当前时间 + * */ + public static Date now(String format){ + return parseDateTime(getFormatedDateString(8,format),format); + } + public static String nowStr(){ return getFormatedDateString(8, FORMAT_SECOND); } @@ -205,6 +212,17 @@ public class DateUtils { public static Date parseDateTime(String dateTimeStr) { return parse(dateTimeStr, FORMAT_SECOND); } + + /** + * 按照format 格式时间转化为 Date 格式时间 + * + * @param dateTimeStr yyyy-MM-dd HH:mm:ss 格式时间(如:2022-06-17 16:06:17) + * @param format 格式 + * @return Date 格式时间 + */ + public static Date parseDateTime(String dateTimeStr,String format) { + return parse(dateTimeStr, format); + } /** * 将 yyyy-MM-dd HH:mm:ss:SSS 格式时间转化为 Date 格式时间 @@ -450,15 +468,16 @@ public class DateUtils { * @return -1(时间为空),其他数字(今年的第几周) */ public static int getWeekOfYearIgnoreLastYear(Date date) { + int seven = 7; if (Objects.isNull(date)) { return -1; } Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int days = calendar.get(Calendar.DAY_OF_YEAR); - int weeks = days / 7; + int weeks = days / seven; // 如果是 7 的倍数,则表示恰好是多少周 - if (days % 7 == 0) { + if (days % seven == 0) { return weeks; } // 如果有余数,则需要再加 1 @@ -849,7 +868,9 @@ public class DateUtils { * @return */ public static String getFormatedDateString(float timeZoneOffset, String pattern) { - if (timeZoneOffset > 13 || timeZoneOffset < -12) { + int thirteen = 13; + int minusTwelve = -12; + if (timeZoneOffset > thirteen || timeZoneOffset < minusTwelve) { timeZoneOffset = 0; } diff --git a/damai-common/src/main/java/com/damai/util/RsaSignTool.java b/damai-common/src/main/java/com/damai/util/RsaSignTool.java index da673e885a04966e1f4f8c071068060f915c0af3..22695466f4440f5f76a0f21871d8ddf8c603976a 100644 --- a/damai-common/src/main/java/com/damai/util/RsaSignTool.java +++ b/damai-common/src/main/java/com/damai/util/RsaSignTool.java @@ -184,7 +184,7 @@ public class RsaSignTool { } public static void parameterTransferV1() { - Map map = new HashMap<>(); + Map map = new HashMap<>(8); //基础参数 map.put("code", "1234"); //业务参数 @@ -199,20 +199,20 @@ public class RsaSignTool { } public static void parameterTransferV2() { - Map map = new HashMap<>(); + Map map = new HashMap<>(8); //基础参数 map.put("code","1234"); //参数加密后再签名 - Map businessMap = new HashMap<>(); + Map businessMap = new HashMap<>(8); businessMap.put("id","1111"); businessMap.put("sleepTime",10); //将业务参数进行加密 - String encrypt = RSATool.encrypt(JSON.toJSONString(businessMap), dataPublicKey); + String encrypt = RsaTool.encrypt(JSON.toJSONString(businessMap), dataPublicKey); System.out.println("参数加密后:" + encrypt); - String decrypt = RSATool.decrypt(encrypt, dataPrivateKey); + String decrypt = RsaTool.decrypt(encrypt, dataPrivateKey); System.out.println("参数解密后:" + decrypt); //将未加密的业务参数和基础参数进行拼接 diff --git a/damai-common/src/main/java/com/damai/util/RSATool.java b/damai-common/src/main/java/com/damai/util/RsaTool.java similarity index 94% rename from damai-common/src/main/java/com/damai/util/RSATool.java rename to damai-common/src/main/java/com/damai/util/RsaTool.java index c016aa915fb57c218087f12fccfc556929678894..32e2c2ce995482fb4e072029420d314c971517f1 100644 --- a/damai-common/src/main/java/com/damai/util/RSATool.java +++ b/damai-common/src/main/java/com/damai/util/RsaTool.java @@ -25,7 +25,7 @@ import java.util.Map; * @author: 阿宽不是程序员 **/ @Slf4j -public class RSATool { +public class RsaTool { private final static Integer KEY_SIZE = 2048; @@ -48,7 +48,7 @@ public class RSATool { * 生成公私钥 */ public Map getKey() { - Map pubPriKey = new HashMap<>(); + Map pubPriKey = new HashMap<>(8); KeyPair keyPair = KeyUtil.generateKeyPair(KEY_ALGORITHM, KEY_SIZE); String publicKeyStr = java.util.Base64.getEncoder().encodeToString(keyPair.getPublic().getEncoded()); String privateKeyStr = java.util.Base64.getEncoder().encodeToString(keyPair.getPrivate().getEncoded()); @@ -147,9 +147,8 @@ public class RSATool { */ public static String decrypt(String data, String privateKeyStr) { try { - PrivateKey privateKey2 = RSATool.getPrivateKey(privateKeyStr); - String decryptstr = RSATool.decrypt(data, privateKey2); - return decryptstr; + PrivateKey privateKey2 = RsaTool.getPrivateKey(privateKeyStr); + return RsaTool.decrypt(data, privateKey2); }catch (Exception e) { log.error("decrypt error",e); throw new DaMaiFrameException(BaseCode.RSA_DECRYPT_ERROR); @@ -165,7 +164,7 @@ public class RSATool { */ public static String encrypt(String data, String publicKey) { try { - PublicKey publicKeyTmp = RSATool.getPublicKey(publicKey); + PublicKey publicKeyTmp = RsaTool.getPublicKey(publicKey); return encrypt(data,publicKeyTmp); }catch (Exception e) { log.error("encrypt error",e); @@ -191,12 +190,12 @@ public class RSATool { public static void main(String[] args) throws Exception { String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAirLDI4SPxLXAjk+CMJWrdREnQjJJQgEd7RAw+ZCPZKBFfkoPa5YjcYQzqtc4RPOszBZhPmGr732WLA0O2U0WFnPG6vva9x7pYQot4u5IoncRl7kBb89d1XdR5DZxKovQyDM91CkLikq8h0sBVTkfX2Jz34LmYd8TPQ4BSHUDE5h+f42WkUYG9PCaXvPg+yv4+1AwJeXI/wW181h1JQ5cmogFXIHEFOxS/wwtnoijwmRv/3nKhdyYZbpC2V7F2xq9jWuTBL01Oj3sRhbykHDW2aK2oJ53U5vqlaC6XsheCabMqeqjDPCa8rUjp10pWy7LneYxVigVuONOmlvt56ja7QIDAQAB"; String privateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCKssMjhI/EtcCOT4Iwlat1ESdCMklCAR3tEDD5kI9koEV+Sg9rliNxhDOq1zhE86zMFmE+YavvfZYsDQ7ZTRYWc8bq+9r3HulhCi3i7kiidxGXuQFvz13Vd1HkNnEqi9DIMz3UKQuKSryHSwFVOR9fYnPfguZh3xM9DgFIdQMTmH5/jZaRRgb08Jpe8+D7K/j7UDAl5cj/BbXzWHUlDlyaiAVcgcQU7FL/DC2eiKPCZG//ecqF3JhlukLZXsXbGr2Na5MEvTU6PexGFvKQcNbZoragnndTm+qVoLpeyF4Jpsyp6qMM8JrytSOnXSlbLsud5jFWKBW4406aW+3nqNrtAgMBAAECggEAbCHOTSSOSZhBlTGbmHE3iT9kUhGOV60zPZ0/8XGouZTSWRE4UHJvE5M0DN9Z+TfY4gwYqF/RghdxOsq7ZuLYc4yz6oOMRNmOrZ8YAzIu4qrdxmHwItGSoFg0Oi3PsJHspgh9DakqXBjEPt5VHbI5KU5CdGFDZ85Y22LN0UWYrm8wOj6P4qJU/bXIOYYl4LfQRIdF6z/0a/ooi0JvQWfgiVMjymTaeF/aRNxqt2Mm09hWEfKUzYX96LINrCJ0DG/Rz+xyShW3rajOHxdY61gyIPybQcXehtacGW+DE/4M6KrWZYUoH/X3KUaXjq0Ed+Sj2cSmv30idcdyDsRmSK7VaQKBgQDOTVoMVhrzDAZf1DywMwSyObQJ4tFr1MwNLXD1wqRJta07448IuRGOdXoq4hoEw1gBAcHyWlIT/8hY7fiBvMi0YETL2gN+PWLhJL24dxR92ACsKP1j3cYM6b0HmfyrbTUuzk+dWcI835ADzWq+b093+EUI/7VZUAALowk2o/DtQwKBgQCsHEgxK7cW6nRLevssnnBIWQ5IlJlUsp/tqyn+IKwuUyJzJWRXvxag4UdMUcMOB/syw9XFyqBgEc+cY1jgoMVsacFyeAkUjfaxGro83H/Inx2Ge25zH/OxZkmL7kkz+bApKhmtHva8mCGu4ZHh0B6PFoffZV6idiAokgVmir/8DwKBgQCrDv5cfkUIRG9ApFXR7+uz8B61l8n39FFhl80zKjpZF/hVUUF3hSTmj8hFqIbUbjkZVKDBWFz4Uj2IZ4GH6cYtsik5MkN1OGc1seZR/wMRuboNBkvcs7YVXPYtSGR2rC3N6qmfGh7xpJngXUJmNxuYqVZsuMJhFPGEtKHeGZ+aywKBgHEPsyz59rCLHBJpm47YFhKwzf1IAOHu5biPdGqItBNKcZsKuTwbP5Y350pve59ABvh2RXxFe80gZi3p5XzKoGZzoqy7xdtG1wPI9wb8IsV8IT0y4H+oQcIL28ycoGIQaHTiPzPG33dMyPPFIrwgp7J/ropGYUCAMOf15K5T/4JpAoGAHwLE5jaJxK5VKKe9x4uPWcPLMgJY3s9J2dn1ZrZTOKqE0d9GCbSEhZNtGOrAzAmWdy3GC0rmP0Fs2DIyTJg9iPsn/ISt0PYvIzSJ6CQeAuEtsjdEdKiVa/um10XeD4dT4vAyMHJpg9WV2NR/vjiuk2YIM1CXo/r/7Gp6aiHY+Bc="; - Map businessBodyMap = new HashMap<>(); + Map businessBodyMap = new HashMap<>(8); businessBodyMap.put("id","1"); businessBodyMap.put("sleepTime","10"); - String encrypt = RSATool.encrypt(JSON.toJSONString(businessBodyMap), publicKey); + String encrypt = RsaTool.encrypt(JSON.toJSONString(businessBodyMap), publicKey); System.out.println("加密后:" + encrypt); - String decrypt = RSATool.decrypt(encrypt, privateKey); + String decrypt = RsaTool.decrypt(encrypt, privateKey); System.out.println("解密后:" + decrypt); } diff --git a/damai-common/src/main/java/com/damai/core/StringUtil.java b/damai-common/src/main/java/com/damai/util/StringUtil.java similarity index 98% rename from damai-common/src/main/java/com/damai/core/StringUtil.java rename to damai-common/src/main/java/com/damai/util/StringUtil.java index 102c9573f4e49bb5a9a96d2130784830fec952cb..962a8dfd90d6d5bd1e71730707932cd6869cdc88 100644 --- a/damai-common/src/main/java/com/damai/core/StringUtil.java +++ b/damai-common/src/main/java/com/damai/util/StringUtil.java @@ -1,4 +1,4 @@ -package com.damai.core; +package com.damai.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/init/InitData.java b/damai-common/src/main/java/com/damai/util/Test.java similarity index 60% rename from damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/init/InitData.java rename to damai-common/src/main/java/com/damai/util/Test.java index c9a1cf74d884592fe625a76a124dc381ed64800c..b41a2aed1cf591a600ada8cdc328a8310d5f857b 100644 --- a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/init/InitData.java +++ b/damai-common/src/main/java/com/damai/util/Test.java @@ -1,11 +1,13 @@ -package com.damai.init; +package com.damai.util; /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 - * @description: 初始化数据抽象 + * @description: 测试使用 * @author: 阿宽不是程序员 **/ -public interface InitData { +public class Test { - void init(); + public static void main(String[] args) { + + } } diff --git a/damai-common/src/main/resources/META-INF/spring.factories b/damai-common/src/main/resources/META-INF/spring.factories index 29f829cfb6176a98b894dc520f52b05c5d397faf..0d5c527e1cb96fa6672c440d66d85e8778130059 100644 --- a/damai-common/src/main/resources/META-INF/spring.factories +++ b/damai-common/src/main/resources/META-INF/spring.factories @@ -1,6 +1,4 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ com.damai.config.DaMaiCommonAutoConfig -org.springframework.boot.SpringApplicationRunListener=\ - com.damai.runlistener.CustomEventPublishingRunListener org.springframework.boot.env.EnvironmentPostProcessor=\ com.damai.environment.SpringEnvironment \ No newline at end of file diff --git a/damai-elasticsearch-framework/src/main/java/com/damai/conf/BusinessEsAutoConfig.java b/damai-elasticsearch-framework/src/main/java/com/damai/conf/BusinessEsAutoConfig.java index 2961efa72a3db70499c7dd92424776be962d5698..e113451054817f9047027e4642822c097d4b5104 100644 --- a/damai-elasticsearch-framework/src/main/java/com/damai/conf/BusinessEsAutoConfig.java +++ b/damai-elasticsearch-framework/src/main/java/com/damai/conf/BusinessEsAutoConfig.java @@ -1,7 +1,7 @@ package com.damai.conf; -import com.damai.core.StringUtil; +import com.damai.util.StringUtil; import com.damai.util.BusinessEsHandle; import org.apache.http.Header; import org.apache.http.HttpHeaders; @@ -34,19 +34,19 @@ public class BusinessEsAutoConfig { @Bean public RestClient businessEsRestClient(BusinessEsProperties businessEsProperties) { + String defaultValue = "default"; HttpHost[] hosts = Arrays.stream(businessEsProperties.getIp()).map(this::makeHttpHost).filter(Objects::nonNull) .toArray(HttpHost[]::new); RestClientBuilder builder = RestClient.builder(hosts); String userName = businessEsProperties.getUserName(); String passWord = businessEsProperties.getPassWord(); - if (StringUtil.isNotEmpty(userName) && !"default".equals(userName) && StringUtil.isNotEmpty(passWord) && !"default".equals(passWord)) { + if (StringUtil.isNotEmpty(userName) && !defaultValue.equals(userName) && StringUtil.isNotEmpty(passWord) && !defaultValue.equals(passWord)) { //开始设置用户名和密码 CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(userName, passWord)); builder.setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider) - .setDefaultIOReactorConfig( - IOReactorConfig.custom() + .setDefaultIOReactorConfig(IOReactorConfig.custom() // 设置线程数 .setIoThreadCount(businessEsProperties.getMaxConnectNum()) .build())); @@ -59,7 +59,7 @@ public class BusinessEsAutoConfig { builder.setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder .setConnectTimeout(businessEsProperties.getConnectTimeOut()) .setSocketTimeout(businessEsProperties.getSocketTimeOut()) - .setConnectionRequestTimeout(businessEsProperties.getConnectionRequestTimeOut())); + .setConnectionRequestTimeout(businessEsProperties.getConnectionRequestTimeOut())); return builder.build(); } diff --git a/damai-elasticsearch-framework/src/main/java/com/damai/conf/BusinessEsProperties.java b/damai-elasticsearch-framework/src/main/java/com/damai/conf/BusinessEsProperties.java index df77f074750a96c8a771c6e6daebcc980906446d..9829e16996bbdbab5e9f86d9860b2a1c81057f21 100644 --- a/damai-elasticsearch-framework/src/main/java/com/damai/conf/BusinessEsProperties.java +++ b/damai-elasticsearch-framework/src/main/java/com/damai/conf/BusinessEsProperties.java @@ -31,6 +31,4 @@ public class BusinessEsProperties { private Integer connectionRequestTimeOut = 40000; private Integer maxConnectNum = 400; - - private Integer maxConnectPerRoute = 400; } diff --git a/damai-elasticsearch-framework/src/main/java/com/damai/dto/EsDocumentMappingDto.java b/damai-elasticsearch-framework/src/main/java/com/damai/dto/EsDocumentMappingDto.java index 625130d6484b2d247c287b0b7427f23f2bd27177..a72241b189a05240973633105782c6082d5fb6d0 100644 --- a/damai-elasticsearch-framework/src/main/java/com/damai/dto/EsDocumentMappingDto.java +++ b/damai-elasticsearch-framework/src/main/java/com/damai/dto/EsDocumentMappingDto.java @@ -1,6 +1,8 @@ package com.damai.dto; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 @@ -8,6 +10,8 @@ import lombok.Data; * @author: 阿宽不是程序员 **/ @Data +@AllArgsConstructor +@NoArgsConstructor public class EsDocumentMappingDto { /** diff --git a/damai-elasticsearch-framework/src/main/java/com/damai/util/BusinessEsHandle.java b/damai-elasticsearch-framework/src/main/java/com/damai/util/BusinessEsHandle.java index c11c3c4fc5c660f9a12a1a51f02e4efb96c67986..0408b5530493deae5923d2bda1a90a2fb241cbd5 100644 --- a/damai-elasticsearch-framework/src/main/java/com/damai/util/BusinessEsHandle.java +++ b/damai-elasticsearch-framework/src/main/java/com/damai/util/BusinessEsHandle.java @@ -4,8 +4,6 @@ import cn.hutool.core.collection.CollectionUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.damai.core.SpringUtil; -import com.damai.core.StringUtil; import com.damai.dto.EsDataQueryDto; import com.damai.dto.EsDocumentMappingDto; import com.damai.dto.EsGeoPointDto; @@ -86,8 +84,8 @@ public class BusinessEsHandle { String paramName = esDocumentMappingDto.getParamName(); String paramType = esDocumentMappingDto.getParamType(); if ("text".equals(paramType)) { - Map> map1 = new HashMap<>(); - Map map2 = new HashMap<>(); + Map> map1 = new HashMap<>(8); + Map map2 = new HashMap<>(8); map2.put("type","keyword"); map2.put("ignore_above",256); map1.put("keyword",map2); @@ -104,8 +102,9 @@ public class BusinessEsHandle { indexRequest.source(builder); String source = indexRequest.source().utf8ToString(); + log.info("create index execute dsl : {}",source); HttpEntity entity = new NStringEntity(source, ContentType.APPLICATION_JSON); - Request request = new Request("PUT","/"+ SpringUtil.getPrefixDistinctionName() + "-" + indexName); + Request request = new Request("PUT","/"+ indexName); request.setEntity(entity); request.addParameters(Collections.emptyMap()); Response performRequest = restClient.performRequest(request); @@ -125,9 +124,9 @@ public class BusinessEsHandle { try { String path = ""; if (esTypeSwitch) { - path = "/" + SpringUtil.getPrefixDistinctionName() + "-" + indexName + "/" + indexType + "/_mapping?include_type_name"; + path = "/" + indexName + "/" + indexType + "/_mapping?include_type_name"; }else { - path = "/" + SpringUtil.getPrefixDistinctionName() + "-" + indexName + "/_mapping"; + path = "/" + indexName + "/_mapping"; } Request request = new Request("GET", path); request.addParameters(Collections.emptyMap()); @@ -135,7 +134,7 @@ public class BusinessEsHandle { return "OK".equals(response.getStatusLine().getReasonPhrase()); }catch (Exception e) { if (e instanceof ResponseException && ((ResponseException)e).getResponse().getStatusLine().getStatusCode() == RestStatus.NOT_FOUND.getStatus()) { - log.warn("index not exist ! indexName:{}, indexType:{}", SpringUtil.getPrefixDistinctionName() + "-" + indexName,indexType); + log.warn("index not exist ! indexName:{}, indexType:{}", indexName,indexType); }else { log.error("checkIndex error",e); } @@ -153,7 +152,7 @@ public class BusinessEsHandle { return false; } try { - Request request = new Request("DELETE", "/" + SpringUtil.getPrefixDistinctionName() + "-" + indexName); + Request request = new Request("DELETE", "/" + indexName); request.addParameters(Collections.emptyMap()); Response response = restClient.performRequest(request); return "OK".equals(response.getStatusLine().getReasonPhrase()); @@ -208,9 +207,9 @@ public class BusinessEsHandle { HttpEntity entity = new NStringEntity(jsonString, ContentType.APPLICATION_JSON); String endpoint = ""; if (esTypeSwitch) { - endpoint = "/" + SpringUtil.getPrefixDistinctionName() + "-" + indexName + "/" + indexType; + endpoint = "/" + indexName + "/" + indexType; }else { - endpoint = "/" + SpringUtil.getPrefixDistinctionName() + "-" + indexName + "/_doc"; + endpoint = "/" + indexName + "/_doc"; } if (StringUtil.isNotEmpty(id)) { endpoint = endpoint + "/" + id; @@ -320,67 +319,7 @@ public class BusinessEsHandle { return list; } SearchSourceBuilder sourceBuilder = getSearchSourceBuilder(esGeoPointDto,esDataQueryDtoList,sortParam,geoPointDtoSortParam,sortOrder); - executeQuery(indexName,indexType,list,null,clazz,sourceBuilder); - return list; - } - - - /** - * 查询 - * - * @param indexName 索引名字 - * @param indexType 索引类型 - * @param dsl es的dsl语句 - * @param clazz 返回的类型 - * @return List - */ - public List query(String indexName, String indexType, String dsl, Class clazz) throws IOException { - if (!esSwitch) { - return new ArrayList<>(); - } - if (StringUtil.isEmpty(dsl)) { - return new ArrayList<>(); - } - HttpEntity entity = new NStringEntity(dsl, ContentType.APPLICATION_JSON); - String endpoint = ""; - if (esTypeSwitch) { - endpoint = "/" + indexName + "/" + indexType + "/_search"; - }else { - endpoint = "/" + indexName + "/_search"; - } - - Request request = new Request("POST",endpoint); - request.setEntity(entity); - request.addParameters(Collections.emptyMap()); - Response response = restClient.performRequest(request); - String results = EntityUtils.toString(response.getEntity()); - if (StringUtil.isEmpty(results)) { - return null; - } - List list = new ArrayList<>(); - JSONObject parse = (JSONObject) JSONObject.parse(results); - if (parse != null) { - JSONObject hits = parse.getJSONObject("hits"); - if (hits != null) { - // 数据 - JSONArray hitsArr = hits.getJSONArray("hits"); - if (null != hitsArr && !hitsArr.isEmpty()) { - for (int i = 0, size = hitsArr.size(); i < size; i++) { - JSONObject data = hitsArr.getJSONObject(i); - if (null != data) { - JSONObject jsonObject = data.getJSONObject("_source"); - - JSONArray jsonArray = data.getJSONArray("sort"); - if (null != jsonArray && !jsonArray.isEmpty()) { - Long sort = jsonArray.getLong(0); - jsonObject.put("sort",sort); - } - list.add(JSONObject.parseObject(jsonObject.toJSONString(),clazz)); - } - } - } - } - } + executeQuery(indexName,indexType,list,null,clazz,sourceBuilder,null); return list; } @@ -462,7 +401,7 @@ public class BusinessEsHandle { SearchSourceBuilder sourceBuilder = getSearchSourceBuilder(esGeoPointDto,esDataQueryDtoList,sortParam,geoPointDtoSortParam,sortOrder); sourceBuilder.from((pageNo - 1) * pageSize); sourceBuilder.size(pageSize); - executeQuery(indexName,indexType,list,pageInfo,clazz,sourceBuilder); + executeQuery(indexName,indexType,list,pageInfo,clazz,sourceBuilder,null); return pageInfo; } @@ -472,7 +411,6 @@ public class BusinessEsHandle { sortOrder = SortOrder.DESC; } if (StringUtil.isNotEmpty(sortParam)) { - // 排序 FieldSortBuilder sort = SortBuilders.fieldSort(sortParam); sort.order(sortOrder); sourceBuilder.sort(sort); @@ -483,13 +421,11 @@ public class BusinessEsHandle { sort.order(sortOrder); sourceBuilder.sort(sort); } - // 经纬度匹配 if (Objects.nonNull(esGeoPointDto)) { QueryBuilder geoQuery = new GeoDistanceQueryBuilder(esGeoPointDto.getParamName()).distance(Long.MAX_VALUE, DistanceUnit.KILOMETERS) .point(esGeoPointDto.getLatitude().doubleValue(), esGeoPointDto.getLongitude().doubleValue()).geoDistance(GeoDistance.PLANE); sourceBuilder.query(geoQuery); } - // 匹配 BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); for (EsDataQueryDto esDataQueryDto : esDataQueryDtoList) { String paramName = esDataQueryDto.getParamName(); @@ -532,10 +468,11 @@ public class BusinessEsHandle { return sourceBuilder; } - private void executeQuery(String indexName, String indexType,List list,PageInfo pageInfo,Class clazz, SearchSourceBuilder sourceBuilder) throws IOException { + public void executeQuery(String indexName, String indexType,List list,PageInfo pageInfo,Class clazz, + SearchSourceBuilder sourceBuilder,List highLightFieldNameList) throws IOException { String string = sourceBuilder.toString(); HttpEntity entity = new NStringEntity(string, ContentType.APPLICATION_JSON); - StringBuilder endpointStringBuilder = new StringBuilder("/" + SpringUtil.getPrefixDistinctionName() + "-" + indexName); + StringBuilder endpointStringBuilder = new StringBuilder("/" + indexName); if (esTypeSwitch) { endpointStringBuilder.append("/").append(indexType).append("/_search"); }else { @@ -547,45 +484,56 @@ public class BusinessEsHandle { request.setEntity(entity); request.addParameters(Collections.emptyMap()); Response response = restClient.performRequest(request); - String results = EntityUtils.toString(response.getEntity()); - if (StringUtil.isEmpty(results)) { + String result = EntityUtils.toString(response.getEntity()); + if (StringUtil.isEmpty(result)) { return; } - JSONObject parse = (JSONObject) JSONObject.parse(results); - if (Objects.nonNull(parse)) { - JSONObject hits = parse.getJSONObject("hits"); - if (Objects.nonNull(hits)) { - // 总条数 - Long value = null; - if (esTypeSwitch) { - value = hits.getLong("total"); - }else { - JSONObject totalJSONObject = hits.getJSONObject("total"); - if (totalJSONObject != null) { - value = totalJSONObject.getLong("value"); - } - } - if (Objects.nonNull(pageInfo)) { - pageInfo.setTotal(value); - } - // 数据 - JSONArray hitsArr = hits.getJSONArray("hits"); - if (null != hitsArr && !hitsArr.isEmpty()) { - for (int i = 0, size = hitsArr.size(); i < size; i++) { - JSONObject data = hitsArr.getJSONObject(i); - if (null != data) { - JSONObject jsonObject = data.getJSONObject("_source"); - - JSONArray jsonArray = data.getJSONArray("sort"); - if (null != jsonArray && !jsonArray.isEmpty()) { - Long sort = jsonArray.getLong(0); - jsonObject.put("sort",sort); - } - list.add(JSONObject.parseObject(jsonObject.toJSONString(),clazz)); - } + JSONObject resultJsonObject = JSONObject.parseObject(result); + if (Objects.isNull(resultJsonObject)) { + return; + } + JSONObject hits = resultJsonObject.getJSONObject("hits"); + if (Objects.isNull(hits)) { + return; + } + Long value = null; + if (esTypeSwitch) { + value = hits.getLong("total"); + }else { + JSONObject totalJsonObject = hits.getJSONObject("total"); + if (Objects.nonNull(totalJsonObject)) { + value = totalJsonObject.getLong("value"); + } + } + if (Objects.nonNull(pageInfo) && Objects.nonNull(value)) { + pageInfo.setTotal(value); + } + JSONArray arrayData = hits.getJSONArray("hits"); + if (Objects.isNull(arrayData) || arrayData.isEmpty()) { + return; + } + for (int i = 0, size = arrayData.size(); i < size; i++) { + JSONObject data = arrayData.getJSONObject(i); + if (Objects.isNull(data)) { + continue; + } + JSONObject jsonObject = data.getJSONObject("_source"); + JSONArray jsonArray = data.getJSONArray("sort"); + if (Objects.nonNull(jsonArray) && !jsonArray.isEmpty()) { + Long sort = jsonArray.getLong(0); + jsonObject.put("sort",sort); + } + JSONObject highlight = data.getJSONObject("highlight"); + if (Objects.nonNull(highlight) && Objects.nonNull(highLightFieldNameList)) { + for (String highLightFieldName : highLightFieldNameList) { + JSONArray highLightFieldValue = highlight.getJSONArray(highLightFieldName); + if (Objects.isNull(highLightFieldValue) || highLightFieldValue.isEmpty()) { + continue; } + jsonObject.put(highLightFieldName,highLightFieldValue.get(0)); } } + list.add(JSONObject.parseObject(jsonObject.toJSONString(),clazz)); } } } diff --git a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/UidGenerator.java b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/UidGenerator.java index a74356723394eb516980a1fc241e9cd688a44906..939d005c6b598e1f186a0d53d2523eef7e166bce 100644 --- a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/UidGenerator.java +++ b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/UidGenerator.java @@ -30,10 +30,20 @@ public interface UidGenerator { * @return UID * @throws UidGenerateException */ - long getUID() throws UidGenerateException; + long getUid() throws UidGenerateException; + /** + * 获取id + * @return 结果 + * */ long getId(); + /** + * 获取订单编号 + * @param userId 用户id + * @param tableCount 分表数量 + * @return 结果 + * */ long getOrderNumber(long userId,long tableCount); /** @@ -43,6 +53,6 @@ public interface UidGenerator { * @param uid * @return Parsed info */ - String parseUID(long uid); + String parseUid(long uid); } diff --git a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/buffer/BufferPaddingExecutor.java b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/buffer/BufferPaddingExecutor.java index b29f8addc33d5e766387458198becd009925c694..64c4ab27dc8839aa191f216826f10e2830cb9862 100644 --- a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/buffer/BufferPaddingExecutor.java +++ b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/buffer/BufferPaddingExecutor.java @@ -42,7 +42,11 @@ public class BufferPaddingExecutor { /** Constants */ private static final String WORKER_NAME = "RingBuffer-Padding-Worker"; private static final String SCHEDULE_NAME = "RingBuffer-Padding-Schedule"; - private static final long DEFAULT_SCHEDULE_INTERVAL = 5 * 60L; // 5 minutes + + /** + * 5 minutes + * */ + private static final long DEFAULT_SCHEDULE_INTERVAL = 5 * 60L; /** Whether buffer padding is running */ private final AtomicBoolean running; diff --git a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/config/IdGeneratorRedisConfig.java b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/config/IdGeneratorRedisConfig.java index 27cedd3739f63e7a5c586e54b3d8f482b553f47f..ada67147eae6c6150a8dec620614b2093eb83cd5 100644 --- a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/config/IdGeneratorRedisConfig.java +++ b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/config/IdGeneratorRedisConfig.java @@ -13,7 +13,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer; * @program: cook-frame * @description: 对百度开源id生成器进行redis适配 * @see 百度开源id生成器 - * @author: 星哥 + * @author: 阿宽不是程序员 * @create: 2023-05-23 **/ @Configuration(proxyBeanMethods = false) diff --git a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/config/RedisDisposableWorkerIdAssigner.java b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/config/RedisDisposableWorkerIdAssigner.java index 75259f63ea82883f882731b895b1947bc90f5a65..9640754bca6943681e00f86756b13c3e67d45d80 100644 --- a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/config/RedisDisposableWorkerIdAssigner.java +++ b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/config/RedisDisposableWorkerIdAssigner.java @@ -1,8 +1,12 @@ package com.baidu.fsg.uid.config; import com.baidu.fsg.uid.worker.WorkerIdAssigner; +import com.damai.enums.BaseCode; +import com.damai.exception.DaMaiFrameException; import org.springframework.data.redis.core.RedisTemplate; +import java.util.Optional; + /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 * @description: redis配置生成work_id @@ -20,6 +24,6 @@ public class RedisDisposableWorkerIdAssigner implements WorkerIdAssigner { public long assignWorkerId() { String key = "uid_work_id"; Long increment = redisTemplate.opsForValue().increment(key); - return increment; + return Optional.ofNullable(increment).orElseThrow(() -> new DaMaiFrameException(BaseCode.UID_WORK_ID_ERROR)); } } diff --git a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/impl/CachedUidGenerator.java b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/impl/CachedUidGenerator.java index f960e6a18556165f575ce990a8dc348196ff6dd2..1bdcb9ca9d9734c745823c93d7425fc8e4d62be4 100644 --- a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/impl/CachedUidGenerator.java +++ b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/impl/CachedUidGenerator.java @@ -74,7 +74,7 @@ public class CachedUidGenerator extends DefaultUidGenerator implements Disposabl } @Override - public long getUID() { + public long getUid() { try { return ringBuffer.take(); } catch (Exception e) { @@ -94,8 +94,8 @@ public class CachedUidGenerator extends DefaultUidGenerator implements Disposabl } @Override - public String parseUID(long uid) { - return super.parseUID(uid); + public String parseUid(long uid) { + return super.parseUid(uid); } @Override diff --git a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/impl/DefaultUidGenerator.java b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/impl/DefaultUidGenerator.java index 1a2b2ae8187a9a99ea826e7c56978175c82990d2..1a03506c3c2c3dc4d178a0f8ad378f6a288102b3 100644 --- a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/impl/DefaultUidGenerator.java +++ b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/impl/DefaultUidGenerator.java @@ -18,7 +18,7 @@ package com.baidu.fsg.uid.impl; import com.baidu.fsg.uid.BitsAllocator; import com.baidu.fsg.uid.UidGenerator; import com.baidu.fsg.uid.exception.UidGenerateException; -import com.baidu.fsg.uid.utils.DateUtils; +import com.baidu.fsg.uid.utils.AbstractDateUtils; import com.baidu.fsg.uid.worker.WorkerIdAssigner; import com.damai.toolkit.SnowflakeIdGenerator; import org.apache.commons.lang.StringUtils; @@ -39,7 +39,7 @@ import java.util.concurrent.TimeUnit; *
  • worker id: The next 22 bits, represents the worker's id which assigns based on database, max id is about 420W *
  • sequence: The next 13 bits, represents a sequence within the same second, max for 8192/s

    * - * The {@link DefaultUidGenerator#parseUID(long)} is a damai method to parse the bits + * The {@link DefaultUidGenerator#parseUid(long)} is a damai method to parse the bits * *
    {@code
      * +------+----------------------+----------------+-----------+
    @@ -101,7 +101,7 @@ public class DefaultUidGenerator implements UidGenerator, InitializingBean {
         }
     
         @Override
    -    public long getUID() throws UidGenerateException {
    +    public long getUid() throws UidGenerateException {
             try {
                 return nextId();
             } catch (Exception e) {
    @@ -121,7 +121,7 @@ public class DefaultUidGenerator implements UidGenerator, InitializingBean {
         }
     
         @Override
    -    public String parseUID(long uid) {
    +    public String parseUid(long uid) {
             long totalBits = BitsAllocator.TOTAL_BITS;
             long signBits = bitsAllocator.getSignBits();
             long timestampBits = bitsAllocator.getTimestampBits();
    @@ -134,7 +134,7 @@ public class DefaultUidGenerator implements UidGenerator, InitializingBean {
             long deltaSeconds = uid >>> (workerIdBits + sequenceBits);
     
             Date thatTime = new Date(TimeUnit.SECONDS.toMillis(epochSeconds + deltaSeconds));
    -        String thatTimeStr = DateUtils.formatByDateTimePattern(thatTime);
    +        String thatTimeStr = AbstractDateUtils.formatByDateTimePattern(thatTime);
     
             // format as string
             return String.format("{\"UID\":\"%d\",\"timestamp\":\"%s\",\"workerId\":\"%d\",\"sequence\":\"%d\"}",
    @@ -227,7 +227,7 @@ public class DefaultUidGenerator implements UidGenerator, InitializingBean {
         public void setEpochStr(String epochStr) {
             if (StringUtils.isNotBlank(epochStr)) {
                 this.epochStr = epochStr;
    -            this.epochSeconds = TimeUnit.MILLISECONDS.toSeconds(DateUtils.parseByDayPattern(epochStr).getTime());
    +            this.epochSeconds = TimeUnit.MILLISECONDS.toSeconds(AbstractDateUtils.parseByDayPattern(epochStr).getTime());
             }
         }
         
    diff --git a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/DateUtils.java b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/AbstractDateUtils.java
    similarity index 92%
    rename from damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/DateUtils.java
    rename to damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/AbstractDateUtils.java
    index e60b8cbbacb369fa195cd35c137ee529395dd002..4899e7664ef4552b56f2f7adadec202e9ae9e2dd 100644
    --- a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/DateUtils.java
    +++ b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/AbstractDateUtils.java
    @@ -15,18 +15,18 @@
      */
     package com.baidu.fsg.uid.utils;
     
    +import org.apache.commons.lang.time.DateFormatUtils;
    +
     import java.text.ParseException;
     import java.util.Calendar;
     import java.util.Date;
     
    -import org.apache.commons.lang.time.DateFormatUtils;
    -
     /**
    - * DateUtils provides date formatting, parsing
    + * AbstractDateUtils provides date formatting, parsing
      *
      * @author yutianbao
      */
    -public abstract class DateUtils extends org.apache.commons.lang.time.DateUtils {
    +public abstract class AbstractDateUtils extends org.apache.commons.lang.time.DateUtils {
         /**
          * Patterns
          */
    @@ -34,7 +34,7 @@ public abstract class DateUtils extends org.apache.commons.lang.time.DateUtils {
         public static final String DATETIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
         public static final String DATETIME_MS_PATTERN = "yyyy-MM-dd HH:mm:ss.SSS";
     
    -    public static final Date DEFAULT_DATE = DateUtils.parseByDayPattern("1970-01-01");
    +    public static final Date DEFAULT_DATE = AbstractDateUtils.parseByDayPattern("1970-01-01");
     
         /**
          * Parse date by 'yyyy-MM-dd' pattern
    diff --git a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/DockerUtils.java b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/AbstractDockerUtils.java
    similarity index 96%
    rename from damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/DockerUtils.java
    rename to damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/AbstractDockerUtils.java
    index 73e1c3b5011211ed0f13d25f3ef6b9fccdc5fb83..59643bed24be13f3bbdc1e141fc2ce9fc8160c6f 100644
    --- a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/DockerUtils.java
    +++ b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/AbstractDockerUtils.java
    @@ -20,12 +20,12 @@ import org.slf4j.Logger;
     import org.slf4j.LoggerFactory;
     
     /**
    - * DockerUtils
    + * AbstractDockerUtils
      * 
      * @author yutianbao
      */
    -public abstract class DockerUtils {
    -    private static final Logger LOGGER = LoggerFactory.getLogger(DockerUtils.class);
    +public abstract class AbstractDockerUtils {
    +    private static final Logger LOGGER = LoggerFactory.getLogger(AbstractDockerUtils.class);
     
         /** Environment param keys */
         private static final String ENV_KEY_HOST = "JPAAS_HOST";
    diff --git a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/EnumUtils.java b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/AbstractEnumUtils.java
    similarity index 91%
    rename from damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/EnumUtils.java
    rename to damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/AbstractEnumUtils.java
    index 326153987fd24aec9187ac184a472b9023940c24..927064ec18478e113dc4ea3b7bf5feaa21d67db3 100644
    --- a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/EnumUtils.java
    +++ b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/AbstractEnumUtils.java
    @@ -18,11 +18,11 @@ package com.baidu.fsg.uid.utils;
     import org.springframework.util.Assert;
     
     /**
    - * EnumUtils provides the operations for {@link ValuedEnum} such as Parse, value of...
    + * AbstractEnumUtils provides the operations for {@link ValuedEnum} such as Parse, value of...
      * 
      * @author yutianbao
      */
    -public abstract class EnumUtils {
    +public abstract class AbstractEnumUtils {
     
         /**
          * Parse the bounded value into ValuedEnum
    diff --git a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/NetUtils.java b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/AbstractNetUtils.java
    similarity index 97%
    rename from damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/NetUtils.java
    rename to damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/AbstractNetUtils.java
    index 4f0f17f4afd2c11cd34655d41bca45231e53ce11..bcad0fe6ef8bbf590a652d3cdc5b620eb623d686 100644
    --- a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/NetUtils.java
    +++ b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/AbstractNetUtils.java
    @@ -21,11 +21,11 @@ import java.net.SocketException;
     import java.util.Enumeration;
     
     /**
    - * NetUtils
    + * AbstractNetUtils
      * 
      * @author yutianbao
      */
    -public abstract class NetUtils {
    +public abstract class AbstractNetUtils {
     
         /**
          * Pre-loaded local address
    diff --git a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/ValuedEnum.java b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/ValuedEnum.java
    index 22a496467286589051ab0c963861ef2489efbae0..d604912955dac5f248dabdab592b43cccddb3881 100644
    --- a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/ValuedEnum.java
    +++ b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/utils/ValuedEnum.java
    @@ -18,10 +18,14 @@ package com.baidu.fsg.uid.utils;
     /**
      * {@code ValuedEnum} defines an enumeration which is bounded to a value, you
      * may implements this interface when you defines such kind of enumeration, that
    - * you can use {@link EnumUtils} to simplify parse and valueOf operation.
    + * you can use {@link AbstractEnumUtils} to simplify parse and valueOf operation.
      *  
      * @author yutianbao
      */
     public interface ValuedEnum {
    +    /**
    +     * 执行
    +     * @return 结果
    +     * */
         T value();
     }
    diff --git a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/worker/WorkerNodeType.java b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/worker/WorkerNodeType.java
    index b69b2401202380c96619747f7b669e2b0fcde70c..213a9537e1e572f53f47a7394eb001b160f6f4c3 100644
    --- a/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/worker/WorkerNodeType.java
    +++ b/damai-id-generator-framework/src/main/java/com/baidu/fsg/uid/worker/WorkerNodeType.java
    @@ -25,7 +25,9 @@ import com.baidu.fsg.uid.utils.ValuedEnum;
      * @author yutianbao
      */
     public enum WorkerNodeType implements ValuedEnum {
    -
    +    /**
    +     * 百度uid
    +     * */
         CONTAINER(1), ACTUAL(2);
     
         /**
    diff --git a/damai-id-generator-framework/src/main/java/com/damai/toolkit/SnowflakeIdGenerator.java b/damai-id-generator-framework/src/main/java/com/damai/toolkit/SnowflakeIdGenerator.java
    index 526e36d9dea6ca54f89f2e397c5fc681b881560d..131eea2323be67ce57be20cdf2493477bd287075 100644
    --- a/damai-id-generator-framework/src/main/java/com/damai/toolkit/SnowflakeIdGenerator.java
    +++ b/damai-id-generator-framework/src/main/java/com/damai/toolkit/SnowflakeIdGenerator.java
    @@ -19,46 +19,28 @@ import java.util.concurrent.ThreadLocalRandom;
     @Slf4j
     public class SnowflakeIdGenerator {
         
    -    /**
    -     * 时间起始标记点,作为基准,一般取系统的最近时间(一旦确定不能变动)
    -     */
    -    private static final long twepoch = 1288834974657L;
    -    /**
    -     * 机器标识位数
    -     */
    +    private static final long BASIS_TIME = 1288834974657L;
         private final long workerIdBits = 5L;
         private final long datacenterIdBits = 5L;
         private final long maxWorkerId = -1L ^ (-1L << workerIdBits);
         private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
    -    /**
    -     * 毫秒内自增位
    -     */
    +    
         private final long sequenceBits = 12L;
         private final long workerIdShift = sequenceBits;
         private final long datacenterIdShift = sequenceBits + workerIdBits;
    -    /**
    -     * 时间戳左移动位
    -     */
    +    
         private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
         private final long sequenceMask = -1L ^ (-1L << sequenceBits);
         
         private final long workerId;
         
    -    /**
    -     * 数据标识 ID 部分
    -     */
    +    
         private final long datacenterId;
    -    /**
    -     * 并发控制
    -     */
    +   
         private long sequence = 0L;
    -    /**
    -     * 上次生产 ID 时间戳
    -     */
    +   
         private long lastTimestamp = -1L;
    -    /**
    -     * IP 地址
    -     */
    +    
         private InetAddress inetAddress;
         
         public SnowflakeIdGenerator(WorkDataCenterId workDataCenterId) {
    @@ -83,13 +65,7 @@ public class SnowflakeIdGenerator {
                 log.debug("Initialization SnowflakeIdGenerator datacenterId:" + this.datacenterId + " workerId:" + this.workerId);
             }
         }
    -
    -    /**
    -     * 有参构造器
    -     *
    -     * @param workerId     工作机器 ID
    -     * @param datacenterId 序列号
    -     */
    +    
         public SnowflakeIdGenerator(long workerId, long datacenterId) {
             Assert.isFalse(workerId > maxWorkerId || workerId < 0,
                 String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));
    @@ -99,29 +75,17 @@ public class SnowflakeIdGenerator {
             this.datacenterId = datacenterId;
             initLog();
         }
    -
    -    /**
    -     * 获取 maxWorkerId
    -     */
    +    
         protected long getMaxWorkerId(long datacenterId, long maxWorkerId) {
             StringBuilder mpid = new StringBuilder();
             mpid.append(datacenterId);
             String name = ManagementFactory.getRuntimeMXBean().getName();
             if (StringUtils.isNotBlank(name)) {
    -            /*
    -             * GET jvmPid
    -             */
                 mpid.append(name.split("@")[0]);
             }
    -        /*
    -         * MAC + PID 的 hashcode 获取16个低位
    -         */
             return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1);
         }
    -
    -    /**
    -     * 数据标识id部分
    -     */
    +    
         protected long getDatacenterId(long maxDatacenterId) {
             long id = 0L;
             try {
    @@ -145,11 +109,12 @@ public class SnowflakeIdGenerator {
         }
         
         public long getBase(){
    +        int five = 5;
             long timestamp = timeGen();
             //闰秒
             if (timestamp < lastTimestamp) {
                 long offset = lastTimestamp - timestamp;
    -            if (offset <= 5) {
    +            if (offset <= five) {
                     try {
                         wait(offset << 1);
                         timestamp = timeGen();
    @@ -180,35 +145,23 @@ public class SnowflakeIdGenerator {
             
             return timestamp;
         }
    -
    -    /**
    -     * 获取分布式id
    -     *
    -     * @return id
    -     */
    +    
         public synchronized long nextId() {
             long timestamp = getBase();
    -
    -        // 时间戳部分 | 数据中心部分 | 机器标识部分 | 序列号部分
    -        return ((timestamp - twepoch) << timestampLeftShift)
    +        
    +        return ((timestamp - BASIS_TIME) << timestampLeftShift)
                 | (datacenterId << datacenterIdShift)
                 | (workerId << workerIdShift)
                 | sequence;
         }
         
    -    /**
    -     * 获取订单编号
    -     *
    -     * @return orderNumber
    -     */
         public synchronized long getOrderNumber(long userId,long tableCount) {
             long timestamp = getBase();
             long sequenceShift = log2N(tableCount);
    -        // 时间戳部分 | 数据中心部分 | 机器标识部分 | 序列号部分 | 用户id基因
    -        return ((timestamp - twepoch) << timestampLeftShift)
    +        return ((timestamp - BASIS_TIME) << timestampLeftShift)
                     | (datacenterId << datacenterIdShift)
                     | (workerId << workerIdShift)
    -                | (sequence << (sequenceBits - sequenceShift))
    +                | (sequence << sequenceShift)
                     | (userId % tableCount);
         }
     
    @@ -223,19 +176,13 @@ public class SnowflakeIdGenerator {
         protected long timeGen() {
             return SystemClock.now();
         }
    -
    -    /**
    -     * 反解id的时间戳部分
    -     */
    +    
         public static long parseIdTimestamp(long id) {
    -        return (id>>22)+twepoch;
    +        return (id>>22)+ BASIS_TIME;
         }
         
    -    /*
    -    * 求log2(N)
    -    * */
    -    public long log2N(long N) {
    -        return (long)(Math.log(N)/ Math.log(2));
    +    public long log2N(long count) {
    +        return (long)(Math.log(count)/ Math.log(2));
         }
         
         public long getMaxWorkerId() {
    diff --git a/damai-id-generator-framework/src/main/java/com/damai/toolkit/WorkAndDataCenterIdHandler.java b/damai-id-generator-framework/src/main/java/com/damai/toolkit/WorkAndDataCenterIdHandler.java
    index f160aecfa0669fb8fb8686dc99a55cb26fef9500..79dd17b027d803bdbcd4b7208302687877129c1e 100644
    --- a/damai-id-generator-framework/src/main/java/com/damai/toolkit/WorkAndDataCenterIdHandler.java
    +++ b/damai-id-generator-framework/src/main/java/com/damai/toolkit/WorkAndDataCenterIdHandler.java
    @@ -7,9 +7,8 @@ import org.springframework.data.redis.core.StringRedisTemplate;
     import org.springframework.data.redis.core.script.DefaultRedisScript;
     import org.springframework.scripting.support.ResourceScriptSource;
     
    +import java.util.Arrays;
     import java.util.List;
    -import java.util.stream.Collectors;
    -import java.util.stream.Stream;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    @@ -24,9 +23,9 @@ public class WorkAndDataCenterIdHandler {
         private final String SNOWFLAKE_DATA_CENTER_ID_key = "snowflake_data_center_id";
         
         
    -    public final List keys = Stream.of(SNOWFLAKE_WORK_ID_KEY,SNOWFLAKE_DATA_CENTER_ID_key).collect(Collectors.toList());
    +    public final List keys = Arrays.asList(SNOWFLAKE_WORK_ID_KEY,SNOWFLAKE_DATA_CENTER_ID_key);
         
    -    private StringRedisTemplate stringRedisTemplate;
    +    private final StringRedisTemplate stringRedisTemplate;
         
         private DefaultRedisScript redisScript;
         
    @@ -44,7 +43,7 @@ public class WorkAndDataCenterIdHandler {
         public WorkDataCenterId getWorkAndDataCenterId(){
             WorkDataCenterId workDataCenterId = new WorkDataCenterId();
             try {
    -            String[] data = new String[2];
    +            Object[] data = new String[2];
                 data[0] = String.valueOf(IdGeneratorConstant.MAX_WORKER_ID);
                 data[1] = String.valueOf(IdGeneratorConstant.MAX_DATA_CENTER_ID);
                 String result = stringRedisTemplate.execute(redisScript, keys, data);
    diff --git a/damai-id-generator-framework/src/main/resources/lua/workAndDataCenterId.lua b/damai-id-generator-framework/src/main/resources/lua/workAndDataCenterId.lua
    index 10c5e44519243568570919adb9c1b6157a041ffa..20f682f8efd1763e98a013ce346b426886b2982c 100644
    --- a/damai-id-generator-framework/src/main/resources/lua/workAndDataCenterId.lua
    +++ b/damai-id-generator-framework/src/main/resources/lua/workAndDataCenterId.lua
    @@ -1,57 +1,37 @@
    --- redis中work_id的key
     local snowflake_work_id_key = KEYS[1]
    --- redis中data_center_id的key
     local snowflake_data_center_id_key = KEYS[2]
    --- worker_id的最大阈值
     local max_worker_id = tonumber(ARGV[1])
    --- data_center_id的最大阈值
     local max_data_center_id = tonumber(ARGV[2])
    --- 返回的work_id
     local return_worker_id = 0
    --- 返回的data_center_id
     local return_data_center_id = 0
    --- work_id初始化flag
     local snowflake_work_id_flag = false
    --- data_center_id初始化flag
     local snowflake_data_center_id_flag = false
    --- 构建并返回JSON字符串
     local json_result = string.format('{"%s": %d, "%s": %d}',
             'workId', return_worker_id,
             'dataCenterId', return_data_center_id)
     
    --- 如果work_id不存在,则将值初始化为0
     if (redis.call('exists', snowflake_work_id_key) == 0) then
         redis.call('set',snowflake_work_id_key,0)
         snowflake_work_id_flag = true
     end
    --- 如果data_center_id不存在,则将值初始化为0
     if (redis.call('exists', snowflake_data_center_id_key) == 0) then
         redis.call('set',snowflake_data_center_id_key,0)
         snowflake_data_center_id_flag = true
     end
    --- 如果work_id和data_center_id都是初始化了,那么执行返回初始化的值
     if (snowflake_work_id_flag and snowflake_data_center_id_flag) then
         return json_result
     end
    --- 获得work_id的值
     local snowflake_work_id = tonumber(redis.call('get',snowflake_work_id_key))
    --- 获得data_center_id的值
     local snowflake_data_center_id = tonumber(redis.call('get',snowflake_data_center_id_key))
     
    --- 如果work_id的值达到了最大阈值
     if (snowflake_work_id == max_worker_id) then
    -    -- 如果data_center_id的值也达到了最大阈值
         if (snowflake_data_center_id == max_data_center_id) then
    -        -- 将work_id的值初始化为0
             redis.call('set',snowflake_work_id_key,0)
    -        -- 将data_center_id的值初始化为0
             redis.call('set',snowflake_data_center_id_key,0)
         else
    -        -- 如果data_center_id的值没有达到最大值,将进行自增,并将自增的结果返回
             return_data_center_id = redis.call('incr',snowflake_data_center_id_key)
         end
     else
    -    -- 如果work_id的值没有达到最大值,将进行自增,并将自增的结果返回
         return_worker_id = redis.call('incr',snowflake_work_id_key)
     end
     return string.format('{"%s": %d, "%s": %d}',
    diff --git a/damai-redis-framework/src/main/java/com/damai/core/RedisKeyEnum.java b/damai-redis-framework/src/main/java/com/damai/core/RedisKeyManage.java
    similarity index 72%
    rename from damai-redis-framework/src/main/java/com/damai/core/RedisKeyEnum.java
    rename to damai-redis-framework/src/main/java/com/damai/core/RedisKeyManage.java
    index 0610a950af55d233e58aece2592d257ad07897da..37f54869ae9ae14efc0fa26e3faf85ade8a37117 100644
    --- a/damai-redis-framework/src/main/java/com/damai/core/RedisKeyEnum.java
    +++ b/damai-redis-framework/src/main/java/com/damai/core/RedisKeyManage.java
    @@ -6,12 +6,15 @@ package com.damai.core;
      * @description: redis key管理
      * @author: 阿宽不是程序员
      **/
    -public enum RedisKeyEnum {
    +public enum RedisKeyManage {
    +    /**
    +     * redis 缓存 key管理
    +     * */
     
         Key("key","键值测试","value为TestCacheDto类型","k"),
         Key2("key:%s","键值占位测试","value为TestCacheDto类型","k"),
         
    -    USER_ID("user_id:%s","userId","value为UserVo类型","k"),
    +    USER_LOGIN("user_login_%s_%s","user_login","value为UserVo类型","k"),
         
         PRODUCT_STOCK("product_stock:%S","商品库存id","value为库存","k"),
         
    @@ -65,66 +68,73 @@ public enum RedisKeyEnum {
         
         PROGRAM_CATEGORY_HASH("d_mai_program_category_hash","节目类型hash集合","节目类型hash集合","k"),
         
    +    COUNTER_COUNT("d_mai_counter_count","计数器的值的key","计数器的值","k"),
    +    
    +    COUNTER_TIMESTAMP("d_mai_counter_timestamp","计数器的时间戳的key","计数器的时间戳","k"),
    +    
    +    VERIFY_CAPTCHA_ID("d_mai_verify_captcha_id_%S","校验验证码id的key","校验验证码id","k"),
    +    
    +    TICKET_USER_LIST("d_mai_ticket_user_list_%S","购票人列表的key","购票人列表","k"),
         ;
     
         /**
          * key值
          * */
    -    private String keyCode;
    +    private String key;
     
         /**
          * key的说明
          * */
    -    private String keyMsg;
    +    private String keyIntroduce;
     
         /**
          * value的说明
          * */
    -    private String valueMsg;
    +    private String valueIntroduce;
     
         /**
          * 作者
          * */
         private String author;
     
    -    RedisKeyEnum(String keyCode, String keyMsg, String valueMsg, String author){
    -        this.keyCode = keyCode;
    -        this.keyMsg = keyMsg;
    -        this.valueMsg = valueMsg;
    +    RedisKeyManage(String key, String keyIntroduce, String valueIntroduce, String author){
    +        this.key = key;
    +        this.keyIntroduce = keyIntroduce;
    +        this.valueIntroduce = valueIntroduce;
             this.author = author;
         }
     
    -    public static RedisKeyEnum getRc(String keyCode) {
    -        for (RedisKeyEnum re : RedisKeyEnum.values()) {
    -            if (re.keyCode.equals(keyCode)) {
    +    public static RedisKeyManage getRc(String keyCode) {
    +        for (RedisKeyManage re : RedisKeyManage.values()) {
    +            if (re.key.equals(keyCode)) {
                     return re;
                 }
             }
             return null;
         }
     
    -    public String getKeyCode() {
    -        return keyCode;
    +    public String getKey() {
    +        return key;
         }
     
    -    public void setKeyCode(String keyCode) {
    -        this.keyCode = keyCode;
    +    public void setKey(String key) {
    +        this.key = key;
         }
     
    -    public String getKeyMsg() {
    -        return keyMsg;
    +    public String getKeyIntroduce() {
    +        return keyIntroduce;
         }
     
    -    public void setKeyMsg(String keyMsg) {
    -        this.keyMsg = keyMsg;
    +    public void setKeyIntroduce(String keyIntroduce) {
    +        this.keyIntroduce = keyIntroduce;
         }
     
    -    public String getValueMsg() {
    -        return valueMsg;
    +    public String getValueIntroduce() {
    +        return valueIntroduce;
         }
     
    -    public void setValueMsg(String valueMsg) {
    -        this.valueMsg = valueMsg;
    +    public void setValueIntroduce(String valueIntroduce) {
    +        this.valueIntroduce = valueIntroduce;
         }
     
         public String getAuthor() {
    diff --git a/damai-redis-framework/src/main/java/com/damai/redis/CacheUtil.java b/damai-redis-framework/src/main/java/com/damai/redis/CacheUtil.java
    index e6d517c345dc042941bda6df9aadf21f65208cf1..cf938b886da67369d2f6cadba116fcc5bc85c858 100644
    --- a/damai-redis-framework/src/main/java/com/damai/redis/CacheUtil.java
    +++ b/damai-redis-framework/src/main/java/com/damai/redis/CacheUtil.java
    @@ -1,7 +1,7 @@
     package com.damai.redis;
     
     import com.alibaba.fastjson.util.ParameterizedTypeImpl;
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import java.lang.reflect.Type;
     import java.util.Collection;
     import java.util.List;
    @@ -53,12 +53,12 @@ public class CacheUtil {
         }
     
         /**
    -     * 检查 redisKeyWrap 中的key是否为空或空的字符串
    +     * 检查 redisKeyBuild 中的key是否为空或空的字符串
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild key包装
          */
    -    public static void checkNotBlank(RedisKeyWrap RedisKeyWrap) {
    -        if (StringUtil.isEmpty(RedisKeyWrap.getRelKey())) {
    +    public static void checkNotBlank(RedisKeyBuild redisKeyBuild) {
    +        if (StringUtil.isEmpty(redisKeyBuild.getRelKey())) {
                 throw new RuntimeException("请求参数缺失");
             }
         }
    @@ -79,9 +79,9 @@ public class CacheUtil {
         /**
          * 检查 list 是否为空或空的字符串
          *
    -     * @param list
    +     * @param list key集合
          */
    -    public static void checkNotEmpty(Collection list) {
    +    public static void checkNotEmpty(Collection list) {
             for (Object o : list) {
                 if (o == null) {
                     throw new RuntimeException("请求参数缺失");
    @@ -103,7 +103,6 @@ public class CacheUtil {
         /**
          * 判断 object 是否为空
          *
    -     * @param object
          */
         public static boolean isEmpty(Object object) {
             if (object == null) {
    @@ -113,13 +112,13 @@ public class CacheUtil {
                 return StringUtil.isEmpty((String) object);
             }
             if (object instanceof Collection) {
    -            return ((Collection)object).size() == 0;
    +            return ((Collection) object).isEmpty();
             }
             return false;
         }
     
    -    public static List getBatchKey(Collection list){
    -        return list.stream().map(RedisKeyWrap::getRelKey).collect(Collectors.toList());
    +    public static List getBatchKey(Collection list){
    +        return list.stream().map(RedisKeyBuild::getRelKey).collect(Collectors.toList());
         }
     
     }
    diff --git a/damai-redis-framework/src/main/java/com/damai/redis/RedisCache.java b/damai-redis-framework/src/main/java/com/damai/redis/RedisCache.java
    index 2f502f535b2bd5c60cf8d718c6d5b66f63f01153..f1477ed3090cc3e485b85102abc49ac76448668b 100644
    --- a/damai-redis-framework/src/main/java/com/damai/redis/RedisCache.java
    +++ b/damai-redis-framework/src/main/java/com/damai/redis/RedisCache.java
    @@ -24,17 +24,17 @@ public interface RedisCache {
         /**
          * 获取字符串对象
          *
    -     * @param RedisKeyWrap   RedisKeyWrap
    +     * @param redisKeyBuild   RedisKeyBuild
          * @param clazz 类对象
          * @param    T
          * @return T 普通对象
          */
    -     T get(RedisKeyWrap RedisKeyWrap, Class clazz);
    +     T get(RedisKeyBuild redisKeyBuild, Class clazz);
         
         /**
          * 获取字符串对象(如果缓存中不存在,则执行给定的supplier接口)
          *
    -     * @param RedisKeyWrap   RedisKeyWrap
    +     * @param redisKeyBuild   RedisKeyBuild
          * @param clazz 类对象
          * @param    T
          * @param supplier 缓存为空时,执行的逻辑
    @@ -42,39 +42,39 @@ public interface RedisCache {
          * @param timeUnit 时间单位
          * @return T 普通对象
          */
    -     T get(RedisKeyWrap RedisKeyWrap, Class clazz, Supplier supplier, long ttl, TimeUnit timeUnit);
    +     T get(RedisKeyBuild redisKeyBuild, Class clazz, Supplier supplier, long ttl, TimeUnit timeUnit);
     
         /**
          * 返回 key 中字符串值的子字符
    -     * @param RedisKeyWrap
    -     * @param start
    -     * @param end
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @param start 开始
    +     * @param end 结束
    +     * @return 结果
          */
    -    String getRange(RedisKeyWrap RedisKeyWrap, long start, long end);
    +    String getRange(RedisKeyBuild redisKeyBuild, long start, long end);
     
         /**
          * 获取字符串对象, 并且字符串中是集合内容
          *
    -     * @param RedisKeyWrap
    -     * @param clazz
    -     * @param 
    +     * @param redisKeyBuild 缓存key
    +     * @param clazz 类型
    +     * @param  指定泛型
          * @return List
          */
    -     List getValueIsList(RedisKeyWrap RedisKeyWrap, Class clazz);
    +     List getValueIsList(RedisKeyBuild redisKeyBuild, Class clazz);
         
         /**
          * 获取字符串对象, 并且字符串中是集合内容(如果缓存中不存在,则执行给定的supplier接口)
          *
    -     * @param RedisKeyWrap
    -     * @param clazz
    -     * @param 
    +     * @param redisKeyBuild 缓存key
    +     * @param clazz 类型
    +     * @param  指定泛型
          * @param supplier 缓存为空时,执行的逻辑
          * @param ttl      过期时间
          * @param timeUnit 时间单位
          * @return List
          */
    -     List getValueIsList(RedisKeyWrap RedisKeyWrap, Class clazz, Supplier> supplier,long ttl, TimeUnit timeUnit);
    +     List getValueIsList(RedisKeyBuild redisKeyBuild, Class clazz, Supplier> supplier, long ttl, TimeUnit timeUnit);
     
     
         /**
    @@ -83,75 +83,74 @@ public interface RedisCache {
          * @param keyList key集合
          * @return List
          */
    -    List getKeys(List keyList);
    +    List getKeys(List keyList);
     
         /**
          * 判断key是否存在
          *
    -     * @param RedisKeyWrap RedisKeyWrap
    +     * @param redisKeyBuild redisKeyBuild
          * @return 是否存在 可能为空
          */
    -    Boolean hasKey(RedisKeyWrap RedisKeyWrap);
    +    Boolean hasKey(RedisKeyBuild redisKeyBuild);
     
         /**
          * 删除key
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild 缓存key
          * @return
          */
    -    void del(RedisKeyWrap RedisKeyWrap);
    +    void del(RedisKeyBuild redisKeyBuild);
     
     
         /**
          * 批量删除key
          *
    -     * @param keys
    -     * @return
    +     * @param keys key集合
          */
    -    void del(Collection keys);
    +    void del(Collection keys);
     
         /**
          * 设置key过期时间
          *
    -     * @param RedisKeyWrap      RedisKeyWrap
    +     * @param redisKeyBuild      RedisKeyBuild
          * @param ttl      过期时间
          * @param timeUnit 时间单位
          * @return 是否成功
          */
    -    Boolean expire(RedisKeyWrap RedisKeyWrap, long ttl, TimeUnit timeUnit);
    +    Boolean expire(RedisKeyBuild redisKeyBuild, long ttl, TimeUnit timeUnit);
     
         /**
          * 获取key超时时间
          *
    -     * @param RedisKeyWrap RedisKeyWrap
    +     * @param redisKeyBuild redisKeyBuild
          * @return 超时时间
          */
    -    Long getExpire(RedisKeyWrap RedisKeyWrap);
    +    Long getExpire(RedisKeyBuild redisKeyBuild);
     
         /**
          * 查找匹配的key
          *
    -     * @param pattern
    -     * @return
    +     * @param pattern 缓存key
    +     * @return keys
          */
         Set keys(String pattern);
     
         /**
          * 将当前数据库的 key 移动到给定的数据库 db 当中
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild 缓存key
          * @param dbIndex
          * @return
          */
    -    Boolean move(RedisKeyWrap RedisKeyWrap, int dbIndex);
    +    Boolean move(RedisKeyBuild redisKeyBuild, int dbIndex);
     
         /**
          * 移除 key 的过期时间,key 将持久保持
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild 缓存key
          * @return
          */
    -    Boolean persist(RedisKeyWrap RedisKeyWrap);
    +    Boolean persist(RedisKeyBuild redisKeyBuild);
     
         /**
          * 从当前数据库中随机返回一个 key
    @@ -163,439 +162,439 @@ public interface RedisCache {
         /**
          * 修改 key 的名称
          *
    -     * @param oldKey
    -     * @param newKey
    +     * @param oldKey 缓存key
    +     * @param newKey 缓存key
          */
    -    void rename(RedisKeyWrap oldKey, RedisKeyWrap newKey);
    +    void rename(RedisKeyBuild oldKey, RedisKeyBuild newKey);
     
         /**
    -     * 仅当 newkey 不存在时,将 oldKey 改名为 newkey
    +     * 仅当 newKey 不存在时,将 oldKey 改名为 newKey
          *
    -     * @param oldKey
    -     * @param newKey
    +     * @param oldKey 缓存key
    +     * @param newKey 缓存key
          * @return
          */
    -    Boolean renameIfAbsent(RedisKeyWrap oldKey, RedisKeyWrap newKey);
    +    Boolean renameIfAbsent(RedisKeyBuild oldKey, RedisKeyBuild newKey);
     
         /**
          * 返回 key 所储存的值的类型
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild 缓存key
          * @return
          */
    -    DataType type(RedisKeyWrap RedisKeyWrap);
    +    DataType type(RedisKeyBuild redisKeyBuild);
     
         /**
          * 设置缓存
          *
    -     * @param RedisKeyWrap        缓存key
    +     * @param redisKeyBuild        缓存key
          * @param object     缓存对象
          */
    -    void set(RedisKeyWrap RedisKeyWrap, Object object);
    +    void set(RedisKeyBuild redisKeyBuild, Object object);
     
         /**
          * 设置缓存
          *
    -     * @param RedisKeyWrap        缓存key
    +     * @param redisKeyBuild        缓存key
          * @param object     缓存对象
          * @param ttl 过期时间
          */
    -    void set(RedisKeyWrap RedisKeyWrap, Object object, long ttl);
    +    void set(RedisKeyBuild redisKeyBuild, Object object, long ttl);
     
         /**
          * 设置缓存
          *
    -     * @param RedisKeyWrap      缓存key
    +     * @param redisKeyBuild      缓存key
          * @param object   缓存对象
          * @param ttl      过期时间
          * @param timeUnit 时间单位
          */
    -    void set(RedisKeyWrap RedisKeyWrap, Object object, long ttl, TimeUnit timeUnit);
    +    void set(RedisKeyBuild redisKeyBuild, Object object, long ttl, TimeUnit timeUnit);
     
         /**
          * 只有在 key 不存在时设置 key 的值
          *
    -     * @param RedisKeyWrap
    -     * @param object
    +     * @param redisKeyBuild  缓存key
    +     * @param object 对象
          * @return 之前已经存在返回false,不存在返回true
          */
    -    boolean setIfAbsent(RedisKeyWrap RedisKeyWrap, Object object);
    +    boolean setIfAbsent(RedisKeyBuild redisKeyBuild, Object object);
     
         /**
          * 获取字符串的长度
          *
    -     * @param RedisKeyWrap
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @return 长度
          */
    -    Long size(RedisKeyWrap RedisKeyWrap);
    +    Long size(RedisKeyBuild redisKeyBuild);
     
         /**
          * 批量添加
          *
    -     * @param map
    +     * @param map 对象
          */
    -    void multiSet(Map map);
    +    void multiSet(Map map);
     
         /**
          * 同时设置一个或多个 key-value 对,当且仅当所有给定 key 都不存在
          *
    -     * @param map
    +     * @param map 对象
          * @return 之前已经存在返回false,不存在返回true
          */
    -    boolean multiSetIfAbsent(Map map);
    +    boolean multiSetIfAbsent(Map map);
     
         /**
          * 增加(自增长), 负数则为自减
          *
    -     * @param RedisKeyWrap
    -     * @param increment
    +     * @param redisKeyBuild 缓存key
    +     * @param increment 步长
          * @return
          */
    -    Long incrBy(RedisKeyWrap RedisKeyWrap, long increment);
    +    Long incrBy(RedisKeyBuild redisKeyBuild, long increment);
     
         /**
          * double类型增加(自增长), 负数则为自减
    -     * @param RedisKeyWrap
    -     * @param increment
    +     * @param redisKeyBuild 缓存key
    +     * @param increment 步长
          * @return
          */
    -    Double incrByDouble(RedisKeyWrap RedisKeyWrap, double increment);
    +    Double incrByDouble(RedisKeyBuild redisKeyBuild, double increment);
     
         /**
          * 追加到末尾
          *
    -     * @param RedisKeyWrap
    -     * @param value
    +     * @param redisKeyBuild 缓存key
    +     * @param value 值
          * @return
          */
    -    Integer append(RedisKeyWrap RedisKeyWrap, String value);
    +    Integer append(RedisKeyBuild redisKeyBuild, String value);
     
         /** -------------------hash相关操作------------------------- */
     
         /**
          * 放置一个键值对
          *
    -     * @param RedisKeyWrap     hash键
    +     * @param redisKeyBuild     hash键
          * @param hashKey hash key
          * @param value   hash value
          */
    -    void putHash(RedisKeyWrap RedisKeyWrap, String hashKey, Object value);
    +    void putHash(RedisKeyBuild redisKeyBuild, String hashKey, Object value);
     
         /**
          * 放置一个键值对 并设置过期时间
          *
    -     * @param RedisKeyWrap           hash键
    +     * @param redisKeyBuild           hash键
          * @param hashKey       hash key
          * @param value         hash value
          * @param ttl    过期时间
          */
    -    void putHash(RedisKeyWrap RedisKeyWrap, String hashKey, Object value, long ttl);
    +    void putHash(RedisKeyBuild redisKeyBuild, String hashKey, Object value, long ttl);
     
         /**
          * 放置一个键值对 并设置过期时间
          *
    -     * @param RedisKeyWrap       hash键
    +     * @param redisKeyBuild       hash键
          * @param hashKey   hash key
          * @param value     hash value
          * @param ttl       过期时间
          * @param timeUnit  时间单位
          */
    -    void putHash(RedisKeyWrap RedisKeyWrap, String hashKey, Object value, long ttl, TimeUnit timeUnit);
    +    void putHash(RedisKeyBuild redisKeyBuild, String hashKey, Object value, long ttl, TimeUnit timeUnit);
     
         /**
          * 放入map中所有键值对
          *
    -     * @param RedisKeyWrap key
    +     * @param redisKeyBuild key
          * @param map hash
          */
    -    void putHash(RedisKeyWrap RedisKeyWrap, Map map);
    +    void putHash(RedisKeyBuild redisKeyBuild, Map map);
     
         /**
          * 放入map中所有键值对 并设置过期时间
          *
    -     * @param RedisKeyWrap key
    +     * @param redisKeyBuild key
          * @param map hash
          * @param ttl 过期时间
          */
    -    void putHash(RedisKeyWrap RedisKeyWrap, Map map, long ttl);
    +    void putHash(RedisKeyBuild redisKeyBuild, Map map, long ttl);
     
         /**
          * 放入 Map 中所有键值对 并设置过期时间和时间单位
          *
    -     * @param RedisKeyWrap key
    +     * @param redisKeyBuild key
          * @param map hash
          * @param ttl 过期时间
          * @param timeUnit 时间单位
          */
    -    void putHash(RedisKeyWrap RedisKeyWrap, Map map, long ttl, TimeUnit timeUnit);
    +    void putHash(RedisKeyBuild redisKeyBuild, Map map, long ttl, TimeUnit timeUnit);
     
         /**
          * 仅当hashKey不存在时才设置
          *
    -     * @param RedisKeyWrap
    -     * @param hashKey
    -     * @param value
    +     * @param redisKeyBuild 缓存key
    +     * @param hashKey hash中key
    +     * @param value 对象
          * @return
          */
    -    Boolean putHashIfAbsent(RedisKeyWrap RedisKeyWrap, String hashKey, Object value);
    +    Boolean putHashIfAbsent(RedisKeyBuild redisKeyBuild, String hashKey, Object value);
     
         /**
          * 从 Hash 中获取普通对象
          *
    -     * @param RedisKeyWrap     key
    +     * @param redisKeyBuild     key
          * @param hashKey hash key
          * @param clazz   类对象
          * @param      T
          * @return 普通对象
          */
         @SuppressWarnings("all")
    -     T getForHash(RedisKeyWrap RedisKeyWrap, String hashKey, Class clazz);
    +     T getForHash(RedisKeyBuild redisKeyBuild, String hashKey, Class clazz);
     
         /**
          * Hash的value是字符串集合,进行提取
          *
    -     * @param RedisKeyWrap     key
    +     * @param redisKeyBuild     key
          * @param hashKey hash key
          * @param clazz   类对象
          * @param      T
          * @return 普通对象
          */
    -     List getValueIsListForHash(RedisKeyWrap RedisKeyWrap, String hashKey, Class clazz);
    +     List getValueIsListForHash(RedisKeyBuild redisKeyBuild, String hashKey, Class clazz);
     
         /**
          * 从 {@code key} 处获取给定 {@code hashKeys} 的值
          *
    -     * @param RedisKeyWrap      key
    +     * @param redisKeyBuild      key
          * @param hashKeys hashKeys
          * @param clazz    类对象
          * @param       T
          * @return
          */
    -     List multiGetForHash(RedisKeyWrap RedisKeyWrap, List hashKeys, Class clazz);
    +     List multiGetForHash(RedisKeyBuild redisKeyBuild, List hashKeys, Class clazz);
     
         /**
          * 谨慎使用!
          * 获取 Hash Key 下所有值
          *
    -     * @param RedisKeyWrap
    -     * @param clazz
    -     * @param 
    +     * @param redisKeyBuild 缓存key
    +     * @param clazz 类型
    +     * @param  泛型
          * @return
          */
    -     List getAllForHash(RedisKeyWrap RedisKeyWrap, Class clazz);
    +     List getAllForHash(RedisKeyBuild redisKeyBuild, Class clazz);
         
         /**
          * 谨慎使用!
          * 获取 Hash Key 下所有值,返回值为map
          *
    -     * @param RedisKeyWrap
    -     * @param clazz
    -     * @param 
    +     * @param redisKeyBuild 缓存key
    +     * @param clazz 类型
    +     * @param  泛型
          * @return
          */
    -     Map getAllMapForHash(RedisKeyWrap RedisKeyWrap, Class clazz);
    +     Map getAllMapForHash(RedisKeyBuild redisKeyBuild, Class clazz);
         /**
          * 判断hash中 key是否存在
          *
    -     * @param RedisKeyWrap
    -     * @param hashKey
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @param hashKey hash中key
    +     * @return 结果
          */
    -    Boolean hasKeyForHash(RedisKeyWrap RedisKeyWrap, String hashKey);
    +    Boolean hasKeyForHash(RedisKeyBuild redisKeyBuild, String hashKey);
     
         /**
          * 删除hash key
          *
    -     * @param RedisKeyWrap
    -     * @param hashKey
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @param hashKey hash中key
    +     * @return 结果
          */
    -    Long delForHash(RedisKeyWrap RedisKeyWrap, String hashKey);
    +    Long delForHash(RedisKeyBuild redisKeyBuild, String hashKey);
     
         /**
          * 批量删除hash key
          *
    -     * @param RedisKeyWrap
    -     * @param hashKeys
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @param hashKeys hash中key
    +     * @return 结果
          */
    -    Long delForHash(RedisKeyWrap RedisKeyWrap, Collection hashKeys);
    +    Long delForHash(RedisKeyBuild redisKeyBuild, Collection hashKeys);
     
         /**
          * 为哈希表 key 中的指定字段的整数值加上增量 increment
          *
    -     * @param RedisKeyWrap
    -     * @param hashKey
    -     * @param increment
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @param hashKey hash中key
    +     * @param increment 步长
    +     * @return 结果
          */
    -    Long incrByForHash(RedisKeyWrap RedisKeyWrap, String hashKey, long increment);
    +    Long incrByForHash(RedisKeyBuild redisKeyBuild, String hashKey, long increment);
     
         /**
          * 为哈希表 key 中的指定字段的整数值加上增量 increment(double类型)
          *
    -     * @param RedisKeyWrap
    -     * @param hashKey
    -     * @param delta
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @param hashKey hash中key
    +     * @param delta 步长
    +     * @return 结果
          */
    -    Double incrByDoubleForHash(RedisKeyWrap RedisKeyWrap, String hashKey, double delta);
    +    Double incrByDoubleForHash(RedisKeyBuild redisKeyBuild, String hashKey, double delta);
     
         /**
          * 获取所有哈希表中的hashKey
          *
    -     * @param RedisKeyWrap
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @return 结果
          */
    -    Set hashKeysForHash(RedisKeyWrap RedisKeyWrap);
    +    Set hashKeysForHash(RedisKeyBuild redisKeyBuild);
     
         /**
          * 获取哈希表中字段的数量
          *
    -     * @param RedisKeyWrap
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @return 结果
          */
    -    Long sizeForHash(RedisKeyWrap RedisKeyWrap);
    +    Long sizeForHash(RedisKeyBuild redisKeyBuild);
     
         /** ------------------------list相关操作---------------------------- */
     
         /**
          * 通过索引获取列表中的元素
          *
    -     * @param RedisKeyWrap
    -     * @param index
    -     * @param clazz
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @param index 索引
    +     * @param clazz 类型
    +     * @return 结果
          */
    -     T indexForList(RedisKeyWrap RedisKeyWrap, long index, Class clazz);
    +     T indexForList(RedisKeyBuild redisKeyBuild, long index, Class clazz);
     
         /**
          * List 从左边放入元素
          *
    -     * @param RedisKeyWrap   key
    +     * @param redisKeyBuild   key
          * @param value value
          * @return 改动行数
          */
    -    Long leftPushForList(RedisKeyWrap RedisKeyWrap, Object value);
    +    Long leftPushForList(RedisKeyBuild redisKeyBuild, Object value);
     
         /**
          * List 从左边放入元素
          *
    -     * @param RedisKeyWrap   key
    +     * @param redisKeyBuild   key
          * @param valueList valueList
          * @return 改动行数
          */
    -    Long leftPushAllForList(RedisKeyWrap RedisKeyWrap, List valueList);
    +    Long leftPushAllForList(RedisKeyBuild redisKeyBuild, List valueList);
     
         /**
          * List 从左边放入元素(当list存在的时候才加入)
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param value
          * @return
          */
    -    Long leftPushIfPresentForList(RedisKeyWrap RedisKeyWrap, Object value);
    +    Long leftPushIfPresentForList(RedisKeyBuild redisKeyBuild, Object value);
     
         /**
          * 如果pivot存在,在pivot左边添加
          *
    -     * @param RedisKeyWrap
    -     * @param pivot
    -     * @param value
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @param pivot pivot
    +     * @param value 对象
    +     * @return 结果
          */
    -    Long leftPushForList(RedisKeyWrap RedisKeyWrap, Object pivot, Object value);
    +    Long leftPushForList(RedisKeyBuild redisKeyBuild, Object pivot, Object value);
     
         /**
          * List 从右边放入元素
          *
    -     * @param RedisKeyWrap   key
    +     * @param redisKeyBuild   key
          * @param value value
          * @return 改动行数
          */
    -    Long rightPushForList(RedisKeyWrap RedisKeyWrap, Object value);
    +    Long rightPushForList(RedisKeyBuild redisKeyBuild, Object value);
     
         /**
          * List 从右边放入元素
          *
    -     * @param RedisKeyWrap   key
    +     * @param redisKeyBuild   key
          * @param valueList valueList
          * @return 改动行数
          */
    -    Long rightPushAllForList(RedisKeyWrap RedisKeyWrap, List valueList);
    +    Long rightPushAllForList(RedisKeyBuild redisKeyBuild, List valueList);
     
         /**
          * List 从右边放入元素(当list存在的时候才加入)
          *
    -     * @param RedisKeyWrap
    -     * @param value
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @param value 对象
    +     * @return 结果
          */
    -    Long rightPushIfPresentForList(RedisKeyWrap RedisKeyWrap, Object value);
    +    Long rightPushIfPresentForList(RedisKeyBuild redisKeyBuild, Object value);
     
         /**
          * 如果pivot存在,在pivot右边添加
          *
    -     * @param RedisKeyWrap
    -     * @param pivot
    -     * @param value
    -     * @return
    +     * @param redisKeyBuild 缓存key
    +     * @param pivot pivot
    +     * @param value 对象
    +     * @return 结果
          */
    -    Long rightPushForList(RedisKeyWrap RedisKeyWrap, Object pivot, Object value);
    +    Long rightPushForList(RedisKeyBuild redisKeyBuild, Object pivot, Object value);
     
         /**
          * 通过索引设置列表元素的值
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild 缓存key
          * @param index
          *            位置
    -     * @param value
    +     * @param value 对象
          */
    -    void setForList(RedisKeyWrap RedisKeyWrap, long index, Object value);
    +    void setForList(RedisKeyBuild redisKeyBuild, long index, Object value);
     
         /**
          * 移出并获取列表的第一个元素
          *
    -     * @param RedisKeyWrap
    -     * @param clazz
    +     * @param redisKeyBuild 缓存key
    +     * @param clazz 类型
          * @return 删除的元素
          */
    -     T leftPopForList(RedisKeyWrap RedisKeyWrap, Class clazz);
    +     T leftPopForList(RedisKeyBuild redisKeyBuild, Class clazz);
     
         /**
          * 移出并获取列表的第一个元素, 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止
          *
    -     * @param RedisKeyWrap
    -     * @param clazz
    +     * @param redisKeyBuild 缓存key
    +     * @param clazz 类型
          * @param timeout
          *            等待时间
          * @param unit
          *            时间单位
          * @return
          */
    -     T leftPopBlockForList(RedisKeyWrap RedisKeyWrap, Class clazz, long timeout, TimeUnit unit);
    +     T leftPopBlockForList(RedisKeyBuild redisKeyBuild, Class clazz, long timeout, TimeUnit unit);
     
         /**
          * 移除并获取列表最后一个元素
          *
    -     * @param RedisKeyWrap
    -     * @param clazz
    +     * @param redisKeyBuild 缓存key
    +     * @param clazz 类型
          * @return 删除的元素
          */
    -     T rightPopForList(RedisKeyWrap RedisKeyWrap, Class clazz);
    +     T rightPopForList(RedisKeyBuild redisKeyBuild, Class clazz);
     
         /**
          * 移出并获取列表的最后一个元素, 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止
          *
    -     * @param RedisKeyWrap
    -     * @param clazz
    +     * @param redisKeyBuild 缓存key
    +     * @param clazz 类型
          * @param timeout
          *            等待时间
          * @param unit
          *            时间单位
          * @return
          */
    -     T rightPopBlockForList(RedisKeyWrap RedisKeyWrap, Class clazz, long timeout, TimeUnit unit);
    +     T rightPopBlockForList(RedisKeyBuild redisKeyBuild, Class clazz, long timeout, TimeUnit unit);
     
         /**
          * 移除列表的最后一个元素,并将该元素添加到另一个列表并返回
    @@ -605,70 +604,71 @@ public interface RedisCache {
          * @param clazz
          * @return
          */
    -     T rightPopAndLeftPushForList(RedisKeyWrap sourceKey, RedisKeyWrap destinationKey, Class clazz);
    +     T rightPopAndLeftPushForList(RedisKeyBuild sourceKey, RedisKeyBuild destinationKey, Class clazz);
     
         /**
          * 从列表中弹出一个值,将弹出的元素插入到另外一个列表中并返回它; 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止
          *
    -     * @param sourceKey
    -     * @param destinationKey
    -     * @param timeout
    -     * @param unit
    -     * @return
    +     * @param sourceKey 缓存key
    +     * @param destinationKey 弹出key
    +     * @param clazz 类型
    +     * @param timeout 时间
    +     * @param unit 时间单位
    +     * @return 结果
          */
    -     T rightPopBlockAndLeftPushForList(RedisKeyWrap sourceKey, RedisKeyWrap destinationKey, Class clazz, long timeout, TimeUnit unit);
    +     T rightPopBlockAndLeftPushForList(RedisKeyBuild sourceKey, RedisKeyBuild destinationKey, Class clazz, long timeout, TimeUnit unit);
     
         /**
          * 获取 List 全部数据
          *
    -     * @param RedisKeyWrap
    -     * @param 
    +     * @param redisKeyBuild 缓存key
    +     * @param  泛型
          * @param clazz 类型
          * @return
          */
    -     List getAllForList(RedisKeyWrap RedisKeyWrap, Class clazz);
    +     List getAllForList(RedisKeyBuild redisKeyBuild, Class clazz);
     
         /**
          * 获取列表指定范围内的元素
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild 缓存key
          * @param start 开始位置, 0是开始位置
          * @param end 结束位置, -1返回所有
          * @param clazz 类型
    -     * @return
    +     * @return 结果
          */
    -     List rangeForList(RedisKeyWrap RedisKeyWrap, long start, long end, Class clazz);
    +     List rangeForList(RedisKeyBuild redisKeyBuild, long start, long end, Class clazz);
     
     
         /**
          * 删除集合中值等于value得元素
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild 缓存key
          * @param index
          *            index=0, 删除所有值等于value的元素; index>0, 从头部开始删除第一个值等于value的元素;
          *            index<0, 从尾部开始删除第一个值等于value的元素;
    -     * @param value
    -     * @return
    +     * @param value 对象
    +     * @return 结果
          */
    -    Long removeForList(RedisKeyWrap RedisKeyWrap, long index, Object value);
    +    Long removeForList(RedisKeyBuild redisKeyBuild, long index, Object value);
     
     
         /**
          * 裁剪list
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param start
          * @param end
          */
    -    void trimForList(RedisKeyWrap RedisKeyWrap, long start, long end);
    +    void trimForList(RedisKeyBuild redisKeyBuild, long start, long end);
     
         /**
          * 获取列表长度
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @return
          */
    -    Long lenForList(RedisKeyWrap RedisKeyWrap);
    +    Long lenForList(RedisKeyBuild redisKeyBuild);
     
     
         /** --------------------set相关操作-------------------------- */
    @@ -676,416 +676,416 @@ public interface RedisCache {
         /**
          * set添加元素
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param value
          * @return
          */
    -    Long addForSet(RedisKeyWrap RedisKeyWrap, Object value);
    +    Long addForSet(RedisKeyBuild redisKeyBuild, Object value);
     
         /**
          * set批量添加元素
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param values
          * @return
          */
    -    Long addForSet(RedisKeyWrap RedisKeyWrap, List values);
    +    Long addForSet(RedisKeyBuild redisKeyBuild, List values);
     
         /**
          * set移除元素
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param value
          * @return
          */
    -    Long removeForSet(RedisKeyWrap RedisKeyWrap, Object value);
    +    Long removeForSet(RedisKeyBuild redisKeyBuild, Object value);
     
         /**
          * set批量移除元素
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param values
          * @return
          */
    -    Long removeForSet(RedisKeyWrap RedisKeyWrap, List values);
    +    Long removeForSet(RedisKeyBuild redisKeyBuild, List values);
     
         /**
          * 移除并返回集合的一个随机元素
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param clazz
          * @return
          */
    -     T popForSet(RedisKeyWrap RedisKeyWrap, Class clazz);
    +     T popForSet(RedisKeyBuild redisKeyBuild, Class clazz);
     
         /**
          * 将元素value从一个集合移到另一个集合
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param value
    -     * @param destRedisKeyWrap
    +     * @param destRedisKeyBuild
          * @return
          */
    -    boolean moveForSet(RedisKeyWrap RedisKeyWrap, Object value, RedisKeyWrap destRedisKeyWrap);
    +    boolean moveForSet(RedisKeyBuild redisKeyBuild, Object value, RedisKeyBuild destRedisKeyBuild);
     
         /**
          * 获取集合的大小
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @return
          */
    -    Long sizeForSet(RedisKeyWrap RedisKeyWrap);
    +    Long sizeForSet(RedisKeyBuild redisKeyBuild);
     
         /**
          * 判断集合是否包含value
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param value
          * @return
          */
    -    Boolean isMemberForSet(RedisKeyWrap RedisKeyWrap, Object value);
    +    Boolean isMemberForSet(RedisKeyBuild redisKeyBuild, Object value);
     
         /**
          * 获取两个集合的交集
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuild
          * @param clazz
          * @return
          */
    -     Set intersectForSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, Class clazz);
    +     Set intersectForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, Class clazz);
     
         /**
          * 获取key集合与多个集合的交集
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWraps
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuilds
          * @param clazz
          * @return
          */
    -     Set intersectForSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, Class clazz);
    +     Set intersectForSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, Class clazz);
     
         /**
          * key集合与otherKey集合的交集存储到destKey集合中
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWrap
    -     * @param destRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuild
    +     * @param destRedisKeyBuild
          * @return
          */
    -    Long intersectAndStoreForSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, RedisKeyWrap destRedisKeyWrap);
    +    Long intersectAndStoreForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild);
     
         /**
          * key集合与多个集合的交集存储到destKey集合中
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWraps
    -     * @param destRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuilds
    +     * @param destRedisKeyBuild
          * @return
          */
    -    Long intersectAndStoreForSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, RedisKeyWrap destRedisKeyWrap);
    +    Long intersectAndStoreForSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild);
     
         /**
          * 获取两个集合的并集
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuild
          * @param clazz
          * @return
          */
    -     Set unionForSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, Class clazz);
    +     Set unionForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, Class clazz);
     
         /**
          * 获取key集合与多个集合的并集
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWraps
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuilds
          * @param clazz
          * @return
          */
    -     Set unionForSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, Class clazz);
    +     Set unionForSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, Class clazz);
     
         /**
          * key集合与otherKey集合的并集存储到destKey中
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWrap
    -     * @param destRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuild
    +     * @param destRedisKeyBuild
          * @return
          */
    -    Long unionAndStoreForSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, RedisKeyWrap destRedisKeyWrap);
    +    Long unionAndStoreForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild);
     
         /**
          * key集合与多个集合的并集存储到destKey中
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWraps
    -     * @param destRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuilds
    +     * @param destRedisKeyBuild
          * @return
          */
    -    Long unionAndStoreForSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, RedisKeyWrap destRedisKeyWrap);
    +    Long unionAndStoreForSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild);
     
         /**
          * 获取两个集合的差集
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuild
          * @param clazz
          * @return
          */
    -     Set differenceForSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, Class clazz);
    +     Set differenceForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, Class clazz);
     
         /**
          * 获取key集合与多个集合的差集
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWraps
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuilds
          * @param clazz
          * @return
          */
    -     Set differenceForSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, Class clazz);
    +     Set differenceForSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, Class clazz);
     
         /**
          * key集合与otherKey集合的差集存储到destKey中
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWrap
    -     * @param destRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuild
    +     * @param destRedisKeyBuild
          * @return
          */
    -    Long differenceForSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, RedisKeyWrap destRedisKeyWrap);
    +    Long differenceForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild);
     
         /**
          * key集合与多个集合的差集存储到destKey中
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWraps
    -     * @param destRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuilds
    +     * @param destRedisKeyBuild
          * @return
          */
    -    Long differenceForSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, RedisKeyWrap destRedisKeyWrap);
    +    Long differenceForSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild);
     
         /**
          * 获取集合所有元素
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param clazz
          * @return
          */
    -     Set membersForSet(RedisKeyWrap RedisKeyWrap, Class clazz);
    +     Set membersForSet(RedisKeyBuild redisKeyBuild, Class clazz);
     
         /**
          * 随机获取集合中的一个元素
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param clazz
          * @return
          */
    -     T randomMemberForSet(RedisKeyWrap RedisKeyWrap, Class clazz);
    +     T randomMemberForSet(RedisKeyBuild redisKeyBuild, Class clazz);
     
         /**
          * 随机获取集合中count个元素
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param count
          * @param clazz
          * @return
          */
    -     List randomMembersForSet(RedisKeyWrap RedisKeyWrap, long count, Class clazz);
    +     List randomMembersForSet(RedisKeyBuild redisKeyBuild, long count, Class clazz);
     
         /**
          * 随机获取集合中count个元素并且去除重复的
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param count
          * @param clazz
          * @return
          */
    -     Set distinctRandomMembersForSet(RedisKeyWrap RedisKeyWrap, long count, Class clazz);
    +     Set distinctRandomMembersForSet(RedisKeyBuild redisKeyBuild, long count, Class clazz);
     
         /**
          * 游标遍历
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param options
          * @return
          */
    -    Cursor scanForSet(RedisKeyWrap RedisKeyWrap, ScanOptions options);
    +    Cursor scanForSet(RedisKeyBuild redisKeyBuild, ScanOptions options);
     
     
     
    -    /**------------------zSet相关操作--------------------------------*/
    +    /**------------------SortedSet相关操作--------------------------------*/
     
         /**
          * 存储有序列表
          *
    -     * @param RedisKeyWrap key
    +     * @param redisKeyBuild key
          * @param value value
          * @param score 评分值
          * @return
          */
    -    void addForZSet(RedisKeyWrap RedisKeyWrap, Object value, Double score);
    +    void addForSortedSet(RedisKeyBuild redisKeyBuild, Object value, Double score);
     
         /**
          * 存储有序列表并设置超时时间(秒)
          *
    -     * @param RedisKeyWrap key
    +     * @param redisKeyBuild key
          * @param value value
          * @param score 评分值
          * @param ttl 超时时间
          * @return
          */
    -    void addForZSet(RedisKeyWrap RedisKeyWrap, Object value, Double score, long ttl);
    +    void addForSortedSet(RedisKeyBuild redisKeyBuild, Object value, Double score, long ttl);
     
         /**
          * 存储有序列表并设置超时时间
          *
    -     * @param RedisKeyWrap key
    +     * @param redisKeyBuild key
          * @param value value
          * @param score 评分值
          * @param ttl 超时时间
          * @param timeUnit 时间单位
          * @return
          */
    -    void addForZSet(RedisKeyWrap RedisKeyWrap, Object value, Double score, long ttl, TimeUnit timeUnit);
    +    void addForSortedSet(RedisKeyBuild redisKeyBuild, Object value, Double score, long ttl, TimeUnit timeUnit);
     
         /**
          * 存储有序列表
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param map map中的key如果是自定义对象类型需要重新equals和hashcode方法
          * @return
          */
    -    Long addForZSet(RedisKeyWrap RedisKeyWrap, Map map);
    +    Long addForSortedSet(RedisKeyBuild redisKeyBuild, Map map);
     
         /**
          * 存储有序列表并设置超时时间(秒)
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param map map中的key如果是自定义对象类型需要重新equals和hashcode方法
          * @param ttl
          * @return
          */
    -    Long addForZSet(RedisKeyWrap RedisKeyWrap, Map map, long ttl);
    +    Long addForSortedSet(RedisKeyBuild redisKeyBuild, Map map, long ttl);
     
         /**
          * 存储有序列表并设置超时时间 自定义单位
          *
    -     * @param RedisKeyWrap      key
    +     * @param redisKeyBuild      key
          * @param map      map中的key如果是自定义对象类型需要重新equals和hashcode方法
          * @param ttl      过期时间
          * @param timeUnit 过期时间单位
          * @return 影响的条目
          */
    -    Long addForZSet(RedisKeyWrap RedisKeyWrap, Map map, long ttl, TimeUnit timeUnit);
    +    Long addForSortedSet(RedisKeyBuild redisKeyBuild, Map map, long ttl, TimeUnit timeUnit);
     
         /**
          * 获取有序列表中范围条目,并转为指定类型
          *
    -     * @param RedisKeyWrap   key
    +     * @param redisKeyBuild   key
          * @param start 开始下标 从0开始
          * @param end   结束下标 包含此条
          * @param clazz 序列化类型
          * @param    泛型参数
          * @return 结果set集合
          */
    -     Set getRangeForZSet(RedisKeyWrap RedisKeyWrap, long start, long end, Class clazz);
    +     Set getRangeForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end, Class clazz);
     
         /**
          * 反转获取有序列表中范围条目,并转为指定类型
          *
    -     * @param RedisKeyWrap   key
    +     * @param redisKeyBuild   key
          * @param start 开始下标 从0开始
          * @param end   结束下标 包含此条
          * @param clazz 序列化类型
          * @param    泛型参数
          * @return 结果set集合
          */
    -     Set getReverseRangeForZSet(RedisKeyWrap RedisKeyWrap, long start, long end, Class clazz);
    +     Set getReverseRangeForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end, Class clazz);
     
         /**
          * 删除zSet条目
          *
    -     * @param RedisKeyWrap   key
    +     * @param redisKeyBuild   key
          * @param value 数据
          * @return 影响条目
          */
    -    Long delForZSet(RedisKeyWrap RedisKeyWrap, Object value);
    +    Long delForSortedSet(RedisKeyBuild redisKeyBuild, Object value);
     
         /**
          * 批量删除zSet条目
          *
    -     * @param RedisKeyWrap             key
    +     * @param redisKeyBuild             key
          * @param valueCollection 数据
          * @return 影响条目
          */
    -    Long delForZSet(RedisKeyWrap RedisKeyWrap, Collection valueCollection);
    +    Long delForSortedSet(RedisKeyBuild redisKeyBuild, Collection valueCollection);
     
         /**
          * 删除范围元素
          *
    -     * @param RedisKeyWrap   key
    +     * @param redisKeyBuild   key
          * @param start 开始range
          * @param end   结束range
          * @return 影响条目
          */
    -    Long delRangeForZSet(RedisKeyWrap RedisKeyWrap, long start, long end);
    +    Long delRangeForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end);
     
     
         /**
          * 增加元素的score值,并返回增加后的值
          *
    -     * @param RedisKeyWrap
    -     * @param value
    -     * @param delta
    -     * @return
    +     * @param redisKeyBuild key
    +     * @param value 对象
    +     * @param delta 值
    +     * @return 结果
          */
    -    Double incrementScoreForZSet(RedisKeyWrap RedisKeyWrap, Object value, double delta);
    +    Double incrementScoreForSortedSet(RedisKeyBuild redisKeyBuild, Object value, double delta);
     
     
     
         /**
          * 计算zSet总条数
          *
    -     * @param RedisKeyWrap key
    +     * @param redisKeyBuild key
          * @return 总条数  不存在则空
          */
    -    Long sizeForZSet(RedisKeyWrap RedisKeyWrap);
    +    Long sizeForSortedSet(RedisKeyBuild redisKeyBuild);
     
         /**
          * 返回元素在集合的排名,有序集合是按照元素的score值由小到大排列
          *
    -     * @param RedisKeyWrap   key
    +     * @param redisKeyBuild   key
          * @param value value
          * @return rank
          */
    -    Long rankForZSet(RedisKeyWrap RedisKeyWrap, Object value);
    +    Long rankForSortedSet(RedisKeyBuild redisKeyBuild, Object value);
     
         /**
          * 返回元素在集合的排名,按元素的score值由大到小排列
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param value
          * @return
          */
    -    Long reverseRankForZSet(RedisKeyWrap RedisKeyWrap, Object value);
    +    Long reverseRankForSortedSet(RedisKeyBuild redisKeyBuild, Object value);
     
     
         /**
          * 获取集合元素, 并且把score值也获取
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param start
          * @param end
          * @param clazz
          * @return
          */
    -     Set> rangeWithScoreForZSet(RedisKeyWrap RedisKeyWrap, long start, long end, Class clazz);
    +     Set> rangeWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end, Class clazz);
     
     
         /**
          * 根据Score值查询集合元素
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param min
          *            最小值
          * @param max
    @@ -1093,12 +1093,12 @@ public interface RedisCache {
          * @param clazz
          * @return
          */
    -     Set rangeByScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max, Class clazz);
    +     Set rangeByScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, Class clazz);
     
         /**
          * 根据Score值查询集合元素(含有score值), 从小到大排序
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param min
          *            最小值
          * @param max
    @@ -1106,13 +1106,13 @@ public interface RedisCache {
          * @param clazz
          * @return
          */
    -     Set> rangeByScoreWithScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max, Class clazz);
    +     Set> rangeByScoreWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, Class clazz);
     
     
         /**
          * 根据Score值查询集合元素, 从小到大排序
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param min
          *            最小值
          * @param max
    @@ -1122,46 +1122,46 @@ public interface RedisCache {
          * @param clazz
          * @return
          */
    -     Set> rangeByScoreWithScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max,
    -                                                                       long start, long end, Class clazz);
    +     Set> rangeByScoreWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max,
    +                                                                            long start, long end, Class clazz);
     
         /**
          * 获取集合的元素, 从大到小排序, 并返回score值
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param start
          * @param end
          * @param clazz
          * @return
          */
    -     Set> reverseRangeWithScoreForZSet(RedisKeyWrap RedisKeyWrap, long start, long end, Class clazz);
    +     Set> reverseRangeWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end, Class clazz);
     
         /**
          * 根据Score值查询集合元素, 从大到小排序
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param min
          * @param max
          * @param clazz
          * @return
          */
    -     Set reverseRangeByScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max, Class clazz);
    +     Set reverseRangeByScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, Class clazz);
     
         /**
          * 根据Score值查询集合元素, 从大到小排序, 并返回score值
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param min
          * @param max
          * @param clazz
          * @return
          */
    -     Set> reverseRangeByScoreWithScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max, Class clazz);
    +     Set> reverseRangeByScoreWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, Class clazz);
     
         /**
          * 根据Score值查询集合元素, 从大到小排序
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param min
          * @param max
          * @param start
    @@ -1169,109 +1169,109 @@ public interface RedisCache {
          * @param clazz
          * @return
          */
    -     Set reverseRangeByScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max, long start, long end, Class clazz);
    +     Set reverseRangeByScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, long start, long end, Class clazz);
     
         /**
          * 根据score值获取集合元素数量
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param min
          * @param max
          * @return
          */
    -    Long countForZSet(RedisKeyWrap RedisKeyWrap, double min, double max);
    +    Long countForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max);
     
         /**
          * 获取集合大小
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @return
          */
    -    Long zCardForZSet(RedisKeyWrap RedisKeyWrap);
    +    Long zCardForSortedSet(RedisKeyBuild redisKeyBuild);
     
         /**
          * 获取集合中value元素的score值
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param value
          * @return
          */
    -    Double scoreByValueForZSet(RedisKeyWrap RedisKeyWrap, Object value);
    +    Double scoreByValueForSortedSet(RedisKeyBuild redisKeyBuild, Object value);
     
         /**
          * 移除指定索引位置的成员
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param start
          * @param end
          * @return
          */
    -    Long removeRangeForZSet(RedisKeyWrap RedisKeyWrap, long start, long end);
    +    Long removeRangeForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end);
     
         /**
          * 根据指定的score值的范围来移除成员
          *
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param min
          * @param max
          * @return
          */
    -    Long removeRangeByScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max);
    +    Long removeRangeByScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max);
     
         /**
          * 获取key和otherKey的并集并存储在destKey中
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWrap
    -     * @param destRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuild
    +     * @param destRedisKeyBuild
          * @return
          */
    -    Long unionAndStoreForZSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, RedisKeyWrap destRedisKeyWrap);
    +    Long unionAndStoreForSortedSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild);
     
         /**
          * 获取key和otherKeys的并集并存储在destKey中
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWraps
    -     * @param destRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuilds
    +     * @param destRedisKeyBuild
          * @return
          */
    -    Long unionAndStoreForZSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, RedisKeyWrap destRedisKeyWrap);
    +    Long unionAndStoreForSortedSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild);
     
         /**
          * 获取key和otherKey的交集并存储在destKey中
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWrap
    -     * @param destRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuild
    +     * @param destRedisKeyBuild
          * @return
          */
    -    Long intersectAndStoreForZSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, RedisKeyWrap destRedisKeyWrap);
    +    Long intersectAndStoreForSortedSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild);
     
         /**
          * 获取key和otherKeys的交集并存储在destKey中
          *
    -     * @param RedisKeyWrap
    -     * @param otherRedisKeyWraps
    -     * @param destRedisKeyWrap
    +     * @param redisKeyBuild
    +     * @param otherRedisKeyBuilds
    +     * @param destRedisKeyBuild
          * @return
          */
    -    Long intersectAndStoreForZSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, RedisKeyWrap destRedisKeyWrap);
    +    Long intersectAndStoreForSortedSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild);
     
         /**
          * 游标遍历
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param options
          * @return
          */
    -    Cursor> scanForZSet(RedisKeyWrap RedisKeyWrap, ScanOptions options);
    +    Cursor> scanForSortedSet(RedisKeyBuild redisKeyBuild, ScanOptions options);
     
         /**
          * 不对外使用
    -     * @param RedisKeyWrap
    +     * @param redisKeyBuild
          * @param genericReturnType
          * @return
          */
    -     T getByType(RedisKeyWrap RedisKeyWrap, Type genericReturnType);
    +     T getByType(RedisKeyBuild redisKeyBuild, Type genericReturnType);
         /**
          * 获取实例
          *
    diff --git a/damai-redis-framework/src/main/java/com/damai/redis/RedisCacheImpl.java b/damai-redis-framework/src/main/java/com/damai/redis/RedisCacheImpl.java
    index a4a4e85203d3643c34bd86c7205ecb9cb607a01b..841b97eea10daea3666f1ffad337ae4be0abc01d 100644
    --- a/damai-redis-framework/src/main/java/com/damai/redis/RedisCacheImpl.java
    +++ b/damai-redis-framework/src/main/java/com/damai/redis/RedisCacheImpl.java
    @@ -2,7 +2,7 @@ package com.damai.redis;
     
     import com.alibaba.fastjson.JSON;
     import com.alibaba.fastjson.JSONObject;
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import lombok.AllArgsConstructor;
     import org.springframework.data.redis.connection.DataType;
     import org.springframework.data.redis.core.Cursor;
    @@ -35,9 +35,9 @@ public class RedisCacheImpl implements RedisCache {
         private StringRedisTemplate redisTemplate;
     
         @Override
    -    public  T get(RedisKeyWrap RedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  T get(RedisKeyBuild redisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             // 如果取String类型 则直接取出返回
             String cachedValue = redisTemplate.opsForValue().get(key);
             if (String.class.isAssignableFrom(clazz)) {
    @@ -47,29 +47,29 @@ public class RedisCacheImpl implements RedisCache {
         }
         
         @Override
    -    public  T get(RedisKeyWrap RedisKeyWrap, Class clazz, Supplier supplier,long ttl, TimeUnit timeUnit) {
    -        T t = get(RedisKeyWrap, clazz);
    +    public  T get(RedisKeyBuild redisKeyBuild, Class clazz, Supplier supplier, long ttl, TimeUnit timeUnit) {
    +        T t = get(redisKeyBuild, clazz);
             if (CacheUtil.isEmpty(t)) {
                 t = supplier.get();
                 if (CacheUtil.isEmpty(t)) {
                     return null;
                 }
    -            set(RedisKeyWrap,t,ttl,timeUnit);
    +            set(redisKeyBuild,t,ttl,timeUnit);
             }
             return t;
         }
     
         @Override
    -    public String getRange(RedisKeyWrap RedisKeyWrap, long start, long end) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public String getRange(RedisKeyBuild redisKeyBuild, long start, long end) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForValue().get(key, start, end);
         };
     
         @Override
    -    public  List getValueIsList(RedisKeyWrap RedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  List getValueIsList(RedisKeyBuild redisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String valueStr = redisTemplate.opsForValue().get(key);
             if (StringUtil.isEmpty(valueStr)) {
                 return new ArrayList<>();
    @@ -78,9 +78,9 @@ public class RedisCacheImpl implements RedisCache {
         }
         
         @Override
    -    public  List getValueIsList(RedisKeyWrap RedisKeyWrap, Class clazz, Supplier> supplier,long ttl, TimeUnit timeUnit) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  List getValueIsList(RedisKeyBuild redisKeyBuild, Class clazz, Supplier> supplier, long ttl, TimeUnit timeUnit) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String valueStr = redisTemplate.opsForValue().get(key);
             List tList = null;
             if (CacheUtil.isEmpty(valueStr)) {
    @@ -88,30 +88,30 @@ public class RedisCacheImpl implements RedisCache {
                 if (CacheUtil.isEmpty(tList)) {
                     return null;
                 }
    -            set(RedisKeyWrap,tList,ttl,timeUnit);
    +            set(redisKeyBuild,tList,ttl,timeUnit);
             }
             return tList;
         }
     
     
         @Override
    -    public List getKeys(List keyList) {
    +    public List getKeys(List keyList) {
             CacheUtil.checkNotEmpty(keyList);
             List batchKey = CacheUtil.getBatchKey(keyList);
             return redisTemplate.opsForValue().multiGet(batchKey);
         }
     
         @Override
    -    public Boolean hasKey(RedisKeyWrap RedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Boolean hasKey(RedisKeyBuild redisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.hasKey(key);
         }
     
         @Override
    -    public Long getExpire(RedisKeyWrap RedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long getExpire(RedisKeyBuild redisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.getExpire(key);
         }
     
    @@ -121,16 +121,16 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public Boolean move(RedisKeyWrap RedisKeyWrap, int dbIndex) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Boolean move(RedisKeyBuild redisKeyBuild, int dbIndex) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.move(key, dbIndex);
         }
     
         @Override
    -    public Boolean persist(RedisKeyWrap RedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Boolean persist(RedisKeyBuild redisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.persist(key);
         }
     
    @@ -140,64 +140,64 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public void rename(RedisKeyWrap oldKey, RedisKeyWrap newKey) {
    +    public void rename(RedisKeyBuild oldKey, RedisKeyBuild newKey) {
             CacheUtil.checkNotBlank(oldKey);
             CacheUtil.checkNotBlank(newKey);
             redisTemplate.rename(oldKey.getRelKey(), newKey.getRelKey());
         }
     
         @Override
    -    public Boolean renameIfAbsent(RedisKeyWrap oldKey, RedisKeyWrap newKey) {
    +    public Boolean renameIfAbsent(RedisKeyBuild oldKey, RedisKeyBuild newKey) {
             CacheUtil.checkNotBlank(oldKey);
             CacheUtil.checkNotBlank(newKey);
             return redisTemplate.renameIfAbsent(oldKey.getRelKey(), newKey.getRelKey());
         }
     
         @Override
    -    public DataType type(RedisKeyWrap RedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public DataType type(RedisKeyBuild redisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.type(key);
         }
         
         @Override
    -    public void set(RedisKeyWrap RedisKeyWrap, Object object) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public void set(RedisKeyBuild redisKeyBuild, Object object) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String json = object instanceof String ? (String) object : JSON.toJSONString(object);
             redisTemplate.opsForValue().set(key, json);
         }
     
         @Override
    -    public void set(RedisKeyWrap RedisKeyWrap, Object object, long ttl) {
    -        set(RedisKeyWrap, object, ttl, CacheUtil.DEFAULT_TIME_UNIT);
    +    public void set(RedisKeyBuild redisKeyBuild, Object object, long ttl) {
    +        set(redisKeyBuild, object, ttl, CacheUtil.DEFAULT_TIME_UNIT);
         }
     
         @Override
    -    public void set(RedisKeyWrap RedisKeyWrap, Object object, long ttl, TimeUnit timeUnit) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public void set(RedisKeyBuild redisKeyBuild, Object object, long ttl, TimeUnit timeUnit) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String json = object instanceof String ? (String) object : JSON.toJSONString(object);
             redisTemplate.opsForValue().set(key, json, ttl, timeUnit);
         }
     
         @Override
    -    public boolean setIfAbsent(RedisKeyWrap RedisKeyWrap, Object object) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public boolean setIfAbsent(RedisKeyBuild redisKeyBuild, Object object) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String json = object instanceof String ? (String) object : JSON.toJSONString(object);
             return redisTemplate.opsForValue().setIfAbsent(key, json);
         }
     
         @Override
    -    public Long size(RedisKeyWrap RedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long size(RedisKeyBuild redisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForValue().size(key);
         }
     
         @Override
    -    public void multiSet(Map map) {
    +    public void multiSet(Map map) {
             CacheUtil.checkNotEmpty(map);
             Map mapForSave = new HashMap<>(map.size());
             map.forEach((hashKey, val) -> {
    @@ -208,7 +208,7 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public boolean multiSetIfAbsent(Map map) {
    +    public boolean multiSetIfAbsent(Map map) {
             CacheUtil.checkNotEmpty(map);
             Map mapForSave = new HashMap<>(map.size());
             map.forEach((hashKey, val) -> {
    @@ -219,50 +219,50 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public Long incrBy(RedisKeyWrap RedisKeyWrap, long increment) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long incrBy(RedisKeyBuild redisKeyBuild, long increment) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForValue().increment(key, increment);
         }
     
         @Override
    -    public Double incrByDouble(RedisKeyWrap RedisKeyWrap, double increment) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Double incrByDouble(RedisKeyBuild redisKeyBuild, double increment) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForValue().increment(key, increment);
         }
     
         @Override
    -    public Integer append(RedisKeyWrap RedisKeyWrap, String value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Integer append(RedisKeyBuild redisKeyBuild, String value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForValue().append(key, value);
         }
     
         @Override
    -    public void putHash(RedisKeyWrap RedisKeyWrap, String hashKey, Object value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public void putHash(RedisKeyBuild redisKeyBuild, String hashKey, Object value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             redisTemplate.opsForHash().put(key, hashKey, jsonValue);
         }
     
         @Override
    -    public void putHash(RedisKeyWrap RedisKeyWrap, String hashKey, Object value, long ttl) {
    -        putHash(RedisKeyWrap, hashKey, value, ttl, CacheUtil.DEFAULT_TIME_UNIT);
    +    public void putHash(RedisKeyBuild redisKeyBuild, String hashKey, Object value, long ttl) {
    +        putHash(redisKeyBuild, hashKey, value, ttl, CacheUtil.DEFAULT_TIME_UNIT);
         }
     
         @Override
    -    public void putHash(RedisKeyWrap RedisKeyWrap, String hashKey, Object value, long ttl, TimeUnit timeUnit) {
    -        putHash(RedisKeyWrap, hashKey, value);
    +    public void putHash(RedisKeyBuild redisKeyBuild, String hashKey, Object value, long ttl, TimeUnit timeUnit) {
    +        putHash(redisKeyBuild, hashKey, value);
             // 设置过期时间
    -        expire(RedisKeyWrap, ttl, timeUnit);
    +        expire(redisKeyBuild, ttl, timeUnit);
         }
     
         @Override
    -    public void putHash(RedisKeyWrap RedisKeyWrap, Map map) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public void putHash(RedisKeyBuild redisKeyBuild, Map map) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Map mapForSave = new HashMap<>(map.size());
             map.forEach((hashKey, val) -> {
                 String jsonValue = val instanceof String ? (String) val : JSON.toJSONString(val);
    @@ -272,30 +272,30 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public void putHash(RedisKeyWrap RedisKeyWrap, Map map, long ttl) {
    -        putHash(RedisKeyWrap, map, ttl, CacheUtil.DEFAULT_TIME_UNIT);
    +    public void putHash(RedisKeyBuild redisKeyBuild, Map map, long ttl) {
    +        putHash(redisKeyBuild, map, ttl, CacheUtil.DEFAULT_TIME_UNIT);
         }
     
         @Override
    -    public void putHash(RedisKeyWrap RedisKeyWrap, Map map, long ttl, TimeUnit timeUnit) {
    -        putHash(RedisKeyWrap, map);
    -        expire(RedisKeyWrap, ttl, timeUnit);
    +    public void putHash(RedisKeyBuild redisKeyBuild, Map map, long ttl, TimeUnit timeUnit) {
    +        putHash(redisKeyBuild, map);
    +        expire(redisKeyBuild, ttl, timeUnit);
         }
     
         @Override
    -    public Boolean putHashIfAbsent(RedisKeyWrap RedisKeyWrap, String hashKey, Object value){
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Boolean putHashIfAbsent(RedisKeyBuild redisKeyBuild, String hashKey, Object value){
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotBlank(hashKey);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForHash().putIfAbsent(key, hashKey, jsonValue);
         }
     
         @Override
    -    public  T getForHash(RedisKeyWrap RedisKeyWrap, String hashKey, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public  T getForHash(RedisKeyBuild redisKeyBuild, String hashKey, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotBlank(hashKey);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             Object o = redisTemplate.opsForHash().get(key, hashKey);
             // 如果取String类型 则直接取出返回
             if (String.class.isAssignableFrom(clazz)) {
    @@ -305,10 +305,10 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public  List getValueIsListForHash(RedisKeyWrap RedisKeyWrap, String hashKey, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public  List getValueIsListForHash(RedisKeyBuild redisKeyBuild, String hashKey, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotBlank(hashKey);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             Object o = redisTemplate.opsForHash().get(key,hashKey);
             if (o == null) {
                 return new ArrayList<>();
    @@ -321,10 +321,10 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public  List multiGetForHash(RedisKeyWrap RedisKeyWrap, List hashKeys, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public  List multiGetForHash(RedisKeyBuild redisKeyBuild, List hashKeys, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotBlank(hashKeys);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             List objHashKeys = new ArrayList<>();
             objHashKeys.addAll(hashKeys);
             List multiGetObj = redisTemplate.opsForHash().multiGet(key, objHashKeys);
    @@ -336,9 +336,9 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public  List getAllForHash(RedisKeyWrap RedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  List getAllForHash(RedisKeyBuild redisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             List valuesObj = redisTemplate.opsForHash().values(key);
             if (String.class.isAssignableFrom(clazz)) {
                 return (List) valuesObj;
    @@ -348,11 +348,11 @@ public class RedisCacheImpl implements RedisCache {
         }
         
         @Override
    -    public  Map getAllMapForHash(RedisKeyWrap RedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Map getAllMapForHash(RedisKeyBuild redisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Map entries = redisTemplate.opsForHash().entries(key);
    -        Map map = new HashMap<>();
    +        Map map = new HashMap<>(64);
             entries.forEach((k,v) -> {
                 map.put(String.valueOf(k),getComplex(v, clazz));
             });
    @@ -360,9 +360,9 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public  T indexForList(RedisKeyWrap RedisKeyWrap, long index, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  T indexForList(RedisKeyBuild redisKeyBuild, long index, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String cachedValue = redisTemplate.opsForList().index(key, index);
             if (StringUtil.isEmpty(cachedValue)) {
                 return null;
    @@ -374,19 +374,19 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public Long leftPushForList(RedisKeyWrap RedisKeyWrap, Object value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long leftPushForList(RedisKeyBuild redisKeyBuild, Object value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForList().leftPush(key, jsonValue);
         }
     
         @Override
    -    public Long leftPushAllForList(RedisKeyWrap RedisKeyWrap, List valueList){
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long leftPushAllForList(RedisKeyBuild redisKeyBuild, List valueList){
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(valueList);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             List jsonList = new ArrayList<>(valueList.size());
             valueList.forEach(value -> {
                 String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
    @@ -396,39 +396,39 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public Long leftPushIfPresentForList(RedisKeyWrap RedisKeyWrap, Object value){
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long leftPushIfPresentForList(RedisKeyBuild redisKeyBuild, Object value){
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForList().leftPushIfPresent(key, jsonValue);
         }
     
         @Override
    -    public Long leftPushForList(RedisKeyWrap RedisKeyWrap, Object pivot, Object value){
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long leftPushForList(RedisKeyBuild redisKeyBuild, Object pivot, Object value){
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(pivot);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonPivot = value instanceof String ? (String) pivot : JSON.toJSONString(pivot);
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForList().leftPush(key, jsonPivot, jsonValue);
         }
     
         @Override
    -    public Long rightPushForList(RedisKeyWrap RedisKeyWrap, Object value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long rightPushForList(RedisKeyBuild redisKeyBuild, Object value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForList().rightPush(key, jsonValue);
         }
     
         @Override
    -    public Long rightPushAllForList(RedisKeyWrap RedisKeyWrap, List valueList){
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long rightPushAllForList(RedisKeyBuild redisKeyBuild, List valueList){
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(valueList);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             List jsonList = new ArrayList<>(valueList.size());
             valueList.forEach(value -> {
                 String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
    @@ -438,68 +438,68 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public Long rightPushIfPresentForList(RedisKeyWrap RedisKeyWrap, Object value){
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long rightPushIfPresentForList(RedisKeyBuild redisKeyBuild, Object value){
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForList().rightPushIfPresent(key, jsonValue);
         }
     
         @Override
    -    public Long rightPushForList(RedisKeyWrap RedisKeyWrap, Object pivot, Object value){
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long rightPushForList(RedisKeyBuild redisKeyBuild, Object pivot, Object value){
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(pivot);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonPivot = value instanceof String ? (String) pivot : JSON.toJSONString(pivot);
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForList().rightPush(key, jsonPivot, jsonValue);
         }
     
         @Override
    -    public void setForList(RedisKeyWrap RedisKeyWrap, long index, Object value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public void setForList(RedisKeyBuild redisKeyBuild, long index, Object value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             redisTemplate.opsForList().set(key, index, jsonValue);
         }
     
         @Override
    -    public  T leftPopForList(RedisKeyWrap RedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  T leftPopForList(RedisKeyBuild redisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String s = redisTemplate.opsForList().leftPop(key);
             return getComplex(s, clazz);
         }
     
         @Override
    -    public  T leftPopBlockForList(RedisKeyWrap RedisKeyWrap, Class clazz, long timeout, TimeUnit unit) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  T leftPopBlockForList(RedisKeyBuild redisKeyBuild, Class clazz, long timeout, TimeUnit unit) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String s = redisTemplate.opsForList().leftPop(key, timeout, unit);
             return getComplex(s, clazz);
         }
     
         @Override
    -    public  T rightPopForList(RedisKeyWrap RedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  T rightPopForList(RedisKeyBuild redisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String s = redisTemplate.opsForList().rightPop(key);
             return getComplex(s, clazz);
         }
     
         @Override
    -    public  T rightPopBlockForList(RedisKeyWrap RedisKeyWrap, Class clazz, long timeout, TimeUnit unit) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  T rightPopBlockForList(RedisKeyBuild redisKeyBuild, Class clazz, long timeout, TimeUnit unit) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String s = redisTemplate.opsForList().rightPop(key, timeout, unit);
             return getComplex(s, clazz);
         }
     
         @Override
    -    public  T rightPopAndLeftPushForList(RedisKeyWrap sourceKey, RedisKeyWrap destinationKey, Class clazz) {
    +    public  T rightPopAndLeftPushForList(RedisKeyBuild sourceKey, RedisKeyBuild destinationKey, Class clazz) {
             CacheUtil.checkNotBlank(sourceKey);
             CacheUtil.checkNotBlank(destinationKey);
             String sourceRelKey = sourceKey.getRelKey();
    @@ -509,7 +509,7 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public  T rightPopBlockAndLeftPushForList(RedisKeyWrap sourceKey, RedisKeyWrap destinationKey, Class clazz, long timeout, TimeUnit unit) {
    +    public  T rightPopBlockAndLeftPushForList(RedisKeyBuild sourceKey, RedisKeyBuild destinationKey, Class clazz, long timeout, TimeUnit unit) {
             CacheUtil.checkNotBlank(sourceKey);
             CacheUtil.checkNotBlank(destinationKey);
             String sourceRelKey = sourceKey.getRelKey();
    @@ -519,133 +519,133 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public  List getAllForList(RedisKeyWrap RedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  List getAllForList(RedisKeyBuild redisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             List list = redisTemplate.opsForList().range(key, 0, -1);
             return parseObjects(list, clazz);
         }
     
         @Override
    -    public  List rangeForList(RedisKeyWrap RedisKeyWrap, long start, long end, Class clazz){
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  List rangeForList(RedisKeyBuild redisKeyBuild, long start, long end, Class clazz){
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             List range = redisTemplate.opsForList().range(key, start, end);
             return parseObjects(range, clazz);
         }
     
         @Override
    -    public Long removeForList(RedisKeyWrap RedisKeyWrap, long index, Object value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long removeForList(RedisKeyBuild redisKeyBuild, long index, Object value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForList().remove(key, index, jsonValue);
         }
     
         @Override
    -    public void trimForList(RedisKeyWrap RedisKeyWrap, long start, long end) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public void trimForList(RedisKeyBuild redisKeyBuild, long start, long end) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             redisTemplate.opsForList().trim(key, start, end);
         }
     
         @Override
    -    public Long lenForList(RedisKeyWrap RedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long lenForList(RedisKeyBuild redisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForList().size(key);
         }
     
         @Override
    -    public Boolean hasKeyForHash(RedisKeyWrap RedisKeyWrap, String hashKey) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Boolean hasKeyForHash(RedisKeyBuild redisKeyBuild, String hashKey) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotBlank(hashKey);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForHash().hasKey(key, hashKey);
         }
     
         @Override
    -    public void del(RedisKeyWrap RedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public void del(RedisKeyBuild redisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             redisTemplate.delete(key);
         }
         
     
         @Override
    -    public Long delForHash(RedisKeyWrap RedisKeyWrap, String hashKey) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long delForHash(RedisKeyBuild redisKeyBuild, String hashKey) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotBlank(hashKey);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForHash().delete(key, hashKey);
         }
     
         @Override
    -    public Long delForHash(RedisKeyWrap RedisKeyWrap, Collection hashKeys) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long delForHash(RedisKeyBuild redisKeyBuild, Collection hashKeys) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotBlank(hashKeys);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForHash().delete(key, hashKeys.toArray());
         }
     
         @Override
    -    public Long incrByForHash(RedisKeyWrap RedisKeyWrap, String hashKey, long increment) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long incrByForHash(RedisKeyBuild redisKeyBuild, String hashKey, long increment) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotBlank(hashKey);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForHash().increment(key, hashKey, increment);
         }
     
         @Override
    -    public Double incrByDoubleForHash(RedisKeyWrap RedisKeyWrap, String hashKey, double delta){
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Double incrByDoubleForHash(RedisKeyBuild redisKeyBuild, String hashKey, double delta){
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotBlank(hashKey);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForHash().increment(key, hashKey, delta);
         }
     
         @Override
    -    public Set hashKeysForHash(RedisKeyWrap RedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Set hashKeysForHash(RedisKeyBuild redisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set keys = redisTemplate.opsForHash().keys(key);
             return parseObjects(keys,String.class);
         }
     
         @Override
    -    public Long sizeForHash(RedisKeyWrap RedisKeyWrap){
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long sizeForHash(RedisKeyBuild redisKeyBuild){
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForHash().size(key);
         }
     
         @Override
    -    public void del(Collection keys) {
    +    public void del(Collection keys) {
             CacheUtil.checkNotEmpty(keys);
             List batchKey = CacheUtil.getBatchKey(keys);
             redisTemplate.delete(batchKey);
         }
     
         @Override
    -    public Boolean expire(RedisKeyWrap RedisKeyWrap, long ttl, TimeUnit timeUnit) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Boolean expire(RedisKeyBuild redisKeyBuild, long ttl, TimeUnit timeUnit) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.expire(key, ttl, timeUnit);
         }
     
         @Override
    -    public Long addForSet(RedisKeyWrap RedisKeyWrap, Object value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long addForSet(RedisKeyBuild redisKeyBuild, Object value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForSet().add(key, jsonValue);
         }
     
         @Override
    -    public Long addForSet(RedisKeyWrap RedisKeyWrap, List values) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long addForSet(RedisKeyBuild redisKeyBuild, List values) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(values);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             List jsonList = new ArrayList<>(values.size());
             values.forEach(value -> {
                 String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
    @@ -655,19 +655,19 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public Long removeForSet(RedisKeyWrap RedisKeyWrap, Object value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long removeForSet(RedisKeyBuild redisKeyBuild, Object value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForSet().remove(key, jsonValue);
         }
     
         @Override
    -    public Long removeForSet(RedisKeyWrap RedisKeyWrap, List values) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long removeForSet(RedisKeyBuild redisKeyBuild, List values) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(values);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             List jsonList = values.stream()
                     .map(value -> value instanceof String ? (String) value : JSON.toJSONString(value))
                     .collect(Collectors.toList());
    @@ -675,231 +675,231 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public  T popForSet(RedisKeyWrap RedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  T popForSet(RedisKeyBuild redisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String cachedValue = redisTemplate.opsForSet().pop(key);
             return getComplex(cachedValue,clazz);
         }
     
         @Override
    -    public boolean moveForSet(RedisKeyWrap RedisKeyWrap, Object value, RedisKeyWrap destRedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public boolean moveForSet(RedisKeyBuild redisKeyBuild, Object value, RedisKeyBuild destRedisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
    -        CacheUtil.checkNotBlank(destRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        String destKey = destRedisKeyWrap.getRelKey();
    +        CacheUtil.checkNotBlank(destRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        String destKey = destRedisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForSet().move(key, jsonValue, destKey);
         }
     
         @Override
    -    public Long sizeForSet(RedisKeyWrap RedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long sizeForSet(RedisKeyBuild redisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForSet().size(key);
         }
     
         @Override
    -    public Boolean isMemberForSet(RedisKeyWrap RedisKeyWrap, Object value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Boolean isMemberForSet(RedisKeyBuild redisKeyBuild, Object value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForSet().isMember(key, jsonValue);
         }
     
         @Override
    -    public  Set intersectForSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotBlank(otherRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        String otherKey = otherRedisKeyWrap.getRelKey();
    +    public  Set intersectForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotBlank(otherRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        String otherKey = otherRedisKeyBuild.getRelKey();
             Set set = redisTemplate.opsForSet().intersect(key, otherKey);
             return parseObjects(set,clazz);
         }
     
         @Override
    -    public  Set intersectForSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotEmpty(otherRedisKeyWraps);
    -        String key = RedisKeyWrap.getRelKey();
    -        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyWraps);
    +    public  Set intersectForSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotEmpty(otherRedisKeyBuilds);
    +        String key = redisKeyBuild.getRelKey();
    +        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyBuilds);
             Set set = redisTemplate.opsForSet().intersect(key, otherKeys);
             return parseObjects(set,clazz);
         }
     
         @Override
    -    public Long intersectAndStoreForSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, RedisKeyWrap destRedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotBlank(otherRedisKeyWrap);
    -        CacheUtil.checkNotBlank(destRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        String otherKey = otherRedisKeyWrap.getRelKey();
    -        String destKey = destRedisKeyWrap.getRelKey();
    +    public Long intersectAndStoreForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotBlank(otherRedisKeyBuild);
    +        CacheUtil.checkNotBlank(destRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        String otherKey = otherRedisKeyBuild.getRelKey();
    +        String destKey = destRedisKeyBuild.getRelKey();
             return redisTemplate.opsForSet().intersectAndStore(key, otherKey, destKey);
         }
     
         @Override
    -    public Long intersectAndStoreForSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, RedisKeyWrap destRedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotEmpty(otherRedisKeyWraps);
    -        CacheUtil.checkNotBlank(destRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyWraps);
    -        String destKey = destRedisKeyWrap.getRelKey();
    +    public Long intersectAndStoreForSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotEmpty(otherRedisKeyBuilds);
    +        CacheUtil.checkNotBlank(destRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyBuilds);
    +        String destKey = destRedisKeyBuild.getRelKey();
             return redisTemplate.opsForSet().intersectAndStore(key, otherKeys, destKey);
         }
     
         @Override
    -    public  Set unionForSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotBlank(otherRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        String otherKey = otherRedisKeyWrap.getRelKey();
    +    public  Set unionForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotBlank(otherRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        String otherKey = otherRedisKeyBuild.getRelKey();
             Set set = redisTemplate.opsForSet().union(key, otherKey);
             return parseObjects(set,clazz);
         }
     
         @Override
    -    public  Set unionForSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotEmpty(otherRedisKeyWraps);
    -        String key = RedisKeyWrap.getRelKey();
    -        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyWraps);
    +    public  Set unionForSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotEmpty(otherRedisKeyBuilds);
    +        String key = redisKeyBuild.getRelKey();
    +        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyBuilds);
             Set set = redisTemplate.opsForSet().union(key, otherKeys);
             return parseObjects(set,clazz);
         }
     
         @Override
    -    public Long unionAndStoreForSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, RedisKeyWrap destRedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotBlank(otherRedisKeyWrap);
    -        CacheUtil.checkNotBlank(destRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        String otherKey = otherRedisKeyWrap.getRelKey();
    -        String destKey = destRedisKeyWrap.getRelKey();
    +    public Long unionAndStoreForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotBlank(otherRedisKeyBuild);
    +        CacheUtil.checkNotBlank(destRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        String otherKey = otherRedisKeyBuild.getRelKey();
    +        String destKey = destRedisKeyBuild.getRelKey();
             return redisTemplate.opsForSet().unionAndStore(key, otherKey, destKey);
         }
     
         @Override
    -    public Long unionAndStoreForSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, RedisKeyWrap destRedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotEmpty(otherRedisKeyWraps);
    -        CacheUtil.checkNotBlank(destRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyWraps);
    -        String destKey = destRedisKeyWrap.getRelKey();
    +    public Long unionAndStoreForSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotEmpty(otherRedisKeyBuilds);
    +        CacheUtil.checkNotBlank(destRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyBuilds);
    +        String destKey = destRedisKeyBuild.getRelKey();
             return redisTemplate.opsForSet().unionAndStore(key, otherKeys, destKey);
         }
     
         @Override
    -    public  Set differenceForSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotBlank(otherRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        String otherKey = otherRedisKeyWrap.getRelKey();
    +    public  Set differenceForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotBlank(otherRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        String otherKey = otherRedisKeyBuild.getRelKey();
             Set set = redisTemplate.opsForSet().difference(key, otherKey);
             return parseObjects(set,clazz);
         }
     
         @Override
    -    public  Set differenceForSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotEmpty(otherRedisKeyWraps);
    -        String key = RedisKeyWrap.getRelKey();
    -        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyWraps);
    +    public  Set differenceForSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotEmpty(otherRedisKeyBuilds);
    +        String key = redisKeyBuild.getRelKey();
    +        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyBuilds);
             Set set = redisTemplate.opsForSet().difference(key, otherKeys);
             return parseObjects(set,clazz);
         }
     
         @Override
    -    public Long differenceForSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, RedisKeyWrap destRedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotBlank(otherRedisKeyWrap);
    -        CacheUtil.checkNotBlank(destRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        String otherKey = otherRedisKeyWrap.getRelKey();
    -        String destKey = destRedisKeyWrap.getRelKey();
    +    public Long differenceForSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotBlank(otherRedisKeyBuild);
    +        CacheUtil.checkNotBlank(destRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        String otherKey = otherRedisKeyBuild.getRelKey();
    +        String destKey = destRedisKeyBuild.getRelKey();
             return redisTemplate.opsForSet().differenceAndStore(key, otherKey, destKey);
         }
     
         @Override
    -    public Long differenceForSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, RedisKeyWrap destRedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotEmpty(otherRedisKeyWraps);
    -        CacheUtil.checkNotBlank(destRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyWraps);
    -        String destKey = destRedisKeyWrap.getRelKey();
    +    public Long differenceForSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotEmpty(otherRedisKeyBuilds);
    +        CacheUtil.checkNotBlank(destRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyBuilds);
    +        String destKey = destRedisKeyBuild.getRelKey();
             return redisTemplate.opsForSet().differenceAndStore(key, otherKeys, destKey);
         }
     
         @Override
    -    public  Set membersForSet(RedisKeyWrap RedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Set membersForSet(RedisKeyBuild redisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set members = redisTemplate.opsForSet().members(key);
             return parseObjects(members,clazz);
         }
     
         @Override
    -    public  T randomMemberForSet(RedisKeyWrap RedisKeyWrap, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  T randomMemberForSet(RedisKeyBuild redisKeyBuild, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String s = redisTemplate.opsForSet().randomMember(key);
             return getComplex(s, clazz);
         }
     
         @Override
    -    public  List randomMembersForSet(RedisKeyWrap RedisKeyWrap, long count, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  List randomMembersForSet(RedisKeyBuild redisKeyBuild, long count, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             List list = redisTemplate.opsForSet().randomMembers(key, count);
             return parseObjects(list,clazz);
         }
     
         @Override
    -    public  Set distinctRandomMembersForSet(RedisKeyWrap RedisKeyWrap, long count, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Set distinctRandomMembersForSet(RedisKeyBuild redisKeyBuild, long count, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set set = redisTemplate.opsForSet().distinctRandomMembers(key, count);
             return parseObjects(set,clazz);
         }
     
         @Override
    -    public Cursor scanForSet(RedisKeyWrap RedisKeyWrap, ScanOptions options) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Cursor scanForSet(RedisKeyBuild redisKeyBuild, ScanOptions options) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Cursor scan = redisTemplate.opsForSet().scan(key, options);
             return scan;
         }
     
         @Override
    -    public void addForZSet(RedisKeyWrap RedisKeyWrap, Object value, Double score){
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public void addForSortedSet(RedisKeyBuild redisKeyBuild, Object value, Double score){
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
             CacheUtil.checkNotEmpty(score);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             redisTemplate.opsForZSet().add(key,jsonValue,score);
         }
     
         @Override
    -    public void addForZSet(RedisKeyWrap RedisKeyWrap, Object value, Double score, long ttl){
    -        addForZSet(RedisKeyWrap,value,score,ttl, CacheUtil.DEFAULT_TIME_UNIT);
    +    public void addForSortedSet(RedisKeyBuild redisKeyBuild, Object value, Double score, long ttl){
    +        addForSortedSet(redisKeyBuild,value,score,ttl, CacheUtil.DEFAULT_TIME_UNIT);
         }
     
         @Override
    -    public void addForZSet(RedisKeyWrap RedisKeyWrap, Object value, Double score, long ttl, TimeUnit timeUnit){
    -        addForZSet(RedisKeyWrap,value,score);
    -        expire(RedisKeyWrap, ttl, timeUnit);
    +    public void addForSortedSet(RedisKeyBuild redisKeyBuild, Object value, Double score, long ttl, TimeUnit timeUnit){
    +        addForSortedSet(redisKeyBuild,value,score);
    +        expire(redisKeyBuild, ttl, timeUnit);
         }
     
         @Override
    -    public Long addForZSet(RedisKeyWrap RedisKeyWrap, Map map) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long addForSortedSet(RedisKeyBuild redisKeyBuild, Map map) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set> collect =
                     map.entrySet()
                             .stream()
    @@ -912,46 +912,46 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public Long addForZSet(RedisKeyWrap RedisKeyWrap, Map map, long ttl) {
    -        return addForZSet(RedisKeyWrap, map, ttl, CacheUtil.DEFAULT_TIME_UNIT);
    +    public Long addForSortedSet(RedisKeyBuild redisKeyBuild, Map map, long ttl) {
    +        return addForSortedSet(redisKeyBuild, map, ttl, CacheUtil.DEFAULT_TIME_UNIT);
         }
     
         @Override
    -    public Long addForZSet(RedisKeyWrap RedisKeyWrap, Map map, long ttl, TimeUnit timeUnit) {
    -        Long count = addForZSet(RedisKeyWrap, map);
    -        expire(RedisKeyWrap, ttl, timeUnit);
    +    public Long addForSortedSet(RedisKeyBuild redisKeyBuild, Map map, long ttl, TimeUnit timeUnit) {
    +        Long count = addForSortedSet(redisKeyBuild, map);
    +        expire(redisKeyBuild, ttl, timeUnit);
             return count;
         }
     
         @Override
    -    public  Set getRangeForZSet(RedisKeyWrap RedisKeyWrap, long start, long end, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Set getRangeForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set resultSet = redisTemplate.opsForZSet().range(key, start, end);
             return parseObjects(resultSet,clazz);
         }
     
         @Override
    -    public  Set getReverseRangeForZSet(RedisKeyWrap RedisKeyWrap, long start, long end, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Set getReverseRangeForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set resultSet = redisTemplate.opsForZSet().reverseRange(key, start, end);
             return parseObjects(resultSet,clazz);
         }
     
         @Override
    -    public Long delForZSet(RedisKeyWrap RedisKeyWrap, Object value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long delForSortedSet(RedisKeyBuild redisKeyBuild, Object value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForZSet().remove(key, jsonValue);
         }
     
         @Override
    -    public Long delForZSet(RedisKeyWrap RedisKeyWrap, Collection valueCollection) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long delForSortedSet(RedisKeyBuild redisKeyBuild, Collection valueCollection) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(valueCollection);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             List jsonValueList = valueCollection.stream()
                     .map(value -> value instanceof String ? (String) value : JSON.toJSONString(value))
                     .distinct()
    @@ -960,50 +960,50 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public Long delRangeForZSet(RedisKeyWrap RedisKeyWrap, long start, long end) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long delRangeForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForZSet().removeRange(key, start, end);
         }
     
         @Override
    -    public Double incrementScoreForZSet(RedisKeyWrap RedisKeyWrap, Object value, double delta) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Double incrementScoreForSortedSet(RedisKeyBuild redisKeyBuild, Object value, double delta) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForZSet().incrementScore(key, jsonValue, delta);
         }
     
         @Override
    -    public Long sizeForZSet(RedisKeyWrap RedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long sizeForSortedSet(RedisKeyBuild redisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForZSet().size(key);
         }
     
         @Override
    -    public Long rankForZSet(RedisKeyWrap RedisKeyWrap, Object value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long rankForSortedSet(RedisKeyBuild redisKeyBuild, Object value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForZSet().rank(key, jsonValue);
         }
     
         @Override
    -    public Long reverseRankForZSet(RedisKeyWrap RedisKeyWrap, Object value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Long reverseRankForSortedSet(RedisKeyBuild redisKeyBuild, Object value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForZSet().reverseRank(key, jsonValue);
         }
     
         @Override
    -    public  Set> rangeWithScoreForZSet(RedisKeyWrap RedisKeyWrap, long start, long end, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Set> rangeWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set> cacheSet = redisTemplate.opsForZSet().rangeWithScores(key, start, end);
             if (cacheSet == null) {
                 return new HashSet<>();
    @@ -1012,153 +1012,153 @@ public class RedisCacheImpl implements RedisCache {
         }
     
         @Override
    -    public  Set rangeByScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Set rangeByScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set set = redisTemplate.opsForZSet().rangeByScore(key, min, max);
             return parseObjects(set,clazz);
         }
     
         @Override
    -    public  Set> rangeByScoreWithScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Set> rangeByScoreWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set> cacheSet = redisTemplate.opsForZSet().rangeByScoreWithScores(key, min, max);
             return typedTupleStringParseObjects(cacheSet, clazz);
         }
     
         @Override
    -    public  Set> rangeByScoreWithScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max,
    -                                                                              long start, long end, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Set> rangeByScoreWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max,
    +                                                                                   long start, long end, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set> cacheSet = redisTemplate.opsForZSet().rangeByScoreWithScores(key, min, max, start, end);
             return typedTupleStringParseObjects(cacheSet, clazz);
         }
     
         @Override
    -    public  Set> reverseRangeWithScoreForZSet(RedisKeyWrap RedisKeyWrap, long start, long end, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Set> reverseRangeWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set> cacheSet = redisTemplate.opsForZSet().reverseRangeWithScores(key, start, end);
             return typedTupleStringParseObjects(cacheSet, clazz);
         }
     
         @Override
    -    public  Set reverseRangeByScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Set reverseRangeByScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set set = redisTemplate.opsForZSet().reverseRangeByScore(key, min, max);
             return parseObjects(set,clazz);
         }
     
         @Override
    -    public  Set> reverseRangeByScoreWithScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Set> reverseRangeByScoreWithScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set> cacheSet = redisTemplate.opsForZSet().reverseRangeByScoreWithScores(key, min, max);
             return typedTupleStringParseObjects(cacheSet, clazz);
         }
     
         @Override
    -    public  Set reverseRangeByScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max, long start, long end, Class clazz) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public  Set reverseRangeByScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max, long start, long end, Class clazz) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             Set set = redisTemplate.opsForZSet().reverseRangeByScore(key, min, max, start, end);
             return parseObjects(set, clazz);
         }
     
         @Override
    -    public Long countForZSet(RedisKeyWrap RedisKeyWrap, double min, double max) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long countForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForZSet().count(key, min, max);
         }
     
         @Override
    -    public Long zCardForZSet(RedisKeyWrap RedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long zCardForSortedSet(RedisKeyBuild redisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForZSet().zCard(key);
         }
     
         @Override
    -    public Double scoreByValueForZSet(RedisKeyWrap RedisKeyWrap, Object value) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    +    public Double scoreByValueForSortedSet(RedisKeyBuild redisKeyBuild, Object value) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
             CacheUtil.checkNotEmpty(value);
    -        String key = RedisKeyWrap.getRelKey();
    +        String key = redisKeyBuild.getRelKey();
             String jsonValue = value instanceof String ? (String) value : JSON.toJSONString(value);
             return redisTemplate.opsForZSet().score(key, jsonValue);
         }
     
         @Override
    -    public Long removeRangeForZSet(RedisKeyWrap RedisKeyWrap, long start, long end) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long removeRangeForSortedSet(RedisKeyBuild redisKeyBuild, long start, long end) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForZSet().removeRange(key, start, end);
         }
     
         @Override
    -    public Long removeRangeByScoreForZSet(RedisKeyWrap RedisKeyWrap, double min, double max) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Long removeRangeByScoreForSortedSet(RedisKeyBuild redisKeyBuild, double min, double max) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForZSet().removeRangeByScore(key, min, max);
         }
     
         @Override
    -    public Long unionAndStoreForZSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, RedisKeyWrap destRedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotBlank(otherRedisKeyWrap);
    -        CacheUtil.checkNotBlank(destRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        String otherKey = otherRedisKeyWrap.getRelKey();
    -        String destKey = destRedisKeyWrap.getRelKey();
    +    public Long unionAndStoreForSortedSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotBlank(otherRedisKeyBuild);
    +        CacheUtil.checkNotBlank(destRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        String otherKey = otherRedisKeyBuild.getRelKey();
    +        String destKey = destRedisKeyBuild.getRelKey();
             return redisTemplate.opsForZSet().unionAndStore(key, otherKey, destKey);
         }
     
         @Override
    -    public Long unionAndStoreForZSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, RedisKeyWrap destRedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotEmpty(otherRedisKeyWraps);
    -        CacheUtil.checkNotBlank(destRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyWraps);
    -        String destKey = destRedisKeyWrap.getRelKey();
    +    public Long unionAndStoreForSortedSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotEmpty(otherRedisKeyBuilds);
    +        CacheUtil.checkNotBlank(destRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyBuilds);
    +        String destKey = destRedisKeyBuild.getRelKey();
             return redisTemplate.opsForZSet().unionAndStore(key, otherKeys, destKey);
         }
     
         @Override
    -    public Long intersectAndStoreForZSet(RedisKeyWrap RedisKeyWrap, RedisKeyWrap otherRedisKeyWrap, RedisKeyWrap destRedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotBlank(otherRedisKeyWrap);
    -        CacheUtil.checkNotBlank(destRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        String otherKey = otherRedisKeyWrap.getRelKey();
    -        String destKey = destRedisKeyWrap.getRelKey();
    +    public Long intersectAndStoreForSortedSet(RedisKeyBuild redisKeyBuild, RedisKeyBuild otherRedisKeyBuild, RedisKeyBuild destRedisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotBlank(otherRedisKeyBuild);
    +        CacheUtil.checkNotBlank(destRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        String otherKey = otherRedisKeyBuild.getRelKey();
    +        String destKey = destRedisKeyBuild.getRelKey();
             return redisTemplate.opsForZSet().intersectAndStore(key, otherKey, destKey);
         }
     
         @Override
    -    public Long intersectAndStoreForZSet(RedisKeyWrap RedisKeyWrap, Collection otherRedisKeyWraps, RedisKeyWrap destRedisKeyWrap) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        CacheUtil.checkNotEmpty(otherRedisKeyWraps);
    -        CacheUtil.checkNotBlank(destRedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    -        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyWraps);
    -        String destKey = destRedisKeyWrap.getRelKey();
    +    public Long intersectAndStoreForSortedSet(RedisKeyBuild redisKeyBuild, Collection otherRedisKeyBuilds, RedisKeyBuild destRedisKeyBuild) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        CacheUtil.checkNotEmpty(otherRedisKeyBuilds);
    +        CacheUtil.checkNotBlank(destRedisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
    +        List otherKeys = CacheUtil.getBatchKey(otherRedisKeyBuilds);
    +        String destKey = destRedisKeyBuild.getRelKey();
             return redisTemplate.opsForZSet().intersectAndStore(key, otherKeys, destKey);
         }
     
         @Override
    -    public Cursor> scanForZSet(RedisKeyWrap RedisKeyWrap, ScanOptions options) {
    -        CacheUtil.checkNotBlank(RedisKeyWrap);
    -        String key = RedisKeyWrap.getRelKey();
    +    public Cursor> scanForSortedSet(RedisKeyBuild redisKeyBuild, ScanOptions options) {
    +        CacheUtil.checkNotBlank(redisKeyBuild);
    +        String key = redisKeyBuild.getRelKey();
             return redisTemplate.opsForZSet().scan(key, options);
         }
     
         @Override
    -    public  T getByType(RedisKeyWrap RedisKeyWrap, Type genericReturnType){
    -        String key = RedisKeyWrap.getRelKey();
    +    public  T getByType(RedisKeyBuild redisKeyBuild, Type genericReturnType){
    +        String key = redisKeyBuild.getRelKey();
             String s = redisTemplate.boundValueOps(key).get();
             if (StringUtil.isEmpty(s)) {
                 return null;
    diff --git a/damai-redis-framework/src/main/java/com/damai/redis/RedisKeyWrap.java b/damai-redis-framework/src/main/java/com/damai/redis/RedisKeyBuild.java
    similarity index 63%
    rename from damai-redis-framework/src/main/java/com/damai/redis/RedisKeyWrap.java
    rename to damai-redis-framework/src/main/java/com/damai/redis/RedisKeyBuild.java
    index ce670779a46d4ae3456dce377cddb7e082154c3e..587f72b9c4bd459c4e38c048a70f6e04a14f4b64 100644
    --- a/damai-redis-framework/src/main/java/com/damai/redis/RedisKeyWrap.java
    +++ b/damai-redis-framework/src/main/java/com/damai/redis/RedisKeyBuild.java
    @@ -1,7 +1,7 @@
     package com.damai.redis;
     
     
    -import com.damai.core.RedisKeyEnum;
    +import com.damai.core.RedisKeyManage;
     import com.damai.core.SpringUtil;
     
     import java.util.Objects;
    @@ -11,26 +11,24 @@ import java.util.Objects;
      * @description: redis key包装
      * @author: 阿宽不是程序员
      **/
    -public final class RedisKeyWrap {
    +public final class RedisKeyBuild {
         /**
          * 实际使用的key
          * */
    -    private String relKey;
    +    private final String relKey;
     
    -    private RedisKeyWrap() {}
    -
    -    private RedisKeyWrap(String relKey) {
    +    private RedisKeyBuild(String relKey) {
             this.relKey = relKey;
         }
     
         /**
          * 构建真实的key
    -     * @param RedisKeyEnum key的枚举
    +     * @param redisKeyManage key的枚举
          * @param args 占位符的值
          * */
    -    public static RedisKeyWrap createRedisKey(RedisKeyEnum RedisKeyEnum, Object... args){
    -        String redisRelKey = String.format(RedisKeyEnum.getKeyCode(),args);
    -        return new RedisKeyWrap(SpringUtil.getPrefixDistinctionName() + "-" + redisRelKey);
    +    public static RedisKeyBuild createRedisKey(RedisKeyManage redisKeyManage, Object... args){
    +        String redisRelKey = String.format(redisKeyManage.getKey(),args);
    +        return new RedisKeyBuild(SpringUtil.getPrefixDistinctionName() + "-" + redisRelKey);
         }
     
         public String getRelKey() {
    @@ -45,7 +43,7 @@ public final class RedisKeyWrap {
             if (o == null || getClass() != o.getClass()) {
                 return false;
             }
    -        RedisKeyWrap that = (RedisKeyWrap) o;
    +        RedisKeyBuild that = (RedisKeyBuild) o;
             return relKey.equals(that.relKey);
         }
     
    diff --git a/api-stat/.gitignore b/damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/.gitignore
    similarity index 100%
    rename from api-stat/.gitignore
    rename to damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/.gitignore
    diff --git a/api-stat/api-stat-reported/api-stat-reported-cloud-service/pom.xml b/damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/pom.xml
    similarity index 60%
    rename from api-stat/api-stat-reported/api-stat-reported-cloud-service/pom.xml
    rename to damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/pom.xml
    index 8c8e113665b1792088126dd8e76915d0708102f0..13793afb0f1fe4d59e2b850ade0938fcc9cf8b7c 100644
    --- a/api-stat/api-stat-reported/api-stat-reported-cloud-service/pom.xml
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/pom.xml
    @@ -5,27 +5,25 @@
     
         
             com.example
    -        api-stat-reported
    +        damai-redisson-service-framework
             ${revision}
         
     
     
    -    api-stat-reported-cloud-service
    -
    -    api-stat-reported-cloud-service
    -    api微服务统计
    +    damai-bloom-filter-framework
     
    +    bloom-filter-framework
    +    布隆过滤器工具
     
         
             
                 com.example
    -            api-stat-reported-single-service
    +            damai-redisson-common-framework
                 ${revision}
             
             
    -            org.springframework.cloud
    -            spring-cloud-starter-openfeign
    +            org.springframework.boot
    +            spring-boot-starter
             
         
    -    
     
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/src/main/java/com/damai/config/BloomFilterAutoConfiguration.java b/damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/src/main/java/com/damai/config/BloomFilterAutoConfiguration.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..a7a90ef486172cafc8e948f8109a093a0dcdd7be
    --- /dev/null
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/src/main/java/com/damai/config/BloomFilterAutoConfiguration.java
    @@ -0,0 +1,23 @@
    +package com.damai.config;
    +
    +import com.damai.handler.BloomFilterHandler;
    +import org.redisson.api.RedissonClient;
    +import org.springframework.boot.context.properties.EnableConfigurationProperties;
    +import org.springframework.context.annotation.Bean;
    +
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 布隆过滤器 配置
    + * @author: 阿宽不是程序员
    + **/
    +@EnableConfigurationProperties(BloomFilterProperties.class)
    +public class BloomFilterAutoConfiguration {
    +    
    +    /**
    +     * 布隆过滤器
    +     */
    +    @Bean
    +    public BloomFilterHandler rBloomFilterUtil(RedissonClient redissonClient, BloomFilterProperties bloomFilterProperties) {
    +        return new BloomFilterHandler(redissonClient, bloomFilterProperties);
    +    }
    +}
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/config/RedissonProperties.java b/damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/src/main/java/com/damai/config/BloomFilterProperties.java
    similarity index 62%
    rename from damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/config/RedissonProperties.java
    rename to damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/src/main/java/com/damai/config/BloomFilterProperties.java
    index c5eba873a43acd43ea311fdc48c98b0687e5d21f..9ebf4e7a3558ac867e8e1f39437c7bedd0d205ad 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/config/RedissonProperties.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/src/main/java/com/damai/config/BloomFilterProperties.java
    @@ -5,16 +5,16 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 分布式锁 配置属性
    + * @description: 布隆过滤器 配置属性
      * @author: 阿宽不是程序员
      **/
     @Data
    -@ConfigurationProperties(prefix = RedissonProperties.PREFIX)
    -public class RedissonProperties {
    +@ConfigurationProperties(prefix = BloomFilterProperties.PREFIX)
    +public class BloomFilterProperties {
     
    -    public static final String PREFIX = "redisson";
    +    public static final String PREFIX = "bloom-filter";
         
    -    private String rbLoomFilterName = "user_register_rb_loom_filter";
    +    private String name;
         
         private Long expectedInsertions = 20000L;
         
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/util/RBloomFilterUtil.java b/damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/src/main/java/com/damai/handler/BloomFilterHandler.java
    similarity index 73%
    rename from damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/util/RBloomFilterUtil.java
    rename to damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/src/main/java/com/damai/handler/BloomFilterHandler.java
    index 0f4044f5888cc3e7a0bf6140591c4861b34366ad..e9f393ba07b65c18dac43d1c2f3dbd76e6f1bd40 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/util/RBloomFilterUtil.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/src/main/java/com/damai/handler/BloomFilterHandler.java
    @@ -1,7 +1,7 @@
    -package com.damai.util;
    +package com.damai.handler;
     
     
    -import com.damai.config.RedissonProperties;
    +import com.damai.config.BloomFilterProperties;
     import org.redisson.api.RBloomFilter;
     import org.redisson.api.RedissonClient;
     
    @@ -9,16 +9,16 @@ import org.redisson.api.RedissonClient;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 布隆过滤器 方法抽象
    + * @description: 布隆过滤器
      * @author: 阿宽不是程序员
      **/
    -public class RBloomFilterUtil {
    +public class BloomFilterHandler {
         
         private final RBloomFilter cachePenetrationBloomFilter;
         
    -    public RBloomFilterUtil(RedissonClient redissonClient, RedissonProperties redissonProperties){
    -        RBloomFilter cachePenetrationBloomFilter = redissonClient.getBloomFilter(redissonProperties.getRbLoomFilterName());
    -        cachePenetrationBloomFilter.tryInit(redissonProperties.getExpectedInsertions(), redissonProperties.getFalseProbability());
    +    public BloomFilterHandler(RedissonClient redissonClient, BloomFilterProperties bloomFilterProperties){
    +        RBloomFilter cachePenetrationBloomFilter = redissonClient.getBloomFilter(bloomFilterProperties.getName());
    +        cachePenetrationBloomFilter.tryInit(bloomFilterProperties.getExpectedInsertions(), bloomFilterProperties.getFalseProbability());
             this.cachePenetrationBloomFilter = cachePenetrationBloomFilter;
         }
         
    diff --git a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/resources/META-INF/spring.factories b/damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/src/main/resources/META-INF/spring.factories
    similarity index 58%
    rename from api-stat/api-stat-reported/api-stat-reported-single-service/src/main/resources/META-INF/spring.factories
    rename to damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/src/main/resources/META-INF/spring.factories
    index 501ea7db81866456a312417ff29ef8bf02c38b67..086505941335a28b945c04543da5258fd3d57d41 100644
    --- a/api-stat/api-stat-reported/api-stat-reported-single-service/src/main/resources/META-INF/spring.factories
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-bloom-filter-framework/src/main/resources/META-INF/spring.factories
    @@ -1,2 +1,2 @@
     org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
    -  com.damai.config.ApiStatAutoConfig
    \ No newline at end of file
    +  com.damai.config.BloomFilterAutoConfiguration
    \ No newline at end of file
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-redisson-common-framework/src/main/java/com/damai/handle/RedissonDataHandle.java b/damai-redisson-framework/damai-redisson-service-framework/damai-redisson-common-framework/src/main/java/com/damai/handle/RedissonDataHandle.java
    index caa579c27168c8ec55dafeff207254eeb1aea31d..70acaf2ab9163c518a902301e80c4110423a9c64 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-redisson-common-framework/src/main/java/com/damai/handle/RedissonDataHandle.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-redisson-common-framework/src/main/java/com/damai/handle/RedissonDataHandle.java
    @@ -15,8 +15,8 @@ public class RedissonDataHandle {
         
         private final RedissonClient redissonClient;
         
    -    public Object get(String key){
    -        return redissonClient.getBucket(key).get();
    +    public String get(String key){
    +        return (String)redissonClient.getBucket(key).get();
         }
         
         public void set(String key,String value){
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-redisson-common-framework/src/main/java/com/damai/lockinfo/AbstractLockInfoHandle.java b/damai-redisson-framework/damai-redisson-service-framework/damai-redisson-common-framework/src/main/java/com/damai/lockinfo/AbstractLockInfoHandle.java
    index 3fe2b0f9502685895b27f73cf5c43afce75ecb0c..9337a9e7b60cbddf7b06a1126631e689d45079ce 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-redisson-common-framework/src/main/java/com/damai/lockinfo/AbstractLockInfoHandle.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-redisson-common-framework/src/main/java/com/damai/lockinfo/AbstractLockInfoHandle.java
    @@ -2,7 +2,7 @@ package com.damai.lockinfo;
     
     
     import com.damai.core.SpringUtil;
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import lombok.extern.slf4j.Slf4j;
     import org.aspectj.lang.JoinPoint;
     import org.aspectj.lang.reflect.MethodSignature;
    @@ -34,6 +34,10 @@ public abstract class AbstractLockInfoHandle implements LockInfoHandle {
     
         private final ExpressionParser parser = new SpelExpressionParser();
         
    +    /**
    +     * 锁信息前缀
    +     * @return 具体前缀
    +     * */
         protected abstract String getLockPrefixName();
         @Override
         public String getLockName(JoinPoint joinPoint,String name,String[] keys){
    @@ -56,7 +60,7 @@ public abstract class AbstractLockInfoHandle implements LockInfoHandle {
          * */
         private String getRelKey(JoinPoint joinPoint, String[] keys){
             Method method = getMethod(joinPoint);
    -        List definitionKeys = getSpelRelKey(keys, method, joinPoint.getArgs());
    +        List definitionKeys = getSpElKey(keys, method, joinPoint.getArgs());
             return SEPARATOR + String.join(SEPARATOR, definitionKeys);
         }
         
    @@ -74,7 +78,7 @@ public abstract class AbstractLockInfoHandle implements LockInfoHandle {
             return method;
         }
     
    -    private List getSpelRelKey(String[] definitionKeys, Method method, Object[] parameterValues) {
    +    private List getSpElKey(String[] definitionKeys, Method method, Object[] parameterValues) {
             List definitionKeyList = new ArrayList<>();
             for (String definitionKey : definitionKeys) {
                 if (!ObjectUtils.isEmpty(definitionKey)) {
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-redisson-common-framework/src/main/java/com/damai/lockinfo/LockInfoHandle.java b/damai-redisson-framework/damai-redisson-service-framework/damai-redisson-common-framework/src/main/java/com/damai/lockinfo/LockInfoHandle.java
    index 30ecb42598fdaa9fd25242afd5bba91d8e6c5594..a21c2a9a5524c6b093f4f43dd54e0d69bae62994 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-redisson-common-framework/src/main/java/com/damai/lockinfo/LockInfoHandle.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-redisson-common-framework/src/main/java/com/damai/lockinfo/LockInfoHandle.java
    @@ -8,8 +8,20 @@ import org.aspectj.lang.JoinPoint;
      * @author: 阿宽不是程序员
      **/
     public interface LockInfoHandle {
    -    
    +    /**
    +     * 获取锁信息
    +     * @param joinPoint 切面
    +     * @param name 锁业务名
    +     * @param keys 锁
    +     * @return 锁信息
    +     * */
         String getLockName(JoinPoint joinPoint, String name, String[] keys);
         
    +    /**
    +     * 拼装锁信息
    +     * @param name 锁业务名
    +     * @param keys 锁
    +     * @return 锁信息
    +     * */
         String simpleGetLockName(String name,String[] keys);
     }
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-repeat-execute-limit-framework/src/main/java/com/damai/config/RepeatExecuteLimitAutoConfiguration.java b/damai-redisson-framework/damai-redisson-service-framework/damai-repeat-execute-limit-framework/src/main/java/com/damai/config/RepeatExecuteLimitAutoConfiguration.java
    index f8d4b2d596d89f8961397ee749951e4dfccb9c80..0e86297c9bebcc2b64a412ffc90437da3699d6df 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-repeat-execute-limit-framework/src/main/java/com/damai/config/RepeatExecuteLimitAutoConfiguration.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-repeat-execute-limit-framework/src/main/java/com/damai/config/RepeatExecuteLimitAutoConfiguration.java
    @@ -18,13 +18,16 @@ import org.springframework.context.annotation.Bean;
     public class RepeatExecuteLimitAutoConfiguration {
         
         @Bean(LockInfoType.REPEAT_EXECUTE_LIMIT)
    -    public LockInfoHandle serviceLockInfoHandle(){
    +    public LockInfoHandle repeatExecuteLimitHandle(){
             return new RepeatExecuteLimitLockInfoHandle();
         }
         
         @Bean
    -    public RepeatExecuteLimitAspect repeatExecuteLimitAspect(LocalLockCache localLockCache,LockInfoHandleFactory lockInfoHandleFactory,
    -                                                             ServiceLockFactory serviceLockFactory,RedissonDataHandle redissonDataHandle){
    +    public RepeatExecuteLimitAspect repeatExecuteLimitAspect(LocalLockCache localLockCache,
    +                                                             LockInfoHandleFactory lockInfoHandleFactory,
    +                                                             ServiceLockFactory serviceLockFactory,
    +                                                             RedissonDataHandle redissonDataHandle){
             return new RepeatExecuteLimitAspect(localLockCache, lockInfoHandleFactory,serviceLockFactory,redissonDataHandle);
         }
     }
    +    
    \ No newline at end of file
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-repeat-execute-limit-framework/src/main/java/com/damai/core/RepeatExecuteLimitConstants.java b/damai-redisson-framework/damai-redisson-service-framework/damai-repeat-execute-limit-framework/src/main/java/com/damai/core/RepeatExecuteLimitConstants.java
    index 108a3fb2b46098658b999bdfc84ca862d5271e40..902ef3e2142b855e86185714a9685dfc8413ed32 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-repeat-execute-limit-framework/src/main/java/com/damai/core/RepeatExecuteLimitConstants.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-repeat-execute-limit-framework/src/main/java/com/damai/core/RepeatExecuteLimitConstants.java
    @@ -2,8 +2,14 @@ package com.damai.core;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 常量
    + * @description: 防重复幂等业务名管理
      * @author: 阿宽不是程序员
      **/
     public class RepeatExecuteLimitConstants {
    +    
    +    public static final String CONSUMER_API_DATA_MESSAGE = "consumer_api_data_message";
    +    
    +    public static final String CREATE_PROGRAM_ORDER = "create_program_order";
    +   
    +    public final static String CANCEL_PROGRAM_ORDER = "cancel_program_order";
     }
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-repeat-execute-limit-framework/src/main/java/com/damai/repeatexecutelimit/aspect/RepeatExecuteLimitAspect.java b/damai-redisson-framework/damai-redisson-service-framework/damai-repeat-execute-limit-framework/src/main/java/com/damai/repeatexecutelimit/aspect/RepeatExecuteLimitAspect.java
    index b93b76d98cdcea810a809a66d8c05c1fa9365820..3281c61c609ff26222df03b75d29188cf264a704 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-repeat-execute-limit-framework/src/main/java/com/damai/repeatexecutelimit/aspect/RepeatExecuteLimitAspect.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-repeat-execute-limit-framework/src/main/java/com/damai/repeatexecutelimit/aspect/RepeatExecuteLimitAspect.java
    @@ -31,7 +31,7 @@ import static com.damai.repeatexecutelimit.constant.RepeatExecuteLimitConstant.S
      **/
     @Slf4j
     @Aspect
    -@Order(-9)
    +@Order(-11)
     @AllArgsConstructor
     public class RepeatExecuteLimitAspect {
         
    @@ -52,22 +52,18 @@ public class RepeatExecuteLimitAspect {
             LockInfoHandle lockInfoHandle = lockInfoHandleFactory.getLockInfoHandle(LockInfoType.REPEAT_EXECUTE_LIMIT);
             String lockName = lockInfoHandle.getLockName(joinPoint,repeatLimit.name(), repeatLimit.keys());
             String repeatFlagName = PREFIX_NAME + lockName;
    -        Object flagObject;
    -        if (durationTime > 0) {
    -            flagObject = redissonDataHandle.get(repeatFlagName);
    -            if (SUCCESS_FLAG.equals(flagObject)) {
    -                throw new DaMaiFrameException(message);
    -            }
    +        String flagObject = redissonDataHandle.get(repeatFlagName);
    +        if (SUCCESS_FLAG.equals(flagObject)) {
    +            throw new DaMaiFrameException(message);
             }
    -        ReentrantLock localLock = localLockCache.getLock(lockName,false);
    +        ReentrantLock localLock = localLockCache.getLock(lockName,true);
             boolean localLockResult = localLock.tryLock();
             if (!localLockResult) {
                 throw new DaMaiFrameException(message);
             }
             try {
    -            ServiceLocker lock = serviceLockFactory.getLock(LockType.Reentrant);
    +            ServiceLocker lock = serviceLockFactory.getLock(LockType.Fair);
                 boolean result = lock.tryLock(lockName, TimeUnit.SECONDS, 0);
    -            //加锁成功执行
                 if (result) {
                     try{
                         flagObject = redissonDataHandle.get(repeatFlagName);
    @@ -75,10 +71,12 @@ public class RepeatExecuteLimitAspect {
                             throw new DaMaiFrameException(message);
                         }
                         obj = joinPoint.proceed();
    -                    try {
    -                        redissonDataHandle.set(repeatFlagName,SUCCESS_FLAG,durationTime,TimeUnit.SECONDS);
    -                    }catch (Exception e) {
    -                        log.error("getBucket error",e);
    +                    if (durationTime > 0) {
    +                        try {
    +                            redissonDataHandle.set(repeatFlagName,SUCCESS_FLAG,durationTime,TimeUnit.SECONDS);
    +                        }catch (Exception e) {
    +                            log.error("getBucket error",e);
    +                        }
                         }
                         return obj;
                     } finally {
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/config/ServiceLockAutoConfiguration.java b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/config/ServiceLockAutoConfiguration.java
    index f3a3e6d709d827aee257361375e37ce94bb70d31..82ed393c1ed679c7ab838a988c73f4b9e14d562e 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/config/ServiceLockAutoConfiguration.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/config/ServiceLockAutoConfiguration.java
    @@ -6,10 +6,8 @@ import com.damai.lockinfo.factory.LockInfoHandleFactory;
     import com.damai.lockinfo.impl.ServiceLockInfoHandle;
     import com.damai.servicelock.aspect.ServiceLockAspect;
     import com.damai.servicelock.factory.ServiceLockFactory;
    -import com.damai.util.RBloomFilterUtil;
     import com.damai.util.ServiceLockTool;
     import org.redisson.api.RedissonClient;
    -import org.springframework.boot.context.properties.EnableConfigurationProperties;
     import org.springframework.context.annotation.Bean;
     
     /**
    @@ -17,7 +15,6 @@ import org.springframework.context.annotation.Bean;
      * @description: 分布式锁 配置
      * @author: 阿宽不是程序员
      **/
    -@EnableConfigurationProperties(RedissonProperties.class)
     public class ServiceLockAutoConfiguration {
         
         @Bean(LockInfoType.SERVICE_LOCK)
    @@ -39,12 +36,4 @@ public class ServiceLockAutoConfiguration {
         public ServiceLockTool serviceLockUtil(LockInfoHandleFactory lockInfoHandleFactory,ServiceLockFactory serviceLockFactory){
             return new ServiceLockTool(lockInfoHandleFactory,serviceLockFactory);
         }
    -    
    -    /**
    -     * 布隆过滤器
    -     */
    -    @Bean
    -    public RBloomFilterUtil rBloomFilterUtil(RedissonClient redissonClient, RedissonProperties redissonProperties) {
    -        return new RBloomFilterUtil(redissonClient,redissonProperties);
    -    }
     }
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/core/DistributedLockConstants.java b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/core/DistributedLockConstants.java
    index 0d88abb0b59e34821f92b43aad7198c0dded39f2..5c57f4b13ba6dd1076b33643298fb0aa1304289e 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/core/DistributedLockConstants.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/core/DistributedLockConstants.java
    @@ -10,8 +10,7 @@ public class DistributedLockConstants {
         /**
          * 	分布式id datacenterId
          * */
    -    public static final String  DATACENTER_Id = "datacenter_id";
    -    
    +    public static final String DATACENTER_ID = "datacenter_id";
         /**
          * api统计定时任务
          * */
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/ServiceLocker.java b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/ServiceLocker.java
    index c7a4145e6276e7bc59e758ba70b9750808af983e..69d097c2ce7deec3581e9fb6d41ce538a73a0941 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/ServiceLocker.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/ServiceLocker.java
    @@ -11,19 +11,65 @@ import java.util.concurrent.TimeUnit;
      **/
     public interface ServiceLocker {
         
    +    /**
    +     * 获取锁
    +     * @param lockKey 锁的key
    +     * @return 结果
    +     * */
         RLock getLock(String lockKey);
    -
    +    
    +    /**
    +     * 加锁
    +     * @param lockKey 锁的key
    +     * @return 结果
    +     * */
         RLock lock(String lockKey);
    -
    +    
    +    /**
    +     * 加锁
    +     * @param lockKey 锁的key
    +     * @param leaseTime 释放时间
    +     * @return 结果
    +     * */
         RLock lock(String lockKey, long leaseTime);
    -
    +    
    +    /**
    +     * 加锁
    +     * @param lockKey 锁的key
    +     * @param unit 时间单位
    +     * @param leaseTime 释放时间
    +     * @return 结果
    +     * */
         RLock lock(String lockKey, TimeUnit unit, long leaseTime);
    -
    +    
    +    /**
    +     * 加锁
    +     * @param lockKey 锁的key
    +     * @param unit 时间单位
    +     * @param waitTime 等待时间
    +     * @return 结果
    +     * */
         boolean tryLock(String lockKey, TimeUnit unit, long waitTime);
         
    +    /**
    +     * 加锁
    +     * @param lockKey 锁的key
    +     * @param unit 时间单位
    +     * @param waitTime 等待时间
    +     * @param leaseTime 释放时间
    +     * @return 结果
    +     * */
         boolean tryLock(String lockKey, TimeUnit unit, long waitTime, long leaseTime);
    -
    +    
    +    /**
    +     * 解锁
    +     * @param lockKey 锁的key
    +     * */
         void unlock(String lockKey);
    -
    +    
    +    /**
    +     * 解锁
    +     * @param lock 锁
    +     * */
         void unlock(RLock lock);
     }
    \ No newline at end of file
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/aspect/ServiceLockAspect.java b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/aspect/ServiceLockAspect.java
    index bad8ce31cafb3df86a28d3e4c55b6097ea9d1395..d93c62ede5062136cdb8c70bab2e08b148a15948 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/aspect/ServiceLockAspect.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/aspect/ServiceLockAspect.java
    @@ -1,7 +1,7 @@
     package com.damai.servicelock.aspect;
     
     import com.damai.constant.LockInfoType;
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import com.damai.lockinfo.LockInfoHandle;
     import com.damai.lockinfo.factory.LockInfoHandleFactory;
     import com.damai.servicelock.LockType;
    @@ -56,12 +56,10 @@ public class ServiceLockAspect {
                 }
             }else {
                 log.warn("Timeout while acquiring serviceLock:{}",lockName);
    -            //加锁失败,如果设置了自定义处理,则执行
                 String customLockTimeoutStrategy = servicelock.customLockTimeoutStrategy();
                 if (StringUtil.isNotEmpty(customLockTimeoutStrategy)) {
                     return handleCustomLockTimeoutStrategy(customLockTimeoutStrategy, joinPoint);
                 }else{
    -                //默认处理
                     servicelock.lockTimeoutStrategy().handler(lockName);
                 }
                 return joinPoint.proceed();
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/info/LockTimeOutHandler.java b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/info/LockTimeOutHandler.java
    index b4b2e2d0be525e0560c64c375e5023acff281c00..7b6d1f9a24ea3eb4ee88e4e3268c5717b7d2554e 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/info/LockTimeOutHandler.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/info/LockTimeOutHandler.java
    @@ -6,6 +6,10 @@ package com.damai.servicelock.info;
      * @author: 阿宽不是程序员
      **/
     public interface LockTimeOutHandler {
    -
    +    
    +    /**
    +     * 处理
    +     * @param lockName 锁名
    +     * */
         void handler(String lockName);
     }
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/info/LockTimeOutStrategy.java b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/info/LockTimeOutStrategy.java
    index 3e97aecbec17cb3d3c941a203b9c4253dbc761d4..d754c0da6faa3d11f743d159361560aecb612686 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/info/LockTimeOutStrategy.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/servicelock/info/LockTimeOutStrategy.java
    @@ -7,7 +7,9 @@ package com.damai.servicelock.info;
      * @author: 阿宽不是程序员
      **/
     public enum LockTimeOutStrategy implements LockTimeOutHandler{
    -
    +    /**
    +     * 快速失败
    +     * */
         FAIL(){
             @Override
             public void handler(String lockName) {
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/util/TaskCall.java b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/util/TaskCall.java
    index fd3f68d8a8c13a0a2d3d71bc737b6b6ac094dbf7..14a7089294a632eba665b767d94b87d41b0b4dd7 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/util/TaskCall.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/util/TaskCall.java
    @@ -8,5 +8,9 @@ package com.damai.util;
     @FunctionalInterface
     public interface TaskCall {
     
    +    /**
    +     * 执行任务
    +     * @return 结果
    +     * */
         V call();
     }
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/util/TaskRun.java b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/util/TaskRun.java
    index be4636089b9c65fe4e103f2f84f0c93ee0479834..91e692562cbed3f5aa3388683ea7838971b7eca5 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/util/TaskRun.java
    +++ b/damai-redisson-framework/damai-redisson-service-framework/damai-service-lock-framework/src/main/java/com/damai/util/TaskRun.java
    @@ -7,6 +7,9 @@ package com.damai.util;
      **/
     @FunctionalInterface
     public interface TaskRun {
    -
    +    
    +    /**
    +     * 执行任务
    +     * */
         void run();
     }
    diff --git a/damai-redisson-framework/damai-redisson-service-framework/pom.xml b/damai-redisson-framework/damai-redisson-service-framework/pom.xml
    index 1d4f32d2885c05441ce9ddce172b0355146a096a..b0778c026491e912a0a1879ad2a42bb07517eef7 100644
    --- a/damai-redisson-framework/damai-redisson-service-framework/pom.xml
    +++ b/damai-redisson-framework/damai-redisson-service-framework/pom.xml
    @@ -18,6 +18,7 @@
             damai-redisson-common-framework
     		damai-service-lock-framework
             damai-repeat-execute-limit-framework
    +        damai-bloom-filter-framework
         
     
     
    diff --git a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/config/DelayQueueAutoConfig.java b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/config/DelayQueueAutoConfig.java
    index a87b0337daac9bd191c9c98409a062b39b8f2f8e..1ef613d7ed07435c4bc9746d67559f64c1a11bc5 100644
    --- a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/config/DelayQueueAutoConfig.java
    +++ b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/config/DelayQueueAutoConfig.java
    @@ -1,6 +1,7 @@
     package com.damai.config;
     
     
    +import com.damai.context.DelayQueueBasePart;
     import com.damai.context.DelayQueueContext;
     import com.damai.event.DelayQueueInitHandler;
     import org.redisson.api.RedissonClient;
    @@ -16,12 +17,17 @@ import org.springframework.context.annotation.Bean;
     public class DelayQueueAutoConfig {
         
         @Bean
    -    public DelayQueueInitHandler DelayQueueInitHandler(DelayQueueProperties delayQueueProperties, RedissonClient redissonClient){
    -        return new DelayQueueInitHandler(delayQueueProperties, redissonClient);
    +    public DelayQueueInitHandler delayQueueInitHandler(DelayQueueBasePart delayQueueBasePart){
    +        return new DelayQueueInitHandler(delayQueueBasePart);
         }
    -    
    +   
    +    @Bean
    +    public DelayQueueBasePart delayQueueBasePart(RedissonClient redissonClient,DelayQueueProperties delayQueueProperties){
    +        return new DelayQueueBasePart(redissonClient,delayQueueProperties);
    +    }
    +  
         @Bean
    -    public DelayQueueContext delayQueueContext(DelayQueueProperties delayQueueProperties, RedissonClient redissonClient){
    -        return new DelayQueueContext(delayQueueProperties,redissonClient);
    +    public DelayQueueContext delayQueueContext(DelayQueueBasePart delayQueueBasePart){
    +        return new DelayQueueContext(delayQueueBasePart);
         }
     }
    diff --git a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueueBasePart.java b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueueBasePart.java
    index bfdd98775958db2fcf3e06d3bfae665124400c2c..371d36dea5e5e676202fef6056acb00894bb25cb 100644
    --- a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueueBasePart.java
    +++ b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueueBasePart.java
    @@ -7,20 +7,14 @@ import org.redisson.api.RedissonClient;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 延迟队列 分片
    + * @description: 延迟队列配置信息
      * @author: 阿宽不是程序员
      **/
     @Data
     @AllArgsConstructor
     public class DelayQueueBasePart {
         
    -    /**
    -     * redisson客户端
    -     * */
         private final RedissonClient redissonClient;
         
    -    /**
    -     * 配置信息
    -     * */
         private final DelayQueueProperties delayQueueProperties;
     }
    diff --git a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueueContext.java b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueueContext.java
    index dcaf814a41c0bc3e1357f6973593412c01b588c3..20c9bc5d15bc9b5401d0d256ed5d34cf7a33df65 100644
    --- a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueueContext.java
    +++ b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueueContext.java
    @@ -1,8 +1,5 @@
     package com.damai.context;
     
    -import com.damai.config.DelayQueueProperties;
    -import org.redisson.api.RedissonClient;
    -
     import java.util.Map;
     import java.util.concurrent.ConcurrentHashMap;
     import java.util.concurrent.TimeUnit;
    @@ -14,22 +11,19 @@ import java.util.concurrent.TimeUnit;
      **/
     public class DelayQueueContext {
         
    -    private final DelayQueueProperties delayQueueProperties;
    -    
    -    private final RedissonClient redissonClient;
    -    
    +    private final DelayQueueBasePart delayQueueBasePart;
    +    /**
    +     * key为topic主题,value为发送消息的处理器
    +     * */
         private final Map delayQueueProduceCombineMap = new ConcurrentHashMap<>();
         
    -    public DelayQueueContext(DelayQueueProperties delayQueueProperties,RedissonClient redissonClient){
    -        this.delayQueueProperties = delayQueueProperties;
    -        this.redissonClient = redissonClient;
    +    public DelayQueueContext(DelayQueueBasePart delayQueueBasePart){
    +        this.delayQueueBasePart = delayQueueBasePart;
         }
         
         public void sendMessage(String topic,String content,long delayTime, TimeUnit timeUnit) {
    -        DelayQueueProduceCombine delayQueueProduceCombine = delayQueueProduceCombineMap.computeIfAbsent(topic,k -> {
    -            DelayQueueBasePart delayQueueBasePart = new DelayQueueBasePart(redissonClient,delayQueueProperties);
    -            return new DelayQueueProduceCombine(delayQueueBasePart,topic);
    -        });
    +        DelayQueueProduceCombine delayQueueProduceCombine = delayQueueProduceCombineMap.computeIfAbsent(
    +                topic, k -> new DelayQueueProduceCombine(delayQueueBasePart,topic));
             delayQueueProduceCombine.offer(content,delayTime,timeUnit);
         }
     }
    diff --git a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueuePart.java b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueuePart.java
    index 7659e330883c3a4a33eef54c3c9574fa3bfd66b4..f13fa2565246ccd1ad8e03c6ee633e92a99d4260 100644
    --- a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueuePart.java
    +++ b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueuePart.java
    @@ -1,25 +1,22 @@
     package com.damai.context;
     
    -import com.damai.config.DelayQueueProperties;
     import com.damai.core.ConsumerTask;
     import lombok.Data;
    -import org.redisson.api.RedissonClient;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 延迟队列 消费分片
    + * @description: 消息主题
      * @author: 阿宽不是程序员
      **/
     @Data
    -public class DelayQueuePart extends DelayQueueBasePart {
    +public class DelayQueuePart {
         
    -    /**
    -     * 客户端对象
    -     * */
    +    private final DelayQueueBasePart delayQueueBasePart;
    + 
         private final ConsumerTask consumerTask;
         
    -    public DelayQueuePart(RedissonClient redissonClient, DelayQueueProperties delayQueueProperties, ConsumerTask consumerTask){
    -        super(redissonClient,delayQueueProperties);
    +    public DelayQueuePart(DelayQueueBasePart delayQueueBasePart, ConsumerTask consumerTask){
    +        this.delayQueueBasePart = delayQueueBasePart;
             this.consumerTask = consumerTask;
         }
     }
    diff --git a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueueProduceCombine.java b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueueProduceCombine.java
    index 92938314b00954adea8394fc0c5ebd658fbd8202..cd5777c90b78a7b28a65681144835d839cf1eb55 100644
    --- a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueueProduceCombine.java
    +++ b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/context/DelayQueueProduceCombine.java
    @@ -2,7 +2,6 @@ package com.damai.context;
     
     import com.damai.core.DelayProduceQueue;
     import com.damai.core.IsolationRegionSelector;
    -import com.damai.core.SpringUtil;
     
     import java.util.ArrayList;
     import java.util.List;
    @@ -23,8 +22,7 @@ public class DelayQueueProduceCombine {
             Integer isolationRegionCount = delayQueueBasePart.getDelayQueueProperties().getIsolationRegionCount();
             isolationRegionSelector =new IsolationRegionSelector(isolationRegionCount);
             for(int i = 0; i < isolationRegionCount; i++) {
    -            delayProduceQueueList.add(new DelayProduceQueue(delayQueueBasePart.getRedissonClient(), 
    -                    SpringUtil.getPrefixDistinctionName() + "-" + topic + "-" + i));
    +            delayProduceQueueList.add(new DelayProduceQueue(delayQueueBasePart.getRedissonClient(),topic + "-" + i));
             }
         }
         
    diff --git a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/core/ConsumerTask.java b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/core/ConsumerTask.java
    index ec045e3e501b24caab661ac2678b8e2310927f4e..658aae299f85566cc130eb4ab1e19e795379abbd 100644
    --- a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/core/ConsumerTask.java
    +++ b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/core/ConsumerTask.java
    @@ -7,7 +7,14 @@ package com.damai.core;
      **/
     public interface ConsumerTask {
         
    +    /**
    +     * 消费任务
    +     * @param content 具体参数
    +     * */
         void execute(String content);
    -    
    +    /**
    +     * 主题
    +     * @return 主题
    +     * */
         String topic();
     }
    diff --git a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/core/DelayConsumerQueue.java b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/core/DelayConsumerQueue.java
    index c059061017917f676209a767bde0240ce6b4f1d7..99b6acd67f58c31fcdb39a93005b34eb5c0d81db 100644
    --- a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/core/DelayConsumerQueue.java
    +++ b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/core/DelayConsumerQueue.java
    @@ -7,6 +7,7 @@ import java.util.Objects;
     import java.util.concurrent.ExecutorService;
     import java.util.concurrent.LinkedBlockingQueue;
     import java.util.concurrent.ThreadPoolExecutor;
    +import java.util.concurrent.TimeUnit;
     import java.util.concurrent.atomic.AtomicBoolean;
     import java.util.concurrent.atomic.AtomicInteger;
     
    @@ -18,36 +19,43 @@ import java.util.concurrent.atomic.AtomicInteger;
     @Slf4j
     public class DelayConsumerQueue extends DelayBaseQueue{
         
    -    private final AtomicInteger threadCount = new AtomicInteger(1);
    +    private final AtomicInteger listenStartThreadCount = new AtomicInteger(1);
         
    -    private final ExecutorService executorService;
    +    private final AtomicInteger executeTaskThreadCount = new AtomicInteger(1);
    +    
    +    private final ThreadPoolExecutor listenStartThreadPool;
    +    
    +    private final ThreadPoolExecutor executeTaskThreadPool;
         
         private final AtomicBoolean runFlag = new AtomicBoolean(false);
         
         private final ConsumerTask consumerTask;
         
         public DelayConsumerQueue(DelayQueuePart delayQueuePart, String relTopic){
    -        super(delayQueuePart.getRedissonClient(),relTopic);
    -        this.executorService = new ThreadPoolExecutor(
    -                delayQueuePart.getDelayQueueProperties().getCorePoolSize(),
    -                delayQueuePart.getDelayQueueProperties().getMaximumPoolSize(),
    -                delayQueuePart.getDelayQueueProperties().getKeepAliveTime(),
    -                delayQueuePart.getDelayQueueProperties().getUnit(),
    -                new LinkedBlockingQueue<>(delayQueuePart.getDelayQueueProperties().getWorkQueueSize()),
    +        super(delayQueuePart.getDelayQueueBasePart().getRedissonClient(),relTopic);
    +        this.listenStartThreadPool = new ThreadPoolExecutor(1,1,60, 
    +                TimeUnit.SECONDS,new LinkedBlockingQueue<>(),r -> new Thread(Thread.currentThread().getThreadGroup(), r,
    +                "listen-start-thread-" + listenStartThreadCount.getAndIncrement()));
    +        this.executeTaskThreadPool = new ThreadPoolExecutor(
    +                delayQueuePart.getDelayQueueBasePart().getDelayQueueProperties().getCorePoolSize(),
    +                delayQueuePart.getDelayQueueBasePart().getDelayQueueProperties().getMaximumPoolSize(),
    +                delayQueuePart.getDelayQueueBasePart().getDelayQueueProperties().getKeepAliveTime(),
    +                delayQueuePart.getDelayQueueBasePart().getDelayQueueProperties().getUnit(),
    +                new LinkedBlockingQueue<>(delayQueuePart.getDelayQueueBasePart().getDelayQueueProperties().getWorkQueueSize()),
                     r -> new Thread(Thread.currentThread().getThreadGroup(), r, 
    -                        "delay-queue-consume-thread-" + threadCount.getAndIncrement()));
    +                        "delay-queue-consume-thread-" + executeTaskThreadCount.getAndIncrement()));
             this.consumerTask = delayQueuePart.getConsumerTask();
         }
         
         public synchronized void listenStart(){
             if (!runFlag.get()) {
                 runFlag.set(true);
    -            new Thread(Thread.currentThread().getThreadGroup(), () -> {
    +            listenStartThreadPool.execute(() -> {
                     while (!Thread.interrupted()) {
                         try {
                             assert blockingQueue != null;
                             String content = blockingQueue.take();
    -                        executorService.execute(() -> {
    +                        executeTaskThreadPool.execute(() -> {
                                 try {
                                     consumerTask.execute(content);
                                 }catch (Exception e) {
    @@ -55,12 +63,12 @@ public class DelayConsumerQueue extends DelayBaseQueue{
                                 }
                             });
                         } catch (InterruptedException e) {
    -                        destroy(executorService);
    +                        destroy(executeTaskThreadPool);
                         } catch (Throwable e) {
                             log.error("blockingQueue take error",e);
                         }
                     }
    -            }, "listen-thread").start();
    +            });
             }
         }
         
    diff --git a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/event/DelayQueueInitHandler.java b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/event/DelayQueueInitHandler.java
    index 58f242a4f907bc81a391ba4a88835e7421022dbb..3cb87e594bc53cd76370c497751bd2f7e977cef6 100644
    --- a/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/event/DelayQueueInitHandler.java
    +++ b/damai-redisson-framework/damai-service-delay-queue-framework/src/main/java/com/damai/event/DelayQueueInitHandler.java
    @@ -1,44 +1,43 @@
     package com.damai.event;
     
     import cn.hutool.core.collection.CollectionUtil;
    -import com.damai.config.DelayQueueProperties;
    +import com.damai.context.DelayQueueBasePart;
     import com.damai.context.DelayQueuePart;
     import com.damai.core.ConsumerTask;
     import com.damai.core.DelayConsumerQueue;
    -import com.damai.core.SpringUtil;
     import lombok.AllArgsConstructor;
    -import org.redisson.api.RedissonClient;
     import org.springframework.boot.context.event.ApplicationStartedEvent;
     import org.springframework.context.ApplicationListener;
     
     import java.util.Map;
     
     /**
    - * DelayQueueInitHandler 类用于处理应用程序启动事件。
    - */
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 处理应用程序启动事件
    + * @author: 阿宽不是程序员
    + **/
     @AllArgsConstructor
     public class DelayQueueInitHandler implements ApplicationListener {
         
    -    private final DelayQueueProperties delayQueueProperties;
    -    
    -    private final RedissonClient redissonClient;
    +    private final DelayQueueBasePart delayQueueBasePart;
         
         @Override
         public void onApplicationEvent(ApplicationStartedEvent event) {
    +
             Map consumerTaskMap = event.getApplicationContext().getBeansOfType(ConsumerTask.class);
             if (CollectionUtil.isEmpty(consumerTaskMap)) {
                 return;
             }
             for (ConsumerTask consumerTask : consumerTaskMap.values()) {
    -            DelayQueuePart delayQueuePart = new DelayQueuePart(redissonClient,delayQueueProperties,consumerTask);
    -            Integer isolationRegionCount = delayQueuePart.getDelayQueueProperties().getIsolationRegionCount();
    +            DelayQueuePart delayQueuePart = new DelayQueuePart(delayQueueBasePart,consumerTask);
    +            Integer isolationRegionCount = delayQueuePart.getDelayQueueBasePart().getDelayQueueProperties()
    +                    .getIsolationRegionCount();
    +            
                 for(int i = 0; i < isolationRegionCount; i++) {
                     DelayConsumerQueue delayConsumerQueue = new DelayConsumerQueue(delayQueuePart, 
    -                        SpringUtil.getPrefixDistinctionName() + "-" + delayQueuePart.getConsumerTask().topic() + "-" + i);
    +                        delayQueuePart.getConsumerTask().topic() + "-" + i);
                     delayConsumerQueue.listenStart();
                 }
             }
         }
    -    
    -    
     }
    diff --git a/damai-server-client/damai-base-data-client/src/main/java/com/damai/client/BaseDataClient.java b/damai-server-client/damai-base-data-client/src/main/java/com/damai/client/BaseDataClient.java
    index 1c29cd7f44d82028264c41d712697c0e12a397b0..bed0a5fe23084b18ea696ae54fb12265edcaf171 100644
    --- a/damai-server-client/damai-base-data-client/src/main/java/com/damai/client/BaseDataClient.java
    +++ b/damai-server-client/damai-base-data-client/src/main/java/com/damai/client/BaseDataClient.java
    @@ -13,24 +13,44 @@ import org.springframework.web.bind.annotation.PostMapping;
     
     import java.util.List;
     
    +import static com.damai.constant.Constant.SPRING_INJECT_PREFIX_DISTINCTION_NAME;
    +
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
      * @description: 基础数据服务 feign
      * @author: 阿宽不是程序员
      **/
     @Component
    -@FeignClient(value = "base-data-service",fallback = BaseDataClientFallback.class)
    +@FeignClient(value = SPRING_INJECT_PREFIX_DISTINCTION_NAME+"-"+"base-data-service",fallback = BaseDataClientFallback.class)
     public interface BaseDataClient {
    -    
    +    /**
    +     * 根据code查询数据
    +     * @param dto 参数
    +     * @return 结果
    +     * */
         @PostMapping("/channel/data/getByCode")
         ApiResponse getByCode(GetChannelDataByCodeDto dto);
         
    +    /**
    +     * 查询token数据
    +     * @return 结果
    +     * */
         @PostMapping(value = "/get")
         ApiResponse get();
         
    +    /**
    +     * 根据id集合查询地区列表
    +     * @param dto 参数
    +     * @return 结果
    +     * */
         @PostMapping(value = "/area/selectByIdList")
    -    ApiResponse> selectByIdList(AreaSelectDto areaSelectDto);
    +    ApiResponse> selectByIdList(AreaSelectDto dto);
         
    +    /**
    +     * 根据id查询地区
    +     * @param dto 参数
    +     * @return 结果
    +     * */
         @PostMapping(value = "/area/getById")
    -    ApiResponse getById(AreaGetDto areaGetDto);
    +    ApiResponse getById(AreaGetDto dto);
     }
    diff --git a/damai-server-client/damai-base-data-client/src/main/java/com/damai/dto/ChannelDataAddDto.java b/damai-server-client/damai-base-data-client/src/main/java/com/damai/dto/ChannelDataAddDto.java
    index a08dba49cb57725d48f72027c5216874260945ef..44f7ee0d360cf7758a79b25113787836f32c79af 100644
    --- a/damai-server-client/damai-base-data-client/src/main/java/com/damai/dto/ChannelDataAddDto.java
    +++ b/damai-server-client/damai-base-data-client/src/main/java/com/damai/dto/ChannelDataAddDto.java
    @@ -43,4 +43,8 @@ public class ChannelDataAddDto {
         @ApiModelProperty(name ="dataSecretKey", dataType ="String", value ="rsa参数私钥")
         private String dataSecretKey;
         
    +    @ApiModelProperty(name ="tokenSecret", dataType ="String", value ="token秘钥", required =true)
    +    @NotBlank
    +    private String tokenSecret;;
    +    
     }
    diff --git a/damai-server-client/damai-base-data-client/src/main/java/com/damai/vo/GetChannelDataVo.java b/damai-server-client/damai-base-data-client/src/main/java/com/damai/vo/GetChannelDataVo.java
    index 4ea5a1fb92e06a4386916a609edb9609d4e3d2d6..ab18a22412ff667998fbe0bb11faddb534b8b33c 100644
    --- a/damai-server-client/damai-base-data-client/src/main/java/com/damai/vo/GetChannelDataVo.java
    +++ b/damai-server-client/damai-base-data-client/src/main/java/com/damai/vo/GetChannelDataVo.java
    @@ -46,4 +46,7 @@ public class GetChannelDataVo {
         
         @ApiModelProperty(name ="dataSecretKey", dataType ="String", value ="rsa参数私钥", required =true)
         private String dataSecretKey;
    +    
    +    @ApiModelProperty(name ="tokenSecret", dataType ="String", value ="token秘钥", required =true)
    +    private String tokenSecret;
     }
    \ No newline at end of file
    diff --git a/damai-server-client/damai-job-client/src/main/java/com/damai/client/JobClient.java b/damai-server-client/damai-job-client/src/main/java/com/damai/client/JobClient.java
    index 6b428fa4dedc908697ac3d53fb648c879e467249..384725f14f90ccb10860d3a5f058c2195a583bb6 100644
    --- a/damai-server-client/damai-job-client/src/main/java/com/damai/client/JobClient.java
    +++ b/damai-server-client/damai-job-client/src/main/java/com/damai/client/JobClient.java
    @@ -10,15 +10,22 @@ import org.springframework.web.bind.annotation.RequestMethod;
     
     import javax.validation.Valid;
     
    +import static com.damai.constant.Constant.SPRING_INJECT_PREFIX_DISTINCTION_NAME;
    +
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
      * @description: job服务 feign
      * @author: 阿宽不是程序员
      **/
     @Component
    -@FeignClient(value = "job-service",fallback = JobClientFallback.class)
    +@FeignClient(value = SPRING_INJECT_PREFIX_DISTINCTION_NAME+"-"+"job-service",fallback = JobClientFallback.class)
     public interface JobClient {
         
    +    /**
    +     * 上报任务状态
    +     * @param dto 参数
    +     * @return 结果
    +     * */
         @RequestMapping(value = "jobRunRecord/callBack", method = RequestMethod.POST)
         ApiResponse callBack(@Valid @RequestBody JobCallBackDto dto);
     }
    diff --git a/damai-server-client/damai-order-client/src/main/java/com/damai/client/OrderClient.java b/damai-server-client/damai-order-client/src/main/java/com/damai/client/OrderClient.java
    index acde21e9ee5db327071dfb9c097754e80586a239..beb0ad318e44dd6c804c631263dd258d592c342c 100644
    --- a/damai-server-client/damai-order-client/src/main/java/com/damai/client/OrderClient.java
    +++ b/damai-server-client/damai-order-client/src/main/java/com/damai/client/OrderClient.java
    @@ -6,18 +6,22 @@ import org.springframework.cloud.openfeign.FeignClient;
     import org.springframework.stereotype.Component;
     import org.springframework.web.bind.annotation.PostMapping;
     
    +import static com.damai.constant.Constant.SPRING_INJECT_PREFIX_DISTINCTION_NAME;
    +
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
      * @description: 订单服务 feign
      * @author: 阿宽不是程序员
      **/
     @Component
    -@FeignClient(value = "order-service",fallback = OrderClientFallback.class)
    +@FeignClient(value = SPRING_INJECT_PREFIX_DISTINCTION_NAME+"-"+"order-service",fallback = OrderClientFallback.class)
     public interface OrderClient {
         
         /**
          * 创建订单
    +     * @param dto 参数
    +     * @return 结果
          * */
         @PostMapping("/order/create")
    -    ApiResponse create(OrderCreateDto orderCreateDto);
    +    ApiResponse create(OrderCreateDto dto);
     }
    diff --git a/damai-server-client/damai-pay-client/src/main/java/com/damai/client/PayClient.java b/damai-server-client/damai-pay-client/src/main/java/com/damai/client/PayClient.java
    index c3d2a945bfc9f98ac0608deabe64786c43304a41..7c46cca8759833f436fb4bc1080b771e58cc1e81 100644
    --- a/damai-server-client/damai-pay-client/src/main/java/com/damai/client/PayClient.java
    +++ b/damai-server-client/damai-pay-client/src/main/java/com/damai/client/PayClient.java
    @@ -10,21 +10,35 @@ import org.springframework.cloud.openfeign.FeignClient;
     import org.springframework.stereotype.Component;
     import org.springframework.web.bind.annotation.PostMapping;
     
    +import static com.damai.constant.Constant.SPRING_INJECT_PREFIX_DISTINCTION_NAME;
    +
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
      * @description: 支付服务 feign
      * @author: 阿宽不是程序员
      **/
     @Component
    -@FeignClient(value = "pay-service",fallback = PayClientFallback.class)
    +@FeignClient(value = SPRING_INJECT_PREFIX_DISTINCTION_NAME+"-"+"pay-service",fallback = PayClientFallback.class)
     public interface PayClient {
    -    
    +    /**
    +     * 支付
    +     * @param dto 参数
    +     * @return 结果
    +     * */
         @PostMapping(value = "/pay/common/pay")
    -    ApiResponse commonPay(PayDto payDto);
    -    
    +    ApiResponse commonPay(PayDto dto);
    +    /**
    +     * 回调
    +     * @param dto 参数
    +     * @return 结果
    +     * */
         @PostMapping(value = "/pay/notify")
    -    ApiResponse notify(NotifyDto notifyDto);
    -    
    +    ApiResponse notify(NotifyDto dto);
    +    /**
    +     * 查询支付状态
    +     * @param dto 参数
    +     * @return 结果
    +     * */
         @PostMapping(value = "/pay/trade/check")
    -    ApiResponse tradeCheck(TradeCheckDto tradeCheckDto);
    +    ApiResponse tradeCheck(TradeCheckDto dto);
     }
    diff --git a/damai-server/damai-base-data-service/src/main/java/com/damai/entity/TokenData.java b/damai-server-client/damai-pay-client/src/main/java/com/damai/dto/PayBillDto.java
    similarity index 36%
    rename from damai-server/damai-base-data-service/src/main/java/com/damai/entity/TokenData.java
    rename to damai-server-client/damai-pay-client/src/main/java/com/damai/dto/PayBillDto.java
    index 5ae5985eb30dcb8b71a1316242432a80cc5b4539..cb94cdd59eef7eefb2a7cd4ddf784b7cac7fe6de 100644
    --- a/damai-server/damai-base-data-service/src/main/java/com/damai/entity/TokenData.java
    +++ b/damai-server-client/damai-pay-client/src/main/java/com/damai/dto/PayBillDto.java
    @@ -1,30 +1,24 @@
    -package com.damai.entity;
    +package com.damai.dto;
     
    -import com.damai.data.BaseData;
    +import io.swagger.annotations.ApiModel;
    +import io.swagger.annotations.ApiModelProperty;
     import lombok.Data;
     
    +import javax.validation.constraints.NotNull;
     import java.io.Serializable;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: token 实体
    + * @description: 账单 dto
      * @author: 阿宽不是程序员
      **/
     @Data
    -public class TokenData extends BaseData implements Serializable {
    +@ApiModel(value="PayDto", description ="支付")
    +public class PayBillDto implements Serializable {
         
    -    /**
    -     * id
    -     * */
    -    private Long id;
    +    private static final long serialVersionUID = 1L;
         
    -    /**
    -     * 名称
    -     * */
    -    private String name;
    -    
    -    /**
    -     * token秘钥
    -     * */
    -    private String secret;
    +    @ApiModelProperty(name ="orderNumber", dataType ="Long", value ="订单号")
    +    @NotNull
    +    private String orderNumber;
     }
    diff --git a/damai-server-client/damai-pay-client/src/main/java/com/damai/dto/TradeCheckDto.java b/damai-server-client/damai-pay-client/src/main/java/com/damai/dto/TradeCheckDto.java
    index 8bf095792f7acfdd8c447ece6864ca2d0dfc2fd7..2010a71355e127fb67252f1ec3007eb9249e24ff 100644
    --- a/damai-server-client/damai-pay-client/src/main/java/com/damai/dto/TradeCheckDto.java
    +++ b/damai-server-client/damai-pay-client/src/main/java/com/damai/dto/TradeCheckDto.java
    @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
     import lombok.Data;
     
     import javax.validation.constraints.NotBlank;
    +import java.io.Serializable;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    @@ -13,7 +14,7 @@ import javax.validation.constraints.NotBlank;
      **/
     @Data
     @ApiModel(value="TradeCheckDto", description ="交易状态入参")
    -public class TradeCheckDto {
    +public class TradeCheckDto implements Serializable {
         
         @ApiModelProperty(name ="outTradeNo", dataType ="String", value ="商户订单号", required = true)
         @NotBlank
    diff --git a/damai-server-client/damai-pay-client/src/main/java/com/damai/vo/PayBillVo.java b/damai-server-client/damai-pay-client/src/main/java/com/damai/vo/PayBillVo.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..43235f4449ccff632a59e547ee9f24b29748b00d
    --- /dev/null
    +++ b/damai-server-client/damai-pay-client/src/main/java/com/damai/vo/PayBillVo.java
    @@ -0,0 +1,85 @@
    +package com.damai.vo;
    +
    +import io.swagger.annotations.ApiModelProperty;
    +import lombok.Data;
    +
    +import java.io.Serializable;
    +import java.math.BigDecimal;
    +import java.util.Date;
    +
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 支付账单 实体
    + * @author: 阿宽不是程序员
    + **/
    +@Data
    +public class PayBillVo implements Serializable {
    +
    +    private static final long serialVersionUID = 1L;
    +
    +    /**
    +     * 主键id
    +     */
    +    @ApiModelProperty(name ="id", dataType ="Long", value ="主键id")
    +    private Long id;
    +
    +    /**
    +     * 支付流水号
    +     */
    +    @ApiModelProperty(name ="payNumber", dataType ="String", value ="支付流水号")
    +    private String payNumber;
    +
    +    /**
    +     * 商户订单号
    +     */
    +    @ApiModelProperty(name ="outOrderNo", dataType ="String", value ="商户订单号")
    +    private String outOrderNo;
    +
    +    /**
    +     * 支付渠道
    +     */
    +    @ApiModelProperty(name ="payChannel", dataType ="String", value ="支付渠道")
    +    private String payChannel;
    +
    +    /**
    +     * 支付环境
    +     */
    +    @ApiModelProperty(name ="payScene", dataType ="String", value ="支付环境")
    +    private String payScene;
    +
    +    /**
    +     * 订单标题
    +     */
    +    @ApiModelProperty(name ="subject", dataType ="String", value ="订单标题")
    +    private String subject;
    +
    +    /**
    +     * 三方交易凭证号
    +     */
    +    @ApiModelProperty(name ="tradeNumber", dataType ="String", value ="三方交易凭证号")
    +    private String tradeNumber;
    +
    +    /**
    +     * 支付金额
    +     */
    +    @ApiModelProperty(name ="payAmount", dataType ="String", value ="支付金额")
    +    private BigDecimal payAmount;
    +    
    +    /**
    +     * 支付种类
    +     * */
    +    @ApiModelProperty(name ="payBillType", dataType ="String", value ="支付种类")
    +    private Integer payBillType;
    +
    +    /**
    +     * 支付状态
    +     */
    +    @ApiModelProperty(name ="payBillStatus", dataType ="String", value ="支付状态")
    +    private Integer payBillStatus;
    +
    +    /**
    +     * 支付时间
    +     */
    +    @ApiModelProperty(name ="payTime", dataType ="String", value ="支付时间")
    +    private Date payTime;
    +}
    diff --git a/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramListDto.java b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramListDto.java
    index b6aa57d58d8c03c44c469399130b7870b4edb7e5..d734c0c743ddfd850d8c7e61cb407f29ce9e4bce 100644
    --- a/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramListDto.java
    +++ b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramListDto.java
    @@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
     import lombok.Data;
     
     import javax.validation.constraints.NotNull;
    -import java.util.Date;
    +import javax.validation.constraints.Size;
     import java.util.List;
     
     /**
    @@ -23,10 +23,6 @@ public class ProgramListDto {
         
         @ApiModelProperty(name ="parentProgramCategoryIds", dataType ="Long[]", value ="父节目类型id集合")
         @NotNull
    +    @Size(max = 4)
         private List parentProgramCategoryIds;
    -    
    -    /**
    -     * 业务字段,后端自己填充
    -     * */
    -    private Date time;
     }
    diff --git a/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramPageListDto.java b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramPageListDto.java
    index dd48be95cf0d10f153678d06477f46fd60a9cc4e..05316df3c2a24fa219db8378d80896b86e82880c 100644
    --- a/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramPageListDto.java
    +++ b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramPageListDto.java
    @@ -4,8 +4,8 @@ import io.swagger.annotations.ApiModel;
     import io.swagger.annotations.ApiModelProperty;
     import lombok.Data;
     
    +import javax.validation.constraints.NotNull;
     import java.util.Date;
    -import java.util.List;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    @@ -19,20 +19,19 @@ public class ProgramPageListDto extends BasePageDto{
         @ApiModelProperty(name ="areaId", dataType ="Long", value ="所在区域id")
         private Long areaId;
         
    -    @ApiModelProperty(name ="programCategoryIds", dataType ="Long[]", value ="节目类型id集合")
    -    private List programCategoryIds;
    +    @ApiModelProperty(name ="parentProgramCategoryId", dataType ="Long", value ="父节目类型id")
    +    private Long parentProgramCategoryId;
         
    -    @ApiModelProperty(name ="parentProgramCategoryIds", dataType ="Long[]", value ="父节目类型id集合")
    -    private List parentProgramCategoryIds;
    +    @ApiModelProperty(name ="programCategoryId", dataType ="Long", value ="节目类型id")
    +    private Long programCategoryId;
         
    -    @ApiModelProperty(name ="showDayTime", dataType ="Date", value ="今天/明天/按日历")
    -    private Date showDayTime;
    -    
    -    @ApiModelProperty(name ="timeType", dataType ="int", value ="1:本周内 2:一个月内")
    +    @ApiModelProperty(name ="timeType", dataType ="Integer", value ="0:全部 1:今天 2:明天 3:一周内 4:一个月内 5:按日历")
    +    @NotNull
         private Integer timeType;
         
    -    /**
    -     * 业务字段,后端自己填充
    -     * */
    -    private Date time;
    +    @ApiModelProperty(name ="startDateTime", dataType ="Date", value ="开始时间(如果timeType = 5,此项必填)")
    +    private Date startDateTime;
    +    
    +    @ApiModelProperty(name ="endDateTime", dataType ="Date", value ="结束时间(如果timeType = 5,此项必填)")
    +    private Date endDateTime;
     }
    diff --git a/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramResetExecuteDto.java b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramResetExecuteDto.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..ec475ac4d0aa7fee2de712fb8429afb20a4b3293
    --- /dev/null
    +++ b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramResetExecuteDto.java
    @@ -0,0 +1,21 @@
    +package com.damai.dto;
    +
    +import io.swagger.annotations.ApiModel;
    +import io.swagger.annotations.ApiModelProperty;
    +import lombok.Data;
    +
    +import javax.validation.constraints.NotNull;
    +
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 节目数据重置 dto
    + * @author: 阿宽不是程序员
    + **/
    +@Data
    +@ApiModel(value="ProgramResetExecuteDto", description ="节目数据重置")
    +public class ProgramResetExecuteDto {
    +    
    +    @ApiModelProperty(name ="programId", dataType ="Long", value ="节目id")
    +    @NotNull
    +    private Long programId;
    +}
    diff --git a/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramSearchDto.java b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramSearchDto.java
    index c0bf51ff5341182a00993f82a27803e8f4db3179..6df2bc00b5a3279cbf6179365bad21544acfdb8e 100644
    --- a/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramSearchDto.java
    +++ b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/ProgramSearchDto.java
    @@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel;
     import io.swagger.annotations.ApiModelProperty;
     import lombok.Data;
     
    -import javax.validation.constraints.NotBlank;
    -
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
      * @description: 节目搜索 dto
    @@ -13,9 +11,8 @@ import javax.validation.constraints.NotBlank;
      **/
     @Data
     @ApiModel(value="ProgramSearchDto", description ="节目搜索")
    -public class ProgramSearchDto extends BasePageDto{
    +public class ProgramSearchDto extends ProgramPageListDto{
         
    -    @ApiModelProperty(name ="title", dataType ="String", value ="标题")
    -    @NotBlank
    -    private String title;
    +    @ApiModelProperty(name ="content", dataType ="String", value ="搜索内容")
    +    private String content;
     }
    diff --git a/damai-server-client/damai-program-client/src/main/java/com/damai/dto/SeatBatchAddDto.java b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/SeatBatchAddDto.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..7959d6bb1fc19c17ead64979dc4740cd4e5dafa8
    --- /dev/null
    +++ b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/SeatBatchAddDto.java
    @@ -0,0 +1,26 @@
    +package com.damai.dto;
    +
    +import io.swagger.annotations.ApiModel;
    +import io.swagger.annotations.ApiModelProperty;
    +import lombok.Data;
    +
    +import javax.validation.constraints.NotNull;
    +import java.util.List;
    +
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 节目座位添加 dto
    + * @author: 阿宽不是程序员
    + **/
    +@Data
    +@ApiModel(value="SeatBatchAddDto", description ="节目座位批量添加")
    +public class SeatBatchAddDto {
    +    
    +    @ApiModelProperty(name ="programId", dataType ="Long", value ="节目表id",required = true)
    +    @NotNull
    +    private Long programId;
    +    
    +    @ApiModelProperty(name ="ticketCategoryId", dataType ="SeatBatchRelateInfoAddDto", value ="节目座位相关信息",required = true)
    +    @NotNull
    +    private List seatBatchRelateInfoAddDtoList;
    +}
    diff --git a/damai-server-client/damai-program-client/src/main/java/com/damai/dto/SeatBatchRelateInfoAddDto.java b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/SeatBatchRelateInfoAddDto.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..0a390c351d3e75a9bd8e1e0b083b2adfd5bed132
    --- /dev/null
    +++ b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/SeatBatchRelateInfoAddDto.java
    @@ -0,0 +1,31 @@
    +
    +package com.damai.dto;
    +
    +import io.swagger.annotations.ApiModel;
    +import io.swagger.annotations.ApiModelProperty;
    +import lombok.Data;
    +
    +import javax.validation.constraints.NotNull;
    +import java.math.BigDecimal;
    +
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 节目座位相关信息 dto
    + * @author: 阿宽不是程序员
    + **/
    +@Data
    +@ApiModel(value="SeatBatchRelateInfoAddDto", description ="节目座位相关信息批量添加")
    +public class SeatBatchRelateInfoAddDto {
    +    
    +    @ApiModelProperty(name ="ticketCategoryId", dataType ="Long", value ="节目票档id",required = true)
    +    @NotNull
    +    private Long ticketCategoryId;
    +    
    +    @ApiModelProperty(name ="price", dataType ="BigDecimal", value ="座位价格",required = true)
    +    @NotNull
    +    private BigDecimal price;
    +    
    +    @ApiModelProperty(name ="count", dataType ="Integer", value ="添加的座位数量",required = true)
    +    @NotNull
    +    private Integer count;
    +}
    diff --git a/damai-server-client/damai-program-client/src/main/java/com/damai/dto/SeatListDto.java b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/SeatListDto.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..5d8829dab9ed4e3030d288218b0a854466a729fb
    --- /dev/null
    +++ b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/SeatListDto.java
    @@ -0,0 +1,21 @@
    +package com.damai.dto;
    +
    +import io.swagger.annotations.ApiModel;
    +import io.swagger.annotations.ApiModelProperty;
    +import lombok.Data;
    +
    +import javax.validation.constraints.NotNull;
    +
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 节目座位列表 dto
    + * @author: 阿宽不是程序员
    + **/
    +@Data
    +@ApiModel(value="SeatListDto", description ="节目座位列表")
    +public class SeatListDto {
    +    
    +    @ApiModelProperty(name ="programId", dataType ="Long", value ="节目表id",required = true)
    +    @NotNull
    +    private Long programId;
    +}
    diff --git a/damai-server-client/damai-user-client/src/main/java/com/damai/vo/CheckVerifyVo.java b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/TicketCategoryDto.java
    similarity index 50%
    rename from damai-server-client/damai-user-client/src/main/java/com/damai/vo/CheckVerifyVo.java
    rename to damai-server-client/damai-program-client/src/main/java/com/damai/dto/TicketCategoryDto.java
    index 596aa2164e0f2f1f56c423741d61044890d07e42..b583bc33d058fb4567278685b09ddbfc8768638e 100644
    --- a/damai-server-client/damai-user-client/src/main/java/com/damai/vo/CheckVerifyVo.java
    +++ b/damai-server-client/damai-program-client/src/main/java/com/damai/dto/TicketCategoryDto.java
    @@ -1,18 +1,22 @@
    -package com.damai.vo;
    +package com.damai.dto;
     
     import io.swagger.annotations.ApiModel;
     import io.swagger.annotations.ApiModelProperty;
     import lombok.Data;
     
    +import javax.validation.constraints.NotNull;
    +
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 检查验证码 vo
    + * @description: 节目票档 dto
      * @author: 阿宽不是程序员
      **/
     @Data
    -@ApiModel(value="CheckVerifyVo", description ="检查验证码")
    -public class CheckVerifyVo {
    +@ApiModel(value="TicketCategoryDto", description ="节目票档")
    +public class TicketCategoryDto {
    +    
    +    @ApiModelProperty(name ="id", dataType ="Long", value ="id",required = true)
    +    @NotNull
    +    private Long id;
         
    -    @ApiModelProperty(name ="type", dataType ="Integer", value ="是否需要验证码 1:是 0:否")
    -    private Integer type;
     }
    diff --git a/damai-server-client/damai-program-client/src/main/java/com/damai/vo/ProgramVo.java b/damai-server-client/damai-program-client/src/main/java/com/damai/vo/ProgramVo.java
    index 41a7be5759be7860254c151b9169a8336bce2748..1a14ca7fbbbd074f401c0c3c0a6a97f5065e5f74 100644
    --- a/damai-server-client/damai-program-client/src/main/java/com/damai/vo/ProgramVo.java
    +++ b/damai-server-client/damai-program-client/src/main/java/com/damai/vo/ProgramVo.java
    @@ -49,6 +49,9 @@ public class ProgramVo implements Serializable {
         @ApiModelProperty(name ="parentProgramCategoryId", dataType ="Long", value ="父节目类型表id")
         private Long parentProgramCategoryId;
         
    +    @ApiModelProperty(name ="parentProgramCategoryName", dataType ="String", value ="父节目类型名字")
    +    private String parentProgramCategoryName;
    +    
         @ApiModelProperty(name ="detail", dataType ="String", value ="项目详情")
         private String detail;
         
    @@ -127,6 +130,12 @@ public class ProgramVo implements Serializable {
         @ApiModelProperty(name ="electronicInvoice", dataType ="Integer", value ="电子发票 1:是 0:不是")
         private Integer electronicInvoice;
         
    +    /**
    +     * 高热度节目 0:否 1:是
    +     * */
    +    @ApiModelProperty(name ="highHeat", dataType ="Integer", value ="高热度节目 0:否 1:是")
    +    private Integer highHeat;
    +    
         @ApiModelProperty(name ="programStatus", dataType ="Integer", value ="节目状态 1:上架 0:下架")
         private Integer programStatus;
         
    diff --git a/damai-server-client/damai-program-client/src/main/java/com/damai/vo/SeatRelateInfoVo.java b/damai-server-client/damai-program-client/src/main/java/com/damai/vo/SeatRelateInfoVo.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..fc73d98deeb0f3767b4995c717c326e079f912c8
    --- /dev/null
    +++ b/damai-server-client/damai-program-client/src/main/java/com/damai/vo/SeatRelateInfoVo.java
    @@ -0,0 +1,42 @@
    +package com.damai.vo;
    +
    +import io.swagger.annotations.ApiModel;
    +import io.swagger.annotations.ApiModelProperty;
    +import lombok.Data;
    +
    +import java.io.Serializable;
    +import java.util.Date;
    +import java.util.List;
    +import java.util.Map;
    +
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 座位相关信息 vo
    + * @author: 阿宽不是程序员
    + **/
    +@Data
    +@ApiModel(value="SeatRelateInfoVo", description ="座位相关信息")
    +public class SeatRelateInfoVo implements Serializable {
    +
    +    private static final long serialVersionUID = 1L;
    +    
    +    
    +    @ApiModelProperty(name ="programId", dataType ="Long", value ="节目表id")
    +    private Long programId;
    +    
    +    @ApiModelProperty(name ="place", dataType ="String", value ="地点")
    +    private String place;
    +    
    +    @ApiModelProperty(name ="showTime", dataType ="Date", value ="演出时间")
    +    private Date showTime;
    +    
    +    @ApiModelProperty(name ="showWeekTime", dataType ="String", value ="演出时间所在的星期")
    +    private String showWeekTime;
    +    
    +    @ApiModelProperty(name ="priceList", dataType ="List", value ="价格集合")
    +    private List priceList;
    +    
    +    @ApiModelProperty(name ="seatVoMap", dataType ="Map>", value ="座位集合")
    +    private Map> seatVoMap;
    +   
    +}
    diff --git a/damai-server-client/damai-program-client/src/main/java/com/damai/vo/TicketCategoryDetailVo.java b/damai-server-client/damai-program-client/src/main/java/com/damai/vo/TicketCategoryDetailVo.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..93c182f86be4b3ed7a16531303029e726cc8fd7b
    --- /dev/null
    +++ b/damai-server-client/damai-program-client/src/main/java/com/damai/vo/TicketCategoryDetailVo.java
    @@ -0,0 +1,34 @@
    +package com.damai.vo;
    +
    +import io.swagger.annotations.ApiModel;
    +import io.swagger.annotations.ApiModelProperty;
    +import lombok.Data;
    +
    +import java.math.BigDecimal;
    +
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 节目票档详情 Vo
    + * @author: 阿宽不是程序员
    + **/
    +@Data
    +@ApiModel(value="TicketCategoryDetailVo", description ="节目票档详情")
    +public class TicketCategoryDetailVo {
    +    
    +    @ApiModelProperty(name ="programId", dataType ="Long", value ="节目表id",required = true)
    +    private Long programId;
    +    
    +    @ApiModelProperty(name ="introduce", dataType ="String", value ="介绍",required = true)
    +    private String introduce;
    +    
    +    @ApiModelProperty(name ="price", dataType ="BigDecimal", value ="价格",required = true)
    +    private BigDecimal price;
    +    
    +    @ApiModelProperty(name ="totalNumber", dataType ="Long", value ="总数量",required = true)
    +    private Long totalNumber;
    +    
    +    @ApiModelProperty(name ="remainNumber", dataType ="Long", value ="剩余数量",required = true)
    +    private Long remainNumber;
    +    
    +    
    +}
    diff --git a/damai-server-client/damai-user-client/src/main/java/com/damai/client/UserClient.java b/damai-server-client/damai-user-client/src/main/java/com/damai/client/UserClient.java
    index 9699aed30fdb0875eaa9f2fa10c6cabf19c98d14..6bda1608b760585c2de2d734c063d2bbd250fb70 100644
    --- a/damai-server-client/damai-user-client/src/main/java/com/damai/client/UserClient.java
    +++ b/damai-server-client/damai-user-client/src/main/java/com/damai/client/UserClient.java
    @@ -1,45 +1,52 @@
     package com.damai.client;
     
     import com.damai.common.ApiResponse;
    +import com.damai.dto.TicketUserListDto;
     import com.damai.dto.UserGetAndTicketUserListDto;
     import com.damai.dto.UserIdDto;
    -import com.damai.vo.UserGetAndTicketUserListVo;
     import com.damai.vo.TicketUserVo;
    +import com.damai.vo.UserGetAndTicketUserListVo;
     import com.damai.vo.UserVo;
     import org.springframework.cloud.openfeign.FeignClient;
     import org.springframework.stereotype.Component;
     import org.springframework.web.bind.annotation.PostMapping;
    -import org.springframework.web.bind.annotation.RequestBody;
     
    -import javax.validation.Valid;
     import java.util.List;
     
    +import static com.damai.constant.Constant.SPRING_INJECT_PREFIX_DISTINCTION_NAME;
    +
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
      * @description: 用户服务 feign
      * @author: 阿宽不是程序员
      **/
     @Component
    -@FeignClient(value = "user-service",fallback = UserClientFallback.class)
    +@FeignClient(value = SPRING_INJECT_PREFIX_DISTINCTION_NAME+"-"+"user-service",fallback = UserClientFallback.class)
     public interface UserClient {
         
         /**
          * 查询用户(通过id)
    +     * @param dto 参数
    +     * @return 结果
          * */
         @PostMapping(value = "/user/getById")
    -    ApiResponse getById(UserIdDto userIdDto);
    +    ApiResponse getById(UserIdDto dto);
         
     
         /**
          * 查询购票人(通过userId)
    +     * @param dto 参数
    +     * @return 结果
          * */
         @PostMapping(value = "/ticket/user/select")
    -    ApiResponse> select(@Valid @RequestBody UserIdDto userIdDto);
    +    ApiResponse> select(TicketUserListDto dto);
         
         /**
          * 查询用户和购票人集合
    +     * @param dto 参数
    +     * @return 结果
          */
    -    @PostMapping(value = "/user/getUserAndTicketUserList")
    -    ApiResponse getUserAndTicketUserList(UserGetAndTicketUserListDto userGetAndTicketUserListDto);
    +    @PostMapping(value = "/user/get/user/ticket/list")
    +    ApiResponse getUserAndTicketUserList(UserGetAndTicketUserListDto dto);
         
     }
    diff --git a/damai-server-client/damai-user-client/src/main/java/com/damai/client/UserClientFallback.java b/damai-server-client/damai-user-client/src/main/java/com/damai/client/UserClientFallback.java
    index 011225fb133d42012c8f68ff01926721713afb4d..a70178f3d1dfb46426b1dedc62e9065b4218628d 100644
    --- a/damai-server-client/damai-user-client/src/main/java/com/damai/client/UserClientFallback.java
    +++ b/damai-server-client/damai-user-client/src/main/java/com/damai/client/UserClientFallback.java
    @@ -1,6 +1,7 @@
     package com.damai.client;
     
     import com.damai.common.ApiResponse;
    +import com.damai.dto.TicketUserListDto;
     import com.damai.dto.UserGetAndTicketUserListDto;
     import com.damai.dto.UserIdDto;
     import com.damai.enums.BaseCode;
    @@ -25,12 +26,12 @@ public class UserClientFallback implements UserClient {
         }
         
         @Override
    -    public ApiResponse> select(final UserIdDto userIdDto) {
    +    public ApiResponse> select(final TicketUserListDto dto) {
             return ApiResponse.error(BaseCode.SYSTEM_ERROR);
         }
         
         @Override
    -    public ApiResponse getUserAndTicketUserList(final UserGetAndTicketUserListDto userGetAndTicketUserListDto) {
    +    public ApiResponse getUserAndTicketUserList(final UserGetAndTicketUserListDto dto) {
             return ApiResponse.error(BaseCode.SYSTEM_ERROR);
         }
     }
    diff --git a/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserGetAndTicketUserListDto.java b/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserGetAndTicketUserListDto.java
    index 76c454e317eaa123835f286af1df41f70459e884..31231ff3c6d5611ff0d9039a093332bc67cb7d02 100644
    --- a/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserGetAndTicketUserListDto.java
    +++ b/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserGetAndTicketUserListDto.java
    @@ -5,21 +5,16 @@ import io.swagger.annotations.ApiModelProperty;
     import lombok.Data;
     
     import javax.validation.constraints.NotNull;
    -import java.util.List;
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
      * @description: 用户和购票人查询 dto
      * @author: 阿宽不是程序员
      **/
     @Data
    -@ApiModel(value="UserGetAndTicketUserListDto", description ="查询用户和购票人集合入参")
    +@ApiModel(value="UserGetAndTicketUserListDto", description ="查询用户以及用户下购票人集合入参")
     public class UserGetAndTicketUserListDto {
         
         @ApiModelProperty(name ="id", dataType ="Long", value ="用户id", required =true)
         @NotNull
         private Long userId;
    -    
    -    @ApiModelProperty(name ="ticketUserIdList", dataType ="List", value ="购票人id集合", required =true)
    -    @NotNull
    -    private List ticketUserIdList;
     }
    \ No newline at end of file
    diff --git a/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserLoginDto.java b/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserLoginDto.java
    index 7a8850c86c49bf3874a2ed203eb27cbfa6ce33e1..68fed78ecf5d3d03f5f0e0ed2a24a4fca898dab8 100644
    --- a/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserLoginDto.java
    +++ b/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserLoginDto.java
    @@ -3,6 +3,9 @@ package com.damai.dto;
     import io.swagger.annotations.ApiModel;
     import io.swagger.annotations.ApiModelProperty;
     import lombok.Data;
    +
    +import javax.validation.constraints.NotBlank;
    +
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
      * @description: 用户登录 dto
    @@ -12,9 +15,17 @@ import lombok.Data;
     @ApiModel(value="UserLoginDto", description ="用户登录")
     public class UserLoginDto {
         
    +    @ApiModelProperty(name ="code", dataType ="String", value ="渠道code 0001:pc网站", required = true)
    +    @NotBlank
    +    private String code;
    +    
         @ApiModelProperty(name ="name", dataType ="String", value ="用户手机号")
         private String mobile;
         
         @ApiModelProperty(name ="email", dataType ="String", value ="用户邮箱")
         private String email;
    +    
    +    @ApiModelProperty(name ="password", dataType ="String", value ="密码", required = true)
    +    @NotBlank
    +    private String password;
     }
    \ No newline at end of file
    diff --git a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/src/main/java/com/damai/dto/InfoDto.java b/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserLogoutDto.java
    similarity index 35%
    rename from api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/src/main/java/com/damai/dto/InfoDto.java
    rename to damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserLogoutDto.java
    index 3d6cf2cea3771ae9743cf94f80837a8e6f809d48..4106ab0826432443ba7c733f0a8849b5a0403715 100644
    --- a/api-stat/api-stat-example/api-stat-example-cloud/api-stat-example-cloud-feign-client/src/main/java/com/damai/dto/InfoDto.java
    +++ b/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserLogoutDto.java
    @@ -5,13 +5,22 @@ import io.swagger.annotations.ApiModelProperty;
     import lombok.Data;
     
     import javax.validation.constraints.NotBlank;
    +import javax.validation.constraints.NotNull;
     
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 用户退出登录 dto
    + * @author: 阿宽不是程序员
    + **/
     @Data
    -@ApiModel(value="InfoDto", description ="信息数据查询")
    -public class InfoDto {
    +@ApiModel(value="UserLoginDto", description ="用户退出登录")
    +public class UserLogoutDto {
         
    -    @ApiModelProperty(name ="code", dataType ="String", value ="code码", required =true)
    +    @ApiModelProperty(name ="code", dataType ="String", value ="渠道code 0001:pc网站", required = true)
         @NotBlank
         private String code;
         
    +    @ApiModelProperty(name ="id", dataType ="Long", value ="用户id", required =true)
    +    @NotNull
    +    private Long id;
     }
    \ No newline at end of file
    diff --git a/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserRegisterDto.java b/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserRegisterDto.java
    index 83aeccbacbfcbbd09a4d5b239383525c815311ce..e85b7497fd338e84d6c563d2cae686d218568f89 100644
    --- a/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserRegisterDto.java
    +++ b/damai-server-client/damai-user-client/src/main/java/com/damai/dto/UserRegisterDto.java
    @@ -47,6 +47,10 @@ public class UserRegisterDto implements Serializable {
         @ApiModelProperty(name ="idNumber", dataType ="String", value ="身份证号码")
         private String idNumber;
         
    +    @ApiModelProperty(name ="id", dataType ="captchaId", value ="captchaId 调用是否需要校验验证码接口返回")
    +    @NotBlank
    +    private String captchaId;
    +    
         @ApiModelProperty(name ="captchaType", dataType ="String", value ="验证码类型:(clickWord,blockPuzzle)")
         private String captchaType;
         
    diff --git a/damai-server-client/damai-user-client/src/main/java/com/damai/vo/CheckNeedCaptchaDataVo.java b/damai-server-client/damai-user-client/src/main/java/com/damai/vo/CheckNeedCaptchaDataVo.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..e16206618a88f743b253381a7c4ec937c41fca44
    --- /dev/null
    +++ b/damai-server-client/damai-user-client/src/main/java/com/damai/vo/CheckNeedCaptchaDataVo.java
    @@ -0,0 +1,21 @@
    +package com.damai.vo;
    +
    +import io.swagger.annotations.ApiModel;
    +import io.swagger.annotations.ApiModelProperty;
    +import lombok.Data;
    +
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 是否需要进行校验验证码 vo
    + * @author: 阿宽不是程序员
    + **/
    +@Data
    +@ApiModel(value="CheckNeedCaptchaDataVo", description ="是否需要进行校验验证码")
    +public class CheckNeedCaptchaDataVo {
    +    
    +    @ApiModelProperty(name ="verifyCaptcha", dataType ="Boolean", value ="是否需要验证码 true:是 false:否")
    +    private Boolean verifyCaptcha;
    +    
    +    @ApiModelProperty(name ="id", dataType ="captchaId", value ="唯一标识id,用户注册接口需要传入此id")
    +    private Long captchaId;
    +}
    diff --git a/damai-server-client/damai-user-client/src/main/java/com/damai/vo/TicketUserVo.java b/damai-server-client/damai-user-client/src/main/java/com/damai/vo/TicketUserVo.java
    index c4b8cd2f24c42c737c3cc143c23f6a6a63b9f52f..df853ddd9c9ebf2520559d4edb02c9af0bd63ecc 100644
    --- a/damai-server-client/damai-user-client/src/main/java/com/damai/vo/TicketUserVo.java
    +++ b/damai-server-client/damai-user-client/src/main/java/com/damai/vo/TicketUserVo.java
    @@ -1,7 +1,8 @@
     package com.damai.vo;
     
     import cn.hutool.core.util.DesensitizedUtil;
    -import com.damai.core.StringUtil;
    +import cn.hutool.core.util.StrUtil;
    +import com.damai.util.StringUtil;
     import io.swagger.annotations.ApiModel;
     import io.swagger.annotations.ApiModelProperty;
     import lombok.Data;
    @@ -34,6 +35,13 @@ public class TicketUserVo implements Serializable {
         @ApiModelProperty(name ="idNumber", dataType ="String", value ="证件号码")
         private String idNumber;
         
    +    public String getRelName() {
    +        if (StringUtil.isNotEmpty(relName)) {
    +            return StrUtil.hide(relName, 0, 1);
    +        }
    +        return relName;
    +    }
    +    
         public String getIdNumber() {
             if (StringUtil.isNotEmpty(idNumber)) {
                 return DesensitizedUtil.idCardNum(idNumber, 4, 4);
    diff --git a/damai-server-client/damai-user-client/src/main/java/com/damai/vo/UserVo.java b/damai-server-client/damai-user-client/src/main/java/com/damai/vo/UserVo.java
    index 244ec7dc6fcafce9e924dde50a9eb34ac32bf5df..30243b54a4c770d82dffd3155cffb6cd37579b20 100644
    --- a/damai-server-client/damai-user-client/src/main/java/com/damai/vo/UserVo.java
    +++ b/damai-server-client/damai-user-client/src/main/java/com/damai/vo/UserVo.java
    @@ -1,7 +1,7 @@
     package com.damai.vo;
     
     import cn.hutool.core.util.DesensitizedUtil;
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import io.swagger.annotations.ApiModel;
     import io.swagger.annotations.ApiModelProperty;
     import lombok.Data;
    diff --git a/damai-server/damai-admin-service/src/main/java/com/damai/monitor/DingTalkMessage.java b/damai-server/damai-admin-service/src/main/java/com/damai/monitor/DingTalkMessage.java
    index dbb75d1a68572d735b3379afe02efced599eb94e..8c3fce1f8b8690721a0ea7bf8c35a59b66154ac7 100644
    --- a/damai-server/damai-admin-service/src/main/java/com/damai/monitor/DingTalkMessage.java
    +++ b/damai-server/damai-admin-service/src/main/java/com/damai/monitor/DingTalkMessage.java
    @@ -1,7 +1,7 @@
     package com.damai.monitor;
     
     import com.alibaba.fastjson.JSON;
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import lombok.RequiredArgsConstructor;
     import org.springframework.http.HttpEntity;
     import org.springframework.http.HttpHeaders;
    @@ -24,13 +24,13 @@ public class DingTalkMessage {
         private RestTemplate restTemplate = new RestTemplate();
         
         private HttpEntity createMessage(String message) {
    -        Map messageJson = new HashMap<>();
    -        Map context = new HashMap<>();
    +        Map messageJson = new HashMap<>(8);
    +        Map context = new HashMap<>(8);
             context.put("content", message);
             messageJson.put("text", JSON.toJSONString(context));
             messageJson.put("msgtype", "text");
             HttpHeaders headers = new HttpHeaders();
    -        headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
    +        headers.setContentType(MediaType.APPLICATION_JSON);
             return new HttpEntity<>(JSON.toJSONString(messageJson), headers);
         }
         
    diff --git a/damai-server/damai-admin-service/src/main/java/com/damai/monitor/MonitorServer.java b/damai-server/damai-admin-service/src/main/java/com/damai/monitor/MonitorServer.java
    index 213af7667b94b32cc327207b5d447dd6c14f246b..3b95f1da67a1a63a60bb0889e5b0c4a7cacabdd2 100644
    --- a/damai-server/damai-admin-service/src/main/java/com/damai/monitor/MonitorServer.java
    +++ b/damai-server/damai-admin-service/src/main/java/com/damai/monitor/MonitorServer.java
    @@ -56,7 +56,7 @@ public class MonitorServer extends AbstractStatusChangeNotifier {
             String from = this.getLastStatus(event.getInstance());
             String to = statusChange.getStatusInfo().getStatus();
             
    -        Map root = new HashMap<>();
    +        Map root = new HashMap<>(16);
             root.put("instance", instance);
             root.put("fromStatus",from);
             root.put("toStatus",to);
    diff --git a/damai-server/damai-admin-service/src/main/resources/application.yml b/damai-server/damai-admin-service/src/main/resources/application.yml
    index f635c2d86f8ffc9711a0939a2972f5359d2a4441..857a781088e4b80a3c3f6269fd5262a7b11079e0 100644
    --- a/damai-server/damai-admin-service/src/main/resources/application.yml
    +++ b/damai-server/damai-admin-service/src/main/resources/application.yml
    @@ -9,10 +9,9 @@ spring:
       cloud:
         nacos:
           discovery:
    -        server-addr: www.cookframe.com:8848
    -        # 标识
    -        metadata:
    -          mark: true
    +        server-addr: 127.0.0.1:8848
    +        username: nacos
    +        password: nacos
       security:
         user:
           name: admin
    diff --git a/damai-server/damai-base-data-service/pom.xml b/damai-server/damai-base-data-service/pom.xml
    index e0684a0f4d193824aa31e38255b8052c968a7d5f..10e322129046dcb4f173916d08a0a91993f3332e 100644
    --- a/damai-server/damai-base-data-service/pom.xml
    +++ b/damai-server/damai-base-data-service/pom.xml
    @@ -110,6 +110,14 @@
                 jasypt-spring-boot-starter
                 ${jasypt.version}
             
    +        
    +            com.alibaba.cloud
    +            spring-cloud-starter-alibaba-sentinel
    +        
    +        
    +            com.alibaba.csp
    +            sentinel-datasource-nacos
    +        
         
     
         
    @@ -119,7 +127,7 @@
                     spring-boot-maven-plugin
                     ${spring-boot.version}
                     
    -                    com.damai.ProgramApplication
    +                    com.damai.BaseDataApplication
                         
                         true
                     
    diff --git a/damai-server/damai-base-data-service/src/main/java/com/damai/controller/AreaController.java b/damai-server/damai-base-data-service/src/main/java/com/damai/controller/AreaController.java
    index 8ea2cfe44f0b78516f06aa146194607c5f2eb1d0..ca31586f743270d622b253587e5608cef5e738cd 100644
    --- a/damai-server/damai-base-data-service/src/main/java/com/damai/controller/AreaController.java
    +++ b/damai-server/damai-base-data-service/src/main/java/com/damai/controller/AreaController.java
    @@ -23,7 +23,7 @@ import java.util.List;
      **/
     @RestController
     @RequestMapping("/area")
    -@Api(tags = "area", description = "区域")
    +@Api(tags = "area", value = "区域")
     public class AreaController {
         
         @Autowired
    diff --git a/damai-server/damai-base-data-service/src/main/java/com/damai/controller/ChannelDataController.java b/damai-server/damai-base-data-service/src/main/java/com/damai/controller/ChannelDataController.java
    index f3e985e0447537f8c6bcef13b29d0df237167cba..dd025c65ad8ea925a34396b20769f7921a1010ec 100644
    --- a/damai-server/damai-base-data-service/src/main/java/com/damai/controller/ChannelDataController.java
    +++ b/damai-server/damai-base-data-service/src/main/java/com/damai/controller/ChannelDataController.java
    @@ -22,7 +22,7 @@ import javax.validation.Valid;
      **/
     @RestController
     @RequestMapping("/channel/data")
    -@Api(tags = "channel-data", description = "渠道数据")
    +@Api(tags = "channel-data", value = "渠道数据")
     public class ChannelDataController {
         
         @Autowired
    diff --git a/damai-server/damai-base-data-service/src/main/java/com/damai/entity/Area.java b/damai-server/damai-base-data-service/src/main/java/com/damai/entity/Area.java
    index 279531b9fae1ac26307de16fb1389559bcffd52e..904802b803ca6484ca36134a73cb12b5950e3e39 100644
    --- a/damai-server/damai-base-data-service/src/main/java/com/damai/entity/Area.java
    +++ b/damai-server/damai-base-data-service/src/main/java/com/damai/entity/Area.java
    @@ -3,7 +3,7 @@ package com.damai.entity;
     import com.baomidou.mybatisplus.annotation.IdType;
     import com.baomidou.mybatisplus.annotation.TableId;
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -15,7 +15,7 @@ import java.io.Serializable;
      **/
     @Data
     @TableName("d_area")
    -public class Area extends BaseData implements Serializable {
    +public class Area extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
    diff --git a/damai-server/damai-base-data-service/src/main/java/com/damai/entity/ChannelData.java b/damai-server/damai-base-data-service/src/main/java/com/damai/entity/ChannelTableData.java
    similarity index 77%
    rename from damai-server/damai-base-data-service/src/main/java/com/damai/entity/ChannelData.java
    rename to damai-server/damai-base-data-service/src/main/java/com/damai/entity/ChannelTableData.java
    index 261d10f28de524c3eb352adcbe3bd9cd2493424e..b09cde744834a432ad22e3a57253efb34a4d3dee 100644
    --- a/damai-server/damai-base-data-service/src/main/java/com/damai/entity/ChannelData.java
    +++ b/damai-server/damai-base-data-service/src/main/java/com/damai/entity/ChannelTableData.java
    @@ -1,6 +1,7 @@
     package com.damai.entity;
     
    -import com.damai.data.BaseData;
    +import com.baomidou.mybatisplus.annotation.TableName;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -10,7 +11,8 @@ import java.io.Serializable;
      * @author: 阿宽不是程序员
      **/
     @Data
    -public class ChannelData extends BaseData implements Serializable {
    +@TableName("d_channel_data")
    +public class ChannelTableData extends BaseTableData implements Serializable {
         /**
          * id
          * */
    @@ -56,4 +58,9 @@ public class ChannelData extends BaseData implements Serializable {
          * */
         private String dataSecretKey;
         
    +    /**
    +     * token秘钥
    +     * */
    +    private String tokenSecret;
    +    
     }
    \ No newline at end of file
    diff --git a/damai-server/damai-base-data-service/src/main/java/com/damai/mapper/ChannelDataMapper.java b/damai-server/damai-base-data-service/src/main/java/com/damai/mapper/ChannelDataMapper.java
    index 18854a1ff6d11cbd11225a0a38ba08a0d1b6596f..0223a48df07b69f590132737172060f84a174c30 100644
    --- a/damai-server/damai-base-data-service/src/main/java/com/damai/mapper/ChannelDataMapper.java
    +++ b/damai-server/damai-base-data-service/src/main/java/com/damai/mapper/ChannelDataMapper.java
    @@ -2,13 +2,13 @@ package com.damai.mapper;
     
     
     import com.baomidou.mybatisplus.core.mapper.BaseMapper;
    -import com.damai.entity.ChannelData;
    +import com.damai.entity.ChannelTableData;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
      * @description: 渠道 mapper
      * @author: 阿宽不是程序员
      **/
    -public interface ChannelDataMapper extends BaseMapper {
    +public interface ChannelDataMapper extends BaseMapper {
     
     }
    diff --git a/damai-server/damai-base-data-service/src/main/java/com/damai/mapper/TokenDataMapper.java b/damai-server/damai-base-data-service/src/main/java/com/damai/mapper/TokenDataMapper.java
    deleted file mode 100644
    index ff9aa611d6892640e7d4112abe9487aa9a4e94ec..0000000000000000000000000000000000000000
    --- a/damai-server/damai-base-data-service/src/main/java/com/damai/mapper/TokenDataMapper.java
    +++ /dev/null
    @@ -1,14 +0,0 @@
    -package com.damai.mapper;
    -
    -
    -import com.baomidou.mybatisplus.core.mapper.BaseMapper;
    -import com.damai.entity.TokenData;
    -
    -/**
    - * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: token mapper
    - * @author: 阿宽不是程序员
    - **/
    -public interface TokenDataMapper extends BaseMapper {
    -
    -}
    diff --git a/damai-server/damai-base-data-service/src/main/java/com/damai/service/ChannelDataService.java b/damai-server/damai-base-data-service/src/main/java/com/damai/service/ChannelDataService.java
    index 080e5e0362efa9cbb193ed4da26d88c9ce6e76f2..60711cc95de9224b5c5bf3a9659a62ca2633eb6d 100644
    --- a/damai-server/damai-base-data-service/src/main/java/com/damai/service/ChannelDataService.java
    +++ b/damai-server/damai-base-data-service/src/main/java/com/damai/service/ChannelDataService.java
    @@ -3,13 +3,13 @@ package com.damai.service;
     import com.baidu.fsg.uid.UidGenerator;
     import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
    -import com.damai.core.RedisKeyEnum;
    +import com.damai.core.RedisKeyManage;
     import com.damai.dto.ChannelDataAddDto;
     import com.damai.dto.GetChannelDataByCodeDto;
    -import com.damai.entity.ChannelData;
    +import com.damai.entity.ChannelTableData;
     import com.damai.enums.Status;
     import com.damai.mapper.ChannelDataMapper;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
     import com.damai.util.DateUtils;
     import com.damai.vo.GetChannelDataVo;
     import lombok.extern.slf4j.Slf4j;
    @@ -41,9 +41,9 @@ public class ChannelDataService {
         
         public GetChannelDataVo getByCode(GetChannelDataByCodeDto dto){
             GetChannelDataVo getChannelDataVo = new GetChannelDataVo();
    -        LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ChannelData.class)
    -                .eq(ChannelData::getStatus, Status.RUN.getCode())
    -                .eq(ChannelData::getCode,dto.getCode());
    +        LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ChannelTableData.class)
    +                .eq(ChannelTableData::getStatus, Status.RUN.getCode())
    +                .eq(ChannelTableData::getCode,dto.getCode());
             Optional.ofNullable(channelDataMapper.selectOne(wrapper)).ifPresent(channelData -> {
                 BeanUtils.copyProperties(channelData,getChannelDataVo);
             });
    @@ -52,17 +52,17 @@ public class ChannelDataService {
         
         @Transactional(rollbackFor = Exception.class)
         public void add(ChannelDataAddDto channelDataAddDto) {
    -        ChannelData channelData = new ChannelData();
    +        ChannelTableData channelData = new ChannelTableData();
             BeanUtils.copyProperties(channelDataAddDto,channelData);
    -        channelData.setId(uidGenerator.getUID());
    +        channelData.setId(uidGenerator.getUid());
             channelData.setCreateTime(DateUtils.now());
             channelDataMapper.insert(channelData);
             addRedisChannelData(channelData);
         }
         
    -    private void addRedisChannelData(ChannelData channelData){
    +    private void addRedisChannelData(ChannelTableData channelData){
             GetChannelDataVo getChannelDataVo = new GetChannelDataVo();
             BeanUtils.copyProperties(channelData,getChannelDataVo);
    -        redisCache.set(RedisKeyWrap.createRedisKey(RedisKeyEnum.CHANNEL_DATA,getChannelDataVo.getCode()),getChannelDataVo);
    +        redisCache.set(RedisKeyBuild.createRedisKey(RedisKeyManage.CHANNEL_DATA,getChannelDataVo.getCode()),getChannelDataVo);
         }
     }
    diff --git a/damai-server/damai-base-data-service/src/main/java/com/damai/service/TokenDataService.java b/damai-server/damai-base-data-service/src/main/java/com/damai/service/TokenDataService.java
    deleted file mode 100644
    index 8ee1a9690f0deedbe7a15017fc368a6b547409d6..0000000000000000000000000000000000000000
    --- a/damai-server/damai-base-data-service/src/main/java/com/damai/service/TokenDataService.java
    +++ /dev/null
    @@ -1,48 +0,0 @@
    -package com.damai.service;
    -
    -import com.baidu.fsg.uid.UidGenerator;
    -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
    -import com.damai.dto.TokenDataDto;
    -import com.damai.entity.TokenData;
    -import com.damai.enums.Status;
    -import com.damai.mapper.TokenDataMapper;
    -import com.damai.util.DateUtils;
    -import com.damai.vo.TokenDataVo;
    -import org.springframework.beans.BeanUtils;
    -import org.springframework.beans.factory.annotation.Autowired;
    -import org.springframework.stereotype.Service;
    -
    -import javax.annotation.Resource;
    -import java.util.Optional;
    -
    -/**
    - * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: token service
    - * @author: 阿宽不是程序员
    - **/
    -@Service
    -public class TokenDataService {
    -
    -    @Autowired
    -    private TokenDataMapper tokenDataMapper;
    -    @Resource
    -    private UidGenerator uidGenerator; 
    -    
    -    public void add(TokenDataDto tokenDataDto){
    -        TokenData tokenData = new TokenData();
    -        BeanUtils.copyProperties(tokenDataDto,tokenData);
    -        tokenData.setId(uidGenerator.getUID());
    -        tokenData.setCreateTime(DateUtils.now());
    -        tokenDataMapper.insert(tokenData);
    -    }
    -    
    -    public TokenDataVo get() {
    -        TokenDataVo tokenDataVo = new TokenDataVo();
    -        LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
    -        queryWrapper.eq(TokenData::getStatus, Status.RUN.getCode());
    -        Optional.ofNullable(tokenDataMapper.selectOne(queryWrapper)).ifPresent(tokenData -> {
    -            BeanUtils.copyProperties(tokenData,tokenDataVo);
    -        });
    -        return tokenDataVo;
    -    }
    -}
    diff --git a/damai-server/damai-base-data-service/src/main/resources/application.yml b/damai-server/damai-base-data-service/src/main/resources/application.yml
    new file mode 100644
    index 0000000000000000000000000000000000000000..80ff3c2175ece9754004e831c078c756b413de5f
    --- /dev/null
    +++ b/damai-server/damai-base-data-service/src/main/resources/application.yml
    @@ -0,0 +1,94 @@
    +#服务端口
    +server:
    +  port: 6083
    +# 应用名称
    +spring:
    +  application:
    +    name: ${prefix.distinction.name:damai}-base-data-service
    +  main:
    +    allow-bean-definition-overriding: true
    +  mvc:
    +    pathmatch:
    +      matching-strategy: ant_path_matcher
    +    servlet:
    +      load-on-startup: 1
    +    jackson:
    +      time-zone: GMT+8
    +      date-format: yyyy-MM-dd HH:mm:ss
    +      generator:
    +        WRITE_NUMBERS_AS_STRINGS: true
    +  datasource:
    +    type: com.zaxxer.hikari.HikariDataSource
    +    driver-class-name: com.mysql.cj.jdbc.Driver
    +    url: jdbc:mysql://127.0.0.1:3306/damai_base_data?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
    +    username: root
    +    password: root      
    +  redis:
    +    database: 0
    +    host: 127.0.0.1
    +    port: 6379
    +    timeout: 3000
    +  cloud:
    +    nacos:
    +      discovery:
    +        server-addr: 127.0.0.1:8848
    +        username: nacos
    +        password: nacos
    +mybatis-plus:
    +  mapper-locations: classpath:mapper/*.xml
    +  global-config:
    +    db-config:
    +      logic-delete-field: status
    +      logic-delete-value: 0
    +      logic-not-delete-value: 1
    +  configuration:
    +    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    +    local-cache-scope: statement
    +feign:
    +  sentinel:
    +    enabled: false
    +  hystrix:
    +    enabled: true
    +  httpclient:
    +    enabled: false
    +  okhttp:
    +    enabled: true
    +  compression:
    +    request:
    +      enabled: true
    +      mime-types: text/xml,application/xml,application/json
    +      min-request-size: 512
    +    response:
    +      enabled: true
    +hystrix:
    +  command:
    +    default:
    +      execution:
    +        timeout:
    +          enabled: true
    +        isolation:
    +          thread:
    +            timeoutInMilliseconds: 10000
    +          semaphore:
    +            maxConcurrentRequests: 99999
    +ribbon:
    +  ReadTimeout: 60000
    +  ConnectTimeout: 60000
    +  MaxAutoRetries: 0
    +  MaxAutoRetriesNextServer: 1
    +management:
    +  endpoints:
    +    web:
    +      exposure:
    +        include: '*'
    +    health:
    +      show-details: always
    +  security:
    +    enabled: false
    +  health:
    +    elasticsearch:
    +      enabled: false
    +jasypt:
    +  encryptor:
    +    password: bgtjkjl!%^sdc
    +    algorithm: PBEWithMD5AndDES      
    diff --git a/damai-server/damai-base-data-service/src/main/resources/bootstrap.yml b/damai-server/damai-base-data-service/src/main/resources/bootstrap.yml
    deleted file mode 100644
    index 02a63aeeabfbca73d07a565e010f836b4b8ae83d..0000000000000000000000000000000000000000
    --- a/damai-server/damai-base-data-service/src/main/resources/bootstrap.yml
    +++ /dev/null
    @@ -1,23 +0,0 @@
    -#服务端口
    -server:
    -  port: 6083
    -# 应用名称
    -spring:
    -  application:
    -    name: ${prefix.distinction.name:damai}-base-data-service
    -  main:
    -    allow-bean-definition-overriding: true
    -  cloud:
    -    nacos:
    -      discovery:
    -        server-addr: 62.234.31.217:8848
    -        username: nacos
    -        password: nacos
    -      config:
    -        server-addr: 62.234.31.217:8848
    -        file-extension: yaml
    -        shared-configs:
    -          - data-id: common.yaml
    -            refresh: true
    -        username: nacos
    -        password: nacos
    diff --git a/damai-server/damai-base-data-service/src/main/resources/log4j2.xml b/damai-server/damai-base-data-service/src/main/resources/log4j2.xml
    index 8bba99eeac8f8c0d052df8008d56c12f05bb22f2..84a2017d25a85b12132ded3dae0f304921760ef7 100644
    --- a/damai-server/damai-base-data-service/src/main/resources/log4j2.xml
    +++ b/damai-server/damai-base-data-service/src/main/resources/log4j2.xml
    @@ -10,10 +10,10 @@
         
             
             .
    -        channel-data-service
    +        base-data-service
             local
             log
    -        [channel-data-service] [%X{traceId}] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n
    +        [base-data-service] [%X{traceId}] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n
             UTF-8
             com.damai
         
    diff --git a/damai-server/damai-customize-service/pom.xml b/damai-server/damai-customize-service/pom.xml
    index ca34d1769b20570d3e17e824ef20e8d3142a80c5..2ee480b26435379665a4b8e67d90e08ec66d33e4 100644
    --- a/damai-server/damai-customize-service/pom.xml
    +++ b/damai-server/damai-customize-service/pom.xml
    @@ -66,6 +66,11 @@
                 damai-service-lock-framework
                 ${revision}
             
    +        
    +            com.example
    +            damai-repeat-execute-limit-framework
    +            ${revision}
    +        
             
                 org.springframework.cloud
                 spring-cloud-starter-openfeign
    @@ -120,9 +125,8 @@
                 ${jasypt.version}
             
             
    -            com.example
    -            damai-sentinel-common-general
    -            ${revision}
    +            com.alibaba.cloud
    +            spring-cloud-starter-alibaba-sentinel
             
             
                 com.alibaba.csp
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/controller/AllRuleController.java b/damai-server/damai-customize-service/src/main/java/com/damai/controller/AllRuleController.java
    index be029c1ae4fe2388c2b066d7b3cc6a1b51d41516..c9b0742ee52ed98c3940de51c9a3620a49ee1b40 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/controller/AllRuleController.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/controller/AllRuleController.java
    @@ -21,7 +21,7 @@ import javax.validation.Valid;
      **/
     @RestController
     @RequestMapping("/allRule")
    -@Api(tags = "allRule", description = "所有规则")
    +@Api(tags = "allRule", value = "所有规则")
     public class AllRuleController {
     
         @Autowired
    @@ -30,7 +30,7 @@ public class AllRuleController {
         
         @ApiOperation(value = "添加所有规则")
         @RequestMapping(value = "/add", method = RequestMethod.POST)
    -    public ApiResponse add(@Valid @RequestBody AllRuleDto allRuleDto) {
    +    public ApiResponse add(@Valid @RequestBody AllRuleDto allRuleDto) {
             allRuleService.add(allRuleDto);
             return ApiResponse.ok();
         }
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/controller/ApiDataController.java b/damai-server/damai-customize-service/src/main/java/com/damai/controller/ApiDataController.java
    index ceae729c602512e5ea3918db74d0e567b00d27cc..05ea5ccb74af8862b21eaba3d7abd48192673222 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/controller/ApiDataController.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/controller/ApiDataController.java
    @@ -22,7 +22,7 @@ import javax.validation.Valid;
      **/
     @RestController
     @RequestMapping("/apiData")
    -@Api(tags = "apiData", description = "api调用记录")
    +@Api(tags = "apiData", value = "api调用记录")
     public class ApiDataController {
         
         @Autowired
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/controller/DepthRuleController.java b/damai-server/damai-customize-service/src/main/java/com/damai/controller/DepthRuleController.java
    index 0f7fa97b97b5d7d901b53f9ac0bc49edf851539f..949165dbd6daa2712d11a7086e975d008f6d0faa 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/controller/DepthRuleController.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/controller/DepthRuleController.java
    @@ -24,7 +24,7 @@ import java.util.List;
      **/
     @RestController
     @RequestMapping("/depthRule")
    -@Api(tags = "depthRule", description = "深度规则")
    +@Api(tags = "depthRule", value = "深度规则")
     public class DepthRuleController {
     
         @Autowired
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/controller/RuleController.java b/damai-server/damai-customize-service/src/main/java/com/damai/controller/RuleController.java
    index f42356e240e3d1e9eb8f280b72a1ca512b17c537..d2d0d303b3052b47c42a27a186426d728a5f3781 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/controller/RuleController.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/controller/RuleController.java
    @@ -24,7 +24,7 @@ import javax.validation.Valid;
      **/
     @RestController
     @RequestMapping("/rule")
    -@Api(tags = "rule", description = "规则")
    +@Api(tags = "rule", value = "规则")
     public class RuleController {
     
         @Autowired
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/entity/ApiData.java b/damai-server/damai-customize-service/src/main/java/com/damai/entity/ApiData.java
    index 3d36f03e77f007c92ffe02f1af3d7cdf436a6bed..364d507772e451df2770573f070cbf592635235e 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/entity/ApiData.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/entity/ApiData.java
    @@ -1,8 +1,10 @@
     package com.damai.entity;
     
    +import com.baomidou.mybatisplus.annotation.TableName;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
    -import java.util.Date;
    +import java.io.Serializable;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    @@ -10,7 +12,8 @@ import java.util.Date;
      * @author: 阿宽不是程序员
      **/
     @Data
    -public class ApiData {
    +@TableName("d_api_data")
    +public class ApiData extends BaseTableData implements Serializable {
         
         private Long id;
         
    @@ -26,10 +29,6 @@ public class ApiData {
         
         private String apiUrl;
         
    -    private Date createTime;
    -    
    -    private Integer status;
    -    
         private String callDayTime;
         
         private String callHourTime;
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/entity/DepthRule.java b/damai-server/damai-customize-service/src/main/java/com/damai/entity/DepthRule.java
    index 0d4a9a979030dcd745d0a0dca9212a6adde3e515..51a1c4794817758089a9a6566f09f9defbc58c14 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/entity/DepthRule.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/entity/DepthRule.java
    @@ -1,17 +1,19 @@
     package com.damai.entity;
     
    +import com.baomidou.mybatisplus.annotation.TableName;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
    -import java.util.Date;
    +import java.io.Serializable;
     
     /**
    - * @program: cook-frame
    - * @description:
    - * @author: 星哥
    - * @create: 2023-06-30
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 深度规则 实体
    + * @author: 阿宽不是程序员
      **/
     @Data
    -public class DepthRule {
    +@TableName("d_depth_rule")
    +public class DepthRule extends BaseTableData implements Serializable {
         
         private Long id;
         
    @@ -32,8 +34,4 @@ public class DepthRule {
         private String limitApi;
         
         private String message;
    -    
    -    private Integer status;
    -    
    -    private Date createTime;
     }
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/entity/Rule.java b/damai-server/damai-customize-service/src/main/java/com/damai/entity/Rule.java
    index e04b51234a4920348261c79a8f058865d6d75d2d..de3cf1e3df911f0ecfd1167c262ac20e76ae109d 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/entity/Rule.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/entity/Rule.java
    @@ -1,8 +1,10 @@
     package com.damai.entity;
     
    +import com.baomidou.mybatisplus.annotation.TableName;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
    -import java.util.Date;
    +import java.io.Serializable;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    @@ -10,7 +12,8 @@ import java.util.Date;
      * @author: 阿宽不是程序员
      **/
     @Data
    -public class Rule {
    +@TableName("d_rule")
    +public class Rule extends BaseTableData implements Serializable {
         
         private Long id;
     
    @@ -27,8 +30,4 @@ public class Rule {
         private String limitApi;
         
         private String message;
    -    
    -    private Integer status;
    -    
    -    private Date createTime;
     }
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/kafka/ApiDataMessageConsumer.java b/damai-server/damai-customize-service/src/main/java/com/damai/kafka/ApiDataMessageConsumer.java
    index ce93d7248a942ae58396c152f877cd1c4de19bdb..3b159d09395386b6e18b4f8ee6ab38c49283b45b 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/kafka/ApiDataMessageConsumer.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/kafka/ApiDataMessageConsumer.java
    @@ -6,7 +6,6 @@ import com.damai.service.ApiDataService;
     import lombok.AllArgsConstructor;
     import lombok.extern.slf4j.Slf4j;
     import org.apache.kafka.clients.consumer.ConsumerRecord;
    -import org.springframework.kafka.annotation.KafkaListener;
     
     import java.util.Optional;
     
    @@ -21,13 +20,13 @@ public class ApiDataMessageConsumer {
         
         private ApiDataService apiDataService;
         
    -    @KafkaListener(topics = {"${kafka.consumer.topic:save_api_data}"},containerFactory = "kafkaListenerContainerFactory")
    -    public void consumerOrderMessage(ConsumerRecord consumerRecord){
    +    //@KafkaListener(topics = {"${kafka.consumer.topic:save_api_data}"},containerFactory = "kafkaListenerContainerFactory")
    +    public void consumerApiDataMessage(ConsumerRecord consumerRecord){
             try {
                 Optional.ofNullable(consumerRecord.value()).map(String::valueOf).ifPresent(value -> {
    -                log.info("consumerOrderMessage message:{}",value);
    +                log.info("consumerApiDataMessage consumerRecord:{}",JSON.toJSONString(consumerRecord));
                     ApiData apiData = JSON.parseObject(value, ApiData.class);
    -                apiDataService.save(apiData);
    +                apiDataService.saveApiData(apiData);
                 });
             }catch (Exception e) {
                 log.error("consumerApiDataMessage error",e);
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/kafka/ConsumerConfig.java b/damai-server/damai-customize-service/src/main/java/com/damai/kafka/ConsumerConfig.java
    index f69b9dcc5b7b8b45d84aeba1b19f2bacaff2fe76..f0660b41972a9e5295bd5efd932e3142af763271 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/kafka/ConsumerConfig.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/kafka/ConsumerConfig.java
    @@ -25,7 +25,7 @@ import java.util.Map;
     public class ConsumerConfig {
         
         public Map consumerConfigs(ConsumerProperty consumerProperty) {
    -        Map propsMap = new HashMap<>();
    +        Map propsMap = new HashMap<>(16);
             propsMap.put(org.apache.kafka.clients.consumer.ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, consumerProperty.getServers());
             propsMap.put(org.apache.kafka.clients.consumer.ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, consumerProperty.isAutoCommit());
             propsMap.put(org.apache.kafka.clients.consumer.ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, consumerProperty.getAutoCommitIntervalMs());
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/mapper/ApiDataMapper.java b/damai-server/damai-customize-service/src/main/java/com/damai/mapper/ApiDataMapper.java
    index 06774960e3790de76c835aaf93b31c1c26363e9c..ce8157c031d2e50c59bc76d8d17168cbc58cdc53 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/mapper/ApiDataMapper.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/mapper/ApiDataMapper.java
    @@ -12,6 +12,11 @@ import com.damai.vo.ApiDataVo;
      * @author: 阿宽不是程序员
      **/
     public interface ApiDataMapper extends BaseMapper {
    -    
    +    /**
    +     * 分页查询
    +     * @param page 分页对象
    +     * @param apiDataDto 参数
    +     * @return 分页数据
    +     * */
         Page pageList(Page page, ApiDataDto apiDataDto);
     }
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/mapper/DepthRuleMapper.java b/damai-server/damai-customize-service/src/main/java/com/damai/mapper/DepthRuleMapper.java
    index 6199d129b6397ae27a43b6f160b79b4f0a86eb19..5f884d13748133f14ac0473ca4f269944d630b9c 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/mapper/DepthRuleMapper.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/mapper/DepthRuleMapper.java
    @@ -10,5 +10,9 @@ import com.damai.entity.DepthRule;
      **/
     public interface DepthRuleMapper extends BaseMapper {
         
    +    /**
    +     * 删除所有规则
    +     * @return 结果
    +     * */
         int delAll();
     }
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/mapper/RuleMapper.java b/damai-server/damai-customize-service/src/main/java/com/damai/mapper/RuleMapper.java
    index c81a86ccc371bac76066a05a9e49f24c545afafe..fa6157d811935abecac470c1e5cb7e9e9b135b18 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/mapper/RuleMapper.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/mapper/RuleMapper.java
    @@ -10,5 +10,9 @@ import com.damai.entity.Rule;
      **/
     public interface RuleMapper extends BaseMapper {
         
    +    /**
    +     * 删除所有规则
    +     * @return 结果
    +     * */
         int delAll();
     }
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/service/AllRuleService.java b/damai-server/damai-customize-service/src/main/java/com/damai/service/AllRuleService.java
    index 41754bf31db5b66e7382a78edc7e2b6728a61281..a1b3bfdf8985005b45e6ce2e4d32408a0eb1426e 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/service/AllRuleService.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/service/AllRuleService.java
    @@ -2,7 +2,7 @@ package com.damai.service;
     
     import cn.hutool.core.collection.CollUtil;
     import cn.hutool.core.date.DateUtil;
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import com.damai.dto.AllRuleDto;
     import com.damai.dto.DepthRuleDto;
     import com.damai.enums.BaseCode;
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/service/ApiDataService.java b/damai-server/damai-customize-service/src/main/java/com/damai/service/ApiDataService.java
    index 85226901803d42374406bf9a10ac77d668c6ed74..351ba08e0ac25e66737b73749b19efa1d5749c01 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/service/ApiDataService.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/service/ApiDataService.java
    @@ -1,15 +1,19 @@
     package com.damai.service;
     
     import cn.hutool.core.collection.CollUtil;
    +import com.alibaba.fastjson.JSON;
     import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
     import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
     import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    -import com.damai.core.StringUtil;
    +import com.damai.core.RepeatExecuteLimitConstants;
    +import com.damai.util.StringUtil;
     import com.damai.dto.ApiDataDto;
     import com.damai.entity.ApiData;
     import com.damai.mapper.ApiDataMapper;
    +import com.damai.repeatexecutelimit.annotion.RepeatExecuteLimit;
     import com.damai.vo.ApiDataVo;
    +import lombok.extern.slf4j.Slf4j;
     import org.springframework.beans.BeanUtils;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Service;
    @@ -24,13 +28,22 @@ import java.util.stream.Collectors;
      * @description: api调用记录 service
      * @author: 阿宽不是程序员
      **/
    -
    +@Slf4j
     @Service
     public class ApiDataService extends ServiceImpl {
     
         @Autowired
         private ApiDataMapper apiDataMapper;
         
    +    @RepeatExecuteLimit(name = RepeatExecuteLimitConstants.CONSUMER_API_DATA_MESSAGE,keys = {"#apiData.id"})
    +    public void saveApiData(ApiData apiData){
    +        ApiData dbApiData = apiDataMapper.selectById(apiData.getId());
    +        if (Objects.isNull(dbApiData)) {
    +            log.info("saveApiData apiData:{}", JSON.toJSONString(apiData));
    +            apiDataMapper.insert(apiData);
    +        }
    +    }
    +    
         public Page pageList(final ApiDataDto dto) {
             Page page = Page.of(dto.getPageNo(), dto.getPageSize());
             LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(ApiData.class)
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/service/DepthRuleService.java b/damai-server/damai-customize-service/src/main/java/com/damai/service/DepthRuleService.java
    index bc8b960df26238b9ba961520a99e7b1f0df6c8bf..b93f99c8d812a433dc9438d233382d5f38ae9f98 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/service/DepthRuleService.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/service/DepthRuleService.java
    @@ -4,7 +4,7 @@ import cn.hutool.core.date.DateUtil;
     import com.baidu.fsg.uid.UidGenerator;
     import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import com.damai.dto.DepthRuleDto;
     import com.damai.dto.DepthRuleStatusDto;
     import com.damai.dto.DepthRuleUpdateDto;
    @@ -75,7 +75,7 @@ public class DepthRuleService {
         public void add(DepthRuleDto depthRuleDto) {
             DepthRule depthRule = new DepthRule();
             BeanUtils.copyProperties(depthRuleDto,depthRule);
    -        depthRule.setId(uidGenerator.getUID());
    +        depthRule.setId(uidGenerator.getUid());
             depthRule.setCreateTime(DateUtils.now());
             depthRuleMapper.insert(depthRule);
         }
    diff --git a/damai-server/damai-customize-service/src/main/java/com/damai/service/RuleService.java b/damai-server/damai-customize-service/src/main/java/com/damai/service/RuleService.java
    index e22a9f19f0f1f91b5777d5ea169a152fc0b1cff3..2eedcd3b8865e9772d80c792be05a9dac1711816 100644
    --- a/damai-server/damai-customize-service/src/main/java/com/damai/service/RuleService.java
    +++ b/damai-server/damai-customize-service/src/main/java/com/damai/service/RuleService.java
    @@ -5,7 +5,7 @@ import cn.hutool.core.date.DateUtil;
     import com.baidu.fsg.uid.UidGenerator;
     import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
    -import com.damai.core.RedisKeyEnum;
    +import com.damai.core.RedisKeyManage;
     import com.damai.dto.RuleDto;
     import com.damai.dto.RuleGetDto;
     import com.damai.dto.RuleStatusDto;
    @@ -16,7 +16,7 @@ import com.damai.enums.RuleStatus;
     import com.damai.mapper.DepthRuleMapper;
     import com.damai.mapper.RuleMapper;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
     import com.damai.vo.RuleVo;
     import org.springframework.beans.BeanUtils;
     import org.springframework.beans.factory.annotation.Autowired;
    @@ -60,7 +60,7 @@ public class RuleService {
             delAll();
             Rule rule = new Rule();
             BeanUtils.copyProperties(ruleDto,rule);
    -        rule.setId(uidGenerator.getUID());
    +        rule.setId(uidGenerator.getUid());
             rule.setCreateTime(DateUtil.date());
             ruleMapper.insert(rule);
             return rule.getId();
    @@ -121,16 +121,16 @@ public class RuleService {
             LambdaQueryWrapper ruleQueryWrapper = Wrappers.lambdaQuery(Rule.class).eq(Rule::getStatus,RuleStatus.RUN.getCode());
             Rule rule = ruleMapper.selectOne(ruleQueryWrapper);
             if (Optional.ofNullable(rule).isPresent()) {
    -            map.put(RedisKeyWrap.createRedisKey(RedisKeyEnum.RULE).getRelKey(),rule);
    +            map.put(RedisKeyBuild.createRedisKey(RedisKeyManage.RULE).getRelKey(),rule);
             }
             LambdaQueryWrapper depthRuleQueryWrapper = Wrappers.lambdaQuery(DepthRule.class).eq(DepthRule::getStatus,RuleStatus.RUN.getCode());
             List depthRules = depthRuleMapper.selectList(depthRuleQueryWrapper);
             if (CollUtil.isNotEmpty(depthRules)) {
    -            map.put(RedisKeyWrap.createRedisKey(RedisKeyEnum.DEPTH_RULE).getRelKey(),depthRules);
    +            map.put(RedisKeyBuild.createRedisKey(RedisKeyManage.DEPTH_RULE).getRelKey(),depthRules);
             }
    -        redisCache.del(RedisKeyWrap.createRedisKey(RedisKeyEnum.ALL_RULE_HASH));
    -        if (map.size() > 0 && Objects.nonNull(map.get(RedisKeyWrap.createRedisKey(RedisKeyEnum.RULE).getRelKey()))) {
    -            redisCache.putHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.ALL_RULE_HASH),map);
    +        redisCache.del(RedisKeyBuild.createRedisKey(RedisKeyManage.ALL_RULE_HASH));
    +        if (map.size() > 0 && Objects.nonNull(map.get(RedisKeyBuild.createRedisKey(RedisKeyManage.RULE).getRelKey()))) {
    +            redisCache.putHash(RedisKeyBuild.createRedisKey(RedisKeyManage.ALL_RULE_HASH),map);
             }
         }
     }
    diff --git a/damai-server/damai-customize-service/src/main/resources/application.yml b/damai-server/damai-customize-service/src/main/resources/application.yml
    new file mode 100644
    index 0000000000000000000000000000000000000000..87eae042af0f3b7467b0c53f8053616c6843181e
    --- /dev/null
    +++ b/damai-server/damai-customize-service/src/main/resources/application.yml
    @@ -0,0 +1,102 @@
    +#服务端口
    +server:
    +  port: 6084
    +# 应用名称
    +spring:
    +  application:
    +    name: ${prefix.distinction.name:damai}-customize-service
    +  main:
    +    allow-bean-definition-overriding: true
    +  mvc:
    +    pathmatch:
    +      matching-strategy: ant_path_matcher
    +    servlet:
    +      load-on-startup: 1
    +    jackson:
    +      time-zone: GMT+8
    +      date-format: yyyy-MM-dd HH:mm:ss
    +      generator:
    +        WRITE_NUMBERS_AS_STRINGS: true
    +  datasource:
    +    type: com.zaxxer.hikari.HikariDataSource
    +    driver-class-name: com.mysql.cj.jdbc.Driver
    +    url: jdbc:mysql://127.0.0.1:3306/damai_customize?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
    +    username: root
    +    password: root
    +  redis:
    +    database: 0
    +    host: 127.0.0.1
    +    port: 6379
    +    timeout: 3000
    +  cloud:
    +    nacos:
    +      discovery:
    +        server-addr: 127.0.0.1:8848
    +        username: nacos
    +        password: nacos
    +kafka:
    +  consumer:
    +    servers: 127.0.0.1:9092
    +    autoCommit: true
    +    autoCommitIntervalMs: 2000
    +    autoOffsetReset: latest
    +    groupId: api_data
    +    topic: save_api_data        
    +mybatis-plus:
    +  mapper-locations: classpath:mapper/*.xml
    +  global-config:
    +    db-config:
    +      logic-delete-field: status
    +      logic-delete-value: 0
    +      logic-not-delete-value: 1
    +  configuration:
    +    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    +    local-cache-scope: statement
    +feign:
    +  sentinel:
    +    enabled: false
    +  hystrix:
    +    enabled: true
    +  httpclient:
    +    enabled: false
    +  okhttp:
    +    enabled: true
    +  compression:
    +    request:
    +      enabled: true
    +      mime-types: text/xml,application/xml,application/json
    +      min-request-size: 512
    +    response:
    +      enabled: true
    +hystrix:
    +  command:
    +    default:
    +      execution:
    +        timeout:
    +          enabled: true
    +        isolation:
    +          thread:
    +            timeoutInMilliseconds: 10000
    +          semaphore:
    +            maxConcurrentRequests: 99999
    +ribbon:
    +  ReadTimeout: 60000
    +  ConnectTimeout: 60000
    +  MaxAutoRetries: 0
    +  MaxAutoRetriesNextServer: 1
    +management:
    +  endpoints:
    +    web:
    +      exposure:
    +        include: '*'
    +    health:
    +      show-details: always
    +  security:
    +    enabled: false
    +  health:
    +    elasticsearch:
    +      enabled: false
    +jasypt:
    +  encryptor:
    +    password: bgtjkjl!%^sdc
    +    algorithm: PBEWithMD5AndDES
    \ No newline at end of file
    diff --git a/damai-server/damai-customize-service/src/main/resources/bootstrap.yml b/damai-server/damai-customize-service/src/main/resources/bootstrap.yml
    deleted file mode 100644
    index 8e4996717db1f0ca89bf9b447089e9339ef5950b..0000000000000000000000000000000000000000
    --- a/damai-server/damai-customize-service/src/main/resources/bootstrap.yml
    +++ /dev/null
    @@ -1,23 +0,0 @@
    -#服务端口
    -server:
    -  port: 6084
    -# 应用名称
    -spring:
    -  application:
    -    name: ${prefix.distinction.name:damai}-customize-service
    -  main:
    -    allow-bean-definition-overriding: true
    -  cloud:
    -    nacos:
    -      discovery:
    -        server-addr: 62.234.31.217:8848
    -        username: nacos
    -        password: nacos
    -      config:
    -        server-addr: 62.234.31.217:8848
    -        file-extension: yaml
    -        shared-configs:
    -          - data-id: common.yaml
    -            refresh: true
    -        username: nacos
    -        password: nacos
    diff --git a/damai-server/damai-customize-service/src/main/resources/log4j2.xml b/damai-server/damai-customize-service/src/main/resources/log4j2.xml
    index 86c65a1698900ba56fae38bbea6849980f0889d9..6a3f2cd23da0a55ea4d70c2e71eb8a054d5026d4 100644
    --- a/damai-server/damai-customize-service/src/main/resources/log4j2.xml
    +++ b/damai-server/damai-customize-service/src/main/resources/log4j2.xml
    @@ -10,10 +10,10 @@
         
             
             .
    -        order-service
    +        customize-service
             local
             log
    -        [order-service] [%X{traceId}] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n
    +        [customize-service] [%X{traceId}] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n
             UTF-8
             com.damai
         
    diff --git a/damai-server/damai-customize-service/src/main/resources/mapper/ApiDataMapper.xml b/damai-server/damai-customize-service/src/main/resources/mapper/ApiDataMapper.xml
    index 9301fd08fb753762638f0481a83bf00f2a6896f5..1b713b55dba9bbd110f1bfeb5421bbdc32fa96d4 100644
    --- a/damai-server/damai-customize-service/src/main/resources/mapper/ApiDataMapper.xml
    +++ b/damai-server/damai-customize-service/src/main/resources/mapper/ApiDataMapper.xml
    @@ -22,7 +22,7 @@
             select
                 id,head_version,api_address,api_method,api_body,api_params,api_url,create_time,
                 status,call_day_time,call_hour_time,call_minute_time,call_second_time,type,count(1) as statistics
    -        from api_data
    +        from d_api_data
             where status = 1
             
                 and create_time = ]]> #{startDate}
    diff --git a/damai-server/damai-customize-service/src/main/resources/mapper/DepthRuleMapper.xml b/damai-server/damai-customize-service/src/main/resources/mapper/DepthRuleMapper.xml
    index 87f3692ac21b92b7e110ec3b1b9b442d00b91645..63033db63a4fb7e3dd4d4286e6fed6fc7edf6576 100644
    --- a/damai-server/damai-customize-service/src/main/resources/mapper/DepthRuleMapper.xml
    +++ b/damai-server/damai-customize-service/src/main/resources/mapper/DepthRuleMapper.xml
    @@ -4,6 +4,6 @@
             "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
     
         
    -        delete from depth_rule
    +        delete from d_depth_rule
         
     
    \ No newline at end of file
    diff --git a/damai-server/damai-customize-service/src/main/resources/mapper/RuleMapper.xml b/damai-server/damai-customize-service/src/main/resources/mapper/RuleMapper.xml
    index 691623a024d3638c2fdc36bdd5f0df45930b02e1..c0c0b8176131f12ac9a5a1ade2afcfc1e8f19e11 100644
    --- a/damai-server/damai-customize-service/src/main/resources/mapper/RuleMapper.xml
    +++ b/damai-server/damai-customize-service/src/main/resources/mapper/RuleMapper.xml
    @@ -4,6 +4,6 @@
             "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
     
         
    -        delete from rule
    +        delete from d_rule
         
     
    \ No newline at end of file
    diff --git a/damai-server/damai-gateway-service/pom.xml b/damai-server/damai-gateway-service/pom.xml
    index ae7ae14400895f6fa3ef793d556edcce1bd8df0b..3b63cee4c43b2e5194ecd23e3238a39f2cdeac31 100644
    --- a/damai-server/damai-gateway-service/pom.xml
    +++ b/damai-server/damai-gateway-service/pom.xml
    @@ -154,9 +154,12 @@
                 ${jasypt.version}
             
             
    -            com.example
    -            damai-sentinel-gateway-general
    -            ${revision}
    +            com.alibaba.cloud
    +            spring-cloud-starter-alibaba-sentinel
    +        
    +        
    +            com.alibaba.csp
    +            sentinel-spring-cloud-gateway-adapter
             
             
                 com.alibaba.csp
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/src/main/java/com/damai/sentinel/GatewayConfiguration.java b/damai-server/damai-gateway-service/src/main/java/com/damai/conf/sentinel/GatewaySentinelConfiguration.java
    similarity index 84%
    rename from damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/src/main/java/com/damai/sentinel/GatewayConfiguration.java
    rename to damai-server/damai-gateway-service/src/main/java/com/damai/conf/sentinel/GatewaySentinelConfiguration.java
    index 53e3257113932b8aef5317e12d139e4f5f440051..2e4376163c07955c9a119db6338a3cdf94256b30 100644
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/src/main/java/com/damai/sentinel/GatewayConfiguration.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/conf/sentinel/GatewaySentinelConfiguration.java
    @@ -1,10 +1,11 @@
    -package com.damai.sentinel;
    +package com.damai.conf.sentinel;
     
     import com.alibaba.csp.sentinel.adapter.gateway.sc.SentinelGatewayFilter;
     import com.alibaba.csp.sentinel.adapter.gateway.sc.exception.SentinelGatewayBlockExceptionHandler;
     import org.springframework.beans.factory.ObjectProvider;
     import org.springframework.cloud.gateway.filter.GlobalFilter;
     import org.springframework.context.annotation.Bean;
    +import org.springframework.context.annotation.Configuration;
     import org.springframework.core.Ordered;
     import org.springframework.core.annotation.Order;
     import org.springframework.http.codec.ServerCodecConfigurer;
    @@ -15,15 +16,16 @@ import java.util.List;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: sentinel gateway配置
    + * @description: sentinel 配置
      * @author: 阿宽不是程序员
      **/
    -public class GatewayConfiguration {
    +@Configuration
    +public class GatewaySentinelConfiguration {
         
         private final List viewResolvers;
         private final ServerCodecConfigurer serverCodecConfigurer;
         
    -    public GatewayConfiguration(ObjectProvider> viewResolversProvider,
    +    public GatewaySentinelConfiguration(ObjectProvider> viewResolversProvider,
                                     ServerCodecConfigurer serverCodecConfigurer) {
             this.viewResolvers = viewResolversProvider.getIfAvailable(Collections::emptyList);
             this.serverCodecConfigurer = serverCodecConfigurer;
    @@ -37,8 +39,8 @@ public class GatewayConfiguration {
         }
         
         @Bean
    -    @Order(Ordered.HIGHEST_PRECEDENCE)
    +    @Order(-1)
         public GlobalFilter sentinelGatewayFilter() {
             return new SentinelGatewayFilter();
         }
    -}
    \ No newline at end of file
    +}
    diff --git a/damai-server/damai-gateway-service/src/main/java/com/damai/conf/swagger/SwaggerProvider.java b/damai-server/damai-gateway-service/src/main/java/com/damai/conf/swagger/SwaggerProvider.java
    index f96c01bffbcb5f6c2acf32d2cb3cd5718bafdedd..b7e6cbdb663690967be827d0a1d627ce7eb41a8a 100644
    --- a/damai-server/damai-gateway-service/src/main/java/com/damai/conf/swagger/SwaggerProvider.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/conf/swagger/SwaggerProvider.java
    @@ -2,7 +2,7 @@ package com.damai.conf.swagger;
     
     
     import cn.hutool.core.collection.CollUtil;
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import lombok.AllArgsConstructor;
     import org.springframework.cloud.client.ServiceInstance;
     import org.springframework.cloud.client.discovery.DiscoveryClient;
    @@ -61,7 +61,7 @@ public class SwaggerProvider implements SwaggerResourcesProvider {
         }
         
         private Map> getServiceMappingNames(GatewayProperties gatewayProperties) {
    -        Map> serviceMap = new HashMap<>();
    +        Map> serviceMap = new HashMap<>(256);
             List routeList = gatewayProperties.getRoutes();
             if (CollUtil.isNotEmpty(routeList)) {
                 for (RouteDefinition route : routeList) {
    diff --git a/damai-server/damai-gateway-service/src/main/java/com/damai/constant/GatewayConstant.java b/damai-server/damai-gateway-service/src/main/java/com/damai/constant/GatewayConstant.java
    index df70e925bd4ca82d981cfe5304033a992b38ea9f..7d3e5d271b2b9809857aa3b1242632241c6ffe89 100644
    --- a/damai-server/damai-gateway-service/src/main/java/com/damai/constant/GatewayConstant.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/constant/GatewayConstant.java
    @@ -25,4 +25,6 @@ public class GatewayConstant {
         
         public static final String USER_ID = "user_id";
         
    +    public static final String V2 = "v2";
    +    
     }
    diff --git a/damai-server/damai-gateway-service/src/main/java/com/damai/exception/CheckCodeHandler.java b/damai-server/damai-gateway-service/src/main/java/com/damai/exception/CheckCodeHandler.java
    index fab5f3d8f595e1013c152552138dbe5c0ca8d340..ac45aca3ca24e2306b770a6ad2b6f9136fd8a98d 100644
    --- a/damai-server/damai-gateway-service/src/main/java/com/damai/exception/CheckCodeHandler.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/exception/CheckCodeHandler.java
    @@ -1,6 +1,6 @@
     package com.damai.exception;
     
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import com.damai.enums.BaseCode;
     import org.springframework.stereotype.Component;
     
    diff --git a/damai-server/damai-gateway-service/src/main/java/com/damai/filter/RequestValidationFilter.java b/damai-server/damai-gateway-service/src/main/java/com/damai/filter/RequestValidationFilter.java
    index a3b9071be1c36c860e52935c12b3c37c005b7e30..0413f7142ce637ad024578fdf8b7771700693256 100644
    --- a/damai-server/damai-gateway-service/src/main/java/com/damai/filter/RequestValidationFilter.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/filter/RequestValidationFilter.java
    @@ -1,22 +1,22 @@
     package com.damai.filter;
     
     
    +import cn.hutool.core.collection.CollectionUtil;
     import com.alibaba.fastjson.JSON;
     import com.baidu.fsg.uid.UidGenerator;
     import com.damai.conf.RequestTemporaryWrapper;
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import com.damai.enums.BaseCode;
     import com.damai.exception.ArgumentError;
     import com.damai.exception.ArgumentException;
    -import com.damai.exception.CheckCodeHandler;
     import com.damai.exception.DaMaiFrameException;
     import com.damai.property.GatewayProperty;
     import com.damai.service.ApiRestrictService;
     import com.damai.service.ChannelDataService;
     import com.damai.service.TokenService;
     import com.damai.threadlocal.BaseParameterHolder;
    -import com.damai.util.RSATool;
     import com.damai.util.RsaSignTool;
    +import com.damai.util.RsaTool;
     import com.damai.vo.GetChannelDataVo;
     import com.damai.vo.UserVo;
     import lombok.extern.slf4j.Slf4j;
    @@ -43,14 +43,14 @@ import org.springframework.web.server.ServerWebExchange;
     import reactor.core.publisher.Flux;
     import reactor.core.publisher.Mono;
     
    -import javax.annotation.Resource;
     import java.util.ArrayList;
     import java.util.HashMap;
     import java.util.List;
     import java.util.Map;
    +import java.util.Objects;
     import java.util.function.Function;
     
    -import static com.damai.constant.Constant.MARK_PARAMETER;
    +import static com.damai.constant.Constant.GRAY_PARAMETER;
     import static com.damai.constant.Constant.TRACE_ID;
     import static com.damai.constant.GatewayConstant.BUSINESS_BODY;
     import static com.damai.constant.GatewayConstant.CODE;
    @@ -59,6 +59,7 @@ import static com.damai.constant.GatewayConstant.NO_VERIFY;
     import static com.damai.constant.GatewayConstant.REQUEST_BODY;
     import static com.damai.constant.GatewayConstant.TOKEN;
     import static com.damai.constant.GatewayConstant.USER_ID;
    +import static com.damai.constant.GatewayConstant.V2;
     import static com.damai.constant.GatewayConstant.VERIFY_VALUE;
     
     /**
    @@ -85,34 +86,32 @@ public class RequestValidationFilter implements GlobalFilter, Ordered {
     
         @Autowired
         private GatewayProperty gatewayProperty;
    -    @Resource
    -    private UidGenerator uidGenerator;
         
         @Autowired
    -    private CheckCodeHandler checkCodeHandler;
    +    private UidGenerator uidGenerator;
         
     
         @Override
         public Mono filter(final ServerWebExchange exchange, final GatewayFilterChain chain) {
             ServerHttpRequest request = exchange.getRequest();
             String traceId = request.getHeaders().getFirst(TRACE_ID);
    -        String mark = request.getHeaders().getFirst(MARK_PARAMETER);
    +        String gray = request.getHeaders().getFirst(GRAY_PARAMETER);
             String noVerify = request.getHeaders().getFirst(NO_VERIFY);
             if (StringUtil.isEmpty(traceId)) {
    -            traceId = String.valueOf(uidGenerator.getUID());
    +            traceId = String.valueOf(uidGenerator.getUid());
             }
             MDC.put(TRACE_ID,traceId);
    -        Map headMap = new HashMap<>();
    +        Map headMap = new HashMap<>(8);
             headMap.put(TRACE_ID,traceId);
    -        headMap.put(MARK_PARAMETER,mark);
    +        headMap.put(GRAY_PARAMETER,gray);
             if (StringUtil.isNotEmpty(noVerify)) {
                 headMap.put(NO_VERIFY,noVerify);
             }
             BaseParameterHolder.setParameter(TRACE_ID,traceId);
    -        BaseParameterHolder.setParameter(MARK_PARAMETER,mark);
    +        BaseParameterHolder.setParameter(GRAY_PARAMETER,gray);
             MediaType contentType = request.getHeaders().getContentType();
             //application json请求
    -        if (contentType != null && contentType.toString().toLowerCase().contains(MediaType.APPLICATION_JSON_VALUE.toLowerCase())) {
    +        if (Objects.nonNull(contentType) && contentType.toString().toLowerCase().contains(MediaType.APPLICATION_JSON_VALUE.toLowerCase())) {
                 return readBody(exchange,chain,headMap);
             }else {
                 Map map = doExecute("", exchange);
    @@ -162,7 +161,7 @@ public class RequestValidationFilter implements GlobalFilter, Ordered {
             log.info("current thread verify: {}",Thread.currentThread().getName());
             ServerHttpRequest request = exchange.getRequest();
             String requestBody = originalBody;
    -        Map bodyContent = new HashMap<>();
    +        Map bodyContent = new HashMap<>(32);
             if (StringUtil.isNotEmpty(originalBody)) {
                 bodyContent = JSON.parseObject(originalBody, Map.class);
             }
    @@ -179,12 +178,10 @@ public class RequestValidationFilter implements GlobalFilter, Ordered {
                 //token
                 token = request.getHeaders().getFirst(TOKEN);
                 
    -            checkCodeHandler.checkCode(code);
    -            
                 GetChannelDataVo channelDataVo = channelDataService.getChannelDataByCode(code);
                 
    -            if (StringUtil.isNotEmpty(encrypt) && "v2".equals(encrypt)) {
    -                String decrypt = RSATool.decrypt(bodyContent.get(BUSINESS_BODY),channelDataVo.getDataSecretKey());
    +            if (StringUtil.isNotEmpty(encrypt) && V2.equals(encrypt)) {
    +                String decrypt = RsaTool.decrypt(bodyContent.get(BUSINESS_BODY),channelDataVo.getDataSecretKey());
                     bodyContent.put(BUSINESS_BODY,decrypt);
                 }
                 boolean checkFlag = RsaSignTool.verifyRsaSign256(bodyContent, channelDataVo.getSignPublicKey());
    @@ -203,7 +200,7 @@ public class RequestValidationFilter implements GlobalFilter, Ordered {
                 }
     
                 if (!skipCheckTokenResult) {
    -                UserVo userVo = tokenService.getUser(token);
    +                UserVo userVo = tokenService.getUser(token,code,channelDataVo.getTokenSecret());
                     userId = userVo.getId();
                 }
                 
    @@ -220,7 +217,9 @@ public class RequestValidationFilter implements GlobalFilter, Ordered {
             }
             return map;
         }
    -    //将网关层request请求头中的重要参数传递给后续的微服务中
    +    /**
    +     * 将网关层request请求头中的重要参数传递给后续的微服务中
    +     */
         private ServerHttpRequestDecorator decorateHead(ServerWebExchange exchange, HttpHeaders headers, CachedBodyOutputMessage outputMessage, RequestTemporaryWrapper requestTemporaryWrapper, Map headMap){
             return new ServerHttpRequestDecorator(exchange.getRequest()){
                 @Override
    @@ -230,10 +229,10 @@ public class RequestValidationFilter implements GlobalFilter, Ordered {
                     HttpHeaders newHeaders = new HttpHeaders();
                     newHeaders.putAll(headers);
                     Map map = requestTemporaryWrapper.getMap();
    -                if (map != null) {
    +                if (CollectionUtil.isNotEmpty(map)) {
                         newHeaders.setAll(map);
                     }
    -                if (headMap != null) {
    +                if (CollectionUtil.isNotEmpty(headMap)) {
                         newHeaders.setAll(headMap);
                     }
                     if (contentLength > 0){
    @@ -241,7 +240,7 @@ public class RequestValidationFilter implements GlobalFilter, Ordered {
                     }else {
                         newHeaders.set(HttpHeaders.TRANSFER_ENCODING,"chunked");
                     }
    -                if (headMap != null && StringUtil.isNotEmpty(headMap.get(TRACE_ID))) {
    +                if (CollectionUtil.isNotEmpty(headMap) && StringUtil.isNotEmpty(headMap.get(TRACE_ID))) {
                         MDC.put(TRACE_ID,headMap.get(TRACE_ID));
                     }
                     return newHeaders;
    @@ -260,12 +259,10 @@ public class RequestValidationFilter implements GlobalFilter, Ordered {
         }
     
         public boolean skipCheckToken(String url){
    -        if (gatewayProperty.getSkipCheckTokenPaths() != null) {
    -            for (String skipCheckTokenPath : gatewayProperty.getSkipCheckTokenPaths()) {
    -                PathMatcher matcher = new AntPathMatcher();
    -                if(matcher.match(skipCheckTokenPath, url)){
    -                    return true;
    -                }
    +        for (String skipCheckTokenPath : gatewayProperty.getSkipCheckTokenPaths()) {
    +            PathMatcher matcher = new AntPathMatcher();
    +            if (matcher.match(skipCheckTokenPath, url)) {
    +                return true;
                 }
             }
             return false;
    diff --git a/damai-server/damai-gateway-service/src/main/java/com/damai/filter/ResponseValidationFilter.java b/damai-server/damai-gateway-service/src/main/java/com/damai/filter/ResponseValidationFilter.java
    index 0d7d83736cf23092b0731ce07a708edb14c56f9d..2dba06efc47304d5afebb9b971ceb8a6ed3fadfa 100644
    --- a/damai-server/damai-gateway-service/src/main/java/com/damai/filter/ResponseValidationFilter.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/filter/ResponseValidationFilter.java
    @@ -2,10 +2,9 @@ package com.damai.filter;
     
     import com.alibaba.fastjson.JSON;
     import com.damai.common.ApiResponse;
    -import com.damai.core.StringUtil;
    -import com.damai.exception.CheckCodeHandler;
    +import com.damai.util.StringUtil;
     import com.damai.service.ChannelDataService;
    -import com.damai.util.RSATool;
    +import com.damai.util.RsaTool;
     import com.damai.vo.GetChannelDataVo;
     import lombok.extern.slf4j.Slf4j;
     import org.reactivestreams.Publisher;
    @@ -36,6 +35,7 @@ import java.util.function.BiFunction;
     import static com.damai.constant.GatewayConstant.CODE;
     import static com.damai.constant.GatewayConstant.ENCRYPT;
     import static com.damai.constant.GatewayConstant.NO_VERIFY;
    +import static com.damai.constant.GatewayConstant.V2;
     import static com.damai.constant.GatewayConstant.VERIFY_VALUE;
     import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.ORIGINAL_RESPONSE_CONTENT_TYPE_ATTR;
     
    @@ -54,11 +54,6 @@ public class ResponseValidationFilter implements GlobalFilter, Ordered {
     
         @Autowired
         private ChannelDataService channelDataService;
    -    
    -    @Autowired
    -    private CheckCodeHandler checkCodeHandler;
    -    
    -
     
         @Override
         public int getOrder() {
    @@ -129,16 +124,13 @@ public class ResponseValidationFilter implements GlobalFilter, Ordered {
             ServerHttpRequest request = serverWebExchange.getRequest();
             String noVerify = request.getHeaders().getFirst(NO_VERIFY);
             String encrypt = request.getHeaders().getFirst(ENCRYPT);
    -        if ((!VERIFY_VALUE.equals(noVerify)) && "v2".equals(encrypt) && StringUtil.isNotEmpty(responseBody)) {
    +        if ((!VERIFY_VALUE.equals(noVerify)) && V2.equals(encrypt) && StringUtil.isNotEmpty(responseBody)) {
                 ApiResponse apiResponse = JSON.parseObject(responseBody, ApiResponse.class);
                 Object data = apiResponse.getData();
                 if (data != null) {
                     String code = request.getHeaders().getFirst(CODE);
    -                
    -                checkCodeHandler.checkCode(code);
    -                
                     GetChannelDataVo channelDataVo = channelDataService.getChannelDataByCode(code);
    -                String rsaEncrypt = RSATool.encrypt(JSON.toJSONString(data),channelDataVo.getDataPublicKey());
    +                String rsaEncrypt = RsaTool.encrypt(JSON.toJSONString(data),channelDataVo.getDataPublicKey());
                     apiResponse.setData(rsaEncrypt);
                     modifyResponseBody = JSON.toJSONString(apiResponse);
                 }
    diff --git a/damai-server/damai-gateway-service/src/main/java/com/damai/hystrixfactory/FineGritHystrixGatewayFilterFactory.java b/damai-server/damai-gateway-service/src/main/java/com/damai/hystrixfactory/FineGritHystrixGatewayFilterFactory.java
    index 1abbe219a687cbe8a13d8e80c38eb74b8038c08b..e385fb295146eca08a102975bdce6021915d046a 100644
    --- a/damai-server/damai-gateway-service/src/main/java/com/damai/hystrixfactory/FineGritHystrixGatewayFilterFactory.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/hystrixfactory/FineGritHystrixGatewayFilterFactory.java
    @@ -62,8 +62,6 @@ public class FineGritHystrixGatewayFilterFactory
     		extends AbstractGatewayFilterFactory {
     
     	private final ObjectProvider dispatcherHandlerProvider;
    -
    -	// do not use this dispatcherHandler directly, use getDispatcherHandler() instead.
     	private volatile DispatcherHandler dispatcherHandler;
     
     	public FineGritHystrixGatewayFilterFactory(
    @@ -195,7 +193,8 @@ public class FineGritHystrixGatewayFilterFactory
     		}
     
     		public void setFallbackUri(URI fallbackUri) {
    -			if (fallbackUri != null && !"forward".equals(fallbackUri.getScheme())) {
    +			String forward = "forward";
    +			if (fallbackUri != null && !forward.equals(fallbackUri.getScheme())) {
     				throw new IllegalArgumentException(
     						"Hystrix Filter currently only supports 'forward' URIs, found "
     								+ fallbackUri);
    @@ -226,7 +225,9 @@ public class FineGritHystrixGatewayFilterFactory
     		}
     	}
     
    -	// TODO: replace with HystrixMonoCommand that we write
    +	/**
    +	 * TODO: replace with HystrixMonoCommand that we write
    +	 * */
     	private class RouteHystrixCommand extends HystrixObservableCommand {
     
     		private final URI fallbackUri;
    diff --git a/damai-server/damai-gateway-service/src/main/java/com/damai/kafka/ProducerConfig.java b/damai-server/damai-gateway-service/src/main/java/com/damai/kafka/ProducerConfig.java
    index 691a823a70a56f28adf70932b9287b63c90cbe3f..9d1c605eb62d42ce2ace7e5fdd1ce79b9cad522c 100644
    --- a/damai-server/damai-gateway-service/src/main/java/com/damai/kafka/ProducerConfig.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/kafka/ProducerConfig.java
    @@ -22,7 +22,7 @@ import java.util.Map;
     public class ProducerConfig {
         
         public Map producerConfigs(ProducerProperty producerProperty) {
    -        Map props = new HashMap<>();
    +        Map props = new HashMap<>(16);
             props.put(org.apache.kafka.clients.producer.ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, producerProperty.getServers());
             props.put(org.apache.kafka.clients.producer.ProducerConfig.RETRIES_CONFIG, producerProperty.getRetries());
             props.put(org.apache.kafka.clients.producer.ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
    diff --git a/damai-server/damai-gateway-service/src/main/java/com/damai/property/GatewayProperty.java b/damai-server/damai-gateway-service/src/main/java/com/damai/property/GatewayProperty.java
    index 06e6f6d8acb2161acd4332ab82a14d847ae13414..6f785b5d3d4b56a2a3e87dfffc9a94cfbd9fb9b0 100644
    --- a/damai-server/damai-gateway-service/src/main/java/com/damai/property/GatewayProperty.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/property/GatewayProperty.java
    @@ -9,13 +9,15 @@ import org.springframework.stereotype.Component;
      * @description: 配置属性
      * @author: 阿宽不是程序员
      **/
    -@Component
     @Data
    +@Component
     public class GatewayProperty {
    -    //需要做频率限制的路径
    +    /**
    +     * 需要做频率限制的路径
    +     */
         @Value("${api.limit.paths:#{null}}")
         private String[] apiRestrictPaths;
         
    -    @Value("${skip.check.token.paths:/**/test/test,/**/user/login,/**/token/data/add}")
    +    @Value("${skip.check.token.paths:/**/user/register,/**/user/exist,/**/user/login,/**/token/data/add}")
         private String[] skipCheckTokenPaths;
     }
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/src/main/java/com/alibaba/csp/sentinel/constant/SentinelConstant.java b/damai-server/damai-gateway-service/src/main/java/com/damai/service/ApiRestrictData.java
    similarity index 41%
    rename from damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/src/main/java/com/alibaba/csp/sentinel/constant/SentinelConstant.java
    rename to damai-server/damai-gateway-service/src/main/java/com/damai/service/ApiRestrictData.java
    index b17e74a9eaea786dfdca7c509dd3581196178f78..4410d94f25517dad2c198ef3554925a7c57f208c 100644
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/src/main/java/com/alibaba/csp/sentinel/constant/SentinelConstant.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/service/ApiRestrictData.java
    @@ -1,13 +1,22 @@
    -package com.alibaba.csp.sentinel.constant;
    +package com.damai.service;
    +
    +import lombok.Data;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: sentinel常量
    + * @description: 接口请求记录 实体对象
      * @author: 阿宽不是程序员
      **/
    -public class SentinelConstant {
    +@Data
    +public class ApiRestrictData {
    +
    +    private Long triggerResult;
    +    
    +    private Long triggerCallStat;
    +    
    +    private Long apiCount;
         
    -    public static final String SPLIT_RESOURCE = "_";
    +    private Long threshold;
         
    -    public static final String GENERAL_URL = "#general";
    +    private Long messageIndex;
     }
    diff --git a/damai-server/damai-gateway-service/src/main/java/com/damai/service/ApiRestrictService.java b/damai-server/damai-gateway-service/src/main/java/com/damai/service/ApiRestrictService.java
    index a510b265ec9653a417854858ec37d81575f50301..48c40e142213ac4ba23dcf20140e552345f3596d 100644
    --- a/damai-server/damai-gateway-service/src/main/java/com/damai/service/ApiRestrictService.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/service/ApiRestrictService.java
    @@ -1,42 +1,40 @@
     package com.damai.service;
     
    +import cn.hutool.core.collection.CollectionUtil;
     import cn.hutool.core.date.DateUtil;
     import com.alibaba.fastjson.JSON;
     import com.alibaba.fastjson.JSONObject;
     import com.baidu.fsg.uid.UidGenerator;
    -import com.damai.core.RedisKeyEnum;
    -import com.damai.core.StringUtil;
    +import com.damai.core.RedisKeyManage;
    +import com.damai.util.StringUtil;
     import com.damai.dto.ApiDataDto;
    +import com.damai.enums.ApiRuleType;
     import com.damai.enums.BaseCode;
     import com.damai.enums.RuleTimeUnit;
     import com.damai.exception.DaMaiFrameException;
     import com.damai.kafka.ApiDataMessageSend;
     import com.damai.property.GatewayProperty;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
    +import com.damai.service.lua.ApiRestrictCacheOperate;
     import com.damai.util.DateUtils;
     import com.damai.vo.DepthRuleVo;
     import com.damai.vo.RuleVo;
     import lombok.extern.slf4j.Slf4j;
     import org.springframework.beans.factory.annotation.Autowired;
    -import org.springframework.core.io.ClassPathResource;
    -import org.springframework.data.redis.core.script.DefaultRedisScript;
     import org.springframework.http.HttpHeaders;
     import org.springframework.http.server.reactive.ServerHttpRequest;
    -import org.springframework.scripting.support.ResourceScriptSource;
     import org.springframework.stereotype.Component;
     import org.springframework.util.AntPathMatcher;
     import org.springframework.util.PathMatcher;
     
    -import javax.annotation.PostConstruct;
    -import javax.annotation.Resource;
     import java.util.ArrayList;
    +import java.util.Collections;
     import java.util.Comparator;
     import java.util.List;
     import java.util.Objects;
     import java.util.Optional;
     import java.util.stream.Collectors;
    -import java.util.stream.Stream;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    @@ -56,27 +54,17 @@ public class ApiRestrictService {
         @Autowired(required = false)
         private ApiDataMessageSend apiDataMessageSend;
         
    -    @Resource
    -    private UidGenerator uidGenerator;
    -    
    -    private DefaultRedisScript redisScript;
    +    @Autowired
    +    private ApiRestrictCacheOperate apiRestrictCacheOperate;
         
    -    @PostConstruct
    -    public void init(){
    -        try {
    -            redisScript = new DefaultRedisScript<>();
    -            redisScript.setScriptSource(new ResourceScriptSource(new ClassPathResource("lua/apiLimit.lua")));
    -            redisScript.setResultType(List.class);
    -        } catch (Exception e) {
    -            log.error("redisScript init lua error",e);
    -        }
    -    }
    +    @Autowired
    +    private UidGenerator uidGenerator;
         
    -    public boolean checkApiRestrict(String requestURI){
    -        if (gatewayProperty.getApiRestrictPaths() != null && gatewayProperty.getApiRestrictPaths().length > 0) {
    +    public boolean checkApiRestrict(String requestUri){
    +        if (gatewayProperty.getApiRestrictPaths() != null) {
                 for (String apiRestrictPath : gatewayProperty.getApiRestrictPaths()) {
                     PathMatcher matcher = new AntPathMatcher();
    -                if(matcher.match(apiRestrictPath, requestURI)){
    +                if(matcher.match(apiRestrictPath, requestUri)){
                         return true;
                     }
                 }
    @@ -88,9 +76,9 @@ public class ApiRestrictService {
             if (checkApiRestrict(url)) {
                 long triggerResult = 0L;
                 long triggerCallStat = 0L;
    -            long apiCount = 0L;
    -            long threshold = 0L;
    -            long messageIndex = -1L;
    +            long apiCount;
    +            long threshold;
    +            long messageIndex;
                 String message = "";
                 
                 String ip = getIpAddress(request);
    @@ -103,78 +91,42 @@ public class ApiRestrictService {
                 try {
                     List depthRuleVoList = new ArrayList<>();
               
    -                RuleVo ruleVo = redisCache.getForHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.ALL_RULE_HASH),RedisKeyWrap.createRedisKey(RedisKeyEnum.RULE).getRelKey(),RuleVo.class);
    +                RuleVo ruleVo = redisCache.getForHash(RedisKeyBuild.createRedisKey(RedisKeyManage.ALL_RULE_HASH), RedisKeyBuild.createRedisKey(RedisKeyManage.RULE).getRelKey(),RuleVo.class);
       
    -                String depthRuleStr = redisCache.getForHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.ALL_RULE_HASH),RedisKeyWrap.createRedisKey(RedisKeyEnum.DEPTH_RULE).getRelKey(),String.class);
    +                String depthRuleStr = redisCache.getForHash(RedisKeyBuild.createRedisKey(RedisKeyManage.ALL_RULE_HASH), RedisKeyBuild.createRedisKey(RedisKeyManage.DEPTH_RULE).getRelKey(),String.class);
                     if (StringUtil.isNotEmpty(depthRuleStr)) {
                         depthRuleVoList = JSON.parseArray(depthRuleStr,DepthRuleVo.class);
                     }
                  
    -                int apiRuleType = 0;
    +                int apiRuleType = ApiRuleType.NO_RULE.getCode();
                     if (Optional.ofNullable(ruleVo).isPresent()) {
    -                    apiRuleType = 1;
    +                    apiRuleType = ApiRuleType.RULE.getCode();
                         message = ruleVo.getMessage();
                     }
    -                if (Optional.ofNullable(ruleVo).isPresent() && depthRuleVoList.size() > 0) {
    -                    apiRuleType = 2;
    +                if (Optional.ofNullable(ruleVo).isPresent() && CollectionUtil.isNotEmpty(depthRuleVoList)) {
    +                    apiRuleType = ApiRuleType.DEPTH_RULE.getCode();
                     }
    -                if (apiRuleType == 1 || apiRuleType == 2) {
    -                    JSONObject parameter = new JSONObject();
    +                if (apiRuleType == ApiRuleType.RULE.getCode() || apiRuleType == ApiRuleType.DEPTH_RULE.getCode()) {
                         
    -                    parameter.put("apiRuleType",apiRuleType);
    +                    assert ruleVo != null;
    +                    JSONObject parameter = getRuleParameter(apiRuleType,commonKey,ruleVo);
                         
    -                    String ruleKey = "rule_api_limit" + "_" + commonKey;
    -                    parameter.put("ruleKey",ruleKey);
    -              
    -                    parameter.put("statTime",String.valueOf(Objects.equals(ruleVo.getStatTimeType(), RuleTimeUnit.SECOND.getCode()) ? ruleVo.getStatTime() : ruleVo.getStatTime() * 60));
    -                    
    -                    parameter.put("threshold",ruleVo.getThreshold());
    -               
    -                    parameter.put("effectiveTime",String.valueOf(Objects.equals(ruleVo.getEffectiveTimeType(), RuleTimeUnit.SECOND.getCode()) ? ruleVo.getEffectiveTime() : ruleVo.getEffectiveTime() * 60));
    -                    
    -                    parameter.put("ruleLimitKey",RedisKeyWrap.createRedisKey(RedisKeyEnum.RULE_LIMIT,commonKey).getRelKey());
    -                    
    -                    parameter.put("zSetRuleStatKey",RedisKeyWrap.createRedisKey(RedisKeyEnum.Z_SET_RULE_STAT,commonKey).getRelKey());
    -                    
    -                    if (apiRuleType == 2) {
    -                        depthRuleVoList = sortStartTimeWindow(depthRuleVoList);
    -                        
    -                        parameter.put("depthRuleSize",String.valueOf(depthRuleVoList.size()));
    -                        
    -                        parameter.put("currentTime",System.currentTimeMillis());
    -                        
    -                        List depthRules = new ArrayList<>();
    -                        for (int i = 0; i < depthRuleVoList.size(); i++) {
    -                            JSONObject depthRule = new JSONObject();
    -                            DepthRuleVo depthRuleVo = depthRuleVoList.get(i);
    -                            
    -                            depthRule.put("statTime",Objects.equals(depthRuleVo.getStatTimeType(), RuleTimeUnit.SECOND.getCode()) ? depthRuleVo.getStatTime() : depthRuleVo.getStatTime() * 60);
    -                            
    -                            depthRule.put("threshold",depthRuleVo.getThreshold());
    -                            
    -                            depthRule.put("effectiveTime",String.valueOf(Objects.equals(depthRuleVo.getEffectiveTimeType(), RuleTimeUnit.SECOND.getCode()) ? depthRuleVo.getEffectiveTime() : depthRuleVo.getEffectiveTime() * 60));
    -                            
    -                            depthRule.put("depthRuleLimit",RedisKeyWrap.createRedisKey(RedisKeyEnum.DEPTH_RULE_LIMIT,i,commonKey).getRelKey());
    -
    -                            depthRule.put("startTimeWindowTimestamp",depthRuleVo.getStartTimeWindowTimestamp());
    -                            depthRule.put("endTimeWindowTimestamp",depthRuleVo.getEndTimeWindowTimestamp());
    -                            
    -                            depthRules.add(depthRule);
    -                        }
    +                    if (apiRuleType == ApiRuleType.DEPTH_RULE.getCode()) {
                             
    -                        parameter.put("depthRules",depthRules);
    +                        parameter = getDepthRuleParameter(parameter,commonKey,depthRuleVoList);
                         }
    -                    List executeResult = (ArrayList)redisCache.getInstance().execute(redisScript, Stream.of(parameter).map(p -> JSON.toJSONString(p)).collect(Collectors.toList()), new String[]{});
    -                
    -                    triggerResult = Optional.ofNullable(executeResult.get(0)).orElse(0L);
    +                    ApiRestrictData apiRestrictData = apiRestrictCacheOperate
    +                            .apiRuleOperate(Collections.singletonList(JSON.toJSONString(parameter)), new Object[]{});
    +                    
    +                    triggerResult = apiRestrictData.getTriggerResult();
                  
    -                    triggerCallStat = Optional.ofNullable(executeResult.get(1)).orElse(0L);
    +                    triggerCallStat = apiRestrictData.getTriggerCallStat();
                     
    -                    apiCount = Optional.ofNullable(executeResult.get(2)).orElse(0L);
    +                    apiCount = apiRestrictData.getApiCount();
                       
    -                    threshold = Optional.ofNullable(executeResult.get(3)).orElse(0L);
    +                    threshold = apiRestrictData.getThreshold();
                  
    -                    messageIndex = Optional.ofNullable(executeResult.get(4)).orElse(-1L);
    +                    messageIndex = apiRestrictData.getMessageIndex();
                         if (messageIndex != -1) {
                             message = Optional.ofNullable(depthRuleVoList.get((int)messageIndex))
                                     .map(DepthRuleVo::getMessage)
    @@ -187,7 +139,7 @@ public class ApiRestrictService {
                     log.error("redis Lua eror", e);
                 }
                 if (triggerResult == 1) {
    -                if (triggerCallStat == 1 || triggerCallStat == 2) {
    +                if (triggerCallStat == ApiRuleType.RULE.getCode() || triggerCallStat == ApiRuleType.DEPTH_RULE.getCode()) {
                         saveApiData(request, url, (int)triggerCallStat);
                     }
                     String defaultMessage = BaseCode.API_RULE_TRIGGER.getMsg();
    @@ -199,11 +151,62 @@ public class ApiRestrictService {
             }
         }
         
    +    public JSONObject getRuleParameter(int apiRuleType, String commonKey, RuleVo ruleVo){
    +        JSONObject parameter = new JSONObject();
    +        
    +        parameter.put("apiRuleType",apiRuleType);
    +        
    +        String ruleKey = "rule_api_limit" + "_" + commonKey;
    +        parameter.put("ruleKey",ruleKey);
    +        
    +        parameter.put("statTime",String.valueOf(Objects.equals(ruleVo.getStatTimeType(), RuleTimeUnit.SECOND.getCode()) ? ruleVo.getStatTime() : ruleVo.getStatTime() * 60));
    +        
    +        parameter.put("threshold",ruleVo.getThreshold());
    +        
    +        parameter.put("effectiveTime",String.valueOf(Objects.equals(ruleVo.getEffectiveTimeType(), RuleTimeUnit.SECOND.getCode()) ? ruleVo.getEffectiveTime() : ruleVo.getEffectiveTime() * 60));
    +        
    +        parameter.put("ruleLimitKey", RedisKeyBuild.createRedisKey(RedisKeyManage.RULE_LIMIT,commonKey).getRelKey());
    +        
    +        parameter.put("zSetRuleStatKey", RedisKeyBuild.createRedisKey(RedisKeyManage.Z_SET_RULE_STAT,commonKey).getRelKey());
    +        
    +        return parameter;
    +    }
    +    
    +    public JSONObject getDepthRuleParameter(JSONObject parameter,String commonKey,List depthRuleVoList){
    +        depthRuleVoList = sortStartTimeWindow(depthRuleVoList);
    +        
    +        parameter.put("depthRuleSize",String.valueOf(depthRuleVoList.size()));
    +        
    +        parameter.put("currentTime",System.currentTimeMillis());
    +        
    +        List depthRules = new ArrayList<>();
    +        for (int i = 0; i < depthRuleVoList.size(); i++) {
    +            JSONObject depthRule = new JSONObject();
    +            DepthRuleVo depthRuleVo = depthRuleVoList.get(i);
    +            
    +            depthRule.put("statTime",Objects.equals(depthRuleVo.getStatTimeType(), RuleTimeUnit.SECOND.getCode()) ? depthRuleVo.getStatTime() : depthRuleVo.getStatTime() * 60);
    +            
    +            depthRule.put("threshold",depthRuleVo.getThreshold());
    +            
    +            depthRule.put("effectiveTime",String.valueOf(Objects.equals(depthRuleVo.getEffectiveTimeType(), RuleTimeUnit.SECOND.getCode()) ? depthRuleVo.getEffectiveTime() : depthRuleVo.getEffectiveTime() * 60));
    +            
    +            depthRule.put("depthRuleLimit", RedisKeyBuild.createRedisKey(RedisKeyManage.DEPTH_RULE_LIMIT,i,commonKey).getRelKey());
    +            
    +            depthRule.put("startTimeWindowTimestamp",depthRuleVo.getStartTimeWindowTimestamp());
    +            depthRule.put("endTimeWindowTimestamp",depthRuleVo.getEndTimeWindowTimestamp());
    +            
    +            depthRules.add(depthRule);
    +        }
    +        
    +        parameter.put("depthRules",depthRules);
    +        
    +        return parameter;
    +    }
    +    
         public List sortStartTimeWindow(List depthRuleVoList){
    -        return depthRuleVoList.stream().map(depthRuleVo -> {
    +        return depthRuleVoList.stream().peek(depthRuleVo -> {
                 depthRuleVo.setStartTimeWindowTimestamp(getTimeWindowTimestamp(depthRuleVo.getStartTimeWindow()));
                 depthRuleVo.setEndTimeWindowTimestamp((getTimeWindowTimestamp(depthRuleVo.getEndTimeWindow())));
    -            return depthRuleVo;
             }).sorted(Comparator.comparing(DepthRuleVo::getStartTimeWindowTimestamp)).collect(Collectors.toList());
         }
         
    @@ -218,38 +221,40 @@ public class ApiRestrictService {
           * @param request 请求
           */
         public static String getIpAddress(ServerHttpRequest request) {
    +        String unknown = "unknown";
    +        String split = ",";
             HttpHeaders headers = request.getHeaders();
             String ip = headers.getFirst("x-forwarded-for");
    -        if (ip != null && ip.length() != 0 && !"unknown".equalsIgnoreCase(ip)) {
    +        if (ip != null && ip.length() != 0 && !unknown.equalsIgnoreCase(ip)) {
                 // 多次反向代理后会有多个ip值,第一个ip才是真实ip
    -            if (ip.contains(",")) {
    -                ip = ip.split(",")[0];
    +            if (ip.contains(split)) {
    +                ip = ip.split(split)[0];
                 }
             }
    -        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
    +        if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
                 ip = headers.getFirst("Proxy-Client-IP");
             }
    -        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
    +        if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
                 ip = headers.getFirst("WL-Proxy-Client-IP");
             }
    -        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
    +        if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
                 ip = headers.getFirst("HTTP_CLIENT_IP");
             }
    -        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
    +        if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
                 ip = headers.getFirst("HTTP_X_FORWARDED_FOR");
             }
    -        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
    +        if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
                 ip = headers.getFirst("X-Real-IP");
             }
    -        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
    -            ip = request.getRemoteAddress().getAddress().getHostAddress();
    +        if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
    +            ip = Objects.requireNonNull(request.getRemoteAddress()).getAddress().getHostAddress();
             }
             return ip;
         }
         
         public void saveApiData(ServerHttpRequest request, String apiUrl, Integer type){
             ApiDataDto apiDataDto = new ApiDataDto();
    -        apiDataDto.setId(uidGenerator.getUID());
    +        apiDataDto.setId(uidGenerator.getUid());
             apiDataDto.setApiAddress(getIpAddress(request));
             apiDataDto.setApiUrl(apiUrl);
             apiDataDto.setCreateTime(DateUtils.now());
    diff --git a/damai-server/damai-gateway-service/src/main/java/com/damai/service/ChannelDataService.java b/damai-server/damai-gateway-service/src/main/java/com/damai/service/ChannelDataService.java
    index 2a0c9376762c0c5c9d7ec36271b9c3ccca51f8f5..54c172463ef77c68cd55fba19a58ebae061b4728 100644
    --- a/damai-server/damai-gateway-service/src/main/java/com/damai/service/ChannelDataService.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/service/ChannelDataService.java
    @@ -2,18 +2,25 @@ package com.damai.service;
     
     import com.damai.client.BaseDataClient;
     import com.damai.common.ApiResponse;
    -import com.damai.core.RedisKeyEnum;
    +import com.damai.core.RedisKeyManage;
    +import com.damai.util.StringUtil;
     import com.damai.dto.GetChannelDataByCodeDto;
     import com.damai.enums.BaseCode;
    +import com.damai.exception.ArgumentError;
    +import com.damai.exception.ArgumentException;
     import com.damai.exception.DaMaiFrameException;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
     import com.damai.vo.GetChannelDataVo;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Service;
     
    +import java.util.ArrayList;
    +import java.util.List;
     import java.util.Objects;
     
    +import static com.damai.constant.GatewayConstant.CODE;
    +
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
      * @description: 渠道数据获取
    @@ -21,6 +28,8 @@ import java.util.Objects;
      **/
     @Service
     public class ChannelDataService {
    +    
    +    private final static String EXCEPTION_MESSAGE = "code参数为空";
     
         @Autowired
         private BaseDataClient baseDataClient;
    @@ -28,7 +37,19 @@ public class ChannelDataService {
         @Autowired
         private RedisCache redisCache;
         
    +    public void checkCode(String code){
    +        if (StringUtil.isEmpty(code)) {
    +            ArgumentError argumentError = new ArgumentError();
    +            argumentError.setArgumentName(CODE);
    +            argumentError.setMessage(EXCEPTION_MESSAGE);
    +            List argumentErrorList = new ArrayList<>();
    +            argumentErrorList.add(argumentError);
    +            throw new ArgumentException(BaseCode.ARGUMENT_EMPTY.getCode(),argumentErrorList);
    +        }
    +    }
    +    
         public GetChannelDataVo getChannelDataByCode(String code){
    +        checkCode(code);
             GetChannelDataVo channelDataVo = getChannelDataByRedis(code);
             if (Objects.isNull(channelDataVo)) {
                 channelDataVo = getChannelDataByClient(code);
    @@ -37,7 +58,7 @@ public class ChannelDataService {
         }
         
         private GetChannelDataVo getChannelDataByRedis(String code){
    -        return redisCache.get(RedisKeyWrap.createRedisKey(RedisKeyEnum.CHANNEL_DATA,code),GetChannelDataVo.class);
    +        return redisCache.get(RedisKeyBuild.createRedisKey(RedisKeyManage.CHANNEL_DATA,code),GetChannelDataVo.class);
         }
         
         private GetChannelDataVo getChannelDataByClient(String code){
    diff --git a/damai-server/damai-gateway-service/src/main/java/com/damai/service/TokenService.java b/damai-server/damai-gateway-service/src/main/java/com/damai/service/TokenService.java
    index 65ceab05b98ad2b6c9c7b2af62d73f33b7256f4b..87fcb735026b3c6b2f354c773e095b7c9d256321 100644
    --- a/damai-server/damai-gateway-service/src/main/java/com/damai/service/TokenService.java
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/service/TokenService.java
    @@ -1,13 +1,13 @@
     package com.damai.service;
     
     import com.alibaba.fastjson.JSONObject;
    -import com.damai.core.RedisKeyEnum;
    -import com.damai.core.StringUtil;
    +import com.damai.core.RedisKeyManage;
    +import com.damai.util.StringUtil;
     import com.damai.enums.BaseCode;
     import com.damai.exception.DaMaiFrameException;
     import com.damai.jwt.TokenUtil;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
     import com.damai.vo.UserVo;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Component;
    @@ -23,24 +23,22 @@ import java.util.Optional;
     @Component
     public class TokenService {
         
    -    private static final String TOKEN_SECRET = "CSYZWECHAT";
    -    
         @Autowired
         private RedisCache redisCache;
         
    -    public String parseToken(String token){
    -        String userStr = TokenUtil.parseToken(token,TOKEN_SECRET);
    +    public String parseToken(String token,String tokenSecret){
    +        String userStr = TokenUtil.parseToken(token,tokenSecret);
             if (StringUtil.isNotEmpty(userStr)) {
                 return JSONObject.parseObject(userStr).getString("userId");
             }
             return null;
         }
         
    -    public UserVo getUser(String token){
    +    public UserVo getUser(String token,String code,String tokenSecret){
             UserVo userVo = null;
    -        String userId = parseToken(token);
    +        String userId = parseToken(token,tokenSecret);
             if (StringUtil.isNotEmpty(userId)) {
    -            userVo = redisCache.get(RedisKeyWrap.createRedisKey(RedisKeyEnum.USER_ID, userId), UserVo.class);
    +            userVo = redisCache.get(RedisKeyBuild.createRedisKey(RedisKeyManage.USER_LOGIN, code, userId), UserVo.class);
             }
             return Optional.ofNullable(userVo).orElseThrow(() -> new DaMaiFrameException(BaseCode.USER_EMPTY));
         }
    diff --git a/damai-server/damai-gateway-service/src/main/java/com/damai/service/lua/ApiRestrictCacheOperate.java b/damai-server/damai-gateway-service/src/main/java/com/damai/service/lua/ApiRestrictCacheOperate.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..7ee77dc6b8f2b7b9a937ac26f867d87927bb7c50
    --- /dev/null
    +++ b/damai-server/damai-gateway-service/src/main/java/com/damai/service/lua/ApiRestrictCacheOperate.java
    @@ -0,0 +1,45 @@
    +package com.damai.service.lua;
    +
    +import com.alibaba.fastjson.JSON;
    +import com.damai.redis.RedisCache;
    +import com.damai.service.ApiRestrictData;
    +import lombok.extern.slf4j.Slf4j;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.core.io.ClassPathResource;
    +import org.springframework.data.redis.core.script.DefaultRedisScript;
    +import org.springframework.scripting.support.ResourceScriptSource;
    +import org.springframework.stereotype.Component;
    +
    +import javax.annotation.PostConstruct;
    +import java.util.List;
    +
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: lua执行
    + * @author: 阿宽不是程序员
    + **/
    +@Slf4j
    +@Component
    +public class ApiRestrictCacheOperate {
    +    
    +    @Autowired
    +    private RedisCache redisCache;
    +    
    +    private DefaultRedisScript redisScript;
    +    
    +    @PostConstruct
    +    public void init(){
    +        try {
    +            redisScript = new DefaultRedisScript<>();
    +            redisScript.setScriptSource(new ResourceScriptSource(new ClassPathResource("lua/apiLimit.lua")));
    +            redisScript.setResultType(String.class);
    +        } catch (Exception e) {
    +            log.error("redisScript init lua error",e);
    +        }
    +    }
    +    
    +    public ApiRestrictData apiRuleOperate(List keys, Object[] args){
    +        Object object = redisCache.getInstance().execute(redisScript, keys, args);
    +        return JSON.parseObject((String)object, ApiRestrictData.class);
    +    }
    +}
    diff --git a/damai-server/damai-gateway-service/src/main/resources/application.yml b/damai-server/damai-gateway-service/src/main/resources/application.yml
    new file mode 100644
    index 0000000000000000000000000000000000000000..b3c045270e17ffab14060dd106ca8fedd1a7fe9a
    --- /dev/null
    +++ b/damai-server/damai-gateway-service/src/main/resources/application.yml
    @@ -0,0 +1,163 @@
    +#服务端口
    +server:
    +  port: 6085
    +# 应用名称
    +spring:
    +  application:
    +    name: ${prefix.distinction.name:damai}-gateway-service
    +  main:
    +    allow-bean-definition-overriding: true
    +  redis:
    +    database: 0
    +    host: 127.0.0.1
    +    port: 6379
    +    timeout: 3000
    +  cloud:
    +    nacos:
    +      discovery:
    +        server-addr: 127.0.0.1:8848
    +        username: nacos
    +        password: nacos
    +    sentinel:
    +      eager: true
    +      transport:
    +        port: 8768
    +        dashboard: 127.0.0.1:8082
    +      datasource:
    +        degrade:
    +          nacos:
    +            server-addr: 127.0.0.1:8848
    +            dataId: ${spring.application.name}-degrade-rules
    +            groupId: SENTINEL_GROUP
    +            dataType: json
    +            rule-type: degrade
    +        flow:
    +          nacos:
    +            server-addr: 127.0.0.1:8848
    +            dataId: ${spring.application.name}-flow-rules
    +            groupId: SENTINEL_GROUP
    +            dataType: json
    +            rule-type: flow
    +    gateway:
    +      enabled: true
    +      discovery:
    +        locator:
    +          enabled: true
    +      routes:
    +        - id: ${prefix.distinction.name:damai}-base-data-service
    +          uri: lb://${prefix.distinction.name:damai}-base-data-service
    +          predicates:
    +            - Path=/damai/basedata/**
    +          filters:
    +            - StripPrefix=2
    +          metadata:
    +            title: 基础数据服务
    +
    +        - id: ${prefix.distinction.name:damai}-customize-service
    +          uri: lb://${prefix.distinction.name:damai}-customize-service
    +          predicates:
    +            - Path=/damai/customize/**
    +          filters:
    +            - StripPrefix=2
    +          metadata:
    +            title: 定制化服务
    +
    +        - id: ${prefix.distinction.name:damai}-job-service
    +          uri: lb://${prefix.distinction.name:damai}-job-service
    +          predicates:
    +            - Path=/damai/job/**
    +          filters:
    +            - StripPrefix=2
    +          metadata:
    +            title: 任务执行服务
    +
    +        - id: ${prefix.distinction.name:damai}-order-service
    +          uri: lb://${prefix.distinction.name:damai}-order-service
    +          predicates:
    +            - Path=/damai/order/**
    +          filters:
    +            - StripPrefix=2
    +          metadata:
    +            title: 订单服务
    +
    +        - id: ${prefix.distinction.name:damai}-pay-service
    +          uri: lb://${prefix.distinction.name:damai}-pay-service
    +          predicates:
    +            - Path=/damai/pay/**
    +          filters:
    +            - StripPrefix=2
    +          metadata:
    +            title: 支付服务
    +
    +        - id: ${prefix.distinction.name:damai}-program-service
    +          uri: lb://${prefix.distinction.name:damai}-program-service
    +          predicates:
    +            - Path=/damai/program/**
    +          filters:
    +            - StripPrefix=2
    +          metadata:
    +            title: 节目服务
    +
    +        - id: ${prefix.distinction.name:damai}-user-service
    +          uri: lb://${prefix.distinction.name:damai}-user-service
    +          predicates:
    +            - Path=/damai/user/**
    +          filters:
    +            - StripPrefix=2
    +          metadata:
    +            title: 用户服务
    +api:
    +  limit:
    +    paths: /**/customize/test/test
    +kafka:
    +  producer:
    +    servers: 127.0.0.1:9092
    +    topic: save_api_data    
    +feign:
    +  sentinel:
    +    enabled: false
    +  hystrix:
    +    enabled: true
    +  httpclient:
    +    enabled: false
    +  okhttp:
    +    enabled: true
    +  compression:
    +    request:
    +      enabled: true
    +      mime-types: text/xml,application/xml,application/json
    +      min-request-size: 512
    +    response:
    +      enabled: true
    +hystrix:
    +  command:
    +    default:
    +      execution:
    +        timeout:
    +          enabled: true
    +        isolation:
    +          thread:
    +            timeoutInMilliseconds: 10000
    +          semaphore:
    +            maxConcurrentRequests: 99999
    +ribbon:
    +  ReadTimeout: 60000
    +  ConnectTimeout: 60000
    +  MaxAutoRetries: 0
    +  MaxAutoRetriesNextServer: 1
    +management:
    +  endpoints:
    +    web:
    +      exposure:
    +        include: '*'
    +    health:
    +      show-details: always
    +  security:
    +    enabled: false
    +  health:
    +    elasticsearch:
    +      enabled: false
    +jasypt:
    +  encryptor:
    +    password: bgtjkjl!%^sdc
    +    algorithm: PBEWithMD5AndDES
    \ No newline at end of file
    diff --git a/damai-server/damai-gateway-service/src/main/resources/bootstrap.yml b/damai-server/damai-gateway-service/src/main/resources/bootstrap.yml
    deleted file mode 100644
    index 3394b0f39a4d70c63774d4e25596d94950d305fb..0000000000000000000000000000000000000000
    --- a/damai-server/damai-gateway-service/src/main/resources/bootstrap.yml
    +++ /dev/null
    @@ -1,19 +0,0 @@
    -#服务端口
    -server:
    -  port: 6085
    -# 应用名称
    -spring:
    -  application:
    -    name: ${prefix.distinction.name:damai}-gateway-service
    -    #name: ${prefix.distinction.name:damai}-gateway-single-service
    -  cloud:
    -    nacos:
    -      discovery:
    -        server-addr: 62.234.31.217:8848
    -        username: nacos
    -        password: nacos
    -      config:
    -        server-addr: 62.234.31.217:8848
    -        file-extension: yaml
    -        username: nacos
    -        password: nacos
    \ No newline at end of file
    diff --git a/damai-server/damai-gateway-service/src/main/resources/log4j2.xml b/damai-server/damai-gateway-service/src/main/resources/log4j2.xml
    index 124e4903bf764eade109171350ae87042f56a0da..f2d20fd0ca24bba278150764fedb9b9e497e9201 100644
    --- a/damai-server/damai-gateway-service/src/main/resources/log4j2.xml
    +++ b/damai-server/damai-gateway-service/src/main/resources/log4j2.xml
    @@ -10,10 +10,10 @@
         
             
             .
    -        gateway
    +        gateway-service
             local
             log
    -        [gateway] [%X{traceId}] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n
    +        [gateway-service] [%X{traceId}] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n
             UTF-8
             com.damai
         
    diff --git a/damai-server/damai-gateway-service/src/main/resources/lua/apiLimit.lua b/damai-server/damai-gateway-service/src/main/resources/lua/apiLimit.lua
    index a4072914517031cbfb86eb38a44681df3b87ec92..79310ea688c0e6ed34249afa66a9125d0296bcf5 100644
    --- a/damai-server/damai-gateway-service/src/main/resources/lua/apiLimit.lua
    +++ b/damai-server/damai-gateway-service/src/main/resources/lua/apiLimit.lua
    @@ -66,15 +66,18 @@ if (api_rule_type == 2) then
                         trigger_result = 1
                         trigger_call_Stat = 2
                         message_index = index
    -                    return {trigger_result,trigger_call_Stat,api_count,threshold,message_index}
    +                    return string.format('{"triggerResult": %d, "triggerCallStat": %d, "apiCount": %d, "threshold": %d, "messageIndex": %d}'
    +                    ,trigger_result,trigger_call_Stat,api_count,threshold,message_index)
                     end
                 end
                 if (redis.call('exists', depth_rule_limit_key) == 1) then
                     trigger_result = 1
                     message_index = index
    -                return {trigger_result,trigger_call_Stat,api_count,threshold,message_index}
    +                return string.format('{"triggerResult": %d, "triggerCallStat": %d, "apiCount": %d, "threshold": %d, "messageIndex": %d}'
    +                ,trigger_result,trigger_call_Stat,api_count,threshold,message_index)
                 end
             end
         end
     end
    -return {trigger_result,trigger_call_Stat,api_count,threshold,message_index}
    +return string.format('{"triggerResult": %d, "triggerCallStat": %d, "apiCount": %d, "threshold": %d, "messageIndex": %d}'
    +,trigger_result,trigger_call_Stat,api_count,threshold,message_index)
    diff --git a/damai-server/damai-job-service/src/main/java/com/damai/controller/JobInfoController.java b/damai-server/damai-job-service/src/main/java/com/damai/controller/JobInfoController.java
    index f786691f0633049cb2933007acb45140dfbe6a9f..de8b766a076549fd453abfeec9d51922993c62bf 100644
    --- a/damai-server/damai-job-service/src/main/java/com/damai/controller/JobInfoController.java
    +++ b/damai-server/damai-job-service/src/main/java/com/damai/controller/JobInfoController.java
    @@ -24,7 +24,7 @@ import javax.validation.Valid;
      **/
     @RestController
     @RequestMapping("/jobInfo")
    -@Api(tags = "jobInfo", description = "任务")
    +@Api(tags = "jobInfo", value = "任务")
     public class JobInfoController {
         
         @Autowired
    diff --git a/damai-server/damai-job-service/src/main/java/com/damai/controller/JobRunRecordController.java b/damai-server/damai-job-service/src/main/java/com/damai/controller/JobRunRecordController.java
    index 855c7da30a9729aae21284c96363fc00fe092542..1aba59c143b0f583668d8bc4cfc11c3483c0e6ca 100644
    --- a/damai-server/damai-job-service/src/main/java/com/damai/controller/JobRunRecordController.java
    +++ b/damai-server/damai-job-service/src/main/java/com/damai/controller/JobRunRecordController.java
    @@ -19,15 +19,15 @@ import javax.validation.Valid;
      **/
     @RestController
     @RequestMapping("/jobRunRecord")
    -@Api(tags = "jobRunRecord", description = "任务执行记录")
    +@Api(tags = "jobRunRecord", value = "任务执行记录")
     public class JobRunRecordController {
         
         @Autowired
         private JobRunRecordService jobRunRecordService;
         
         @RequestMapping(value = "/callBack",method = RequestMethod.POST)
    -    public ApiResponse callBack(@Valid @RequestBody JobCallBackDto JobCallBackDto) {
    -        return ApiResponse.ok(jobRunRecordService.callBack(JobCallBackDto));
    +    public ApiResponse callBack(@Valid @RequestBody JobCallBackDto jobCallBackDto) {
    +        return ApiResponse.ok(jobRunRecordService.callBack(jobCallBackDto));
         }
         
         
    diff --git a/damai-server/damai-job-service/src/main/java/com/damai/mapper/JobRunRecordMapper.java b/damai-server/damai-job-service/src/main/java/com/damai/mapper/JobRunRecordMapper.java
    index ac40da8730441a5c2fb54a7e742569035e18798d..1eabfd505edd9f0bc4881b913dc3154441253ad8 100644
    --- a/damai-server/damai-job-service/src/main/java/com/damai/mapper/JobRunRecordMapper.java
    +++ b/damai-server/damai-job-service/src/main/java/com/damai/mapper/JobRunRecordMapper.java
    @@ -10,5 +10,10 @@ import com.damai.entity.JobRunRecord;
      **/
     public interface JobRunRecordMapper extends BaseMapper {
         
    +    /**
    +     * 上报日志状态
    +     * @param jobRunRecord 数据
    +     * @return 结果
    +     * */
         int callBack(JobRunRecord jobRunRecord);
     }
    diff --git a/damai-server/damai-job-service/src/main/java/com/damai/run/ServiceJobRun.java b/damai-server/damai-job-service/src/main/java/com/damai/run/ServiceJobRun.java
    index 0742891f6d58330d62c48441fb4e4942520184a0..12f18709d986ca734538f3c8f00e44ab10727394 100644
    --- a/damai-server/damai-job-service/src/main/java/com/damai/run/ServiceJobRun.java
    +++ b/damai-server/damai-job-service/src/main/java/com/damai/run/ServiceJobRun.java
    @@ -2,7 +2,7 @@ package com.damai.run;
     
     import com.alibaba.fastjson.JSONObject;
     import com.baidu.fsg.uid.UidGenerator;
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import com.damai.entity.JobInfo;
     import com.damai.entity.JobRunRecord;
     import com.damai.enums.BaseCode;
    @@ -61,7 +61,7 @@ public class ServiceJobRun {
             Integer method = jobInfo.getMethod();
             String params = jobInfo.getParams();
             
    -        String traceId = String.valueOf(uidGenerator.getUID());
    +        String traceId = String.valueOf(uidGenerator.getUid());
             
             JSONObject jsonObjectHeaders = new JSONObject();
             if (StringUtil.isNotEmpty(headers)) {
    @@ -71,7 +71,7 @@ public class ServiceJobRun {
             jsonObjectHeaders.put(TRACE_ID,traceId);
             
             JobRunRecord jobRunRecord = new JobRunRecord();
    -        jobRunRecord.setId(uidGenerator.getUID());
    +        jobRunRecord.setId(uidGenerator.getUid());
             jobRunRecord.setJobId(id);
             jobRunRecord.setCreateTime(new Date());
             jobRunRecord.setTraceId(traceId);
    @@ -120,7 +120,7 @@ public class ServiceJobRun {
             HttpEntity requestEntity = new HttpEntity(header);
             if (StringUtil.isNotEmpty(params)) {
                 JSONObject jsonObjectParams = JSONObject.parseObject(params);
    -            url = splicingURL(url, jsonObjectParams);
    +            url = splicingUrl(url, jsonObjectParams);
             }
             ResponseEntity exchange = restTemplate.exchange(url, HttpMethod.GET, requestEntity, String.class);
             
    @@ -130,21 +130,22 @@ public class ServiceJobRun {
         /**
          * get请求拼接url
          *
    -     * @param url
    -     * @param params
    -     * @return
    +     * @param url 请求
    +     * @param params 参数
    +     * @return 结果
          */
    -    private String splicingURL(String url, JSONObject params) {
    +    private String splicingUrl(String url, JSONObject params) {
    +        String questionMark = "?";
             if (null == params) {
                 return url;
             }
             StringBuilder sb = new StringBuilder(url);
    -        if (url.contains("?")) {
    -            if (!url.endsWith("?")) {
    +        if (url.contains(questionMark)) {
    +            if (!url.endsWith(questionMark)) {
                     sb.append("&");
                 }
             } else {
    -            sb.append("?");
    +            sb.append(questionMark);
             }
             for (String str : params.keySet()) {
                 sb.append(str).append("=").append(params.getString(str)).append("&");
    @@ -175,7 +176,7 @@ public class ServiceJobRun {
             }
             String result = null;
             if (isApplication) {
    -            Map paramMap = new HashMap<>();
    +            Map paramMap = new HashMap<>(8);
                 if (StringUtil.isNotEmpty(params)) {
                     JSONObject jsonObjectParams =  JSONObject.parseObject(params);
                     for (String jsonObjectParam : jsonObjectParams.keySet()) {
    diff --git a/damai-server/damai-job-service/src/main/java/com/damai/service/JobInfoService.java b/damai-server/damai-job-service/src/main/java/com/damai/service/JobInfoService.java
    index 0d379ada8f98ca77b52d4f69fc65c45861446c14..5b583895a5a55608e05dff837c93b380d708ed05 100644
    --- a/damai-server/damai-job-service/src/main/java/com/damai/service/JobInfoService.java
    +++ b/damai-server/damai-job-service/src/main/java/com/damai/service/JobInfoService.java
    @@ -43,7 +43,7 @@ public class JobInfoService extends ServiceImpl {
         public void add(final JobInfoDto jobInfoDto) {
             JobInfo jobInfo = new JobInfo();
             BeanUtils.copyProperties(jobInfoDto,jobInfo);
    -        jobInfo.setId(uidGenerator.getUID());
    +        jobInfo.setId(uidGenerator.getUid());
             jobInfo.setCreateTime(new Date());
             jobInfoMapper.insert(jobInfo);
         }
    diff --git a/damai-server/damai-job-service/src/main/resources/bootstrap.yml b/damai-server/damai-job-service/src/main/resources/bootstrap.yml
    index de54e04914da5923b41566d8b213487faa277de2..23cde14422f3d5daf3d694860ce85f6c7d0438f9 100644
    --- a/damai-server/damai-job-service/src/main/resources/bootstrap.yml
    +++ b/damai-server/damai-job-service/src/main/resources/bootstrap.yml
    @@ -10,9 +10,9 @@ spring:
       cloud:
         nacos:
           discovery:
    -        server-addr: www.cookframe.com:8848
    +        server-addr: 127.0.0.1:8848
           config:
    -        server-addr: 62.234.31.217:8848
    +        server-addr: 127.0.0.1:8848
             file-extension: yaml
             shared-configs:
               - data-id: common.yaml
    diff --git a/damai-server/damai-mybatis-puls-service/src/main/java/com/damai/MybatisPlusGenerator.java b/damai-server/damai-mybatis-puls-service/src/main/java/com/damai/MybatisPlusGenerator.java
    index af8a6e9b90b7df31a0caf67dbe732d6c74b2d211..c058b3e2ade0cba55c354ea162490aa10d03ad98 100644
    --- a/damai-server/damai-mybatis-puls-service/src/main/java/com/damai/MybatisPlusGenerator.java
    +++ b/damai-server/damai-mybatis-puls-service/src/main/java/com/damai/MybatisPlusGenerator.java
    @@ -20,7 +20,6 @@ public class MybatisPlusGenerator {
                     .globalConfig(builder -> {
                         builder.author("k") // 设置作者
                                 //.enableSwagger() // 开启 swagger 模式
    -                            .fileOverride() // 覆盖已生成文件
                                 .outputDir("D://"); // 指定输出目录
                     })
                     .dataSourceConfig(builder -> builder.typeConvertHandler((globalConfig, typeRegistry, metaInfo) -> {
    @@ -39,13 +38,17 @@ public class MybatisPlusGenerator {
                     .packageConfig(builder -> {
                         builder.parent("baomidou") // 设置父包名
                                 .moduleName("system") // 设置父包模块名
    -                            .pathInfo(Collections.singletonMap(OutputFile.xml, "D://baomidou/mybatispluscode")); // 设置mapperXml生成路径
    +                            // 设置mapperXml生成路径
    +                            .pathInfo(Collections.singletonMap(OutputFile.xml, "D://baomidou/mybatispluscode")); 
                     })
                     .strategyConfig(builder -> {
    -                    builder.addInclude("d_user_mobile") // 设置需要生成的表名
    -                            .addTablePrefix("d_"); // 设置过滤表前缀
    +                    // 设置需要生成的表名
    +                    builder.addInclude("d_user_mobile")
    +                            // 设置过滤表前缀
    +                            .addTablePrefix("d_"); 
                     })
    -                .templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板
    +                // 使用Freemarker引擎模板,默认的是Velocity引擎模板
    +                .templateEngine(new FreemarkerTemplateEngine()) 
                     .execute();
         }
     }
    diff --git a/damai-server/damai-order-service/pom.xml b/damai-server/damai-order-service/pom.xml
    index 62fd50fa0790d400be97dd4496bf9f648748d6cf..f39f3fc54fdb2663ac6fcd82b2e088000fb193f2 100644
    --- a/damai-server/damai-order-service/pom.xml
    +++ b/damai-server/damai-order-service/pom.xml
    @@ -75,6 +75,11 @@
                 damai-service-lock-framework
                 ${revision}
             
    +        
    +            com.example
    +            damai-repeat-execute-limit-framework
    +            ${revision}
    +        
             
                 com.example
                 damai-service-delay-queue-framework
    diff --git a/damai-server/damai-order-service/src/main/java/com/damai/controller/OrderController.java b/damai-server/damai-order-service/src/main/java/com/damai/controller/OrderController.java
    index 9c927deb067da138973ea4049c1f759d8385ef25..104d1c69102e805345c4db44139619e5bddcb4ce 100644
    --- a/damai-server/damai-order-service/src/main/java/com/damai/controller/OrderController.java
    +++ b/damai-server/damai-order-service/src/main/java/com/damai/controller/OrderController.java
    @@ -31,7 +31,7 @@ import java.util.Map;
      **/
     @RestController
     @RequestMapping("/order")
    -@Api(tags = "order", description = "订单")
    +@Api(tags = "order", value = "订单")
     public class OrderController {
         
         @Autowired
    diff --git a/damai-server/damai-order-service/src/main/java/com/damai/entity/Order.java b/damai-server/damai-order-service/src/main/java/com/damai/entity/Order.java
    index bbdfe7c83a4d3430a31fc273a781a9046db17bb9..bd8d991f9537c3c378d45c98895135e513df4e56 100644
    --- a/damai-server/damai-order-service/src/main/java/com/damai/entity/Order.java
    +++ b/damai-server/damai-order-service/src/main/java/com/damai/entity/Order.java
    @@ -1,7 +1,7 @@
     package com.damai.entity;
     
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -15,7 +15,7 @@ import java.util.Date;
      **/
     @Data
     @TableName("d_order")
    -public class Order extends BaseData implements Serializable {
    +public class Order extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
    diff --git a/damai-server/damai-order-service/src/main/java/com/damai/entity/OrderTicketUser.java b/damai-server/damai-order-service/src/main/java/com/damai/entity/OrderTicketUser.java
    index 4b685aed7a1e4ebcdc671bad96c960526aedae6d..2298575f562e5cf2a589f27397142bf81e90dd2f 100644
    --- a/damai-server/damai-order-service/src/main/java/com/damai/entity/OrderTicketUser.java
    +++ b/damai-server/damai-order-service/src/main/java/com/damai/entity/OrderTicketUser.java
    @@ -1,7 +1,7 @@
     package com.damai.entity;
     
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -15,7 +15,7 @@ import java.util.Date;
      **/
     @Data
     @TableName("d_order_ticket_user")
    -public class OrderTicketUser extends BaseData implements Serializable {
    +public class OrderTicketUser extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
    diff --git a/damai-server/damai-order-service/src/main/java/com/damai/mapper/OrderTicketUserMapper.java b/damai-server/damai-order-service/src/main/java/com/damai/mapper/OrderTicketUserMapper.java
    index 0fed3f2c095ed3dbe4e953b2c9ee3a30025e8826..64a6b93a8506d42b65bbd9fdab11958997b9945a 100644
    --- a/damai-server/damai-order-service/src/main/java/com/damai/mapper/OrderTicketUserMapper.java
    +++ b/damai-server/damai-order-service/src/main/java/com/damai/mapper/OrderTicketUserMapper.java
    @@ -14,6 +14,11 @@ import java.util.List;
      **/
     public interface OrderTicketUserMapper extends BaseMapper {
         
    +    /**
    +     * 查询订单下购票人数量
    +     * @param orderNumberList 参数
    +     * @return 结果
    +     * */
         List selectOrderTicketUserAggregate(@Param("orderNumberList")List orderNumberList);
     
     }
    diff --git a/damai-server/damai-order-service/src/main/java/com/damai/service/OrderService.java b/damai-server/damai-order-service/src/main/java/com/damai/service/OrderService.java
    index 7c308e0e70debf00cbf6fe1f0530c51c7b920291..eb2cd8409c60c01eb962e4c8faad240d540f40bb 100644
    --- a/damai-server/damai-order-service/src/main/java/com/damai/service/OrderService.java
    +++ b/damai-server/damai-order-service/src/main/java/com/damai/service/OrderService.java
    @@ -13,7 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
     import com.damai.client.PayClient;
     import com.damai.client.UserClient;
     import com.damai.common.ApiResponse;
    -import com.damai.core.RedisKeyEnum;
    +import com.damai.core.RedisKeyManage;
     import com.damai.dto.NotifyDto;
     import com.damai.dto.OrderCancelDto;
     import com.damai.dto.OrderCreateDto;
    @@ -38,7 +38,8 @@ import com.damai.exception.DaMaiFrameException;
     import com.damai.mapper.OrderMapper;
     import com.damai.mapper.OrderTicketUserMapper;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
    +import com.damai.repeatexecutelimit.annotion.RepeatExecuteLimit;
     import com.damai.service.delaysend.DelayOperateProgramDataSend;
     import com.damai.service.properties.OrderProperties;
     import com.damai.servicelock.annotion.ServiceLock;
    @@ -50,6 +51,7 @@ import com.damai.vo.OrderPayCheckVo;
     import com.damai.vo.OrderTicketUserVo;
     import com.damai.vo.SeatVo;
     import com.damai.vo.TicketUserInfoVo;
    +import com.damai.vo.TicketUserVo;
     import com.damai.vo.TradeCheckVo;
     import com.damai.vo.UserAndTicketUserInfoVo;
     import com.damai.vo.UserGetAndTicketUserListVo;
    @@ -69,6 +71,7 @@ import java.util.stream.Collectors;
     import static com.damai.constant.Constant.ALIPAY_NOTIFY_SUCCESS_RESULT;
     import static com.damai.core.DistributedLockConstants.ORDER_CANCEL_LOCK;
     import static com.damai.core.DistributedLockConstants.ORDER_PAY_CHECK;
    +import static com.damai.core.RepeatExecuteLimitConstants.CANCEL_PROGRAM_ORDER;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    @@ -122,12 +125,11 @@ public class OrderService extends ServiceImpl {
             }
             Order order = new Order();
             BeanUtil.copyProperties(orderCreateDto,order);
    -        
             List orderTicketUserList = new ArrayList<>();
             for (OrderTicketUserCreateDto orderTicketUserCreateDto : orderCreateDto.getOrderTicketUserCreateDtoList()) {
                 OrderTicketUser orderTicketUser = new OrderTicketUser();
                 BeanUtil.copyProperties(orderTicketUserCreateDto,orderTicketUser);
    -            orderTicketUser.setId(uidGenerator.getUID());
    +            orderTicketUser.setId(uidGenerator.getUid());
                 orderTicketUserList.add(orderTicketUser);
             }
             orderMapper.insert(order);
    @@ -138,8 +140,9 @@ public class OrderService extends ServiceImpl {
         /**
          * 订单取消,以订单编号加锁
          * */
    -    @Transactional(rollbackFor = Exception.class)
    +    @RepeatExecuteLimit(name = CANCEL_PROGRAM_ORDER,keys = {"#orderCancelDto.orderNumber"})
         @ServiceLock(name = ORDER_CANCEL_LOCK,keys = {"#orderCancelDto.orderNumber"})
    +    @Transactional(rollbackFor = Exception.class)
         public boolean cancel(OrderCancelDto orderCancelDto){
             updateOrderRelatedData(orderCancelDto.getOrderNumber(),OrderStatus.CANCEL);
             return true;
    @@ -165,7 +168,15 @@ public class OrderService extends ServiceImpl {
             if (orderPayDto.getPrice().compareTo(order.getOrderPrice()) != 0) {
                 throw new DaMaiFrameException(BaseCode.PAY_PRICE_NOT_EQUAL_ORDER_PRICE);
             }
    -        //调用支付服务进行支付
    +        PayDto payDto = getPayDto(orderPayDto, orderNumber);
    +        ApiResponse payResponse = payClient.commonPay(payDto);
    +        if (!Objects.equals(payResponse.getCode(), BaseCode.SUCCESS.getCode())) {
    +            throw new DaMaiFrameException(payResponse);
    +        }
    +        return payResponse.getData();
    +    }
    +    
    +    private PayDto getPayDto(OrderPayDto orderPayDto, Long orderNumber) {
             PayDto payDto = new PayDto();
             payDto.setOrderNumber(String.valueOf(orderNumber));
             payDto.setPayBillType(orderPayDto.getPayBillType());
    @@ -175,11 +186,7 @@ public class OrderService extends ServiceImpl {
             payDto.setPrice(orderPayDto.getPrice());
             payDto.setNotifyUrl(orderProperties.getOrderPayNotifyUrl());
             payDto.setReturnUrl(orderProperties.getOrderPayReturnUrl());
    -        ApiResponse payResponse = payClient.commonPay(payDto);
    -        if (!Objects.equals(payResponse.getCode(), BaseCode.SUCCESS.getCode())) {
    -            throw new DaMaiFrameException(payResponse);
    -        }
    -        return payResponse.getData();
    +        return payDto;
         }
         
         /**
    @@ -212,10 +219,10 @@ public class OrderService extends ServiceImpl {
                     orderPayCheckVo.setOrderStatus(payBillStatus);
                     if (Objects.equals(payBillStatus, PayBillStatus.PAY.getCode())) {
                         orderPayCheckVo.setPayOrderTime(DateUtils.now());
    -                    updateOrderRelatedData(order.getId(),OrderStatus.PAY);
    +                    orderService.updateOrderRelatedData(order.getId(),OrderStatus.PAY);
                     }else if (Objects.equals(payBillStatus, PayBillStatus.CANCEL.getCode())) {
                         orderPayCheckVo.setCancelOrderTime(DateUtils.now());
    -                    updateOrderRelatedData(order.getId(),OrderStatus.CANCEL);
    +                    orderService.updateOrderRelatedData(order.getId(),OrderStatus.CANCEL);
                     }
                 }
             }else {
    @@ -234,7 +241,6 @@ public class OrderService extends ServiceImpl {
             if (!Objects.equals(notifyResponse.getCode(), BaseCode.SUCCESS.getCode())) {
                 throw new DaMaiFrameException(notifyResponse);
             }
    -        //将订单状态更新
             if (ALIPAY_NOTIFY_SUCCESS_RESULT.equals(notifyResponse.getData().getPayResult())) {
                 orderService.updateOrderRelatedData(Long.parseLong(notifyResponse.getData().getOutTradeNo()),OrderStatus.PAY);
             }
    @@ -253,27 +259,13 @@ public class OrderService extends ServiceImpl {
             LambdaQueryWrapper orderLambdaQueryWrapper =
                     Wrappers.lambdaQuery(Order.class).eq(Order::getOrderNumber, orderNumber);
             Order order = orderMapper.selectOne(orderLambdaQueryWrapper);
    -        if (Objects.isNull(order)) {
    -            throw new DaMaiFrameException(BaseCode.ORDER_NOT_EXIST);
    -        }
    -        if (Objects.equals(order.getOrderStatus(), OrderStatus.CANCEL.getCode())) {
    -            log.info("订单已取消 orderNumber : {}",orderNumber);
    -            return;
    -        }
    -        if (Objects.equals(order.getOrderStatus(), OrderStatus.PAY.getCode())) {
    -            log.info("订单已支付 orderNumber : {}",orderNumber);
    +        if (!checkOrderStatus(order)) {
                 return;
             }
    -        if (Objects.equals(order.getOrderStatus(), OrderStatus.REFUND.getCode())) {
    -            log.info("订单已退单 orderNumber : {}",orderNumber);
    -            return;
    -        }
    -        //将订单更新为取消或者支付状态
             Order updateOrder = new Order();
             updateOrder.setId(order.getId());
             updateOrder.setOrderStatus(orderStatus.getCode());
             
    -        //将购票人订单更新为取消或者支付状态
             OrderTicketUser updateOrderTicketUser = new OrderTicketUser();
             updateOrderTicketUser.setOrderStatus(orderStatus.getCode());
             if (Objects.equals(orderStatus.getCode(), OrderStatus.PAY.getCode())) {
    @@ -283,10 +275,8 @@ public class OrderService extends ServiceImpl {
                 updateOrder.setCancelOrderTime(DateUtils.now());
                 updateOrderTicketUser.setCancelOrderTime(DateUtils.now());
             }
    -        //更新订单
             int updateOrderResult = orderMapper.updateById(updateOrder);
             
    -        //更新购票人订单
             LambdaUpdateWrapper orderTicketUserLambdaUpdateWrapper =
                     Wrappers.lambdaUpdate(OrderTicketUser.class).eq(OrderTicketUser::getOrderNumber, order.getOrderNumber());
             int updateTicketUserOrderResult =
    @@ -294,25 +284,44 @@ public class OrderService extends ServiceImpl {
             if (updateOrderResult <= 0 || updateTicketUserOrderResult <= 0) {
                 throw new DaMaiFrameException(BaseCode.ORDER_CANAL_ERROR);
             }
    -        
             LambdaQueryWrapper orderTicketUserLambdaQueryWrapper =
                     Wrappers.lambdaQuery(OrderTicketUser.class).eq(OrderTicketUser::getOrderNumber, order.getOrderNumber());
             List orderTicketUserList = orderTicketUserMapper.selectList(orderTicketUserLambdaQueryWrapper);
             if (CollectionUtil.isEmpty(orderTicketUserList)) {
                 throw new DaMaiFrameException(BaseCode.TICKET_USER_ORDER_NOT_EXIST);
             }
    -        Long programId = orderTicketUserList.get(0).getProgramId();
    -        //查询到购票人的座位
    +        Long programId = order.getProgramId();
             List seatIdList =
                     orderTicketUserList.stream().map(OrderTicketUser::getSeatId).map(String::valueOf).collect(Collectors.toList());
    -        //从redis中查询锁定中的座位
    -        List seatVoList = redisCache.multiGetForHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_LOCK_HASH, programId), seatIdList, SeatVo.class);
    +        updateProgramRelatedData(programId,seatIdList,orderStatus);
    +    }
    +    
    +    public boolean checkOrderStatus(Order order){
    +        if (Objects.isNull(order)) {
    +            throw new DaMaiFrameException(BaseCode.ORDER_NOT_EXIST);
    +        }
    +        if (Objects.equals(order.getOrderStatus(), OrderStatus.CANCEL.getCode())) {
    +            log.info("订单已取消 orderNumber : {}",order.getOrderNumber());
    +            return false;
    +        }
    +        if (Objects.equals(order.getOrderStatus(), OrderStatus.PAY.getCode())) {
    +            log.info("订单已支付 orderNumber : {}",order.getOrderNumber());
    +            return false;
    +        }
    +        if (Objects.equals(order.getOrderStatus(), OrderStatus.REFUND.getCode())) {
    +            log.info("订单已退单 orderNumber : {}",order.getOrderNumber());
    +            return false;
    +        }
    +        return true;
    +    }
    +    
    +    public void updateProgramRelatedData(Long programId,List seatIdList,OrderStatus orderStatus){
    +        List seatVoList = 
    +                redisCache.multiGetForHash(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_LOCK_HASH, programId), 
    +                        seatIdList, SeatVo.class);
             if (CollectionUtil.isEmpty(seatVoList)) {
                 throw new DaMaiFrameException(BaseCode.LOCK_SEAT_LIST_EMPTY);
             }
    -        
    -        /**=====操作缓存相关数据====*/
    -        //redis解除锁座位
             List unLockSeatIdList = seatVoList.stream().map(SeatVo::getId).map(String::valueOf).collect(Collectors.toList());
             Map unLockSeatVoMap = seatVoList.stream().collect(Collectors
                     .toMap(seatVo -> String.valueOf(seatVo.getId()), seatVo -> seatVo, (v1, v2) -> v2));
    @@ -328,20 +337,15 @@ public class OrderService extends ServiceImpl {
             });
             
             List keys = new ArrayList<>();
    -        //操作类型
             keys.add(String.valueOf(orderStatus.getCode()));
    -        //锁定座位的key
    -        keys.add(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_LOCK_HASH, programId).getRelKey());
    +        keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_LOCK_HASH, programId).getRelKey());
             
             Object[] data = new String[3];
    -        //扣除锁定的座位数据
             data[0] = JSON.toJSONString(unLockSeatIdList);
    -        //如果是订单取消的操作,那么添加到未售卖的座位数据
    -        //如果是订单支付的操作,那么添加到已售卖的座位数据
             data[1] = JSON.toJSONString(seatDataList);
             
    -        //根据座位集合统计出对应的票档数量
    -        Map ticketCategoryCountMap = seatVoList.stream().collect(Collectors.groupingBy(SeatVo::getTicketCategoryId, Collectors.counting()));
    +        Map ticketCategoryCountMap = 
    +                seatVoList.stream().collect(Collectors.groupingBy(SeatVo::getTicketCategoryId, Collectors.counting()));
             JSONArray jsonArray = new JSONArray();
             ticketCategoryCountMap.forEach((k,v) -> {
                 JSONObject jsonObject = new JSONObject();
    @@ -351,19 +355,14 @@ public class OrderService extends ServiceImpl {
             });
             
             if (Objects.equals(orderStatus.getCode(), OrderStatus.CANCEL.getCode())) {
    -            //没有售卖座位的key
    -            keys.add(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_NO_SOLD_HASH, programId).getRelKey());
    -            //恢复库存的key
    -            keys.add(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_TICKET_REMAIN_NUMBER_HASH, programId).getRelKey());
    -            //恢复库存数据
    +            keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_NO_SOLD_HASH, programId).getRelKey());
    +            keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_TICKET_REMAIN_NUMBER_HASH, programId).getRelKey());
                 data[2] = JSON.toJSONString(jsonArray);
             }else if (Objects.equals(orderStatus.getCode(), OrderStatus.PAY.getCode())) {
    -            //已售卖座位的key
    -            keys.add(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_SOLD_HASH, programId).getRelKey());
    +            keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_SOLD_HASH, programId).getRelKey());
             }
             orderProgramCacheOperate.programCacheReverseOperate(keys,data);
             
    -        //如果是支付成功了,发送延迟队列给program服务,将数据库中的票档的余票更新、座位状态更新
             if (Objects.equals(orderStatus.getCode(), OrderStatus.PAY.getCode())) {
                 ProgramOperateDataDto programOperateDataDto = new ProgramOperateDataDto();
                 programOperateDataDto.setProgramId(programId);
    @@ -383,9 +382,9 @@ public class OrderService extends ServiceImpl {
                 return orderListVos;
             }
             orderListVos = BeanUtil.copyToList(orderList, OrderListVo.class);
    -        //每个订单下的购票人订单数量统计
             List orderTicketUserAggregateList = 
    -                orderTicketUserMapper.selectOrderTicketUserAggregate(orderList.stream().map(Order::getOrderNumber).collect(Collectors.toList()));
    +                orderTicketUserMapper.selectOrderTicketUserAggregate(orderList.stream().map(Order::getOrderNumber).
    +                        collect(Collectors.toList()));
             Map orderTicketUserAggregateMap = orderTicketUserAggregateList.stream()
                     .collect(Collectors.toMap(OrderTicketUserAggregate::getOrderNumber, 
                             OrderTicketUserAggregate::getOrderTicketUserCount, (v1, v2) -> v2));
    @@ -396,14 +395,12 @@ public class OrderService extends ServiceImpl {
         }
         
         public OrderGetVo get(OrderGetDto orderGetDto) {
    -        //查询订单
             LambdaQueryWrapper orderLambdaQueryWrapper =
                     Wrappers.lambdaQuery(Order.class).eq(Order::getOrderNumber, orderGetDto.getOrderNumber());
             Order order = orderMapper.selectOne(orderLambdaQueryWrapper);
             if (Objects.isNull(order)) {
                 throw new DaMaiFrameException(BaseCode.ORDER_NOT_EXIST);
             }
    -        //查询购票人订单
             LambdaQueryWrapper orderTicketUserLambdaQueryWrapper = 
                     Wrappers.lambdaQuery(OrderTicketUser.class).eq(OrderTicketUser::getOrderNumber, order.getOrderNumber());
             List orderTicketUserList = orderTicketUserMapper.selectList(orderTicketUserLambdaQueryWrapper);
    @@ -413,14 +410,10 @@ public class OrderService extends ServiceImpl {
             
             OrderGetVo orderGetVo = new OrderGetVo();
             BeanUtil.copyProperties(order,orderGetVo);
    -        
             orderGetVo.setOrderTicketUserVoList(BeanUtil.copyToList(orderTicketUserList, OrderTicketUserVo.class));
             
    -        //查询用户和购票人信息
             UserGetAndTicketUserListDto userGetAndTicketUserListDto = new UserGetAndTicketUserListDto();
             userGetAndTicketUserListDto.setUserId(order.getUserId());
    -        userGetAndTicketUserListDto.setTicketUserIdList(orderTicketUserList.stream()
    -                .map(OrderTicketUser::getTicketUserId).collect(Collectors.toList()));
             ApiResponse userGetAndTicketUserApiResponse = 
                     userClient.getUserAndTicketUserList(userGetAndTicketUserListDto);
             
    @@ -428,7 +421,6 @@ public class OrderService extends ServiceImpl {
                 throw new DaMaiFrameException(userGetAndTicketUserApiResponse);
                 
             }
    -        //验证用户和购票人信息是否存在
             UserGetAndTicketUserListVo userAndTicketUserListVo =
                     Optional.ofNullable(userGetAndTicketUserApiResponse.getData())
                             .orElseThrow(() -> new DaMaiFrameException(BaseCode.RPC_RESULT_DATA_EMPTY));
    @@ -438,11 +430,17 @@ public class OrderService extends ServiceImpl {
             if (CollectionUtil.isEmpty(userAndTicketUserListVo.getTicketUserVoList())) {
                 throw new DaMaiFrameException(BaseCode.TICKET_USER_EMPTY);
             }
    +        List filterTicketUserVoList = new ArrayList<>();
    +        Map ticketUserVoMap = userAndTicketUserListVo.getTicketUserVoList()
    +                .stream().collect(Collectors.toMap(TicketUserVo::getId, ticketUserVo -> ticketUserVo, (v1, v2) -> v2));
    +        for (OrderTicketUser orderTicketUser : orderTicketUserList) {
    +            filterTicketUserVoList.add(ticketUserVoMap.get(orderTicketUser.getTicketUserId()));
    +        }
             UserInfoVo userInfoVo = new UserInfoVo();
             BeanUtil.copyProperties(userAndTicketUserListVo.getUserVo(),userInfoVo);
             UserAndTicketUserInfoVo userAndTicketUserInfoVo = new UserAndTicketUserInfoVo();
             userAndTicketUserInfoVo.setUserInfoVo(userInfoVo);
    -        userAndTicketUserInfoVo.setTicketUserInfoVoList(BeanUtil.copyToList(userAndTicketUserListVo.getTicketUserVoList(), TicketUserInfoVo.class));
    +        userAndTicketUserInfoVo.setTicketUserInfoVoList(BeanUtil.copyToList(filterTicketUserVoList, TicketUserInfoVo.class));
             orderGetVo.setUserAndTicketUserInfoVo(userAndTicketUserInfoVo);
             
             return orderGetVo;
    diff --git a/damai-server/damai-order-service/src/main/java/com/damai/service/constant/OrderConstant.java b/damai-server/damai-order-service/src/main/java/com/damai/service/constant/OrderConstant.java
    index e1adce001ff69bd3421220362c848a9ea3d89726..077323d559a876e84a11802a988ca257df66b7b9 100644
    --- a/damai-server/damai-order-service/src/main/java/com/damai/service/constant/OrderConstant.java
    +++ b/damai-server/damai-order-service/src/main/java/com/damai/service/constant/OrderConstant.java
    @@ -13,7 +13,7 @@ public class OrderConstant {
         
         public static final String DELAY_OPERATE_PROGRAM_DATA_TOPIC = "d_delay_operate_program_data_topic";
         
    -    public static final Long DELAY_OPERATE_PROGRAM_DATA_TIME = 3L;
    +    public static final Long DELAY_OPERATE_PROGRAM_DATA_TIME = 1L;
         
         public static final TimeUnit DELAY_OPERATE_PROGRAM_DATA_TIME_UNIT = TimeUnit.SECONDS;
     }
    diff --git a/damai-server/damai-order-service/src/main/java/com/damai/service/delayconsumer/DelayOrderCancelConsumer.java b/damai-server/damai-order-service/src/main/java/com/damai/service/delayconsumer/DelayOrderCancelConsumer.java
    index e23fcffa459f3aa5bdc6e9d7444fdbe3b1402819..e9c0c5e639141da784bac0a9470c04fb1eca2958 100644
    --- a/damai-server/damai-order-service/src/main/java/com/damai/service/delayconsumer/DelayOrderCancelConsumer.java
    +++ b/damai-server/damai-order-service/src/main/java/com/damai/service/delayconsumer/DelayOrderCancelConsumer.java
    @@ -1,7 +1,8 @@
     package com.damai.service.delayconsumer;
     
     import com.alibaba.fastjson.JSON;
    -import com.damai.core.StringUtil;
    +import com.damai.core.SpringUtil;
    +import com.damai.util.StringUtil;
     import com.damai.core.ConsumerTask;
     import com.damai.dto.DelayOrderCancelDto;
     import com.damai.dto.OrderCancelDto;
    @@ -46,6 +47,6 @@ public class DelayOrderCancelConsumer implements ConsumerTask {
         
         @Override
         public String topic() {
    -        return DELAY_ORDER_CANCEL_TOPIC;
    +        return SpringUtil.getPrefixDistinctionName() + "-" + DELAY_ORDER_CANCEL_TOPIC;
         }
     }
    diff --git a/damai-server/damai-order-service/src/main/java/com/damai/service/delaysend/DelayOperateProgramDataSend.java b/damai-server/damai-order-service/src/main/java/com/damai/service/delaysend/DelayOperateProgramDataSend.java
    index ce0b1c0d45b16fa8970d50381d61451a3aba46de..b3180f6d613b5ca6ace94026d6475b8a965ffb4d 100644
    --- a/damai-server/damai-order-service/src/main/java/com/damai/service/delaysend/DelayOperateProgramDataSend.java
    +++ b/damai-server/damai-order-service/src/main/java/com/damai/service/delaysend/DelayOperateProgramDataSend.java
    @@ -1,6 +1,7 @@
     package com.damai.service.delaysend;
     
     import com.damai.context.DelayQueueContext;
    +import com.damai.core.SpringUtil;
     import lombok.extern.slf4j.Slf4j;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Component;
    @@ -23,7 +24,8 @@ public class DelayOperateProgramDataSend {
         
         public void sendMessage(String message){
             try {
    -            delayQueueContext.sendMessage(DELAY_OPERATE_PROGRAM_DATA_TOPIC,message, DELAY_OPERATE_PROGRAM_DATA_TIME, DELAY_OPERATE_PROGRAM_DATA_TIME_UNIT);
    +            delayQueueContext.sendMessage(SpringUtil.getPrefixDistinctionName() + "-" + DELAY_OPERATE_PROGRAM_DATA_TOPIC,
    +                    message, DELAY_OPERATE_PROGRAM_DATA_TIME, DELAY_OPERATE_PROGRAM_DATA_TIME_UNIT);
             }catch (Exception e) {
                 log.error("send message error message : {}",message,e);
             }
    diff --git a/damai-server/damai-order-service/src/main/resources/application.yml b/damai-server/damai-order-service/src/main/resources/application.yml
    new file mode 100644
    index 0000000000000000000000000000000000000000..08bed3bcf53604f8fd44e406971fedcf4345aa9b
    --- /dev/null
    +++ b/damai-server/damai-order-service/src/main/resources/application.yml
    @@ -0,0 +1,91 @@
    +#服务端口
    +server:
    +  port: 8081
    +# 应用名称
    +spring:
    +  application:
    +    name: ${prefix.distinction.name:damai}-order-service
    +  main:
    +    allow-bean-definition-overriding: true
    +  mvc:
    +    pathmatch:
    +      matching-strategy: ant_path_matcher
    +    servlet:
    +      load-on-startup: 1
    +    jackson:
    +      time-zone: GMT+8
    +      date-format: yyyy-MM-dd HH:mm:ss
    +      generator:
    +        WRITE_NUMBERS_AS_STRINGS: true
    +  datasource:
    +    driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
    +    url: jdbc:shardingsphere:classpath:shardingsphere-order.yaml
    +  redis:
    +    database: 0
    +    host: 127.0.0.1
    +    port: 6379
    +    timeout: 3000
    +  cloud:
    +    nacos:
    +      discovery:
    +        server-addr: 127.0.0.1:8848
    +        username: nacos
    +        password: nacos
    +mybatis-plus:
    +  mapper-locations: classpath:mapper/*.xml
    +  global-config:
    +    db-config:
    +      logic-delete-field: status
    +      logic-delete-value: 0
    +      logic-not-delete-value: 1
    +  configuration:
    +    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    +    local-cache-scope: statement
    +feign:
    +  sentinel:
    +    enabled: false
    +  hystrix:
    +    enabled: true
    +  httpclient:
    +    enabled: false
    +  okhttp:
    +    enabled: true
    +  compression:
    +    request:
    +      enabled: true
    +      mime-types: text/xml,application/xml,application/json
    +      min-request-size: 512
    +    response:
    +      enabled: true
    +hystrix:
    +  command:
    +    default:
    +      execution:
    +        timeout:
    +          enabled: true
    +        isolation:
    +          thread:
    +            timeoutInMilliseconds: 10000
    +          semaphore:
    +            maxConcurrentRequests: 99999
    +ribbon:
    +  ReadTimeout: 60000
    +  ConnectTimeout: 60000
    +  MaxAutoRetries: 0
    +  MaxAutoRetriesNextServer: 1
    +management:
    +  endpoints:
    +    web:
    +      exposure:
    +        include: '*'
    +    health:
    +      show-details: always
    +  security:
    +    enabled: false
    +  health:
    +    elasticsearch:
    +      enabled: false
    +jasypt:
    +  encryptor:
    +    password: bgtjkjl!%^sdc
    +    algorithm: PBEWithMD5AndDES
    \ No newline at end of file
    diff --git a/damai-server/damai-order-service/src/main/resources/bootstrap.yml b/damai-server/damai-order-service/src/main/resources/bootstrap.yml
    deleted file mode 100644
    index 77de864babf5b24a239779ef07eda4f579ad3c2e..0000000000000000000000000000000000000000
    --- a/damai-server/damai-order-service/src/main/resources/bootstrap.yml
    +++ /dev/null
    @@ -1,23 +0,0 @@
    -#服务端口
    -server:
    -  port: 8081
    -# 应用名称
    -spring:
    -  application:
    -    name: ${prefix.distinction.name:damai}-order-service
    -  main:
    -    allow-bean-definition-overriding: true
    -  cloud:
    -    nacos:
    -      discovery:
    -        server-addr: 62.234.31.217:8848
    -        username: nacos
    -        password: nacos
    -      config:
    -        server-addr: 62.234.31.217:8848
    -        file-extension: yaml
    -        shared-configs:
    -          - data-id: common.yaml
    -            refresh: true
    -        username: nacos
    -        password: nacos
    diff --git a/damai-server/damai-order-service/src/main/resources/lua/OrderProgramData.lua b/damai-server/damai-order-service/src/main/resources/lua/OrderProgramData.lua
    index 1acb170fed8bd7ddc2321b70daa6169723736173..1b90ed60757d01b4cac8ebf700ade453257bc427 100644
    --- a/damai-server/damai-order-service/src/main/resources/lua/OrderProgramData.lua
    +++ b/damai-server/damai-order-service/src/main/resources/lua/OrderProgramData.lua
    @@ -3,16 +3,11 @@ local program_seat_lock_hash_key = KEYS[2]
     local program_seat_hash_key = KEYS[3]
     local un_lock_seat_id_list = cjson.decode(ARGV[1])
     local seat_data_list = cjson.decode(ARGV[2])
    --- 将锁定的座位集合进行扣除
     redis.call('HDEL',program_seat_lock_hash_key,unpack(un_lock_seat_id_list))
    --- 如果是订单取消的操作,那么添加到未售卖的座位hash数据
    --- 如果是订单支付的操作,那么添加到已售卖的座位hash数据
     redis.call('HMSET',program_seat_hash_key,unpack(seat_data_list))
    --- 如果是将订单取消
     if (operate_order_status == 2) then
         local program_ticket_remain_number_hash_key = KEYS[4]
         local increase_data_list = cjson.decode(ARGV[3])
    -    -- 恢复库存
         for index,increase_data in ipairs(increase_data_list) do
             local ticket_category_id = increase_data.ticketCategoryId
             local increase_count = increase_data.count
    diff --git a/damai-server/damai-order-service/src/main/resources/shardingsphere-order.yaml b/damai-server/damai-order-service/src/main/resources/shardingsphere-order.yaml
    index b57d0b95ee2f83ffcd0029eea9d62e5960da343f..8b8609f0161c1f6399f5c01fbadd3ba18e9fc09a 100644
    --- a/damai-server/damai-order-service/src/main/resources/shardingsphere-order.yaml
    +++ b/damai-server/damai-order-service/src/main/resources/shardingsphere-order.yaml
    @@ -1,110 +1,68 @@
    -dataSources: 
    +dataSources:
       ds_0:
         dataSourceClassName: com.zaxxer.hikari.HikariDataSource
         driverClassName: com.mysql.cj.jdbc.Driver
    -    jdbcUrl: jdbc:mysql://www.cookframe.com:3306/damai_order_0?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai&autoReconnect=true
    +    jdbcUrl: jdbc:mysql://127.0.0.1:3306/damai_order_0?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai&autoReconnect=true
         username: root
    -    password: qaz321qwe!
    -
    +    password: root
       ds_1:
         dataSourceClassName: com.zaxxer.hikari.HikariDataSource
         driverClassName: com.mysql.cj.jdbc.Driver
    -    jdbcUrl: jdbc:mysql://www.cookframe.com:3306/damai_order_1?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai&autoReconnect=true
    +    jdbcUrl: jdbc:mysql://127.0.0.1:3306/damai_order_1?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai&autoReconnect=true
         username: root
    -    password: qaz321qwe!
    -    
    +    password: root
    +
     rules:
       - !SHARDING
         tables:
    -      # 对d_order表进行分库分表
           d_order:
    -        # 库为damai_order_0 damai_order_1 表为d_order_0 至 d_user_order_3
             actualDataNodes: ds_${0..1}.d_order_${0..3}
    -        # 分库策略
             databaseStrategy:
               complex:
    -            # 使用order_number,user_id作为分片键
                 shardingColumns: order_number,user_id
    -            # 使用order_number,user_id分库算法
                 shardingAlgorithmName: databaseOrderComplexGeneArithmetic
    -        # 分表策略
             tableStrategy:
               complex:
    -            # 使用order_number,user_id作为分片键
                 shardingColumns: order_number,user_id
    -            # 使用order_number,user_id分表算法
                 shardingAlgorithmName: tableOrderComplexGeneArithmetic
    -      # 对d_order_ticket_user表进行分库分表
           d_order_ticket_user:
    -        # 库为damai_order_0 damai_order_1 表为d_order_ticket_user_0 至 d_order_ticket_user_3
             actualDataNodes: ds_${0..1}.d_order_ticket_user_${0..3}
    -        # 分库策略
             databaseStrategy:
               complex:
    -            # 使用order_number,user_id作为分片键
                 shardingColumns: order_number,user_id
    -            # 使用order_number,user_id分库算法
                 shardingAlgorithmName: databaseOrderTicketUserComplexGeneArithmetic
    -        # 分表策略
             tableStrategy:
               complex:
    -            # 使用order_number,user_id作为分片键
                 shardingColumns: order_number,user_id
    -            # 使用order_number,user_id分表算法
                 shardingAlgorithmName: tableOrderTicketUserComplexGeneArithmetic
    -    # 绑定表        
         bindingTables:
           - d_order,d_order_ticket_user
    -    # 具体的算法
         shardingAlgorithms:
    -      # d_order表分库算法
           databaseOrderComplexGeneArithmetic:
    -        # 通过自定义实现类实现分库算法
             type: CLASS_BASED
             props:
    -          # 分库数量
               sharding-count: 2
    -          # 分表数量
               table-sharding-count: 4
    -          # 分库策略,复合多分片
               strategy: complex
    -          # 具体的分库逻辑在此自定义类中
               algorithmClassName: com.damai.shardingsphere.DatabaseOrderComplexGeneArithmetic
    -      # d_order表分表算法
           tableOrderComplexGeneArithmetic:
    -        # 通过自定义实现类实现分表算法
             type: CLASS_BASED
             props:
    -          # 分表数量
               sharding-count: 4
    -          # 分表策略,复合多分片
               strategy: complex
    -          # 具体的分表逻辑在此自定义类中
               algorithmClassName: com.damai.shardingsphere.TableOrderComplexGeneArithmetic
    -      # d_order_ticket_user表分库算法
           databaseOrderTicketUserComplexGeneArithmetic:
    -        # 通过自定义实现类实现分库算法
             type: CLASS_BASED
             props:
    -          # 分库数量
               sharding-count: 2
    -          # 分表数量
               table-sharding-count: 4
    -          # 分库策略,复合多分片
               strategy: complex
    -          # 具体的分库逻辑在此自定义类中
               algorithmClassName: com.damai.shardingsphere.DatabaseOrderComplexGeneArithmetic
    -      # d_order_ticket_user表分表算法
           tableOrderTicketUserComplexGeneArithmetic:
    -        # 通过自定义实现类实现分表算法
             type: CLASS_BASED
             props:
    -          # 分表数量
               sharding-count: 4
    -          # 分表策略,复合多分片
               strategy: complex
    -          # 具体的分表逻辑在此自定义类中
    -          algorithmClassName: com.damai.shardingsphere.TableOrderComplexGeneArithmetic    
    +          algorithmClassName: com.damai.shardingsphere.TableOrderComplexGeneArithmetic
     props:
    -  # 打印真实sql
       sql-show: true
    \ No newline at end of file
    diff --git a/damai-server/damai-pay-service/pom.xml b/damai-server/damai-pay-service/pom.xml
    index f1a02f3caa37c0d19aa5e8d83f557c1291acce01..551d1cfc7c797779a38f7dfa3a401b69e426aef3 100644
    --- a/damai-server/damai-pay-service/pom.xml
    +++ b/damai-server/damai-pay-service/pom.xml
    @@ -51,6 +51,11 @@
                 damai-service-component
                 ${revision}
             
    +        
    +            com.example
    +            damai-service-initialize
    +            ${revision}
    +        
             
                 com.example
                 damai-service-lock-framework
    diff --git a/damai-server/damai-pay-service/src/main/java/com/damai/controller/PayController.java b/damai-server/damai-pay-service/src/main/java/com/damai/controller/PayController.java
    index d9c2be083150ba87dea53a697e8403eb176d34ef..447f64ffb9b0295c7f7ada9cb74f7360be4173fe 100644
    --- a/damai-server/damai-pay-service/src/main/java/com/damai/controller/PayController.java
    +++ b/damai-server/damai-pay-service/src/main/java/com/damai/controller/PayController.java
    @@ -2,10 +2,12 @@ package com.damai.controller;
     
     import com.damai.common.ApiResponse;
     import com.damai.dto.NotifyDto;
    +import com.damai.dto.PayBillDto;
     import com.damai.dto.PayDto;
     import com.damai.dto.TradeCheckDto;
     import com.damai.service.PayService;
     import com.damai.vo.NotifyVo;
    +import com.damai.vo.PayBillVo;
     import com.damai.vo.TradeCheckVo;
     import io.swagger.annotations.Api;
     import io.swagger.annotations.ApiOperation;
    @@ -24,7 +26,7 @@ import javax.validation.Valid;
      **/
     @RestController
     @RequestMapping("/pay")
    -@Api(tags = "pay", description = "支付")
    +@Api(tags = "pay", value = "支付")
     public class PayController {
         
         @Autowired
    @@ -47,4 +49,10 @@ public class PayController {
         public ApiResponse tradeCheck(@Valid @RequestBody TradeCheckDto tradeCheckDto) {
             return ApiResponse.ok(payService.tradeCheck(tradeCheckDto));
         }
    +    
    +    @ApiOperation(value = "账单详情查询")
    +    @PostMapping(value = "/detail")
    +    public ApiResponse detail(@Valid @RequestBody PayBillDto payBillDto) {
    +        return ApiResponse.ok(payService.detail(payBillDto));
    +    }
     }
    diff --git a/damai-server/damai-pay-service/src/main/java/com/damai/entity/PayBill.java b/damai-server/damai-pay-service/src/main/java/com/damai/entity/PayBill.java
    index 8fe39542ea671cab88ea4d168057ef4a38f7c779..2dc3e6e999b9fe35203537b8e197e944e9857dff 100644
    --- a/damai-server/damai-pay-service/src/main/java/com/damai/entity/PayBill.java
    +++ b/damai-server/damai-pay-service/src/main/java/com/damai/entity/PayBill.java
    @@ -1,7 +1,7 @@
     package com.damai.entity;
     
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -15,7 +15,7 @@ import java.util.Date;
      **/
     @Data
     @TableName("d_pay_bill")
    -public class PayBill extends BaseData implements Serializable {
    +public class PayBill extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
    diff --git a/damai-server/damai-pay-service/src/main/java/com/damai/pay/PayStrategyHandler.java b/damai-server/damai-pay-service/src/main/java/com/damai/pay/PayStrategyHandler.java
    index 4e5d44e6e065983452d7179fea4b395ebf19299d..7c325f0e85ff0636dd724039c9e8332381610447 100644
    --- a/damai-server/damai-pay-service/src/main/java/com/damai/pay/PayStrategyHandler.java
    +++ b/damai-server/damai-pay-service/src/main/java/com/damai/pay/PayStrategyHandler.java
    @@ -11,14 +11,42 @@ import java.util.Map;
      * @author: 阿宽不是程序员
      **/
     public interface PayStrategyHandler {
    -    
    +    /**
    +     * 支付
    +     * @param outTradeNo 订单号
    +     * @param price 支付价格
    +     * @param subject 标题
    +     * @param notifyUrl 回调地址
    +     * @param returnUrl 支付后返回地址
    +     * @return 结果
    +     * */
         PayResult pay(String outTradeNo, BigDecimal price, String subject, String notifyUrl, String returnUrl);
         
    +    /**
    +     * 验签
    +     * @param params 参数
    +     * @return 结果
    +     * */
         boolean signVerify(Map params);
         
    +    /**
    +     * 数据验证
    +     * @param params 参数
    +     * @param payBill 支付账单
    +     * @return 结果
    +     * */
         boolean dataVerify(Map params, PayBill payBill);
         
    +    /**
    +     * 状态查询
    +     * @param outTradeNo 订单号
    +     * @return 结果
    +     * */
         TradeResult queryTrade(String outTradeNo);
         
    +    /**
    +     * 支付渠道
    +     * @return 结果
    +     * */
         String getChannel();
     }
    diff --git a/damai-server/damai-pay-service/src/main/java/com/damai/pay/PayStrategyInitHandler.java b/damai-server/damai-pay-service/src/main/java/com/damai/pay/PayStrategyInitHandler.java
    index 4aded58e282937192d3f0bf20ec9c5563cc89f8e..99a0b9948df1d4ca55da3cf64abdc4955cbbefa5 100644
    --- a/damai-server/damai-pay-service/src/main/java/com/damai/pay/PayStrategyInitHandler.java
    +++ b/damai-server/damai-pay-service/src/main/java/com/damai/pay/PayStrategyInitHandler.java
    @@ -1,8 +1,8 @@
     package com.damai.pay;
     
    +import com.damai.initialize.base.AbstractApplicationInitializingBeanHandler;
     import lombok.AllArgsConstructor;
    -import org.springframework.boot.context.event.ApplicationStartedEvent;
    -import org.springframework.context.ApplicationListener;
    +import org.springframework.context.ConfigurableApplicationContext;
     
     import java.util.Map;
     import java.util.Map.Entry;
    @@ -13,13 +13,18 @@ import java.util.Map.Entry;
      * @author: 阿宽不是程序员
      **/
     @AllArgsConstructor
    -public class PayStrategyInitHandler implements ApplicationListener {
    +public class PayStrategyInitHandler extends AbstractApplicationInitializingBeanHandler {
         
         private final PayStrategyContext payStrategyContext;
         
         @Override
    -    public void onApplicationEvent(ApplicationStartedEvent event) {
    -        Map payStrategyHandlerMap = event.getApplicationContext().getBeansOfType(PayStrategyHandler.class);
    +    public Integer executeOrder() {
    +        return 1;
    +    }
    +    
    +    @Override
    +    public void executeInit(ConfigurableApplicationContext context) {
    +        Map payStrategyHandlerMap = context.getBeansOfType(PayStrategyHandler.class);
             for (Entry entry : payStrategyHandlerMap.entrySet()) {
                 PayStrategyHandler payStrategyHandler = entry.getValue();
                 payStrategyContext.put(payStrategyHandler.getChannel(),payStrategyHandler);
    diff --git a/damai-server/damai-pay-service/src/main/java/com/damai/pay/alipay/AlipayStrategyHandler.java b/damai-server/damai-pay-service/src/main/java/com/damai/pay/alipay/AlipayStrategyHandler.java
    index 806b479e1237a5b6c9d7c90750e45df3fa1b90fc..f271b7e2a601bc7b383975bafd99707ab1bda971 100644
    --- a/damai-server/damai-pay-service/src/main/java/com/damai/pay/alipay/AlipayStrategyHandler.java
    +++ b/damai-server/damai-pay-service/src/main/java/com/damai/pay/alipay/AlipayStrategyHandler.java
    @@ -34,8 +34,14 @@ import java.util.Map;
     @AllArgsConstructor
     public class AlipayStrategyHandler implements PayStrategyHandler {
     
    +    /**
    +     * 支付宝的SDK
    +     * */
         private final AlipayClient alipayClient;
         
    +    /**
    +     * 支付宝相关配置
    +     * */
         private final AlipayProperties aliPayProperties;
         
         @Override
    @@ -106,7 +112,7 @@ public class AlipayStrategyHandler implements PayStrategyHandler {
             }
             //在支付宝的业务通知中,只有交易通知状态为 TRADE_SUCCESS时,支付宝才会认定为买家付款成功
             String tradeStatus = params.get("trade_status");
    -        if(!"TRADE_SUCCESS".equals(tradeStatus)){
    +        if(!AlipayTradeStatus.TRADE_SUCCESS.getValue().equals(tradeStatus)){
                 log.error("支付未成功 tradeStatus : {}",tradeStatus);
                 return false;
             }
    @@ -115,9 +121,12 @@ public class AlipayStrategyHandler implements PayStrategyHandler {
         
         @Override
         public TradeResult queryTrade(String outTradeNo) {
    +        String successCode = "10000";
    +        String successMsg = "Success";
             TradeResult tradeResult = new TradeResult();
             tradeResult.setSuccess(false);
             try {
    +            //构建查询参数,将订单号放入,调用SDK查询
                 AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
                 JSONObject bizContent = new JSONObject();
                 bizContent.put("out_trade_no", outTradeNo);
    @@ -128,10 +137,14 @@ public class AlipayStrategyHandler implements PayStrategyHandler {
                     JSONObject alipayTradeQueryResponse = jsonResponse.getJSONObject("alipay_trade_query_response");
                     String code = alipayTradeQueryResponse.getString("code");
                     String msg = alipayTradeQueryResponse.getString("msg");
    -                if ("10000".equals(code) && "Success".equals(msg)) {
    +                //如果调用成功
    +                if (successCode.equals(code) && successMsg.equals(msg)) {
                         tradeResult.setSuccess(true);
    +                    //订单编号
                         tradeResult.setOutTradeNo(alipayTradeQueryResponse.getString("out_trade_no"));
    +                    //支付金额
                         tradeResult.setTotalAmount(new BigDecimal(alipayTradeQueryResponse.getString("total_amount")));
    +                    //账单状态,需将支付的状态转换为对应的支付服务中账单状态
                         tradeResult.setPayBillStatus(convertPayBillStatus(alipayTradeQueryResponse.getString("trade_status")));
                         return tradeResult;
                     }
    @@ -147,6 +160,9 @@ public class AlipayStrategyHandler implements PayStrategyHandler {
             return PayChannel.ALIPAY.getValue();
         }
         
    +    /**
    +     * 转换账单状态
    +     * */
         private Integer convertPayBillStatus(String tradeStatus){
             if (AlipayTradeStatus.WAIT_BUYER_PAY.getValue().equals(tradeStatus)) {
                 return PayBillStatus.NO_PAY.getCode();
    diff --git a/damai-server/damai-pay-service/src/main/java/com/damai/pay/alipay/config/AlipayProperties.java b/damai-server/damai-pay-service/src/main/java/com/damai/pay/alipay/config/AlipayProperties.java
    index 77dcb7e3a4bcde1b327d4ddededa08cfb5ba4e47..990de753873c9d07f035f59a76a8e9314ec2415f 100644
    --- a/damai-server/damai-pay-service/src/main/java/com/damai/pay/alipay/config/AlipayProperties.java
    +++ b/damai-server/damai-pay-service/src/main/java/com/damai/pay/alipay/config/AlipayProperties.java
    @@ -14,19 +14,43 @@ public class AlipayProperties {
         
         public static final String PREFIX = "alipay";
         
    +    /**
    +     * 应用ID
    +     * */
         private String appId;
         
    +    /**
    +     * 商户PID
    +     * */
         private String sellerId;
         
    +    /**
    +     * 支付宝网关
    +     * */
         private String gatewayUrl;
         
    +    /**
    +     * 商户私钥,您的PKCS8格式RSA2私钥
    +     * */
         private String merchantPrivateKey;
         
    +    /**
    +     * 支付宝公钥,查看地址: 对应APPID下的支付宝公钥
    +     * */
         private String alipayPublicKey;
         
    +    /**
    +     * 接口内容加密秘钥,对称秘钥
    +     * */
         private String contentKey;
         
    +    /**
    +     * 页面跳转同步通知页面路径
    +     * */
         private String returnUrl;
         
    +    /**
    +     * 支付宝异步回调接口  需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
    +     * */
         private String notifyUrl;
     }
    diff --git a/damai-server/damai-pay-service/src/main/java/com/damai/service/PayService.java b/damai-server/damai-pay-service/src/main/java/com/damai/service/PayService.java
    index 11b4b2ab70a1ae1ac988778d6b399f6339c75c12..5452d3b071c9c2ce606e4aba17caea0a4fdf7cd6 100644
    --- a/damai-server/damai-pay-service/src/main/java/com/damai/service/PayService.java
    +++ b/damai-server/damai-pay-service/src/main/java/com/damai/service/PayService.java
    @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
     import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
     import com.damai.dto.NotifyDto;
    +import com.damai.dto.PayBillDto;
     import com.damai.dto.PayDto;
     import com.damai.dto.TradeCheckDto;
     import com.damai.entity.PayBill;
    @@ -21,6 +22,7 @@ import com.damai.pay.TradeResult;
     import com.damai.servicelock.annotion.ServiceLock;
     import com.damai.util.DateUtils;
     import com.damai.vo.NotifyVo;
    +import com.damai.vo.PayBillVo;
     import com.damai.vo.TradeCheckVo;
     import lombok.extern.slf4j.Slf4j;
     import org.springframework.beans.factory.annotation.Autowired;
    @@ -71,7 +73,7 @@ public class PayService {
                     payDto.getSubject(),payDto.getNotifyUrl(),payDto.getReturnUrl());
             if (pay.isSuccess()) {
                 payBill = new PayBill();
    -            payBill.setId(uidGenerator.getUID());
    +            payBill.setId(uidGenerator.getUid());
                 payBill.setOutOrderNo(String.valueOf(payDto.getOrderNumber()));
                 payBill.setPayChannel(payDto.getChannel());
                 payBill.setPayScene("生产");
    @@ -89,18 +91,15 @@ public class PayService {
         @Transactional(rollbackFor = Exception.class)
         public NotifyVo notify(NotifyDto notifyDto){
             NotifyVo notifyVo = new NotifyVo();
    -        
             log.info("回调通知参数 ===> {}", JSON.toJSONString(notifyDto));
             Map params = notifyDto.getParams();
    -        //验签
    +   
             PayStrategyHandler payStrategyHandler = payStrategyContext.get(notifyDto.getChannel());
             boolean signVerifyResult = payStrategyHandler.signVerify(params);
             if (!signVerifyResult) {
                 notifyVo.setPayResult(ALIPAY_NOTIFY_FAILURE_RESULT);
                 return notifyVo;
             }
    -        //按照支付结果异步通知中的描述,对支付结果中的业务内容进行二次校验
    -        //1 商户需要验证该通知数据中的 out_trade_no 是否为商户系统中创建的订单号
             LambdaQueryWrapper payBillLambdaQueryWrapper =
                     Wrappers.lambdaQuery(PayBill.class).eq(PayBill::getOutOrderNo, params.get("out_trade_no"));
             PayBill payBill = payBillMapper.selectOne(payBillLambdaQueryWrapper);
    @@ -127,7 +126,6 @@ public class PayService {
                 notifyVo.setPayResult(ALIPAY_NOTIFY_SUCCESS_RESULT);
                 return notifyVo;
             }
    -        
             boolean dataVerify = payStrategyHandler.dataVerify(notifyDto.getParams(), payBill);
             if (!dataVerify) {
                 notifyVo.setPayResult(ALIPAY_NOTIFY_FAILURE_RESULT);
    @@ -135,10 +133,8 @@ public class PayService {
             }
             PayBill updatePayBill = new PayBill();
             updatePayBill.setPayBillStatus(PayBillStatus.PAY.getCode());
    -        
             LambdaUpdateWrapper payBillLambdaUpdateWrapper =
                     Wrappers.lambdaUpdate(PayBill.class).eq(PayBill::getOutOrderNo, params.get("out_trade_no"));
    -        
             payBillMapper.update(updatePayBill,payBillLambdaUpdateWrapper);
             notifyVo.setOutTradeNo(payBill.getOutOrderNo());
             notifyVo.setPayResult(ALIPAY_NOTIFY_SUCCESS_RESULT);
    @@ -166,17 +162,16 @@ public class PayService {
                 return tradeCheckVo;
             }
             if (payBill.getPayAmount().compareTo(totalAmount) != 0) {
    -            log.error("支付宝和库中账单支付金额不一致 支付宝支付金额 : {}, 库中账单支付金额 : {}, tradeCheckDto : {}",
    +            log.error("支付渠道 和库中账单支付金额不一致 支付渠道支付金额 : {}, 库中账单支付金额 : {}, tradeCheckDto : {}",
                         totalAmount,payBill.getPayAmount(),JSON.toJSONString(tradeCheckDto));
                 return tradeCheckVo;
             }
             if (!Objects.equals(payBill.getPayBillStatus(), payBillStatus)) {
    -            log.info("支付宝和库中账单交易状态不一致 支付宝payBillStatus : {}, 库中payBillStatus : {}, tradeCheckDto : {}",
    +            log.warn("支付渠道和库中账单交易状态不一致 支付渠道payBillStatus : {}, 库中payBillStatus : {}, tradeCheckDto : {}",
                         payBillStatus,payBill.getPayBillStatus(),JSON.toJSONString(tradeCheckDto));
                 PayBill updatePayBill = new PayBill();
                 updatePayBill.setId(payBill.getId());
                 updatePayBill.setPayBillStatus(payBillStatus);
    -            
                 LambdaUpdateWrapper payBillLambdaUpdateWrapper =
                         Wrappers.lambdaUpdate(PayBill.class).eq(PayBill::getOutOrderNo, outTradeNo);
                 payBillMapper.update(updatePayBill,payBillLambdaUpdateWrapper);
    @@ -184,4 +179,15 @@ public class PayService {
             }
             return tradeCheckVo;
         }
    +    
    +    public PayBillVo detail(PayBillDto payBillDto) {
    +        PayBillVo payBillVo = new PayBillVo();
    +        LambdaQueryWrapper payBillLambdaQueryWrapper =
    +                Wrappers.lambdaQuery(PayBill.class).eq(PayBill::getOutOrderNo, payBillDto.getOrderNumber());
    +        PayBill payBill = payBillMapper.selectOne(payBillLambdaQueryWrapper);
    +        if (Objects.nonNull(payBill)) {
    +            BeanUtil.copyProperties(payBill,payBillVo);
    +        }
    +        return payBillVo;
    +    }
     }
    diff --git a/damai-server/damai-pay-service/src/main/resources/application.yml b/damai-server/damai-pay-service/src/main/resources/application.yml
    new file mode 100644
    index 0000000000000000000000000000000000000000..620ff014d472a5751dbb6b4c06460c20267e98eb
    --- /dev/null
    +++ b/damai-server/damai-pay-service/src/main/resources/application.yml
    @@ -0,0 +1,91 @@
    +#服务端口
    +server:
    +  port: 6087
    +# 应用名称
    +spring:
    +  application:
    +    name: ${prefix.distinction.name:damai}-pay-service
    +  main:
    +    allow-bean-definition-overriding: true
    +  mvc:
    +    pathmatch:
    +      matching-strategy: ant_path_matcher
    +    servlet:
    +      load-on-startup: 1
    +    jackson:
    +      time-zone: GMT+8
    +      date-format: yyyy-MM-dd HH:mm:ss
    +      generator:
    +        WRITE_NUMBERS_AS_STRINGS: true
    +  datasource:
    +    driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
    +    url: jdbc:shardingsphere:classpath:shardingsphere-pay.yaml
    +  redis:
    +    database: 0
    +    host: 127.0.0.1
    +    port: 6379
    +    timeout: 3000
    +  cloud:
    +    nacos:
    +      discovery:
    +        server-addr: 127.0.0.1:8848
    +        username: nacos
    +        password: nacos
    +mybatis-plus:
    +  mapper-locations: classpath:mapper/*.xml
    +  global-config:
    +    db-config:
    +      logic-delete-field: status
    +      logic-delete-value: 0
    +      logic-not-delete-value: 1
    +  configuration:
    +    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    +    local-cache-scope: statement
    +feign:
    +  sentinel:
    +    enabled: false
    +  hystrix:
    +    enabled: true
    +  httpclient:
    +    enabled: false
    +  okhttp:
    +    enabled: true
    +  compression:
    +    request:
    +      enabled: true
    +      mime-types: text/xml,application/xml,application/json
    +      min-request-size: 512
    +    response:
    +      enabled: true
    +hystrix:
    +  command:
    +    default:
    +      execution:
    +        timeout:
    +          enabled: true
    +        isolation:
    +          thread:
    +            timeoutInMilliseconds: 10000
    +          semaphore:
    +            maxConcurrentRequests: 99999
    +ribbon:
    +  ReadTimeout: 60000
    +  ConnectTimeout: 60000
    +  MaxAutoRetries: 0
    +  MaxAutoRetriesNextServer: 1
    +management:
    +  endpoints:
    +    web:
    +      exposure:
    +        include: '*'
    +    health:
    +      show-details: always
    +  security:
    +    enabled: false
    +  health:
    +    elasticsearch:
    +      enabled: false
    +jasypt:
    +  encryptor:
    +    password: bgtjkjl!%^sdc
    +    algorithm: PBEWithMD5AndDES
    \ No newline at end of file
    diff --git a/damai-server/damai-pay-service/src/main/resources/bootstrap.yml b/damai-server/damai-pay-service/src/main/resources/bootstrap.yml
    deleted file mode 100644
    index cc4cf9e5174e2af786eb34b817ca9fd6e1705265..0000000000000000000000000000000000000000
    --- a/damai-server/damai-pay-service/src/main/resources/bootstrap.yml
    +++ /dev/null
    @@ -1,23 +0,0 @@
    -#服务端口
    -server:
    -  port: 6087
    -# 应用名称
    -spring:
    -  application:
    -    name: ${prefix.distinction.name:damai}-pay-service
    -  main:
    -    allow-bean-definition-overriding: true
    -  cloud:
    -    nacos:
    -      discovery:
    -        server-addr: 62.234.31.217:8848
    -        username: nacos
    -        password: nacos
    -      config:
    -        server-addr: 62.234.31.217:8848
    -        file-extension: yaml
    -        shared-configs:
    -          - data-id: common.yaml
    -            refresh: true
    -        username: nacos
    -        password: nacos
    diff --git a/damai-server/damai-pay-service/src/main/resources/log4j2.xml b/damai-server/damai-pay-service/src/main/resources/log4j2.xml
    index 8bba99eeac8f8c0d052df8008d56c12f05bb22f2..c378f2925226058cf92b34f8def6460be5b47d54 100644
    --- a/damai-server/damai-pay-service/src/main/resources/log4j2.xml
    +++ b/damai-server/damai-pay-service/src/main/resources/log4j2.xml
    @@ -10,10 +10,10 @@
         
             
             .
    -        channel-data-service
    +        pay-service
             local
             log
    -        [channel-data-service] [%X{traceId}] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n
    +        [pay-service] [%X{traceId}] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n
             UTF-8
             com.damai
         
    diff --git a/damai-server/damai-pay-service/src/main/resources/shardingsphere-pay.yaml b/damai-server/damai-pay-service/src/main/resources/shardingsphere-pay.yaml
    index 7bfbc0008236ccaf86ec0c0def5a1f2fc2d386a2..819505121a2f579169b16eb879dd5bd3d0dca924 100644
    --- a/damai-server/damai-pay-service/src/main/resources/shardingsphere-pay.yaml
    +++ b/damai-server/damai-pay-service/src/main/resources/shardingsphere-pay.yaml
    @@ -2,16 +2,16 @@ dataSources:
       ds_0:
         dataSourceClassName: com.zaxxer.hikari.HikariDataSource
         driverClassName: com.mysql.cj.jdbc.Driver
    -    jdbcUrl: jdbc:mysql://www.cookframe.com:3306/damai_pay_0?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
    +    jdbcUrl: jdbc:mysql://127.0.0.1:3306/damai_pay_0?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
         username: root
    -    password: qaz321qwe!
    +    password: root
     
       ds_1:
         dataSourceClassName: com.zaxxer.hikari.HikariDataSource
         driverClassName: com.mysql.cj.jdbc.Driver
    -    jdbcUrl: jdbc:mysql://www.cookframe.com:3306/damai_pay_1?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
    +    jdbcUrl: jdbc:mysql://127.0.0.1:3306/damai_pay_1?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
         username: root
    -    password: qaz321qwe!
    +    password: root
         
     rules:
       # 分库分表规则
    diff --git a/damai-server/damai-program-service/pom.xml b/damai-server/damai-program-service/pom.xml
    index 4041ecd6d6fea008465fd4d4d082847de46e6924..b195843cae09d2dcc402cfbc6c360bee35c4d429 100644
    --- a/damai-server/damai-program-service/pom.xml
    +++ b/damai-server/damai-program-service/pom.xml
    @@ -36,6 +36,11 @@
                 damai-common
                 ${revision}
             
    +        
    +            com.example
    +            damai-service-initialize
    +            ${revision}
    +        
             
                 com.example
                 damai-redis-framework
    @@ -46,6 +51,11 @@
                 damai-service-lock-framework
                 ${revision}
             
    +        
    +            com.example
    +            damai-repeat-execute-limit-framework
    +            ${revision}
    +        
             
                 com.example
                 damai-service-delay-queue-framework
    @@ -151,6 +161,14 @@
                 snakeyaml
                 ${snakeyaml.version}
             
    +        
    +            com.alibaba.cloud
    +            spring-cloud-starter-alibaba-sentinel
    +        
    +        
    +            com.alibaba.csp
    +            sentinel-datasource-nacos
    +        
         
     
         
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramCategoryController.java b/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramCategoryController.java
    index e164fd70c3098d2232d2841f3af1457c564d421f..46d22823996bbdfcd338373149763622da612488 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramCategoryController.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramCategoryController.java
    @@ -23,7 +23,7 @@ import java.util.List;
      **/
     @RestController
     @RequestMapping("/program/category")
    -@Api(tags = "program-category", description = "节目类型")
    +@Api(tags = "program-category", value = "节目类型")
     public class ProgramCategoryController {
         
         @Autowired
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramController.java b/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramController.java
    index 9d357695a8e66b943ec050ead9ecbde216124f1d..4bcd4c06ff1a1a92431c19b91fabfdf42f57e1d3 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramController.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramController.java
    @@ -29,7 +29,7 @@ import java.util.Map;
      **/
     @RestController
     @RequestMapping("/program")
    -@Api(tags = "program", description = "节目")
    +@Api(tags = "program", value = "节目")
     public class ProgramController {
         
         @Autowired
    @@ -64,14 +64,4 @@ public class ProgramController {
         public ApiResponse getDetail(@Valid @RequestBody ProgramGetDto programGetDto) {
             return ApiResponse.ok(programService.getDetail(programGetDto));
         }
    -    
    -    @PostMapping(value = "/es/index/add")
    -    public ApiResponse indexAdd(@Valid @RequestBody ProgramGetDto programGetDto) {
    -        programService.indexAdd(programGetDto);
    -        return ApiResponse.ok();
    -    }
    -    @PostMapping(value = "/es/data/add")
    -    public ApiResponse dataAdd(@Valid @RequestBody ProgramGetDto programGetDto) {
    -        return ApiResponse.ok(programService.dataAdd(programGetDto));
    -    }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramOrderController.java b/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramOrderController.java
    index 0fac22bafdc36115a6dc32c6074e20ea45b199bc..b7e6ccc98fa978f742fd948be26e3b7706aeedfc 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramOrderController.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramOrderController.java
    @@ -20,27 +20,27 @@ import javax.validation.Valid;
      **/
     @RestController
     @RequestMapping("/program/order")
    -@Api(tags = "program-order", description = "节目订单")
    +@Api(tags = "program-order", value = "节目订单")
     public class ProgramOrderController {
         
         @Autowired
         private ProgramOrderLock programOrderLock;
         
    -    @ApiOperation(value = "生成订单")
    +    @ApiOperation(value = "购票V1")
         @PostMapping(value = "/create/v1")
         public ApiResponse createV1(@Valid @RequestBody ProgramOrderCreateDto programOrderCreateDto) {
             return ApiResponse.ok(programOrderLock.createV1(programOrderCreateDto));
         }
         
    -    @ApiOperation(value = "生成订单(优化版本v2)")
    +    @ApiOperation(value = "购票V2")
         @PostMapping(value = "/create/v2")
         public ApiResponse createV2(@Valid @RequestBody ProgramOrderCreateDto programOrderCreateDto) {
             return ApiResponse.ok(programOrderLock.createV2(programOrderCreateDto));
         }
         
    -    @ApiOperation(value = "生成订单(优化版本v3)")
    +    @ApiOperation(value = "购票V3")
         @PostMapping(value = "/create/v3")
    -    public ApiResponse createNew(@Valid @RequestBody ProgramOrderCreateDto programOrderCreateDto) {
    +    public ApiResponse createV3(@Valid @RequestBody ProgramOrderCreateDto programOrderCreateDto) {
             return ApiResponse.ok(programOrderLock.createV3(programOrderCreateDto));
         }
     }
    diff --git a/damai-server/damai-base-data-service/src/main/java/com/damai/controller/TokenDataController.java b/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramResetController.java
    similarity index 47%
    rename from damai-server/damai-base-data-service/src/main/java/com/damai/controller/TokenDataController.java
    rename to damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramResetController.java
    index 696cd9146fe53b0ad5687961a2f4d5a8c69ea16d..14fc7fd7d7620921504113c17c2d17387ce879fa 100644
    --- a/damai-server/damai-base-data-service/src/main/java/com/damai/controller/TokenDataController.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramResetController.java
    @@ -1,9 +1,8 @@
     package com.damai.controller;
     
     import com.damai.common.ApiResponse;
    -import com.damai.dto.TokenDataDto;
    -import com.damai.service.TokenDataService;
    -import com.damai.vo.TokenDataVo;
    +import com.damai.dto.ProgramResetExecuteDto;
    +import com.damai.service.ProgramService;
     import io.swagger.annotations.Api;
     import io.swagger.annotations.ApiOperation;
     import org.springframework.beans.factory.annotation.Autowired;
    @@ -16,28 +15,20 @@ import javax.validation.Valid;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: token 控制层
    + * @description: 节目相关数据重置 控制层
      * @author: 阿宽不是程序员
      **/
     @RestController
    -@RequestMapping("/token/data")
    -@Api(tags = "token-data", description = "token配置数据")
    -public class TokenDataController {
    +@RequestMapping("/program/reset")
    +@Api(tags = "program-reset", value = "节目数据重置")
    +public class ProgramResetController {
         
         @Autowired
    -    private TokenDataService tokenDataService;
    +    private ProgramService programService;
         
    -    @ApiOperation(value = "获取token配置数据")
    -    @PostMapping (value = "/get")
    -    public ApiResponse get() {
    -        TokenDataVo tokenDataVo = tokenDataService.get();
    -        return ApiResponse.ok(tokenDataVo);
    -    }
    -    
    -    @ApiOperation(value = "添加token配置数据")
    -    @PostMapping(value = "/add")
    -    public ApiResponse add(@Valid @RequestBody TokenDataDto tokenDataDto) {
    -        tokenDataService.add(tokenDataDto);
    -        return ApiResponse.ok(true);
    +    @ApiOperation(value = "执行重置(根据节目id)")
    +    @PostMapping(value = "/execute")
    +    public ApiResponse resetExecute(@Valid @RequestBody ProgramResetExecuteDto programResetExecuteDto) {
    +        return ApiResponse.ok(programService.resetExecute(programResetExecuteDto));
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramShowTimeController.java b/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramShowTimeController.java
    index bc11b5944ed9e0f719de7f4219893533ae7de755..50ba33c13547aacdf04907dd51019acf1536cef5 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramShowTimeController.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/controller/ProgramShowTimeController.java
    @@ -20,7 +20,7 @@ import javax.validation.Valid;
      **/
     @RestController
     @RequestMapping("/program/show/time")
    -@Api(tags = "program-show-time", description = "节目演出时间")
    +@Api(tags = "program-show-time", value = "节目演出时间")
     public class ProgramShowTimeController {
         
         @Autowired
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/controller/SeatController.java b/damai-server/damai-program-service/src/main/java/com/damai/controller/SeatController.java
    index 50f003c124b31cce337288fac77d9d2f723d92e7..1d783273bda07c52b07fe0595288a9d12c78e128 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/controller/SeatController.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/controller/SeatController.java
    @@ -2,7 +2,10 @@ package com.damai.controller;
     
     import com.damai.common.ApiResponse;
     import com.damai.dto.SeatAddDto;
    +import com.damai.dto.SeatBatchAddDto;
    +import com.damai.dto.SeatListDto;
     import com.damai.service.SeatService;
    +import com.damai.vo.SeatRelateInfoVo;
     import io.swagger.annotations.Api;
     import io.swagger.annotations.ApiOperation;
     import org.springframework.beans.factory.annotation.Autowired;
    @@ -20,16 +23,28 @@ import javax.validation.Valid;
      **/
     @RestController
     @RequestMapping("/seat")
    -@Api(tags = "seat", description = "座位")
    +@Api(tags = "seat", value = "座位")
     public class SeatController {
         
         @Autowired
         private SeatService seatService;
         
         
    -    @ApiOperation(value = "添加")
    +    @ApiOperation(value = "单个座位添加")
         @PostMapping(value = "/add")
         public ApiResponse add(@Valid @RequestBody SeatAddDto seatAddDto) {
             return ApiResponse.ok(seatService.add(seatAddDto));
         }
    +    
    +    @ApiOperation(value = "批量座位添加")
    +    @PostMapping(value = "/batch/add")
    +    public ApiResponse batchAdd(@Valid @RequestBody SeatBatchAddDto seatBatchAddDto) {
    +        return ApiResponse.ok(seatService.batchAdd(seatBatchAddDto));
    +    }
    +    
    +    @ApiOperation(value = "查询座位相关信息")
    +    @PostMapping(value = "/relate/info")
    +    public ApiResponse relateInfo(@Valid @RequestBody SeatListDto seatListDto) {
    +        return ApiResponse.ok(seatService.relateInfo(seatListDto));
    +    }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/controller/TicketCategoryController.java b/damai-server/damai-program-service/src/main/java/com/damai/controller/TicketCategoryController.java
    index 74446f1aaff509c6a5946698ed2d48e7972a76c9..2a0e52cdca3ce09da7bfa4ba47ac1a6cf7a7436c 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/controller/TicketCategoryController.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/controller/TicketCategoryController.java
    @@ -2,7 +2,9 @@ package com.damai.controller;
     
     import com.damai.common.ApiResponse;
     import com.damai.dto.TicketCategoryAddDto;
    +import com.damai.dto.TicketCategoryDto;
     import com.damai.service.TicketCategoryService;
    +import com.damai.vo.TicketCategoryDetailVo;
     import io.swagger.annotations.Api;
     import io.swagger.annotations.ApiOperation;
     import org.springframework.beans.factory.annotation.Autowired;
    @@ -20,7 +22,7 @@ import javax.validation.Valid;
      **/
     @RestController
     @RequestMapping("/ticket/category")
    -@Api(tags = "ticket-category", description = "票档")
    +@Api(tags = "ticket-category", value = "票档")
     public class TicketCategoryController {
         
         @Autowired
    @@ -32,4 +34,10 @@ public class TicketCategoryController {
         public ApiResponse add(@Valid @RequestBody TicketCategoryAddDto ticketCategoryAddDto) {
             return ApiResponse.ok(ticketCategoryService.add(ticketCategoryAddDto));
         }
    +    
    +    @ApiOperation(value = "查询详情")
    +    @PostMapping(value = "/detail")
    +    public ApiResponse detail(@Valid @RequestBody TicketCategoryDto ticketCategoryDto) {
    +        return ApiResponse.ok(ticketCategoryService.detail(ticketCategoryDto));
    +    }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/entity/Program.java b/damai-server/damai-program-service/src/main/java/com/damai/entity/Program.java
    index 8d0ce1cc93dd5b5db95d85f9b5f973fc9b1af2d2..9089d3156c12f4108cc5c22ee859523f77227f5b 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/entity/Program.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/entity/Program.java
    @@ -1,7 +1,7 @@
     package com.damai.entity;
     
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -13,7 +13,7 @@ import java.io.Serializable;
      **/
     @Data
     @TableName("d_program")
    -public class Program extends BaseData implements Serializable {
    +public class Program extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
    @@ -42,12 +42,12 @@ public class Program extends BaseData implements Serializable {
          */
         private String title;
         
    -    /*
    +    /**
          * 艺人
          * */
         private String actor;
         
    -    /*
    +    /**
          * 地点
          * */
         private String place;
    @@ -167,6 +167,11 @@ public class Program extends BaseData implements Serializable {
          */
         private Integer electronicInvoice;
         
    +    /**
    +     * 高热度节目 0:否 1:是
    +     * */
    +    private Integer highHeat;
    +    
         /**
          * 节目状态 1:上架 0:下架
          */
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramCategory.java b/damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramCategory.java
    index 3a40fe948f6766bcea685214b80940828ce329fe..e9cdfc6cfe8e953fa2ccd4e434a496991a8d92fb 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramCategory.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramCategory.java
    @@ -3,7 +3,7 @@ package com.damai.entity;
     import com.baomidou.mybatisplus.annotation.IdType;
     import com.baomidou.mybatisplus.annotation.TableId;
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -15,7 +15,7 @@ import java.io.Serializable;
      **/
     @Data
     @TableName("d_program_category")
    -public class ProgramCategory extends BaseData implements Serializable {
    +public class ProgramCategory extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramV2.java b/damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramJoinShowTime.java
    similarity index 89%
    rename from damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramV2.java
    rename to damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramJoinShowTime.java
    index 7837b9b46e761fcaf4f92bcccefda9445fb744ec..277bbc2702e4d0d772c500dde7b339a86aac767b 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramV2.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramJoinShowTime.java
    @@ -11,7 +11,7 @@ import java.util.Date;
      * @author: 阿宽不是程序员
      **/
     @Data
    -public class ProgramV2 extends Program implements Serializable {
    +public class ProgramJoinShowTime extends Program implements Serializable {
     
         private static final long serialVersionUID = 1L;
         
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramShowTime.java b/damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramShowTime.java
    index 5b70c48730e59a4e9fa9648b0c635a31bf8a1131..b6664a0c219fbc5d9e4127b3e838959367b77e64 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramShowTime.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/entity/ProgramShowTime.java
    @@ -1,7 +1,7 @@
     package com.damai.entity;
     
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -14,7 +14,7 @@ import java.util.Date;
      **/
     @Data
     @TableName("d_program_show_time")
    -public class ProgramShowTime extends BaseData implements Serializable {
    +public class ProgramShowTime extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/entity/Seat.java b/damai-server/damai-program-service/src/main/java/com/damai/entity/Seat.java
    index 155cce21211cb0edcb1b455fce6ef9ed1230a39e..e7ba78e063ab72b209eba63cd7a66c95fda1003a 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/entity/Seat.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/entity/Seat.java
    @@ -1,7 +1,9 @@
     package com.damai.entity;
     
    +import com.baomidou.mybatisplus.annotation.IdType;
    +import com.baomidou.mybatisplus.annotation.TableId;
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -14,13 +16,14 @@ import java.math.BigDecimal;
      **/
     @Data
     @TableName("d_seat")
    -public class Seat extends BaseData implements Serializable {
    +public class Seat extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
         /**
          * 主键id
          */
    +    @TableId(value = "id", type = IdType.AUTO)
         private Long id;
     
         /**
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/entity/TicketCategory.java b/damai-server/damai-program-service/src/main/java/com/damai/entity/TicketCategory.java
    index 517565cba7d4127c47866a108d0327ba0813ec01..f762a59ccd50c899906b49ef2b82b9b4301ee532 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/entity/TicketCategory.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/entity/TicketCategory.java
    @@ -1,7 +1,7 @@
     package com.damai.entity;
     
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -14,7 +14,7 @@ import java.math.BigDecimal;
      **/
     @Data
     @TableName("d_ticket_category")
    -public class TicketCategory extends BaseData implements Serializable {
    +public class TicketCategory extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/lock/ProgramOrderLock.java b/damai-server/damai-program-service/src/main/java/com/damai/lock/ProgramOrderLock.java
    index e8f7d41995dbf4f1e1d22c14428860612da39140..4327fe1a1376b483a17608fd9a373b06e7f47751 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/lock/ProgramOrderLock.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/lock/ProgramOrderLock.java
    @@ -2,9 +2,13 @@ package com.damai.lock;
     
     import cn.hutool.core.collection.CollectionUtil;
     import cn.hutool.core.util.StrUtil;
    +import com.damai.core.RepeatExecuteLimitConstants;
     import com.damai.dto.ProgramOrderCreateDto;
     import com.damai.dto.SeatDto;
    +import com.damai.enums.CompositeCheckType;
    +import com.damai.initialize.impl.composite.CompositeContainer;
     import com.damai.locallock.LocalLockCache;
    +import com.damai.repeatexecutelimit.annotion.RepeatExecuteLimit;
     import com.damai.service.ProgramOrderService;
     import com.damai.servicelock.LockType;
     import com.damai.servicelock.annotion.ServiceLock;
    @@ -40,45 +44,43 @@ public class ProgramOrderLock {
         @Autowired
         private ServiceLockTool serviceLockTool;
         
    -    /**
    -     * 订单创建,使用节目id作为锁
    -     * */
    +    @Autowired
    +    private CompositeContainer compositeContainer;
    +    
    +    @RepeatExecuteLimit(
    +            name = RepeatExecuteLimitConstants.CREATE_PROGRAM_ORDER,
    +            keys = {"#programOrderCreateDto.userId","#programOrderCreateDto.programId"})
         @ServiceLock(name = PROGRAM_ORDER_CREATE_V1,keys = {"#programOrderCreateDto.programId"})
         public String createV1(ProgramOrderCreateDto programOrderCreateDto) {
    +        compositeContainer.execute(CompositeCheckType.PROGRAM_ORDER_CREATE_CHECK.getValue(),programOrderCreateDto);
             return programOrderService.create(programOrderCreateDto);
         }
         
    -    /**
    -     * 订单优化版本v2,先用本地锁将没有获得锁的请求拦在外,获得本地锁后,再去获得分布式锁,这样可以减少对redis的压力。
    -     * 
    -     */
    +    @RepeatExecuteLimit(
    +            name = RepeatExecuteLimitConstants.CREATE_PROGRAM_ORDER,
    +            keys = {"#programOrderCreateDto.userId","#programOrderCreateDto.programId"})
         public String createV2(ProgramOrderCreateDto programOrderCreateDto) {
    +        compositeContainer.execute(CompositeCheckType.PROGRAM_ORDER_CREATE_CHECK.getValue(),programOrderCreateDto);
             List seatDtoList = programOrderCreateDto.getSeatDtoList();
             List ticketCategoryIdList = new ArrayList<>();
    -        //根据入参座位或者票档id统计出要锁定的票档id
             if (CollectionUtil.isNotEmpty(seatDtoList)) {
    -            ticketCategoryIdList = seatDtoList.stream().map(SeatDto::getTicketCategoryId).distinct().collect(Collectors.toList());
    +            ticketCategoryIdList = 
    +                    seatDtoList.stream().map(SeatDto::getTicketCategoryId).distinct().collect(Collectors.toList());
             }else {
                 ticketCategoryIdList.add(programOrderCreateDto.getTicketCategoryId());
             }
    -        //本地锁集合
             List localLockList = new ArrayList<>(ticketCategoryIdList.size());
    -        //分布式锁集合
    -        List localLockSuccessList = new ArrayList<>(ticketCategoryIdList.size());
    -        //加锁成功的本地锁集合
             List serviceLockList = new ArrayList<>(ticketCategoryIdList.size());
    -        //加锁成功的分布式锁集合
    +        List localLockSuccessList = new ArrayList<>(ticketCategoryIdList.size());
             List serviceLockSuccessList = new ArrayList<>(ticketCategoryIdList.size());
    -        //根据统计出的票档id获得本地锁和分布式锁集合
             for (Long ticketCategoryId : ticketCategoryIdList) {
    -            //锁的key为d_program_order_create_v2_lock-programId-ticketCategoryId
    -            String lockKey = StrUtil.join("-",PROGRAM_ORDER_CREATE_V2,programOrderCreateDto.getProgramId(),ticketCategoryId);
    -            ReentrantLock localLock = localLockCache.getLock(lockKey,true);
    -            RLock serviceLock = serviceLockTool.getLock(LockType.Fair, lockKey);
    +            String lockKey = StrUtil.join("-",PROGRAM_ORDER_CREATE_V2,
    +                    programOrderCreateDto.getProgramId(),ticketCategoryId);
    +            ReentrantLock localLock = localLockCache.getLock(lockKey,false);
    +            RLock serviceLock = serviceLockTool.getLock(LockType.Reentrant, lockKey);
                 localLockList.add(localLock);
                 serviceLockList.add(serviceLock);
             }
    -        //循环本地锁进行加锁
             for (ReentrantLock reentrantLock : localLockList) {
                 try {
                     reentrantLock.lock();
    @@ -87,7 +89,6 @@ public class ProgramOrderLock {
                 }
                 localLockSuccessList.add(reentrantLock);
             }
    -        //循环分布式锁进行加锁
             for (RLock rLock : serviceLockList) {
                 try {
                     rLock.lock();
    @@ -97,10 +98,8 @@ public class ProgramOrderLock {
                 serviceLockSuccessList.add(rLock);
             }
             try {
    -            //进行订单创建
                 return programOrderService.create(programOrderCreateDto);
             }finally {
    -            //先循环解锁分布式锁
                 for (int i = serviceLockSuccessList.size() - 1; i >= 0; i--) {
                     RLock rLock = serviceLockSuccessList.get(i);
                     try {
    @@ -109,7 +108,6 @@ public class ProgramOrderLock {
                         log.error("service lock unlock error",t);
                     }
                 }
    -            //再循环解锁本地锁
                 for (int i = localLockSuccessList.size() - 1; i >= 0; i--) {
                     ReentrantLock reentrantLock = localLockSuccessList.get(i);
                     try {
    @@ -121,11 +119,11 @@ public class ProgramOrderLock {
             }
         }
         
    -    /**
    -     * 订单创建,进行优化,一开始直接利用lua执行判断要购买的座位和票的数量是足够,不足够直接返回,足够的话进行相应扣除,
    -     * 这样既能将大量无用的抢购请求直接返回掉,又可以实现无锁化
    -     * */
    +    @RepeatExecuteLimit(
    +            name = RepeatExecuteLimitConstants.CREATE_PROGRAM_ORDER,
    +            keys = {"#programOrderCreateDto.userId","#programOrderCreateDto.programId"})
         public String createV3(ProgramOrderCreateDto programOrderCreateDto) {
    +        compositeContainer.execute(CompositeCheckType.PROGRAM_ORDER_CREATE_CHECK.getValue(),programOrderCreateDto);
             return programOrderService.createNew(programOrderCreateDto);
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/mapper/ProgramMapper.java b/damai-server/damai-program-service/src/main/java/com/damai/mapper/ProgramMapper.java
    index 27a66cf971e303f0f46c1c28b8de23c69660fd60..aecb7a7694152eb37187c05b8ba3095b72dbcfc4 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/mapper/ProgramMapper.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/mapper/ProgramMapper.java
    @@ -3,11 +3,14 @@ package com.damai.mapper;
     
     import com.baomidou.mybatisplus.core.mapper.BaseMapper;
     import com.baomidou.mybatisplus.core.metadata.IPage;
    +import com.damai.dto.ProgramListDto;
     import com.damai.dto.ProgramPageListDto;
     import com.damai.entity.Program;
    -import com.damai.entity.ProgramV2;
    +import com.damai.entity.ProgramJoinShowTime;
     import org.apache.ibatis.annotations.Param;
     
    +import java.util.List;
    +
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
      * @description: 节目 mapper
    @@ -15,5 +18,19 @@ import org.apache.ibatis.annotations.Param;
      **/
     public interface ProgramMapper extends BaseMapper {
         
    -    IPage selectPage(IPage page, @Param("programPageListDto")ProgramPageListDto programPageListDto);
    +    /**
    +     * 主页查询
    +     * @param programListDto 参数
    +     * @return 结果
    +     * */
    +    List selectHomeList(@Param("programListDto")ProgramListDto programListDto);
    +    
    +    /**
    +     * 分页查询
    +     * @param page 分页对象
    +     * @param programPageListDto 参数
    +     * @return 结果
    +     * */
    +    IPage selectPage(IPage page, 
    +                                          @Param("programPageListDto")ProgramPageListDto programPageListDto);
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/mapper/TicketCategoryMapper.java b/damai-server/damai-program-service/src/main/java/com/damai/mapper/TicketCategoryMapper.java
    index e88976185dceeb52bd6c406d3d77699c0c2479d0..4266fbcda71ecbaffaa54a0632a9103ad1541555 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/mapper/TicketCategoryMapper.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/mapper/TicketCategoryMapper.java
    @@ -14,10 +14,26 @@ import java.util.Map;
      * @author: 阿宽不是程序员
      **/
     public interface TicketCategoryMapper extends BaseMapper {
    -
    +    
    +    /**
    +     * 票档统计
    +     * @param programIdList 参数
    +     * @return 结果
    +     * */
         List selectAggregateList(@Param("programIdList")List programIdList);
         
    +    /**
    +     * 更新数量
    +     * @param number 数量
    +     * @param id id
    +     * @return 结果
    +     * */
         int updateRemainNumber(@Param("number")Long number,@Param("id")Long id);
         
    +    /**
    +     * 批量更新数量
    +     * @param ticketCategoryCountMap 参数
    +     * @return 结果
    +     * */
         int batchUpdateRemainNumber(@Param("ticketCategoryCountMap") Map ticketCategoryCountMap);
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramCategoryService.java b/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramCategoryService.java
    index 03c81e47a4c76d5947e1727885ea87201fa8d330..674f68d6e807c29cd774e83191b9420fb17e8a22 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramCategoryService.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramCategoryService.java
    @@ -8,13 +8,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
     import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
     import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    -import com.damai.core.RedisKeyEnum;
    +import com.damai.core.RedisKeyManage;
     import com.damai.dto.ProgramCategoryAddDto;
     import com.damai.dto.ProgramCategoryDto;
     import com.damai.entity.ProgramCategory;
     import com.damai.mapper.ProgramCategoryMapper;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
     import com.damai.servicelock.LockType;
     import com.damai.servicelock.annotion.ServiceLock;
     import com.damai.vo.ProgramCategoryVo;
    @@ -64,7 +64,7 @@ public class ProgramCategoryService extends ServiceImpl programCategoryList = programCategoryAddDtoList.stream().map((programCategoryAddDto) -> {
                 ProgramCategory programCategory = new ProgramCategory();
                 BeanUtil.copyProperties(programCategoryAddDto, programCategory);
    -            programCategory.setId(uidGenerator.getUID());
    +            programCategory.setId(uidGenerator.getUid());
                 return programCategory;
             }).collect(Collectors.toList());
             
    @@ -72,7 +72,7 @@ public class ProgramCategoryService extends ServiceImpl programCategoryMap = programCategoryList.stream().collect(
                         Collectors.toMap(p -> String.valueOf(p.getId()), p -> p, (v1, v2) -> v2));
    -            redisCache.putHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_CATEGORY_HASH),programCategoryMap);
    +            redisCache.putHash(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_CATEGORY_HASH),programCategoryMap);
             }
             
         }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramOrderService.java b/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramOrderService.java
    index 49e0074608f88b31cf5e694382640b6c661106df..d2566673d02c5bc5cb8a441f39e7dc13acb7e95a 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramOrderService.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramOrderService.java
    @@ -7,8 +7,7 @@ import com.alibaba.fastjson.JSONObject;
     import com.baidu.fsg.uid.UidGenerator;
     import com.damai.client.OrderClient;
     import com.damai.common.ApiResponse;
    -import com.damai.composite.CompositeContainer;
    -import com.damai.core.RedisKeyEnum;
    +import com.damai.core.RedisKeyManage;
     import com.damai.dto.DelayOrderCancelDto;
     import com.damai.dto.OrderCreateDto;
     import com.damai.dto.OrderTicketUserCreateDto;
    @@ -16,12 +15,11 @@ import com.damai.dto.ProgramOrderCreateDto;
     import com.damai.dto.SeatDto;
     import com.damai.entity.ProgramShowTime;
     import com.damai.enums.BaseCode;
    -import com.damai.enums.CompositeCheckType;
     import com.damai.enums.OrderStatus;
     import com.damai.enums.SellStatus;
     import com.damai.exception.DaMaiFrameException;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
     import com.damai.service.delaysend.DelayOrderCancelSend;
     import com.damai.service.lua.ProgramCacheCreateOrderData;
     import com.damai.service.lua.ProgramCacheCreateOrderOperate;
    @@ -69,109 +67,81 @@ public class ProgramOrderService {
         @Autowired
         private ProgramCacheCreateOrderOperate programCacheCreateOrderOperate;
         
    -    @Autowired
    -    private CompositeContainer compositeContainer;
    -    
         @Autowired
         private DelayOrderCancelSend delayOrderCancelSend;
         
         
         public String create(ProgramOrderCreateDto programOrderCreateDto) {
    -        compositeContainer.execute(CompositeCheckType.PROGRAM_ORDER_CREATE_CHECK.getValue(),programOrderCreateDto);
    -        //节目id
             Long programId = programOrderCreateDto.getProgramId();
    -        //传入的座位总价格
             BigDecimal parameterOrderPrice = new BigDecimal("0");
    -        //库中的座位总价格
             BigDecimal databaseOrderPrice = new BigDecimal("0");
    -        //要购买的座位
             List purchaseSeatList = new ArrayList<>();
             List seatDtoList = programOrderCreateDto.getSeatDtoList();
    -        //该节目下所有未售卖的座位
    -        List seatVoList = redisCache.getAllForHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_NO_SOLD_HASH, programOrderCreateDto.getProgramId()), SeatVo.class);
    -        //该节目下的余票数量
    -        Map ticketCategoryRemainNumber = redisCache.getAllMapForHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_TICKET_REMAIN_NUMBER_HASH, programOrderCreateDto.getProgramId()), Long.class);
    -        //入参座位存在
    +        List seatVoList = 
    +                redisCache.getAllForHash(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_NO_SOLD_HASH, 
    +                        programOrderCreateDto.getProgramId()), SeatVo.class);
    +        Map ticketCategoryRemainNumber = 
    +                redisCache.getAllMapForHash(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_TICKET_REMAIN_NUMBER_HASH, 
    +                        programOrderCreateDto.getProgramId()), Long.class);
             if (CollectionUtil.isNotEmpty(seatDtoList)) {
    -            //余票数量检测
                 Map seatTicketCategoryDtoCount = seatDtoList.stream()
                         .collect(Collectors.groupingBy(SeatDto::getTicketCategoryId, Collectors.counting()));
    -            for (final Entry entry : seatTicketCategoryDtoCount.entrySet()) {
    +            for (Entry entry : seatTicketCategoryDtoCount.entrySet()) {
                     Long ticketCategoryId = entry.getKey();
                     Long purchaseCount = entry.getValue();
    -                Long remainNumber = Optional.ofNullable(ticketCategoryRemainNumber.get(String.valueOf(ticketCategoryId))).orElseThrow(() -> new DaMaiFrameException(BaseCode.TICKET_CATEGORY_NOT_EXIST_V2));
    +                Long remainNumber = Optional.ofNullable(ticketCategoryRemainNumber.get(String.valueOf(ticketCategoryId)))
    +                        .orElseThrow(() -> new DaMaiFrameException(BaseCode.TICKET_CATEGORY_NOT_EXIST_V2));
                     if (purchaseCount > remainNumber) {
                         throw new DaMaiFrameException(BaseCode.TICKET_REMAIN_NUMBER_NOT_SUFFICIENT);
                     }
                 }
    -            //循环入参的座位对象
                 for (SeatDto seatDto : seatDtoList) {
    -                //验证入参的对象在库中的状态,不存在、已锁、已售卖
                     Map seatVoMap = seatVoList.stream().collect(Collectors
                             .toMap(seat -> seat.getRowCode() + "-" + seat.getColCode(), seat -> seat, (v1, v2) -> v2));
                     SeatVo seatVo = seatVoMap.get(seatDto.getRowCode() + "-" + seatDto.getColCode());
                     if (Objects.isNull(seatVo)) {
    -                    throw new DaMaiFrameException(BaseCode.SEAT_NOT_EXIST);
    -                }
    -                if (Objects.equals(seatVo.getSellStatus(), SellStatus.LOCK.getCode())) {
    -                    throw new DaMaiFrameException(BaseCode.SEAT_LOCK);
    -                }
    -                if (Objects.equals(seatVo.getSellStatus(), SellStatus.SOLD.getCode())) {
    -                    throw new DaMaiFrameException(BaseCode.SEAT_SOLD);
    +                    throw new DaMaiFrameException(BaseCode.SEAT_IS_NOT_NOT_SOLD);
                     }
                     purchaseSeatList.add(seatVo);
    -                //将入参的座位价格进行累加
                     parameterOrderPrice = parameterOrderPrice.add(seatDto.getPrice());
    -                //将库中的座位价格进行类型
                     databaseOrderPrice = databaseOrderPrice.add(seatVo.getPrice());
                 }
                 if (parameterOrderPrice.compareTo(databaseOrderPrice) > 0) {
                     throw new DaMaiFrameException(BaseCode.PRICE_ERROR);
                 }
             }else {
    -            //入参座位不存在,利用算法自动根据人数和票档进行分配相邻座位
                 Long ticketCategoryId = programOrderCreateDto.getTicketCategoryId();
                 Integer ticketCount = programOrderCreateDto.getTicketCount();
    -            //余票检测
    -            Long remainNumber = Optional.ofNullable(ticketCategoryRemainNumber.get(String.valueOf(ticketCategoryId))).orElseThrow(() -> new DaMaiFrameException(BaseCode.TICKET_CATEGORY_NOT_EXIST_V2));
    +            Long remainNumber = Optional.ofNullable(ticketCategoryRemainNumber.get(String.valueOf(ticketCategoryId)))
    +                    .orElseThrow(() -> new DaMaiFrameException(BaseCode.TICKET_CATEGORY_NOT_EXIST_V2));
                 if (ticketCount > remainNumber) {
                     throw new DaMaiFrameException(BaseCode.TICKET_REMAIN_NUMBER_NOT_SUFFICIENT);
                 }
                 purchaseSeatList = SeatMatch.findAdjacentSeatVos(seatVoList.stream().filter(seatVo -> 
                         Objects.equals(seatVo.getTicketCategoryId(), ticketCategoryId)).collect(Collectors.toList()), ticketCount);
    -            //如果匹配出来的座位数量小于要购买的数量,拒绝执行
                 if (purchaseSeatList.size() < ticketCount) {
                     throw new DaMaiFrameException(BaseCode.SEAT_OCCUPY);
                 }
             }
    -        //进行操作缓存中的数据
             updateProgramCacheData(programId,purchaseSeatList,OrderStatus.NO_PAY);
    -        //将筛选出来的购买的座位信息传入,执行创建订单的操作
             return doCreate(programOrderCreateDto,purchaseSeatList);
         }
         
         
         public String createNew(ProgramOrderCreateDto programOrderCreateDto) {
    -        compositeContainer.execute(CompositeCheckType.PROGRAM_ORDER_CREATE_CHECK.getValue(),programOrderCreateDto);
    -        //节目id
             Long programId = programOrderCreateDto.getProgramId();
             List seatDtoList = programOrderCreateDto.getSeatDtoList();
             List keys = new ArrayList<>();
    -        //票档数量的key
    -        keys.add(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_TICKET_REMAIN_NUMBER_HASH, programId).getRelKey());
    -        //没有售卖的座位key
    -        keys.add(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_NO_SOLD_HASH, programId).getRelKey());
    -        //锁定的座位key
    -        keys.add(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_LOCK_HASH, programId).getRelKey());
    +        keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_TICKET_REMAIN_NUMBER_HASH, programId).getRelKey());
    +        keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_NO_SOLD_HASH, programId).getRelKey());
    +        keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_LOCK_HASH, programId).getRelKey());
             String[] data = new String[2];
    -        //入参座位存在
             JSONArray jsonArray = new JSONArray();
             if (CollectionUtil.isNotEmpty(seatDtoList)) {
                 keys.add("1");
                 Map seatTicketCategoryDtoCount = seatDtoList.stream()
                         .collect(Collectors.groupingBy(SeatDto::getTicketCategoryId, Collectors.counting()));
    -            //将入参的座位集合统计出票档id和票档数量
    -            for (final Entry entry : seatTicketCategoryDtoCount.entrySet()) {
    +            for (Entry entry : seatTicketCategoryDtoCount.entrySet()) {
                     Long ticketCategoryId = entry.getKey();
                     Long ticketCount = entry.getValue();
                     JSONObject jsonObject = new JSONObject();
    @@ -180,9 +150,7 @@ public class ProgramOrderService {
                     jsonArray.add(jsonObject);
                 }
             }else {
    -            //入参座位不存在
                 keys.add("2");
    -            //如果不选择座位,则直接传入票档id和票档数量
                 Long ticketCategoryId = programOrderCreateDto.getTicketCategoryId();
                 Integer ticketCount = programOrderCreateDto.getTicketCount();
                 JSONObject jsonObject = new JSONObject();
    @@ -192,38 +160,31 @@ public class ProgramOrderService {
             }
             data[0] = JSON.toJSONString(jsonArray);
             data[1] = JSON.toJSONString(seatDtoList);
    -        //升级后的lua脚本处理票档数量和座位状态的检验,以及扣减票档数量的操作
    -        String result = programCacheCreateOrderOperate.programCacheOperate(keys, data);
    -        ProgramCacheCreateOrderData programCacheCreateOrderData = JSON.parseObject(result, ProgramCacheCreateOrderData.class);
    +        ProgramCacheCreateOrderData programCacheCreateOrderData = programCacheCreateOrderOperate.programCacheOperate(keys, data);
             if (!Objects.equals(programCacheCreateOrderData.getCode(), BaseCode.SUCCESS.getCode())) {
                 throw new DaMaiFrameException(Objects.requireNonNull(BaseCode.getRc(programCacheCreateOrderData.getCode())));
             }
             List purchaseSeatList = programCacheCreateOrderData.getPurchaseSeatList();
    -        //将筛选出来的购买的座位信息传入,执行创建订单的操作
             return doCreate(programOrderCreateDto,purchaseSeatList);
         }
         
         private String doCreate(ProgramOrderCreateDto programOrderCreateDto,List purchaseSeatList){
             Long programId = programOrderCreateDto.getProgramId();
    -        //获取要购买的节目信息
    -        ProgramVo programVo = redisCache.get(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM, programId), ProgramVo.class);
    -        //查询节目演出时间
    -        ProgramShowTime programShowTime = redisCache.get(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SHOW_TIME
    +        ProgramVo programVo = redisCache.get(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM, programId), ProgramVo.class);
    +        ProgramShowTime programShowTime = redisCache.get(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SHOW_TIME
                     ,programId),ProgramShowTime.class);
    -        //主订单参数构建
             OrderCreateDto orderCreateDto = new OrderCreateDto();
    -        //生成订单编号
             orderCreateDto.setOrderNumber(uidGenerator.getOrderNumber(programOrderCreateDto.getUserId(),ORDER_TABLE_COUNT));
             orderCreateDto.setProgramId(programOrderCreateDto.getProgramId());
             orderCreateDto.setUserId(programOrderCreateDto.getUserId());
             orderCreateDto.setProgramTitle(programVo.getTitle());
             orderCreateDto.setProgramPlace(programVo.getPlace());
             orderCreateDto.setProgramShowTime(programShowTime.getShowTime());
    -        BigDecimal databaseOrderPrice = purchaseSeatList.stream().map(SeatVo::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
    +        BigDecimal databaseOrderPrice = 
    +                purchaseSeatList.stream().map(SeatVo::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
             orderCreateDto.setOrderPrice(databaseOrderPrice);
             orderCreateDto.setCreateOrderTime(DateUtils.now());
             
    -        //购票人订单构建
             List ticketUserIdList = programOrderCreateDto.getTicketUserIdList();
             List orderTicketUserCreateDtoList = new ArrayList<>();
             for (int i = 0; i < ticketUserIdList.size(); i++) {
    @@ -233,7 +194,9 @@ public class ProgramOrderService {
                 orderTicketUserCreateDto.setProgramId(programOrderCreateDto.getProgramId());
                 orderTicketUserCreateDto.setUserId(programOrderCreateDto.getUserId());
                 orderTicketUserCreateDto.setTicketUserId(ticketUserId);
    -            SeatVo seatVo = Optional.ofNullable(purchaseSeatList.get(i)).orElseThrow(() -> new DaMaiFrameException(BaseCode.SEAT_NOT_EXIST));
    +            SeatVo seatVo = 
    +                    Optional.ofNullable(purchaseSeatList.get(i))
    +                            .orElseThrow(() -> new DaMaiFrameException(BaseCode.SEAT_NOT_EXIST));
                 orderTicketUserCreateDto.setSeatId(seatVo.getId());
                 orderTicketUserCreateDto.setSeatInfo(seatVo.getRowCode()+"排"+seatVo.getColCode()+"列");
                 orderTicketUserCreateDto.setOrderPrice(seatVo.getPrice());
    @@ -248,13 +211,11 @@ public class ProgramOrderService {
             if (Objects.equals(createOrderResponse.getCode(), BaseCode.SUCCESS.getCode())) {
                 orderNumber = createOrderResponse.getData();
             }else {
    -            //订单创建失败将操作缓存中的数据还原
                 updateProgramCacheData(programId,purchaseSeatList,OrderStatus.CANCEL);
                 log.error("创建订单失败 需人工处理 orderCreateDto : {}",JSON.toJSONString(orderCreateDto));
                 throw new DaMaiFrameException(createOrderResponse);
             }
             
    -        //延迟队列创建
             DelayOrderCancelDto delayOrderCancelDto = new DelayOrderCancelDto();
             delayOrderCancelDto.setOrderNumber(orderCreateDto.getOrderNumber());
             delayOrderCancelSend.sendMessage(JSON.toJSONString(delayOrderCancelDto));
    @@ -262,14 +223,12 @@ public class ProgramOrderService {
             return orderNumber;
         }
         
    -    private void updateProgramCacheData(long programId,List seatVoList,OrderStatus orderStatus){
    +    private void updateProgramCacheData(Long programId,List seatVoList,OrderStatus orderStatus){
             if (!(Objects.equals(orderStatus.getCode(), OrderStatus.NO_PAY.getCode()) ||
                     Objects.equals(orderStatus.getCode(), OrderStatus.CANCEL.getCode()))) {
                 throw new DaMaiFrameException(BaseCode.OPERATE_ORDER_STATUS_NOT_PERMIT);
             }
    -        //座位id集合
             List seatIdList = seatVoList.stream().map(SeatVo::getId).map(String::valueOf).collect(Collectors.toList());
    -        //座位map
             Map seatVoMap = seatVoList.stream().collect(Collectors
                     .toMap(seatVo -> String.valueOf(seatVo.getId()), seatVo -> seatVo, (v1, v2) -> v2));
             List seatDataList = new ArrayList<>();
    @@ -283,13 +242,11 @@ public class ProgramOrderService {
                 seatDataList.add(JSON.toJSONString(v));
             });
             List keys = new ArrayList<>();
    -        //票档数量的key
    -        keys.add(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_TICKET_REMAIN_NUMBER_HASH, programId).getRelKey());
    +        keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_TICKET_REMAIN_NUMBER_HASH, programId).getRelKey());
             
             String[] data = new String[3];
    -        //根据座位集合统计出对应的票档数量
    -        Map ticketCategoryCountMap = seatVoList.stream().collect(Collectors.groupingBy(SeatVo::getTicketCategoryId, Collectors.counting()));
    -        //要扣除或者恢复的票档数量
    +        Map ticketCategoryCountMap = 
    +                seatVoList.stream().collect(Collectors.groupingBy(SeatVo::getTicketCategoryId, Collectors.counting()));
             JSONArray jsonArray = new JSONArray();
             ticketCategoryCountMap.forEach((k,v) -> {
                 JSONObject jsonObject = new JSONObject();
    @@ -299,30 +256,20 @@ public class ProgramOrderService {
                 } else if (Objects.equals(orderStatus.getCode(), OrderStatus.CANCEL.getCode())) {
                     jsonObject.put("count",v);
                 }
    -            
                 jsonArray.add(jsonObject);
             });
    -        //票档数量数据
    -        data[0] = JSON.toJSONString(jsonArray);
             
    -        //如果是订单创建,那么就扣除未售卖的座位id
    -        //如果是订单取消,那么就扣除锁定的座位id
    +        data[0] = JSON.toJSONString(jsonArray);
             data[1] = JSON.toJSONString(seatIdList);
    -        //如果是订单创建的操作,那么添加到锁定的座位数据
    -        //如果是订单订单的操作,那么添加到未售卖的座位数据
             data[2] = JSON.toJSONString(seatDataList);
    +     
             if (Objects.equals(orderStatus.getCode(), OrderStatus.NO_PAY.getCode())) {
    -            //没有售卖座位的key
    -            keys.add(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_NO_SOLD_HASH, programId).getRelKey());
    -            //锁定座位的key
    -            keys.add(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_LOCK_HASH, programId).getRelKey());
    +            keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_NO_SOLD_HASH, programId).getRelKey());
    +            keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_LOCK_HASH, programId).getRelKey());
             } else if (Objects.equals(orderStatus.getCode(), OrderStatus.CANCEL.getCode())) {
    -            //锁定座位的key
    -            keys.add(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_LOCK_HASH, programId).getRelKey());
    -            //没有售卖座位的key
    -            keys.add(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_NO_SOLD_HASH, programId).getRelKey());
    +            keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_LOCK_HASH, programId).getRelKey());
    +            keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_NO_SOLD_HASH, programId).getRelKey());
             }
    -        
             programCacheOperate.programCacheOperate(keys,data);
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramService.java b/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramService.java
    index b3fbabd36c3a385d0b24aa83b545933caa7a35a8..8cc9526fe9e766022b355859d8d4facda5e0cd33 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramService.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramService.java
    @@ -9,28 +9,31 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
     import com.baomidou.mybatisplus.core.metadata.IPage;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
     import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    +import com.damai.BusinessThreadPool;
     import com.damai.client.BaseDataClient;
    +import com.damai.client.UserClient;
     import com.damai.common.ApiResponse;
    -import com.damai.core.RedisKeyEnum;
    +import com.damai.core.RedisKeyManage;
     import com.damai.dto.AreaGetDto;
     import com.damai.dto.AreaSelectDto;
    -import com.damai.dto.EsDataQueryDto;
     import com.damai.dto.ProgramAddDto;
     import com.damai.dto.ProgramGetDto;
     import com.damai.dto.ProgramListDto;
     import com.damai.dto.ProgramOperateDataDto;
     import com.damai.dto.ProgramPageListDto;
    +import com.damai.dto.ProgramResetExecuteDto;
     import com.damai.dto.ProgramSearchDto;
    +import com.damai.dto.TicketUserListDto;
     import com.damai.entity.Program;
     import com.damai.entity.ProgramCategory;
    +import com.damai.entity.ProgramJoinShowTime;
     import com.damai.entity.ProgramShowTime;
    -import com.damai.entity.ProgramV2;
     import com.damai.entity.Seat;
    +import com.damai.entity.TicketCategory;
     import com.damai.entity.TicketCategoryAggregate;
     import com.damai.enums.BaseCode;
     import com.damai.enums.BusinessStatus;
     import com.damai.enums.SellStatus;
    -import com.damai.enums.TimeType;
     import com.damai.exception.DaMaiFrameException;
     import com.damai.mapper.ProgramCategoryMapper;
     import com.damai.mapper.ProgramMapper;
    @@ -40,26 +43,26 @@ import com.damai.mapper.TicketCategoryMapper;
     import com.damai.page.PageUtil;
     import com.damai.page.PageVo;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    -import com.damai.service.init.ProgramDocumentParamName;
    -import com.damai.service.pagestrategy.SelectPageWrapper;
    +import com.damai.redis.RedisKeyBuild;
    +import com.damai.repeatexecutelimit.annotion.RepeatExecuteLimit;
    +import com.damai.service.constant.ProgramTimeType;
    +import com.damai.service.es.ProgramEs;
     import com.damai.servicelock.LockType;
     import com.damai.servicelock.annotion.ServiceLock;
    -import com.damai.util.BusinessEsHandle;
    +import com.damai.threadlocal.BaseParameterHolder;
     import com.damai.util.DateUtils;
    +import com.damai.util.StringUtil;
     import com.damai.vo.AreaVo;
     import com.damai.vo.ProgramListVo;
     import com.damai.vo.ProgramVo;
     import com.damai.vo.SeatVo;
     import com.damai.vo.TicketCategoryVo;
    -import com.github.pagehelper.PageInfo;
    +import com.damai.vo.TicketUserVo;
     import lombok.extern.slf4j.Slf4j;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Service;
     import org.springframework.transaction.annotation.Transactional;
    -import org.springframework.web.bind.annotation.RequestBody;
     
    -import javax.validation.Valid;
     import java.util.ArrayList;
     import java.util.Collection;
     import java.util.HashMap;
    @@ -72,8 +75,12 @@ import java.util.Set;
     import java.util.concurrent.TimeUnit;
     import java.util.stream.Collectors;
     
    +import static com.damai.constant.Constant.CODE;
    +import static com.damai.constant.Constant.USER_ID;
     import static com.damai.core.DistributedLockConstants.PROGRAM_LOCK;
    +import static com.damai.core.RepeatExecuteLimitConstants.CANCEL_PROGRAM_ORDER;
     import static com.damai.service.cache.ExpireTime.EXPIRE_TIME;
    +import static com.damai.util.DateUtils.FORMAT_DATE;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    @@ -105,6 +112,9 @@ public class ProgramService extends ServiceImpl {
         @Autowired
         private BaseDataClient baseDataClient;
         
    +    @Autowired
    +    private UserClient userClient;
    +    
         @Autowired
         private RedisCache redisCache;
         
    @@ -121,183 +131,187 @@ public class ProgramService extends ServiceImpl {
         private TicketCategoryService ticketCategoryService;
         
         @Autowired
    -    private BusinessEsHandle businessEsHandle;
    -    
    -    @Autowired
    -    private SelectPageWrapper selectPageWrapper;
    +    private ProgramEs programEs;
         
         public Long add(ProgramAddDto programAddDto){
             Program program = new Program();
             BeanUtil.copyProperties(programAddDto,program);
    -        program.setId(uidGenerator.getUID());
    +        program.setId(uidGenerator.getUid());
             programMapper.insert(program);
             return program.getId();
         }
         
         public PageVo search(ProgramSearchDto programSearchDto) {
    -        PageVo pageVo = new PageVo<>();
    -        try {
    -            List esDataQueryDtoList = new ArrayList<>();
    -            EsDataQueryDto titleQueryDto = new EsDataQueryDto();
    -            titleQueryDto.setParamName(ProgramDocumentParamName.TITLE);
    -            titleQueryDto.setParamValue(programSearchDto.getTitle());
    -            titleQueryDto.setAnalyse(true);
    -            esDataQueryDtoList.add(titleQueryDto);
    -            PageInfo programListVoPageInfo = businessEsHandle.queryPage(ProgramDocumentParamName.INDEX_NAME, 
    -                    ProgramDocumentParamName.INDEX_TYPE, esDataQueryDtoList, programSearchDto.getPageNumber(), 
    -                    programSearchDto.getPageSize(), ProgramListVo.class);
    -            pageVo = PageUtil.convertPage(programListVoPageInfo,programListVo -> programListVo);
    -        }catch (Exception e) {
    -            log.error("search error",e);
    -        }
    -        return pageVo;
    +        setQueryTime(programSearchDto);
    +        return programEs.search(programSearchDto);
         }
         public Map> selectHomeList(ProgramListDto programPageListDto) {
    -        Map> programListVoMap = new HashMap<>();
             
    -        //根据区域id和父节目类型id查询节目列表
    -        LambdaQueryWrapper programLambdaQueryWrapper = Wrappers.lambdaQuery(Program.class)
    -                .eq(Program::getProgramStatus, BusinessStatus.YES.getCode())
    -                .eq(Program::getAreaId,programPageListDto.getAreaId())
    -                .in(Program::getParentProgramCategoryId, programPageListDto.getParentProgramCategoryIds());
    -        List programList = programMapper.selectList(programLambdaQueryWrapper);
    -        //节目id集合
    +        Map> programListVoMap = programEs.selectHomeList(programPageListDto);
    +        if (CollectionUtil.isNotEmpty(programListVoMap)) {
    +            return programListVoMap;
    +        }
    +        return dbSelectHomeList(programPageListDto);
    +    }
    +    
    +    private Map> dbSelectHomeList(ProgramListDto programPageListDto){
    +        Map> programListVoMap = new HashMap<>(256);
    +        Map programCategoryMap = selectProgramCategoryMap(programPageListDto.getParentProgramCategoryIds());
    +        
    +        List programList = programMapper.selectHomeList(programPageListDto);
    +        if (CollectionUtil.isEmpty(programList)) {
    +            return programListVoMap;
    +        }
    +        
             List programIdList = programList.stream().map(Program::getId).collect(Collectors.toList());
    -        //根据节目id集合查询节目演出时间集合
             LambdaQueryWrapper programShowTimeLambdaQueryWrapper = Wrappers.lambdaQuery(ProgramShowTime.class)
                     .in(ProgramShowTime::getProgramId, programIdList);
             List programShowTimeList = programShowTimeMapper.selectList(programShowTimeLambdaQueryWrapper);
    -        //将节目演出集合根据节目id进行分组成map,key:节目id,value:节目演出时间集合
    -        Map> ProgramShowTimeMap = programShowTimeList.stream().collect(Collectors.groupingBy(ProgramShowTime::getProgramId));
    +        Map> programShowTimeMap = 
    +                programShowTimeList.stream().collect(Collectors.groupingBy(ProgramShowTime::getProgramId));
             
    -        //根据获得的节目列表中的父节目类型id来查询节目类型map,key:节目类型id,value:节目类型名
    -        Map programCategoryMap = selectProgramCategoryMap(programList.stream().map(Program::getParentProgramCategoryId).collect(Collectors.toList()));
    -        
    -        //根据节目id统计出票档的最低价和最高价的集合map, key:节目id,value:票档
             Map ticketCategorieMap = selectTicketCategorieMap(programIdList);
             
    +        Map> programMap = programList.stream()
    +                .collect(Collectors.groupingBy(Program::getParentProgramCategoryId));
             
    -        //将节目结合按照父节目类型id进行分组成map,key:父节目类型id,value:节目集合
    -        Map> programMap = programList.stream().collect(Collectors.groupingBy(Program::getParentProgramCategoryId));
    -        //循环此map
             for (Entry> programEntry : programMap.entrySet()) {
    -            //父节目类型id
                 Long key = programEntry.getKey();
    -            //节目集合
                 List value = programEntry.getValue();
                 List programListVoList = new ArrayList<>();
    -            //循环节目集合
                 for (Program program : value) {
                     ProgramListVo programListVo = new ProgramListVo();
                     BeanUtil.copyProperties(program,programListVo);
    -                //演出时间
    -                programListVo.setShowTime(Optional.ofNullable(ProgramShowTimeMap.get(program.getId()))
    +                
    +                programListVo.setShowTime(Optional.ofNullable(programShowTimeMap.get(program.getId()))
                             .filter(list -> !list.isEmpty())
                             .map(list -> list.get(0))
                             .map(ProgramShowTime::getShowTime)
                             .orElse(null));
    -                //演出时间(精确到天)
    -                programListVo.setShowDayTime(Optional.ofNullable(ProgramShowTimeMap.get(program.getId()))
    +                programListVo.setShowDayTime(Optional.ofNullable(programShowTimeMap.get(program.getId()))
                             .filter(list -> !list.isEmpty())
                             .map(list -> list.get(0))
                             .map(ProgramShowTime::getShowDayTime)
                             .orElse(null));
    -                //演出时间所在的星期
    -                programListVo.setShowWeekTime(Optional.ofNullable(ProgramShowTimeMap.get(program.getId()))
    +                programListVo.setShowWeekTime(Optional.ofNullable(programShowTimeMap.get(program.getId()))
                             .filter(list -> !list.isEmpty())
                             .map(list -> list.get(0))
                             .map(ProgramShowTime::getShowWeekTime)
                             .orElse(null));
    -                //节目最高价
    -                programListVo.setMaxPrice(Optional.ofNullable(ticketCategorieMap.get(program.getId())).map(TicketCategoryAggregate::getMaxPrice).orElse(null));
    -                //节目最低价
    -                programListVo.setMinPrice(Optional.ofNullable(ticketCategorieMap.get(program.getId())).map(TicketCategoryAggregate::getMinPrice).orElse(null));
    +                
    +                programListVo.setMaxPrice(Optional.ofNullable(ticketCategorieMap.get(program.getId()))
    +                        .map(TicketCategoryAggregate::getMaxPrice).orElse(null));
    +                programListVo.setMinPrice(Optional.ofNullable(ticketCategorieMap.get(program.getId()))
    +                        .map(TicketCategoryAggregate::getMinPrice).orElse(null));
                     programListVoList.add(programListVo);
                 }
    -            //key:节目类型名 value:节目列表
                 programListVoMap.put(programCategoryMap.get(key),programListVoList);
             }
             return programListVoMap;
         }
         
    +    public void setQueryTime(ProgramPageListDto programPageListDto){
    +        switch (programPageListDto.getTimeType()) {
    +            case ProgramTimeType.TODAY:
    +                programPageListDto.setStartDateTime(DateUtils.now(FORMAT_DATE));
    +                programPageListDto.setEndDateTime(DateUtils.now(FORMAT_DATE));
    +                break;
    +            case ProgramTimeType.TOMORROW:
    +                programPageListDto.setStartDateTime(DateUtils.now(FORMAT_DATE));
    +                programPageListDto.setEndDateTime(DateUtils.addDay(DateUtils.now(FORMAT_DATE),1));
    +                break;
    +            case ProgramTimeType.WEEK:
    +                programPageListDto.setStartDateTime(DateUtils.now(FORMAT_DATE));
    +                programPageListDto.setEndDateTime(DateUtils.addWeek(DateUtils.now(FORMAT_DATE),1));
    +                break;
    +            case ProgramTimeType.MONTH:
    +                programPageListDto.setStartDateTime(DateUtils.now(FORMAT_DATE));
    +                programPageListDto.setEndDateTime(DateUtils.addMonth(DateUtils.now(FORMAT_DATE),1));
    +                break;
    +            case ProgramTimeType.CALENDAR:
    +                if (Objects.isNull(programPageListDto.getStartDateTime())) {
    +                    throw new DaMaiFrameException(BaseCode.START_DATE_TIME_NOT_EXIST);
    +                }
    +                if (Objects.isNull(programPageListDto.getEndDateTime())) {
    +                    throw new DaMaiFrameException(BaseCode.END_DATE_TIME_NOT_EXIST);
    +                }
    +                break;
    +            default:
    +                programPageListDto.setStartDateTime(null);
    +                programPageListDto.setEndDateTime(null);
    +                break;
    +        }
    +    }
         public PageVo selectPage(ProgramPageListDto programPageListDto) {
    -        return selectPageWrapper.selectPage(programPageListDto);
    +        setQueryTime(programPageListDto);
    +        PageVo pageVo = programEs.selectPage(programPageListDto);
    +        if (CollectionUtil.isNotEmpty(pageVo.getList())) {
    +            return pageVo;
    +        }
    +        return dbSelectPage(programPageListDto);
         }
    -    public PageVo doSelectPage(ProgramPageListDto programPageListDto) {
    -        //需要program和program_show_time连表查询
    -        if (Objects.nonNull(programPageListDto.getTimeType())) {
    -            if (programPageListDto.getTimeType().equals(TimeType.WEEK.getCode())) {
    -                programPageListDto.setTime(DateUtils.addWeek(DateUtils.now(),1));
    -            }else if (programPageListDto.getTimeType().equals(TimeType.MONTH.getCode())) {
    -                programPageListDto.setTime(DateUtils.addMonth(DateUtils.now(),1));
    -            }
    +    public PageVo dbSelectPage(ProgramPageListDto programPageListDto) {
    +        IPage iPage = 
    +                programMapper.selectPage(PageUtil.getPageParams(programPageListDto), programPageListDto);
    +        if (CollectionUtil.isEmpty(iPage.getRecords())) {
    +            return new PageVo<>(iPage.getCurrent(), iPage.getSize(), iPage.getTotal(), new ArrayList<>());
             }
    -        IPage iPage = programMapper.selectPage(PageUtil.getPageParams(programPageListDto), programPageListDto);
    -        
    -        //根据节目列表获得节目类型id列表
    -        Set programCategoryIdList = iPage.getRecords().stream().map(Program::getProgramCategoryId).collect(Collectors.toSet());
    -        //根据id来查询节目类型列表map,key:节目类型id,value:节目类型名
    +        Set programCategoryIdList = 
    +                iPage.getRecords().stream().map(Program::getProgramCategoryId).collect(Collectors.toSet());
             Map programCategoryMap = selectProgramCategoryMap(programCategoryIdList);
             
    -        //节目id集合
             List programIdList = iPage.getRecords().stream().map(Program::getId).collect(Collectors.toList());
    -        //根据节目id统计出票档的最低价和最高价的集合map, key:节目id,value:票档
             Map ticketCategorieMap = selectTicketCategorieMap(programIdList);
    -        //查询区域
    -        Map tempAreaMap = new HashMap<>();
    +        
    +        Map tempAreaMap = new HashMap<>(64);
             AreaSelectDto areaSelectDto = new AreaSelectDto();
             areaSelectDto.setIdList(iPage.getRecords().stream().map(Program::getAreaId).distinct().collect(Collectors.toList()));
             ApiResponse> areaResponse = baseDataClient.selectByIdList(areaSelectDto);
             if (Objects.equals(areaResponse.getCode(), ApiResponse.ok().getCode())) {
                 if (CollectionUtil.isNotEmpty(areaResponse.getData())) {
    -                tempAreaMap = areaResponse.getData().stream().collect(Collectors.toMap(AreaVo::getId,AreaVo::getName,(v1,v2) -> v2));
    +                tempAreaMap = areaResponse.getData().stream()
    +                        .collect(Collectors.toMap(AreaVo::getId,AreaVo::getName,(v1,v2) -> v2));
                 }
             }else {
                 log.error("base-data selectByIdList rpc error areaResponse:{}", JSON.toJSONString(areaResponse));
             }
    -        
             Map areaMap = tempAreaMap;
    -        return PageUtil.convertPage(iPage,programV2 -> {
    +        
    +        return PageUtil.convertPage(iPage, programJoinShowTime -> {
                 ProgramListVo programListVo = new ProgramListVo();
    -            BeanUtil.copyProperties(programV2, programListVo);
    -            //区域名字
    -            programListVo.setAreaName(areaMap.get(programV2.getAreaId()));
    -            //节目名字
    -            programListVo.setProgramCategoryName(programCategoryMap.get(programV2.getProgramCategoryId()));
    -            //最低价
    -            programListVo.setMinPrice(Optional.ofNullable(ticketCategorieMap.get(programV2.getId())).map(TicketCategoryAggregate::getMinPrice).orElse(null));
    -            //最高价
    -            programListVo.setMaxPrice(Optional.ofNullable(ticketCategorieMap.get(programV2.getId())).map(TicketCategoryAggregate::getMaxPrice).orElse(null));
    +            BeanUtil.copyProperties(programJoinShowTime, programListVo);
    +            
    +            programListVo.setAreaName(areaMap.get(programJoinShowTime.getAreaId()));
    +            programListVo.setProgramCategoryName(programCategoryMap.get(programJoinShowTime.getProgramCategoryId()));
    +            programListVo.setMinPrice(Optional.ofNullable(ticketCategorieMap.get(programJoinShowTime.getId()))
    +                    .map(TicketCategoryAggregate::getMinPrice).orElse(null));
    +            programListVo.setMaxPrice(Optional.ofNullable(ticketCategorieMap.get(programJoinShowTime.getId()))
    +                    .map(TicketCategoryAggregate::getMaxPrice).orElse(null));
                 return programListVo;
             });
         }
         
    +    
         public ProgramVo getDetail(ProgramGetDto programGetDto) {
             ProgramVo redisProgramVo = programService.getById(programGetDto.getId());
             
    -        //查询节目类型
    -        ProgramCategory programCategory = redisCache.getForHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_CATEGORY_HASH)
    -                ,String.valueOf(redisProgramVo.getProgramCategoryId()),ProgramCategory.class);
    -        if (Objects.nonNull(programCategory)) {
    -            redisProgramVo.setProgramCategoryName(programCategory.getName());
    -        }
    +        preloadTicketUserList(redisProgramVo.getHighHeat());
    +        
    +        setProgramCategoryData(redisProgramVo);
             
    -        //查询节目演出时间
             ProgramShowTime redisProgramShowTime = programShowTimeService.selectProgramShowTimeByProgramId(redisProgramVo.getId());
             redisProgramVo.setShowTime(redisProgramShowTime.getShowTime());
             redisProgramVo.setShowDayTime(redisProgramShowTime.getShowDayTime());
             redisProgramVo.setShowWeekTime(redisProgramShowTime.getShowWeekTime());
             
    -        
    -        //查询座位
             List redisSeatVoList = seatService.selectSeatByProgramId(redisProgramVo.getId());
    -        redisProgramVo.setSeatVoList(redisSeatVoList);
    +        if (Objects.equals(redisProgramVo.getPermitChooseSeat(), BusinessStatus.YES.getCode())) {
    +            redisProgramVo.setSeatVoList(redisSeatVoList);
    +        }
             
    -        //查询节目票档
             List ticketCategoryVoList = ticketCategoryService.selectTicketCategoryListByProgramId(redisProgramVo.getId());
             redisProgramVo.setTicketCategoryVoList(ticketCategoryVoList);
             
    -        //余票数量
             ticketCategoryService.setRedisRemainNumber(redisProgramVo.getId());
             
             return redisProgramVo;
    @@ -305,31 +319,13 @@ public class ProgramService extends ServiceImpl {
         
         @ServiceLock(lockType= LockType.Read,name = PROGRAM_LOCK,keys = {"#programId"})
         public ProgramVo getById(Long programId) {
    -        return redisCache.get(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM,programId),ProgramVo.class,() -> {
    -            ProgramVo programVo = new ProgramVo();
    -            //根据id查询到节目
    -            Program program = Optional.ofNullable(programMapper.selectById(programId)).orElseThrow(() -> new DaMaiFrameException(BaseCode.PROGRAM_NOT_EXIST));
    -            BeanUtil.copyProperties(program,programVo);
    -            
    -            //查询区域
    -            AreaGetDto areaGetDto = new AreaGetDto();
    -            areaGetDto.setId(program.getAreaId());
    -            ApiResponse areaResponse = baseDataClient.getById(areaGetDto);
    -            if (Objects.equals(areaResponse.getCode(), ApiResponse.ok().getCode())) {
    -                if (Objects.nonNull(areaResponse.getData())) {
    -                    programVo.setAreaName(areaResponse.getData().getName());
    -                }
    -            }else {
    -                log.error("base-data rpc getById error areaResponse:{}", JSON.toJSONString(areaResponse));
    -            }
    -            return programVo;
    -        },EXPIRE_TIME, TimeUnit.DAYS);
    +        return redisCache.get(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM,programId)
    +                ,ProgramVo.class,
    +                () -> createProgramVo(programId)
    +                ,EXPIRE_TIME, 
    +                TimeUnit.DAYS);
         }
    -    /**
    -     * 根据节目类型id集合查询节目类型名字
    -     * @param programCategoryIdList 节目类型id集合
    -     * @return Map key:节目类型id value:节目类型名字
    -     * */
    +    
         public Map selectProgramCategoryMap(Collection programCategoryIdList){
             LambdaQueryWrapper pcLambdaQueryWrapper = Wrappers.lambdaQuery(ProgramCategory.class)
                     .in(ProgramCategory::getId, programCategoryIdList);
    @@ -340,40 +336,34 @@ public class ProgramService extends ServiceImpl {
         }
         
         public Map selectTicketCategorieMap(List programIdList){
    -        //根据节目id统计出票档的最低价和最高价的集合
             List ticketCategorieList = ticketCategoryMapper.selectAggregateList(programIdList);
    -        //将集合转换为map,key:节目id,value:票档
             return ticketCategorieList
                     .stream()
                     .collect(Collectors.toMap(TicketCategoryAggregate::getProgramId, ticketCategory -> ticketCategory, (v1, v2) -> v2));
         }
         
    +    @RepeatExecuteLimit(name = CANCEL_PROGRAM_ORDER,keys = {"#programOperateDataDto.programId"})
         @Transactional(rollbackFor = Exception.class)
    -    public void OperateProgramData(ProgramOperateDataDto programOperateDataDto){
    +    public void operateProgramData(ProgramOperateDataDto programOperateDataDto){
             Map ticketCategoryCountMap = programOperateDataDto.getTicketCategoryCountMap();
    -        //从库中查询座位集合
             List seatIdList = programOperateDataDto.getSeatIdList();
             LambdaQueryWrapper seatLambdaQueryWrapper = 
                     Wrappers.lambdaQuery(Seat.class).in(Seat::getId, seatIdList);
             List seatList = seatMapper.selectList(seatLambdaQueryWrapper);
    -        //如果库中的座位集合为空或者库中的座位集合数量和传入的座位数量不相同则抛出异常
             if (CollectionUtil.isEmpty(seatList) || seatList.size() != seatIdList.size()) {
                 throw new DaMaiFrameException(BaseCode.SEAT_NOT_EXIST);
             }
             for (Seat seat : seatList) {
    -            //如果库中的座位有一个已经是已售卖的状态,则抛出异常
                 if (Objects.equals(seat.getSellStatus(), SellStatus.SOLD.getCode())) {
                     throw new DaMaiFrameException(BaseCode.SEAT_SOLD);
                 }
             }
    -        //将库中的座位集合批量更新为售卖状态
             LambdaUpdateWrapper seatLambdaUpdateWrapper = 
                     Wrappers.lambdaUpdate(Seat.class).in(Seat::getId, seatIdList);
             Seat updateSeat = new Seat();
             updateSeat.setSellStatus(SellStatus.SOLD.getCode());
             seatMapper.update(updateSeat,seatLambdaUpdateWrapper);
             
    -        //将库中的对应票档进行更新库存
             int updateRemainNumberCount = 
                     ticketCategoryMapper.batchUpdateRemainNumber(ticketCategoryCountMap);
             if (updateRemainNumberCount != ticketCategoryCountMap.size()) {
    @@ -381,21 +371,12 @@ public class ProgramService extends ServiceImpl {
             }
         }
         
    -    public List getAllProgramIdList(){
    -        LambdaQueryWrapper programLambdaQueryWrapper =
    -                Wrappers.lambdaQuery(Program.class).eq(Program::getProgramStatus, BusinessStatus.YES.getCode())
    -                        .select(Program::getId);
    -        List programs = programMapper.selectList(programLambdaQueryWrapper);
    -        return programs.stream().map(Program::getId).collect(Collectors.toList());
    -    }
    -    
    -    public ProgramVo getDetailFromDb(Long programId) {
    +    private ProgramVo createProgramVo(long programId){
             ProgramVo programVo = new ProgramVo();
    -        //根据id查询到节目
    -        Program program = Optional.ofNullable(programMapper.selectById(programId)).orElseThrow(() -> new DaMaiFrameException(BaseCode.PROGRAM_NOT_EXIST));
    +        Program program = 
    +                Optional.ofNullable(programMapper.selectById(programId))
    +                        .orElseThrow(() -> new DaMaiFrameException(BaseCode.PROGRAM_NOT_EXIST));
             BeanUtil.copyProperties(program,programVo);
    -        
    -        //查询区域
             AreaGetDto areaGetDto = new AreaGetDto();
             areaGetDto.setId(program.getAreaId());
             ApiResponse areaResponse = baseDataClient.getById(areaGetDto);
    @@ -406,21 +387,27 @@ public class ProgramService extends ServiceImpl {
             }else {
                 log.error("base-data rpc getById error areaResponse:{}", JSON.toJSONString(areaResponse));
             }
    +        return programVo;
    +    }
    +    
    +    public List getAllProgramIdList(){
    +        LambdaQueryWrapper programLambdaQueryWrapper =
    +                Wrappers.lambdaQuery(Program.class).eq(Program::getProgramStatus, BusinessStatus.YES.getCode())
    +                        .select(Program::getId);
    +        List programs = programMapper.selectList(programLambdaQueryWrapper);
    +        return programs.stream().map(Program::getId).collect(Collectors.toList());
    +    }
    +    
    +    public ProgramVo getDetailFromDb(Long programId) {
    +        ProgramVo programVo = createProgramVo(programId);
             
    -        //查询节目类型
    -        ProgramCategory programCategory = redisCache.getForHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_CATEGORY_HASH)
    -                ,String.valueOf(programVo.getProgramCategoryId()),ProgramCategory.class);
    -        if (Objects.nonNull(programCategory)) {
    -            programVo.setProgramCategoryName(programCategory.getName());
    -        }
    +        setProgramCategoryData(programVo);
             
    -        //查询节目演出时间
             LambdaQueryWrapper programShowTimeLambdaQueryWrapper =
                     Wrappers.lambdaQuery(ProgramShowTime.class).eq(ProgramShowTime::getProgramId, programId);
             ProgramShowTime programShowTime = Optional.ofNullable(programShowTimeMapper.selectOne(programShowTimeLambdaQueryWrapper))
                     .orElseThrow(() -> new DaMaiFrameException(BaseCode.PROGRAM_SHOW_TIME_NOT_EXIST));
             
    -        
             programVo.setShowTime(programShowTime.getShowTime());
             programVo.setShowDayTime(programShowTime.getShowDayTime());
             programVo.setShowWeekTime(programShowTime.getShowWeekTime());
    @@ -428,11 +415,103 @@ public class ProgramService extends ServiceImpl {
             return programVo;
         }
         
    -    public void indexAdd(@Valid @RequestBody ProgramGetDto programGetDto) {
    +    private void preloadTicketUserList(Integer highHeat){
    +        if (Objects.equals(highHeat, BusinessStatus.NO.getCode())) {
    +            return;
    +        }
    +        String userId = BaseParameterHolder.getParameter(USER_ID);
    +        String code = BaseParameterHolder.getParameter(CODE);
    +        if (StringUtil.isEmpty(userId) || StringUtil.isEmpty(code)) {
    +            return;
    +        }
    +        BusinessThreadPool.execute(() -> {
    +            try {
    +                Boolean userLogin = 
    +                        redisCache.hasKey(RedisKeyBuild.createRedisKey(RedisKeyManage.USER_LOGIN, code, userId));
    +                if (!userLogin) {
    +                    return;
    +                }
    +                if (redisCache.hasKey(RedisKeyBuild.createRedisKey(RedisKeyManage.TICKET_USER_LIST,userId))) {
    +                    return;
    +                }
    +                TicketUserListDto ticketUserListDto = new TicketUserListDto();
    +                ticketUserListDto.setUserId(Long.parseLong(userId));
    +                ApiResponse> apiResponse = userClient.select(ticketUserListDto);
    +                if (Objects.equals(apiResponse.getCode(), BaseCode.SUCCESS.getCode())) {
    +                    Optional.ofNullable(apiResponse.getData()).filter(CollectionUtil::isNotEmpty)
    +                            .ifPresent(ticketUserVoList -> redisCache.set(RedisKeyBuild.createRedisKey(
    +                                    RedisKeyManage.TICKET_USER_LIST,userId),ticketUserVoList));
    +                }else {
    +                    log.warn("userClient.select 调用失败 apiResponse : {}",JSON.toJSONString(apiResponse));
    +                }
    +            }catch (Exception e) {
    +                log.error("预热加载投票人列表失败",e);
    +            }
    +        });
    +    }
    +    
    +    public void setProgramCategoryData(ProgramVo programVo){
    +        ProgramCategory programCategory = redisCache.getForHash(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_CATEGORY_HASH)
    +                ,String.valueOf(programVo.getProgramCategoryId()),ProgramCategory.class);
    +        if (Objects.nonNull(programCategory)) {
    +            programVo.setProgramCategoryName(programCategory.getName());
    +        }
    +        ProgramCategory parentProgramCategory = redisCache.getForHash(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_CATEGORY_HASH)
    +                ,String.valueOf(programVo.getParentProgramCategoryId()),ProgramCategory.class);
    +        if (Objects.nonNull(parentProgramCategory)) {
    +            programVo.setParentProgramCategoryName(parentProgramCategory.getName());
    +        }
    +    }
    +    
    +    @Transactional(rollbackFor = Exception.class)
    +    public Boolean resetExecute(ProgramResetExecuteDto programResetExecuteDto) {
    +        Long programId = programResetExecuteDto.getProgramId();
    +        LambdaQueryWrapper seatQueryWrapper =
    +                Wrappers.lambdaQuery(Seat.class).eq(Seat::getProgramId, programId);
    +        List seatList = seatMapper.selectList(seatQueryWrapper);
    +        if (CollectionUtil.isEmpty(seatList)) {
    +            return true;
    +        }
    +        boolean resetSeatFlag = false;
    +        for (Seat seat : seatList) {
    +            if (!seat.getSellStatus().equals(SellStatus.NO_SOLD.getCode())) {
    +                resetSeatFlag = true;
    +                break;
    +            }
    +        }
    +        if (resetSeatFlag) {
    +            LambdaUpdateWrapper seatUpdateWrapper =
    +                    Wrappers.lambdaUpdate(Seat.class).eq(Seat::getProgramId, programId);
    +            Seat seatUpdate = new Seat();
    +            seatUpdate.setSellStatus(SellStatus.NO_SOLD.getCode());
    +            seatMapper.update(seatUpdate,seatUpdateWrapper);
    +        }
             
    +        LambdaQueryWrapper ticketCategoryQueryWrapper =
    +                Wrappers.lambdaQuery(TicketCategory.class).eq(TicketCategory::getProgramId, programId);
    +        List ticketCategories = ticketCategoryMapper.selectList(ticketCategoryQueryWrapper);
    +        for (TicketCategory ticketCategory : ticketCategories) {
    +            Long remainNumber = ticketCategory.getRemainNumber();
    +            Long totalNumber = ticketCategory.getTotalNumber();
    +            if (!remainNumber.equals(totalNumber)) {
    +                TicketCategory ticketCategoryUpdate = new TicketCategory();
    +                ticketCategoryUpdate.setRemainNumber(totalNumber);
    +                ticketCategoryUpdate.setId(ticketCategory.getId());
    +                ticketCategoryMapper.updateById(ticketCategoryUpdate);
    +            }
    +        }
    +        delRedisData(programId);
    +        return true;
         }
         
    -    public ProgramVo dataAdd(@Valid @RequestBody ProgramGetDto programGetDto) {
    -        return null;
    +    private void delRedisData(Long programId){
    +        redisCache.del(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM,programId));
    +        redisCache.del(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SHOW_TIME,programId));
    +        redisCache.del(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_NO_SOLD_HASH, programId));
    +        redisCache.del(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_LOCK_HASH, programId));
    +        redisCache.del(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_SOLD_HASH, programId));
    +        redisCache.del(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_TICKET_CATEGORY_LIST, programId));
    +        redisCache.del(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_TICKET_REMAIN_NUMBER_HASH, programId));
         }
     }
    +
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramShowTimeService.java b/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramShowTimeService.java
    index a31e95bac884821d80abac52226094a1373dadfc..3282c50a55c0eb160eb97d921296c9b2e8812098 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramShowTimeService.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/ProgramShowTimeService.java
    @@ -7,14 +7,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
     import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
     import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    -import com.damai.core.RedisKeyEnum;
    +import com.damai.core.RedisKeyManage;
     import com.damai.dto.ProgramShowTimeAddDto;
     import com.damai.entity.ProgramShowTime;
     import com.damai.enums.BaseCode;
     import com.damai.exception.DaMaiFrameException;
     import com.damai.mapper.ProgramShowTimeMapper;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
     import com.damai.util.DateUtils;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Service;
    @@ -52,7 +52,7 @@ public class ProgramShowTimeService extends ServiceImpl {
    -            LambdaQueryWrapper programShowTimeLambdaQueryWrapper =
    -                    Wrappers.lambdaQuery(ProgramShowTime.class).eq(ProgramShowTime::getProgramId, programId);
    -            return Optional.ofNullable(programShowTimeMapper.selectOne(programShowTimeLambdaQueryWrapper))
    -                    .orElseThrow(() -> new DaMaiFrameException(BaseCode.PROGRAM_SHOW_TIME_NOT_EXIST));
    -        },EXPIRE_TIME, TimeUnit.DAYS);
    +        return redisCache.get(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SHOW_TIME,programId),
    +                ProgramShowTime.class,
    +                () -> {
    +                    LambdaQueryWrapper programShowTimeLambdaQueryWrapper =
    +                            Wrappers.lambdaQuery(ProgramShowTime.class).eq(ProgramShowTime::getProgramId, programId);
    +                    return Optional.ofNullable(programShowTimeMapper.selectOne(programShowTimeLambdaQueryWrapper))
    +                            .orElseThrow(() -> new DaMaiFrameException(BaseCode.PROGRAM_SHOW_TIME_NOT_EXIST));
    +                },
    +                EXPIRE_TIME, 
    +                TimeUnit.DAYS);
         }
         
         @Transactional(rollbackFor = Exception.class)
    -    public void renewal(){
    +    public boolean renewal(){
    +        boolean flag = false;
             LambdaQueryWrapper programShowTimeLambdaQueryWrapper =
                     Wrappers.lambdaQuery(ProgramShowTime.class).
                             le(ProgramShowTime::getShowTime, DateUtils.addDay(DateUtils.now(), 1));
    @@ -78,6 +83,11 @@ public class ProgramShowTimeService extends ServiceImpl programShowTimeLambdaUpdateWrapper =
                         Wrappers.lambdaUpdate(ProgramShowTime.class).eq(ProgramShowTime::getProgramId, programShowTime.getProgramId());
                 programShowTimeMapper.update(updateProgramShowTime,programShowTimeLambdaUpdateWrapper);
    -            redisCache.set(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SHOW_TIME,programShowTime.getProgramId())
    +            redisCache.set(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SHOW_TIME,programShowTime.getProgramId())
                         ,updateProgramShowTime,EXPIRE_TIME, TimeUnit.DAYS);
             }
    +        return flag;
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/SeatService.java b/damai-server/damai-program-service/src/main/java/com/damai/service/SeatService.java
    index 1435ccdf9b2ff5082e7402541f8e79297724d13f..e4ecdece98ffd67eadf3307a7287df635f791a2f 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/SeatService.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/SeatService.java
    @@ -6,21 +6,30 @@ import com.baidu.fsg.uid.UidGenerator;
     import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
     import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    -import com.damai.core.RedisKeyEnum;
    +import com.damai.core.RedisKeyManage;
    +import com.damai.dto.ProgramGetDto;
     import com.damai.dto.SeatAddDto;
    +import com.damai.dto.SeatBatchAddDto;
    +import com.damai.dto.SeatBatchRelateInfoAddDto;
    +import com.damai.dto.SeatListDto;
    +import com.damai.entity.ProgramShowTime;
     import com.damai.entity.Seat;
     import com.damai.enums.BaseCode;
    +import com.damai.enums.BusinessStatus;
     import com.damai.enums.SeatType;
     import com.damai.enums.SellStatus;
     import com.damai.exception.DaMaiFrameException;
     import com.damai.mapper.SeatMapper;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
    +import com.damai.vo.ProgramVo;
    +import com.damai.vo.SeatRelateInfoVo;
     import com.damai.vo.SeatVo;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Service;
    +import org.springframework.transaction.annotation.Transactional;
     
    -import java.util.ArrayList;
    +import java.math.BigDecimal;
     import java.util.Comparator;
     import java.util.List;
     import java.util.Map;
    @@ -47,6 +56,12 @@ public class SeatService extends ServiceImpl {
         @Autowired
         private SeatMapper seatMapper;
         
    +    @Autowired
    +    private ProgramService programService;
    +    
    +    @Autowired
    +    private ProgramShowTimeService programShowTimeService;
    +    
         /**
          * 添加座位
          * */
    @@ -61,7 +76,7 @@ public class SeatService extends ServiceImpl {
             }
             seat = new Seat();
             BeanUtil.copyProperties(seatAddDto,seat);
    -        seat.setId(uidGenerator.getUID());
    +        seat.setId(uidGenerator.getUid());
             seatMapper.insert(seat);
             return seat.getId();
         }
    @@ -70,11 +85,16 @@ public class SeatService extends ServiceImpl {
          * 查询座位
          * */
         public List selectSeatByProgramId(Long programId) {
    -        List seatVoList = new ArrayList<>();
    -        if ((!redisCache.hasKey(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_NO_SOLD_HASH, programId))) &&
    -                (!redisCache.hasKey(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_LOCK_HASH, programId))) &&
    -                (!redisCache.hasKey(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_SOLD_HASH, programId)))) {
    -            LambdaQueryWrapper seatLambdaQueryWrapper = Wrappers.lambdaQuery(Seat.class).eq(Seat::getProgramId, programId);
    +        List seatVoList = redisCache.getAllForHash(RedisKeyBuild.createRedisKey(
    +                RedisKeyManage.PROGRAM_SEAT_NO_SOLD_HASH, programId),SeatVo.class);
    +        seatVoList.addAll(redisCache.getAllForHash(RedisKeyBuild.createRedisKey(
    +                RedisKeyManage.PROGRAM_SEAT_LOCK_HASH, programId),SeatVo.class));
    +        seatVoList.addAll(redisCache.getAllForHash(RedisKeyBuild.createRedisKey(
    +                RedisKeyManage.PROGRAM_SEAT_SOLD_HASH, programId),SeatVo.class));
    +        
    +        if (CollectionUtil.isEmpty(seatVoList)) {
    +            LambdaQueryWrapper seatLambdaQueryWrapper = 
    +                    Wrappers.lambdaQuery(Seat.class).eq(Seat::getProgramId, programId);
                 List seats = seatMapper.selectList(seatLambdaQueryWrapper);
                 for (Seat seat : seats) {
                     SeatVo seatVo = new SeatVo();
    @@ -87,27 +107,86 @@ public class SeatService extends ServiceImpl {
                 List lockSeatVoList = seatMap.get(SellStatus.LOCK.getCode());
                 List soldSeatVoList = seatMap.get(SellStatus.SOLD.getCode());
                 if (CollectionUtil.isNotEmpty(noSoldSeatVoList)) {
    -                redisCache.putHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_NO_SOLD_HASH, programId)
    -                        ,noSoldSeatVoList.stream().collect(Collectors.toMap(s -> String.valueOf(s.getId()),s -> s,(v1,v2) -> v2))
    +                redisCache.putHash(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_NO_SOLD_HASH, programId)
    +                        ,noSoldSeatVoList.stream()
    +                                .collect(Collectors.toMap(s -> String.valueOf(s.getId()),s -> s,(v1,v2) -> v2))
                             ,EXPIRE_TIME, TimeUnit.DAYS);
                 }
                 if (CollectionUtil.isNotEmpty(lockSeatVoList)) {
    -                redisCache.putHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_LOCK_HASH, programId)
    -                        ,lockSeatVoList.stream().collect(Collectors.toMap(s -> String.valueOf(s.getId()),s -> s,(v1,v2) -> v2))
    +                redisCache.putHash(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_LOCK_HASH, programId)
    +                        ,lockSeatVoList.stream()
    +                                .collect(Collectors.toMap(s -> String.valueOf(s.getId()),s -> s,(v1,v2) -> v2))
                             ,EXPIRE_TIME, TimeUnit.DAYS);
                 }
                 if (CollectionUtil.isNotEmpty(soldSeatVoList)) {
    -                redisCache.putHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_SOLD_HASH, programId)
    -                        ,soldSeatVoList.stream().collect(Collectors.toMap(s -> String.valueOf(s.getId()),s -> s,(v1,v2) -> v2))
    +                redisCache.putHash(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SEAT_SOLD_HASH, programId)
    +                        ,soldSeatVoList.stream()
    +                                .collect(Collectors.toMap(s -> String.valueOf(s.getId()),s -> s,(v1,v2) -> v2))
                             ,EXPIRE_TIME, TimeUnit.DAYS);
                 }
    -        }else {
    -            seatVoList = redisCache.getAllForHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_NO_SOLD_HASH, programId),SeatVo.class);
    -            seatVoList.addAll(redisCache.getAllForHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_LOCK_HASH, programId),SeatVo.class));
    -            seatVoList.addAll(redisCache.getAllForHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SEAT_SOLD_HASH, programId),SeatVo.class));
    -            seatVoList = seatVoList.stream().sorted(Comparator.comparingInt(SeatVo::getRowCode)
    -                    .thenComparingInt(SeatVo::getColCode)).collect(Collectors.toList());
             }
    +        seatVoList = seatVoList.stream().sorted(Comparator.comparingInt(SeatVo::getRowCode)
    +                .thenComparingInt(SeatVo::getColCode)).collect(Collectors.toList());
             return seatVoList;
         }
    +    
    +    public SeatRelateInfoVo relateInfo(SeatListDto seatListDto) {
    +        SeatRelateInfoVo seatRelateInfoVo = new SeatRelateInfoVo();
    +        ProgramVo programVo = 
    +                redisCache.get(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM,seatListDto.getProgramId()),ProgramVo.class);
    +        if (Objects.isNull(programVo)){
    +            ProgramGetDto programGetDto = new ProgramGetDto();
    +            programGetDto.setId(seatListDto.getProgramId());
    +            programVo = programService.getDetail(programGetDto);
    +        }
    +        if (programVo.getPermitChooseSeat().equals(BusinessStatus.NO.getCode())) {
    +            throw new DaMaiFrameException(BaseCode.PROGRAM_NOT_ALLOW_CHOOSE_SEAT);
    +        }
    +        List seatVos = selectSeatByProgramId(seatListDto.getProgramId());
    +        Map> seatVoMap = 
    +                seatVos.stream().collect(Collectors.groupingBy(seatVo -> seatVo.getPrice().toString()));
    +        ProgramShowTime programShowTime = programShowTimeService.selectProgramShowTimeByProgramId(seatListDto.getProgramId());
    +        
    +        seatRelateInfoVo.setProgramId(programVo.getId());
    +        seatRelateInfoVo.setPlace(programVo.getPlace());
    +        seatRelateInfoVo.setShowTime(programShowTime.getShowTime());
    +        seatRelateInfoVo.setShowWeekTime(programShowTime.getShowWeekTime());
    +        seatRelateInfoVo.setPriceList(seatVoMap.keySet().stream().sorted().collect(Collectors.toList()));
    +        seatRelateInfoVo.setSeatVoMap(seatVoMap);
    +        return seatRelateInfoVo;
    +    }
    +    
    +    @Transactional(rollbackFor = Exception.class)
    +    public Boolean batchAdd(SeatBatchAddDto seatBatchAddDto) {
    +        Long programId = seatBatchAddDto.getProgramId();
    +        List seatBatchRelateInfoAddDtoList = seatBatchAddDto.getSeatBatchRelateInfoAddDtoList();
    +        
    +        
    +        int rowIndex = 0;
    +        for (SeatBatchRelateInfoAddDto seatBatchRelateInfoAddDto : seatBatchRelateInfoAddDtoList) {
    +            Long ticketCategoryId = seatBatchRelateInfoAddDto.getTicketCategoryId();
    +            BigDecimal price = seatBatchRelateInfoAddDto.getPrice();
    +            Integer count = seatBatchRelateInfoAddDto.getCount();
    +            
    +            int colCount = 10;
    +            int rowCount = count / colCount;
    +            
    +            for (int i = 1;i<= rowCount;i++) {
    +                rowIndex++;
    +                for (int j = 1;j<=colCount;j++) {
    +                    Seat seat = new Seat();
    +                    seat.setProgramId(programId);
    +                    seat.setTicketCategoryId(ticketCategoryId);
    +                    seat.setRowCode(rowIndex);
    +                    seat.setColCode(j);
    +                    seat.setSeatType(1);
    +                    seat.setPrice(price);
    +                    seat.setSellStatus(SellStatus.NO_SOLD.getCode());
    +                    seatMapper.insert(seat);
    +                }
    +            }
    +        }
    +        
    +        return true;
    +    }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/TicketCategoryService.java b/damai-server/damai-program-service/src/main/java/com/damai/service/TicketCategoryService.java
    index a02386540decc86211b58dbf2907fd4de456c5e8..f101c5955828eb4585affd802d4d7928eec4f7e1 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/TicketCategoryService.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/TicketCategoryService.java
    @@ -6,17 +6,22 @@ import com.baidu.fsg.uid.UidGenerator;
     import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
     import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    -import com.damai.core.RedisKeyEnum;
    +import com.damai.core.RedisKeyManage;
     import com.damai.dto.TicketCategoryAddDto;
    +import com.damai.dto.TicketCategoryDto;
     import com.damai.entity.TicketCategory;
     import com.damai.mapper.TicketCategoryMapper;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
    +import com.damai.vo.TicketCategoryDetailVo;
     import com.damai.vo.TicketCategoryVo;
    +import lombok.extern.slf4j.Slf4j;
    +import org.apache.ibatis.session.SqlSessionFactory;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Service;
     import org.springframework.transaction.annotation.Transactional;
     
    +import javax.annotation.Resource;
     import java.util.List;
     import java.util.Map;
     import java.util.concurrent.TimeUnit;
    @@ -29,6 +34,7 @@ import static com.damai.service.cache.ExpireTime.EXPIRE_TIME;
      * @description: 票档 service
      * @author: 阿宽不是程序员
      **/
    +@Slf4j
     @Service
     public class TicketCategoryService extends ServiceImpl {
         
    @@ -41,20 +47,26 @@ public class TicketCategoryService extends ServiceImpl selectTicketCategoryListByProgramId(Long programId){
    -        return redisCache.getValueIsList(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_TICKET_CATEGORY_LIST, programId), TicketCategoryVo.class, () -> {
    -                    LambdaQueryWrapper ticketCategoryLambdaQueryWrapper = Wrappers.lambdaQuery(TicketCategory.class)
    -                            .eq(TicketCategory::getProgramId, programId);
    -                    List ticketCategoryList = ticketCategoryMapper.selectList(ticketCategoryLambdaQueryWrapper);
    +        return redisCache.getValueIsList(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_TICKET_CATEGORY_LIST, programId), 
    +                TicketCategoryVo.class, 
    +                () -> {
    +                    LambdaQueryWrapper ticketCategoryLambdaQueryWrapper = 
    +                            Wrappers.lambdaQuery(TicketCategory.class).eq(TicketCategory::getProgramId, programId);
    +                    List ticketCategoryList = 
    +                            ticketCategoryMapper.selectList(ticketCategoryLambdaQueryWrapper);
                         return ticketCategoryList.stream().map(ticketCategory -> {
                             ticketCategory.setRemainNumber(null);
                             TicketCategoryVo ticketCategoryVo = new TicketCategoryVo();
    @@ -64,18 +76,23 @@ public class TicketCategoryService extends ServiceImpl ticketCategoryLambdaQueryWrapper = Wrappers.lambdaQuery(TicketCategory.class)
                         .eq(TicketCategory::getProgramId, programId);
                 List ticketCategoryList = ticketCategoryMapper.selectList(ticketCategoryLambdaQueryWrapper);
                 Map map = ticketCategoryList.stream().collect(Collectors.toMap(t -> String.valueOf(t.getId()),
                         TicketCategory::getRemainNumber, (v1, v2) -> v2));
    -            redisCache.putHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_TICKET_REMAIN_NUMBER_HASH, programId),map);
    +            redisCache.putHash(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_TICKET_REMAIN_NUMBER_HASH, programId),map);
             }
         }
    +    
    +    public TicketCategoryDetailVo detail(TicketCategoryDto ticketCategoryDto) {
    +        TicketCategory ticketCategory = ticketCategoryMapper.selectById(ticketCategoryDto.getId());
    +        TicketCategoryDetailVo ticketCategoryDetailVo = new TicketCategoryDetailVo();
    +        BeanUtil.copyProperties(ticketCategory,ticketCategoryDetailVo);
    +        return ticketCategoryDetailVo;
    +    }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/composite/AbstractProgramCheckHandler.java b/damai-server/damai-program-service/src/main/java/com/damai/service/composite/AbstractProgramCheckHandler.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..b32d51437bc2ee2c46b0e003fff6037d146f0923
    --- /dev/null
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/composite/AbstractProgramCheckHandler.java
    @@ -0,0 +1,18 @@
    +package com.damai.service.composite;
    +
    +import com.damai.dto.ProgramOrderCreateDto;
    +import com.damai.enums.CompositeCheckType;
    +import com.damai.initialize.impl.composite.AbstractComposite;
    +
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 生成节目订单验证基类,生成节目订单的相关验证逻辑继承此类
    + * @author: 阿宽不是程序员
    + **/
    +public abstract class AbstractProgramCheckHandler extends AbstractComposite {
    +    
    +    @Override
    +    public String type() {
    +        return CompositeCheckType.PROGRAM_ORDER_CREATE_CHECK.getValue();
    +    }
    +}
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/composite/ProgramDetailCheckHandler.java b/damai-server/damai-program-service/src/main/java/com/damai/service/composite/impl/ProgramDetailCheckHandler.java
    similarity index 72%
    rename from damai-server/damai-program-service/src/main/java/com/damai/service/composite/ProgramDetailCheckHandler.java
    rename to damai-server/damai-program-service/src/main/java/com/damai/service/composite/impl/ProgramDetailCheckHandler.java
    index ddb07e57c5d9ca1730de486489fb43d45d7ecf8b..868fbc4f71c9def309f32502439fd86da29400eb 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/composite/ProgramDetailCheckHandler.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/composite/impl/ProgramDetailCheckHandler.java
    @@ -1,10 +1,10 @@
    -package com.damai.service.composite;
    +package com.damai.service.composite.impl;
    +
     
    -import com.damai.composite.AbstractComposite;
     import com.damai.dto.ProgramGetDto;
     import com.damai.dto.ProgramOrderCreateDto;
    -import com.damai.enums.CompositeCheckType;
     import com.damai.service.ProgramService;
    +import com.damai.service.composite.AbstractProgramCheckHandler;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Component;
     
    @@ -14,35 +14,30 @@ import org.springframework.stereotype.Component;
      * @author: 阿宽不是程序员
      **/
     @Component
    -public class ProgramDetailCheckHandler extends AbstractComposite {
    +public class ProgramDetailCheckHandler extends AbstractProgramCheckHandler {
         
         @Autowired
         private ProgramService programService;
    +    
         @Override
         protected void execute(final ProgramOrderCreateDto programOrderCreateDto) {
    -        //避免节目不存在,再次缓存
             ProgramGetDto programGetDto = new ProgramGetDto();
             programGetDto.setId(programOrderCreateDto.getProgramId());
             programService.getDetail(programGetDto);
         }
         
    -    @Override
    -    public String type() {
    -        return CompositeCheckType.PROGRAM_ORDER_CREATE_CHECK.getValue();
    -    }
    -    
         @Override
         public Integer executeParentOrder() {
    -        return 0;
    +        return 1;
         }
         
         @Override
         public Integer executeTier() {
    -        return 1;
    +        return 2;
         }
         
         @Override
         public Integer executeOrder() {
    -        return 2;
    +        return 1;
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/composite/ProgramExistCheckHandler.java b/damai-server/damai-program-service/src/main/java/com/damai/service/composite/impl/ProgramExistCheckHandler.java
    similarity index 58%
    rename from damai-server/damai-program-service/src/main/java/com/damai/service/composite/ProgramExistCheckHandler.java
    rename to damai-server/damai-program-service/src/main/java/com/damai/service/composite/impl/ProgramExistCheckHandler.java
    index 55fd5419a9cad43ad4844cf1643159eb58dad274..c37df4f2615656c557a8d0189cac237acff9d748 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/composite/ProgramExistCheckHandler.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/composite/impl/ProgramExistCheckHandler.java
    @@ -1,13 +1,14 @@
    -package com.damai.service.composite;
    +package com.damai.service.composite.impl;
     
    -import com.damai.composite.AbstractComposite;
    -import com.damai.core.RedisKeyEnum;
    +
    +import com.damai.core.RedisKeyManage;
     import com.damai.dto.ProgramOrderCreateDto;
     import com.damai.enums.BaseCode;
    -import com.damai.enums.CompositeCheckType;
    +import com.damai.enums.BusinessStatus;
     import com.damai.exception.DaMaiFrameException;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
    +import com.damai.service.composite.AbstractProgramCheckHandler;
     import com.damai.vo.ProgramVo;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Component;
    @@ -20,36 +21,36 @@ import java.util.Objects;
      * @author: 阿宽不是程序员
      **/
     @Component
    -public class ProgramExistCheckHandler extends AbstractComposite {
    +public class ProgramExistCheckHandler extends AbstractProgramCheckHandler {
         
         @Autowired
         private RedisCache redisCache;
    +    
         @Override
         protected void execute(final ProgramOrderCreateDto programOrderCreateDto) {
    -        //查询要购买的节目
    -        ProgramVo programVo = redisCache.get(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM, programOrderCreateDto.getProgramId()), ProgramVo.class);
    +        ProgramVo programVo = redisCache.get(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM, programOrderCreateDto.getProgramId()), ProgramVo.class);
             if (Objects.isNull(programVo)) {
                 throw new DaMaiFrameException(BaseCode.PROGRAM_NOT_EXIST);
             }
    -    }
    -    
    -    @Override
    -    public String type() {
    -        return CompositeCheckType.PROGRAM_ORDER_CREATE_CHECK.getValue();
    +        if (programVo.getPermitChooseSeat().equals(BusinessStatus.NO.getCode())) {
    +            if (Objects.nonNull(programOrderCreateDto.getSeatDtoList())) {
    +                throw new DaMaiFrameException(BaseCode.PROGRAM_NOT_ALLOW_CHOOSE_SEAT);
    +            }
    +        }
         }
         
         @Override
         public Integer executeParentOrder() {
    -        return 0;
    +        return 1;
         }
         
         @Override
         public Integer executeTier() {
    -        return 1;
    +        return 2;
         }
         
         @Override
         public Integer executeOrder() {
    -        return 3;
    +        return 2;
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/composite/ProgramOrderCreateParamCheckHandler.java b/damai-server/damai-program-service/src/main/java/com/damai/service/composite/impl/ProgramOrderCreateParamCheckHandler.java
    similarity index 75%
    rename from damai-server/damai-program-service/src/main/java/com/damai/service/composite/ProgramOrderCreateParamCheckHandler.java
    rename to damai-server/damai-program-service/src/main/java/com/damai/service/composite/impl/ProgramOrderCreateParamCheckHandler.java
    index 2d45183062ab385d1ca0df3513097e7f03e1e7ba..0bff57ab0ff33c08fb27937066f980a9e6170da0 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/composite/ProgramOrderCreateParamCheckHandler.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/composite/impl/ProgramOrderCreateParamCheckHandler.java
    @@ -1,16 +1,17 @@
    -package com.damai.service.composite;
    +package com.damai.service.composite.impl;
     
     import cn.hutool.core.collection.CollectionUtil;
    -import com.damai.composite.AbstractComposite;
     import com.damai.dto.ProgramOrderCreateDto;
     import com.damai.dto.SeatDto;
     import com.damai.enums.BaseCode;
    -import com.damai.enums.CompositeCheckType;
     import com.damai.exception.DaMaiFrameException;
    +import com.damai.service.composite.AbstractProgramCheckHandler;
     import org.springframework.stereotype.Component;
     
     import java.util.List;
    +import java.util.Map;
     import java.util.Objects;
    +import java.util.stream.Collectors;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    @@ -18,12 +19,22 @@ import java.util.Objects;
      * @author: 阿宽不是程序员
      **/
     @Component
    -public class ProgramOrderCreateParamCheckHandler extends AbstractComposite {
    +public class ProgramOrderCreateParamCheckHandler extends AbstractProgramCheckHandler {
         @Override
         protected void execute(final ProgramOrderCreateDto programOrderCreateDto) {
    -        //验证手动选择座位和自动分配座位的参数是否正确
             List seatDtoList = programOrderCreateDto.getSeatDtoList();
    +        List ticketUserIdList = programOrderCreateDto.getTicketUserIdList();
    +        Map> ticketUserIdMap = 
    +                ticketUserIdList.stream().collect(Collectors.groupingBy(ticketUserId -> ticketUserId));
    +        for (List value : ticketUserIdMap.values()) {
    +            if (value.size() > 1) {
    +                throw new DaMaiFrameException(BaseCode.TICKET_USER_ID_REPEAT);
    +            }
    +        }
             if (CollectionUtil.isNotEmpty(seatDtoList)) {
    +            if (seatDtoList.size() != programOrderCreateDto.getTicketUserIdList().size()) {
    +                throw new DaMaiFrameException(BaseCode.TICKET_USER_COUNT_UNEQUAL_SEAT_COUNT);
    +            }
                 for (SeatDto seatDto : seatDtoList) {
                     if (Objects.isNull(seatDto.getId())) {
                         throw new DaMaiFrameException(BaseCode.SEAT_ID_EMPTY);
    @@ -54,11 +65,6 @@ public class ProgramOrderCreateParamCheckHandler extends AbstractComposite {
    +public class ProgramShowTimeCheckHandler extends AbstractProgramCheckHandler {
         
         @Autowired
         private RedisCache redisCache;
         @Override
         protected void execute(final ProgramOrderCreateDto programOrderCreateDto) {
    -        //查询节目演出时间
    -        ProgramShowTime programShowTime = redisCache.get(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_SHOW_TIME
    +        ProgramShowTime programShowTime = redisCache.get(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_SHOW_TIME
                     ,programOrderCreateDto.getProgramId()),ProgramShowTime.class);
             if (Objects.isNull(programShowTime)) {
                 throw new DaMaiFrameException(BaseCode.PROGRAM_SHOW_TIME_NOT_EXIST);
             }
         }
         
    -    @Override
    -    public String type() {
    -        return CompositeCheckType.PROGRAM_ORDER_CREATE_CHECK.getValue();
    -    }
    -    
         @Override
         public Integer executeParentOrder() {
    -        return 0;
    +        return 1;
         }
         
         @Override
         public Integer executeTier() {
    -        return 1;
    +        return 2;
         }
         
         @Override
         public Integer executeOrder() {
    -        return 4;
    +        return 3;
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/composite/UserExistCheckHandler.java b/damai-server/damai-program-service/src/main/java/com/damai/service/composite/impl/ProgramUserExistCheckHandler.java
    similarity index 30%
    rename from damai-server/damai-program-service/src/main/java/com/damai/service/composite/UserExistCheckHandler.java
    rename to damai-server/damai-program-service/src/main/java/com/damai/service/composite/impl/ProgramUserExistCheckHandler.java
    index 4a4c8fda73ee6d4dc2996f02455d94c16c40ccc9..5e1cfb171fc55611dc70d5c602fe5e2b353560e1 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/composite/UserExistCheckHandler.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/composite/impl/ProgramUserExistCheckHandler.java
    @@ -1,25 +1,26 @@
    -package com.damai.service.composite;
    +package com.damai.service.composite.impl;
     
    +import cn.hutool.core.collection.CollectionUtil;
     import com.alibaba.fastjson.JSON;
     import com.damai.client.UserClient;
     import com.damai.common.ApiResponse;
    -import com.damai.composite.AbstractComposite;
    +import com.damai.core.RedisKeyManage;
     import com.damai.dto.ProgramOrderCreateDto;
    -import com.damai.dto.UserGetAndTicketUserListDto;
    +import com.damai.dto.TicketUserListDto;
     import com.damai.enums.BaseCode;
    -import com.damai.enums.CompositeCheckType;
     import com.damai.exception.DaMaiFrameException;
    +import com.damai.redis.RedisCache;
    +import com.damai.redis.RedisKeyBuild;
    +import com.damai.service.composite.AbstractProgramCheckHandler;
     import com.damai.vo.TicketUserVo;
    -import com.damai.vo.UserGetAndTicketUserListVo;
    -import com.damai.vo.UserVo;
     import lombok.extern.slf4j.Slf4j;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Component;
     
    -import java.util.ArrayList;
     import java.util.List;
    +import java.util.Map;
     import java.util.Objects;
    -import java.util.Optional;
    +import java.util.stream.Collectors;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    @@ -28,55 +29,53 @@ import java.util.Optional;
      **/
     @Slf4j
     @Component
    -public class UserExistCheckHandler extends AbstractComposite {
    +public class ProgramUserExistCheckHandler extends AbstractProgramCheckHandler {
         
         @Autowired
         private UserClient userClient;
         
    +    @Autowired
    +    private RedisCache redisCache;
    +    
         @Override
    -    protected void execute(final ProgramOrderCreateDto programOrderCreateDto) {
    -        //验证用户和购票人信息正确性
    -        UserVo userVo = new UserVo();
    -        List ticketUserVoList = new ArrayList<>();
    -        UserGetAndTicketUserListDto userGetAndTicketUserListDto = new UserGetAndTicketUserListDto();
    -        userGetAndTicketUserListDto.setUserId(programOrderCreateDto.getUserId());
    -        userGetAndTicketUserListDto.setTicketUserIdList(programOrderCreateDto.getTicketUserIdList());
    -        ApiResponse userGetAndTicketUserApiResponse =
    -                userClient.getUserAndTicketUserList(userGetAndTicketUserListDto);
    -        if (Objects.equals(userGetAndTicketUserApiResponse.getCode(), BaseCode.SUCCESS.getCode())) {
    -            UserGetAndTicketUserListVo userAndTicketUserListVo =
    -                    Optional.ofNullable(userGetAndTicketUserApiResponse.getData())
    -                            .orElseThrow(() -> new DaMaiFrameException(BaseCode.RPC_RESULT_DATA_EMPTY));
    -            if (Objects.isNull(userAndTicketUserListVo.getUserVo())) {
    -                throw new DaMaiFrameException(BaseCode.USER_EMPTY);
    +    protected void execute(ProgramOrderCreateDto programOrderCreateDto) {
    +        List ticketUserVoList = redisCache.getValueIsList(RedisKeyBuild.createRedisKey(
    +                RedisKeyManage.TICKET_USER_LIST, programOrderCreateDto.getUserId()), TicketUserVo.class);
    +        if (CollectionUtil.isEmpty(ticketUserVoList)) {
    +            TicketUserListDto ticketUserListDto = new TicketUserListDto();
    +            ticketUserListDto.setUserId(programOrderCreateDto.getUserId());
    +            ApiResponse> apiResponse = userClient.select(ticketUserListDto);
    +            if (Objects.equals(apiResponse.getCode(), BaseCode.SUCCESS.getCode())) {
    +                ticketUserVoList = apiResponse.getData();
    +            }else {
    +                log.error("user client rpc getUserAndTicketUserList select response : {}", JSON.toJSONString(apiResponse));
    +                throw new DaMaiFrameException(apiResponse);
    +            }
    +        }
    +        if (CollectionUtil.isEmpty(ticketUserVoList)) {
    +            throw new DaMaiFrameException(BaseCode.TICKET_USER_EMPTY);
    +        }
    +        Map ticketUserVoMap = ticketUserVoList.stream()
    +                .collect(Collectors.toMap(TicketUserVo::getId, ticketUserVo -> ticketUserVo, (v1, v2) -> v2));
    +        for (Long ticketUserId : programOrderCreateDto.getTicketUserIdList()) {
    +            if (Objects.isNull(ticketUserVoMap.get(ticketUserId))) {
    +                throw new DaMaiFrameException(BaseCode.TICKET_USER_EMPTY);
                 }
    -            ticketUserVoList =
    -                    Optional.ofNullable(userAndTicketUserListVo.getTicketUserVoList()).filter(list -> !list.isEmpty())
    -                            .orElseThrow(() -> new DaMaiFrameException(BaseCode.TICKET_USER_EMPTY));
    -            log.info("userVo : {}, ticketUserVoList : {}",JSON.toJSONString(userVo),JSON.toJSONString(ticketUserVoList));
    -        }else {
    -            log.error("user client rpc getUserAndTicketUserList error response : {}", JSON.toJSONString(userGetAndTicketUserApiResponse));
    -            throw new DaMaiFrameException(userGetAndTicketUserApiResponse);
             }
    -    }
    -    
    -    @Override
    -    public String type() {
    -        return CompositeCheckType.PROGRAM_ORDER_CREATE_CHECK.getValue();
         }
         
         @Override
         public Integer executeParentOrder() {
    -        return 0;
    +        return 1;
         }
         
         @Override
         public Integer executeTier() {
    -        return 1;
    +        return 2;
         }
         
         @Override
         public Integer executeOrder() {
    -        return 5;
    +        return 4;
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/constant/ProgramTimeType.java b/damai-server/damai-program-service/src/main/java/com/damai/service/constant/ProgramTimeType.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..328c8a65c2585cb3567e14e0ac7fd276a166db35
    --- /dev/null
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/constant/ProgramTimeType.java
    @@ -0,0 +1,19 @@
    +package com.damai.service.constant;
    +
    +/**
    + * @program: damai
    + * @description:
    + * @author: k
    + * @create: 2024-03-11
    + **/
    +public class ProgramTimeType {
    +    
    +    public static final int ALL = 0;
    +    
    +    public static final int TODAY = 1;
    +    public static final int TOMORROW = 2;
    +    public static final int WEEK = 3;
    +    public static final int MONTH = 4;
    +    public static final int CALENDAR = 5;
    +    
    +}
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/delayconsumer/DelayOperateProgramDataConsumer.java b/damai-server/damai-program-service/src/main/java/com/damai/service/delayconsumer/DelayOperateProgramDataConsumer.java
    index 0790763d7dabb3f41c78a6bb9f4a79f1e3750d83..e7b700e2651d3b98a65c2a8a0f98b2569a0bcd9a 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/delayconsumer/DelayOperateProgramDataConsumer.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/delayconsumer/DelayOperateProgramDataConsumer.java
    @@ -2,7 +2,8 @@ package com.damai.service.delayconsumer;
     
     import com.alibaba.fastjson.JSON;
     import com.damai.core.ConsumerTask;
    -import com.damai.core.StringUtil;
    +import com.damai.core.SpringUtil;
    +import com.damai.util.StringUtil;
     import com.damai.dto.ProgramOperateDataDto;
     import com.damai.service.ProgramService;
     import lombok.extern.slf4j.Slf4j;
    @@ -13,7 +14,7 @@ import static com.damai.service.constant.ProgramOrderConstant.DELAY_OPERATE_PROG
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 节目缓存操作
    + * @description: 节目消息监听
      * @author: 阿宽不是程序员
      **/
     @Slf4j
    @@ -31,11 +32,11 @@ public class DelayOperateProgramDataConsumer implements ConsumerTask {
                 return;
             }
             ProgramOperateDataDto programOperateDataDto = JSON.parseObject(content, ProgramOperateDataDto.class);
    -        programService.OperateProgramData(programOperateDataDto);
    +        programService.operateProgramData(programOperateDataDto);
         }
         
         @Override
         public String topic() {
    -        return DELAY_OPERATE_PROGRAM_DATA_TOPIC;
    +        return SpringUtil.getPrefixDistinctionName() + "-" + DELAY_OPERATE_PROGRAM_DATA_TOPIC;
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/delaysend/DelayOrderCancelSend.java b/damai-server/damai-program-service/src/main/java/com/damai/service/delaysend/DelayOrderCancelSend.java
    index 8b10caf412c4d1ef5befb41961edd709b62afbb7..2b1fd1e572260e2f432e2101ac1866a9e8f0e863 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/delaysend/DelayOrderCancelSend.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/delaysend/DelayOrderCancelSend.java
    @@ -1,6 +1,7 @@
     package com.damai.service.delaysend;
     
     import com.damai.context.DelayQueueContext;
    +import com.damai.core.SpringUtil;
     import lombok.extern.slf4j.Slf4j;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Component;
    @@ -23,7 +24,8 @@ public class DelayOrderCancelSend {
         
         public void sendMessage(String message){
             try {
    -            delayQueueContext.sendMessage(DELAY_ORDER_CANCEL_TOPIC,message, DELAY_ORDER_CANCEL_TIME, DELAY_ORDER_CANCEL_TIME_UNIT);
    +            delayQueueContext.sendMessage(SpringUtil.getPrefixDistinctionName() + "-" + DELAY_ORDER_CANCEL_TOPIC,
    +                    message, DELAY_ORDER_CANCEL_TIME, DELAY_ORDER_CANCEL_TIME_UNIT);
             }catch (Exception e) {
                 log.error("send message error message : {}",message,e);
             }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/impl/SelectPageEsHandle.java b/damai-server/damai-program-service/src/main/java/com/damai/service/es/ProgramEs.java
    similarity index 30%
    rename from damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/impl/SelectPageEsHandle.java
    rename to damai-server/damai-program-service/src/main/java/com/damai/service/es/ProgramEs.java
    index 68a3a4b9602e28271eb426c1c288c1655801c8f1..c6ae8df0b496bde8a94501520159be6b96ad737a 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/impl/SelectPageEsHandle.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/es/ProgramEs.java
    @@ -1,36 +1,73 @@
    -package com.damai.service.pagestrategy.impl;
    +package com.damai.service.es;
     
    -import cn.hutool.core.collection.CollectionUtil;
    +import com.damai.core.SpringUtil;
     import com.damai.dto.EsDataQueryDto;
    +import com.damai.dto.ProgramListDto;
     import com.damai.dto.ProgramPageListDto;
    -import com.damai.enums.TimeType;
    +import com.damai.dto.ProgramSearchDto;
     import com.damai.page.PageUtil;
     import com.damai.page.PageVo;
     import com.damai.service.init.ProgramDocumentParamName;
    -import com.damai.service.pagestrategy.ProgramConstant;
    -import com.damai.service.pagestrategy.SelectPageHandle;
     import com.damai.util.BusinessEsHandle;
    -import com.damai.util.DateUtils;
    +import com.damai.util.StringUtil;
     import com.damai.vo.ProgramListVo;
     import com.github.pagehelper.PageInfo;
     import lombok.extern.slf4j.Slf4j;
    +import org.elasticsearch.index.query.BoolQueryBuilder;
    +import org.elasticsearch.index.query.QueryBuilder;
    +import org.elasticsearch.index.query.QueryBuilders;
    +import org.elasticsearch.search.builder.SearchSourceBuilder;
    +import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
     import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.stereotype.Component;
     
     import java.util.ArrayList;
    -import java.util.Date;
    +import java.util.Arrays;
    +import java.util.HashMap;
     import java.util.List;
    +import java.util.Map;
     import java.util.Objects;
    +
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
      * @description: es查询
      * @author: 阿宽不是程序员
      **/
     @Slf4j
    -public class SelectPageEsHandle implements SelectPageHandle {
    +@Component
    +public class ProgramEs {
         
         @Autowired
         private BusinessEsHandle businessEsHandle;
    -    @Override
    +    
    +    public Map> selectHomeList(ProgramListDto programPageListDto) {
    +        Map> programListVoMap = new HashMap<>(256);
    +        
    +        try {
    +            for (Long parentProgramCategoryId : programPageListDto.getParentProgramCategoryIds()) {
    +                List programEsQueryDto = new ArrayList<>();
    +                EsDataQueryDto areaIdQueryDto = new EsDataQueryDto();
    +                areaIdQueryDto.setParamName(ProgramDocumentParamName.AREA_ID);
    +                areaIdQueryDto.setParamValue(programPageListDto.getAreaId());
    +                programEsQueryDto.add(areaIdQueryDto);
    +                EsDataQueryDto parentProgramCategoryIdQueryDto = new EsDataQueryDto();
    +                parentProgramCategoryIdQueryDto.setParamName(ProgramDocumentParamName.PARENT_PROGRAM_CATEGORY_ID);
    +                parentProgramCategoryIdQueryDto.setParamValue(parentProgramCategoryId);
    +                programEsQueryDto.add(parentProgramCategoryIdQueryDto);
    +                PageInfo pageInfo = businessEsHandle.queryPage(
    +                        SpringUtil.getPrefixDistinctionName() + "-" + ProgramDocumentParamName.INDEX_NAME,
    +                        ProgramDocumentParamName.INDEX_TYPE, programEsQueryDto, 1, 7, ProgramListVo.class);
    +                if (!pageInfo.getList().isEmpty()) {
    +                    String areaName = pageInfo.getList().get(0).getAreaName();
    +                    programListVoMap.put(areaName,pageInfo.getList());
    +                }
    +            }
    +        }catch (Exception e) {
    +            log.error("businessEsHandle.queryPage error",e);
    +        }
    +        return programListVoMap;
    +    }
    +    
         public PageVo selectPage(ProgramPageListDto programPageListDto) {
             PageVo pageVo = new PageVo<>();
             try {
    @@ -41,39 +78,29 @@ public class SelectPageEsHandle implements SelectPageHandle {
                     areaIdQueryDto.setParamValue(programPageListDto.getAreaId());
                     esDataQueryDtoList.add(areaIdQueryDto);
                 }
    -            if (CollectionUtil.isNotEmpty(programPageListDto.getProgramCategoryIds())) {
    -                EsDataQueryDto programCategoryIdQueryDto = new EsDataQueryDto();
    -                programCategoryIdQueryDto.setParamName(ProgramDocumentParamName.PROGRAM_CATEGORY_ID);
    -                programCategoryIdQueryDto.setParamValue(programPageListDto.getProgramCategoryIds());
    -                esDataQueryDtoList.add(programCategoryIdQueryDto);
    -            }
    -            if (CollectionUtil.isNotEmpty(programPageListDto.getParentProgramCategoryIds())) {
    +            if (Objects.nonNull(programPageListDto.getParentProgramCategoryId())) {
                     EsDataQueryDto parentProgramCategoryIdQueryDto = new EsDataQueryDto();
                     parentProgramCategoryIdQueryDto.setParamName(ProgramDocumentParamName.PARENT_PROGRAM_CATEGORY_ID);
    -                parentProgramCategoryIdQueryDto.setParamValue(programPageListDto.getParentProgramCategoryIds());
    +                parentProgramCategoryIdQueryDto.setParamValue(programPageListDto.getParentProgramCategoryId());
                     esDataQueryDtoList.add(parentProgramCategoryIdQueryDto);
                 }
    -            if (Objects.nonNull(programPageListDto.getShowDayTime())) {
    -                EsDataQueryDto showDayTimeQueryDto = new EsDataQueryDto();
    -                showDayTimeQueryDto.setParamName(ProgramDocumentParamName.SHOW_DAY_TIME);
    -                showDayTimeQueryDto.setParamValue(programPageListDto.getShowDayTime());
    -                esDataQueryDtoList.add(showDayTimeQueryDto);
    +            if (Objects.nonNull(programPageListDto.getProgramCategoryId())) {
    +                EsDataQueryDto programCategoryIdQueryDto = new EsDataQueryDto();
    +                programCategoryIdQueryDto.setParamName(ProgramDocumentParamName.PROGRAM_CATEGORY_ID);
    +                programCategoryIdQueryDto.setParamValue(programPageListDto.getProgramCategoryId());
    +                esDataQueryDtoList.add(programCategoryIdQueryDto);
                 }
    -            if (Objects.nonNull(programPageListDto.getTimeType())) {
    -                Date time = null;
    -                if (programPageListDto.getTimeType().equals(TimeType.WEEK.getCode())) {
    -                    time = DateUtils.addWeek(DateUtils.now(),1);
    -                }else if (programPageListDto.getTimeType().equals(TimeType.MONTH.getCode())) {
    -                    time = DateUtils.addMonth(DateUtils.now(),1);
    -                }
    +            if (Objects.nonNull(programPageListDto.getStartDateTime()) && 
    +                    Objects.nonNull(programPageListDto.getEndDateTime())) {
                     EsDataQueryDto showDayTimeQueryDto = new EsDataQueryDto();
                     showDayTimeQueryDto.setParamName(ProgramDocumentParamName.SHOW_DAY_TIME);
    -                showDayTimeQueryDto.setStartTime(DateUtils.now());
    -                showDayTimeQueryDto.setEndTime(time);
    +                showDayTimeQueryDto.setStartTime(programPageListDto.getStartDateTime());
    +                showDayTimeQueryDto.setEndTime(programPageListDto.getEndDateTime());
                     esDataQueryDtoList.add(showDayTimeQueryDto);
                 }
                 
    -            PageInfo programListVoPageInfo = businessEsHandle.queryPage(ProgramDocumentParamName.INDEX_NAME,
    +            PageInfo programListVoPageInfo = businessEsHandle.queryPage(
    +                    SpringUtil.getPrefixDistinctionName() + "-" + ProgramDocumentParamName.INDEX_NAME,
                         ProgramDocumentParamName.INDEX_TYPE, esDataQueryDtoList, programPageListDto.getPageNumber(),
                         programPageListDto.getPageSize(), ProgramListVo.class);
                 pageVo = PageUtil.convertPage(programListVoPageInfo, programListVo -> programListVo);
    @@ -83,8 +110,62 @@ public class SelectPageEsHandle implements SelectPageHandle {
             return pageVo;
         }
         
    -    @Override
    -    public String getType() {
    -        return ProgramConstant.ES_TYPE_NAME;
    +    public PageVo search(ProgramSearchDto programSearchDto) {
    +        PageVo pageVo = new PageVo<>();
    +        try {
    +            BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
    +            if (Objects.nonNull(programSearchDto.getAreaId())) {
    +                QueryBuilder builds = QueryBuilders.termQuery(ProgramDocumentParamName.AREA_ID, programSearchDto.getAreaId());
    +                boolQuery.must(builds);
    +            }
    +            if (Objects.nonNull(programSearchDto.getParentProgramCategoryId())) {
    +                QueryBuilder builds = QueryBuilders.termQuery(ProgramDocumentParamName.PARENT_PROGRAM_CATEGORY_ID, programSearchDto.getParentProgramCategoryId());
    +                boolQuery.must(builds);
    +            }
    +            if (Objects.nonNull(programSearchDto.getStartDateTime()) &&
    +                    Objects.nonNull(programSearchDto.getEndDateTime())) {
    +                QueryBuilder builds = QueryBuilders.rangeQuery(ProgramDocumentParamName.SHOW_DAY_TIME)
    +                        .from(programSearchDto.getStartDateTime()).to(programSearchDto.getEndDateTime()).includeLower(true);
    +                boolQuery.must(builds);
    +            }
    +            if (StringUtil.isNotEmpty(programSearchDto.getContent())) {
    +                BoolQueryBuilder innerBoolQuery = QueryBuilders.boolQuery();
    +                innerBoolQuery.should(QueryBuilders.matchQuery(ProgramDocumentParamName.TITLE, programSearchDto.getContent()));
    +                innerBoolQuery.should(QueryBuilders.matchQuery(ProgramDocumentParamName.ACTOR, programSearchDto.getContent()));
    +                innerBoolQuery.minimumShouldMatch(1);
    +                boolQuery.must(innerBoolQuery);
    +            }
    +            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
    +            searchSourceBuilder.query(boolQuery);
    +            searchSourceBuilder.trackTotalHits(true);
    +            searchSourceBuilder.from((programSearchDto.getPageNumber() - 1) * programSearchDto.getPageSize());
    +            searchSourceBuilder.size(programSearchDto.getPageSize());
    +            searchSourceBuilder.highlighter(getHighlightBuilder(Arrays.asList(ProgramDocumentParamName.TITLE,
    +                    ProgramDocumentParamName.ACTOR)));
    +            List list = new ArrayList<>();
    +            PageInfo pageInfo = new PageInfo<>(list);
    +            pageInfo.setPageNum(programSearchDto.getPageNumber());
    +            pageInfo.setPageSize(programSearchDto.getPageSize());
    +            businessEsHandle.executeQuery(SpringUtil.getPrefixDistinctionName() + "-" + ProgramDocumentParamName.INDEX_NAME,
    +                    ProgramDocumentParamName.INDEX_TYPE,list,pageInfo,ProgramListVo.class,
    +                    searchSourceBuilder,Arrays.asList(ProgramDocumentParamName.TITLE,ProgramDocumentParamName.ACTOR));
    +            pageVo = PageUtil.convertPage(pageInfo,programListVo -> programListVo);
    +        }catch (Exception e) {
    +            log.error("search error",e);
    +        }
    +        return pageVo;
    +    }
    +    
    +    public HighlightBuilder getHighlightBuilder(List fieldNameList){
    +        // 创建一个HighlightBuilder
    +        HighlightBuilder highlightBuilder = new HighlightBuilder();
    +        for (String fieldName : fieldNameList) {
    +            // 为特定字段添加高亮设置
    +            HighlightBuilder.Field highlightTitle = new HighlightBuilder.Field(fieldName);
    +            highlightTitle.preTags("");
    +            highlightTitle.postTags("");
    +            highlightBuilder.field(highlightTitle);
    +        }
    +        return highlightBuilder;
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramCategoryInitData.java b/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramCategoryInitData.java
    index 5cc45f433efa996e8b5cfa51635c618e697d3e38..d80b45c6a02db6fd032df36bbb8145fa176de349 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramCategoryInitData.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramCategoryInitData.java
    @@ -4,15 +4,16 @@ import cn.hutool.core.collection.CollectionUtil;
     import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
     import com.damai.BusinessThreadPool;
    -import com.damai.core.RedisKeyEnum;
    +import com.damai.core.RedisKeyManage;
     import com.damai.entity.ProgramCategory;
    -import com.damai.init.InitData;
    +import com.damai.initialize.base.AbstractApplicationPostConstructHandler;
     import com.damai.mapper.ProgramCategoryMapper;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
     import com.damai.servicelock.LockType;
     import com.damai.servicelock.annotion.ServiceLock;
     import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.context.ConfigurableApplicationContext;
     import org.springframework.stereotype.Component;
     
     import java.util.List;
    @@ -26,7 +27,7 @@ import static com.damai.core.DistributedLockConstants.PROGRAM_CATEGORY_LOCK;
      * @author: 阿宽不是程序员
      **/
     @Component
    -public class ProgramCategoryInitData implements InitData {
    +public class ProgramCategoryInitData extends AbstractApplicationPostConstructHandler {
         
         @Autowired
         private ProgramCategoryMapper programCategoryMapper;
    @@ -39,7 +40,12 @@ public class ProgramCategoryInitData implements InitData {
         
         
         @Override
    -    public void init() {
    +    public Integer executeOrder() {
    +        return 1;
    +    }
    +    
    +    @Override
    +    public void executeInit(final ConfigurableApplicationContext context) {
             BusinessThreadPool.execute(() -> {
                 programCategoryInitDataProxy.programCategoryRedisDataInit();
             });
    @@ -52,7 +58,7 @@ public class ProgramCategoryInitData implements InitData {
             if (CollectionUtil.isNotEmpty(programCategoryList)) {
                 Map programCategoryMap = programCategoryList.stream().collect(
                         Collectors.toMap(p -> String.valueOf(p.getId()), p -> p, (v1, v2) -> v2));
    -            redisCache.putHash(RedisKeyWrap.createRedisKey(RedisKeyEnum.PROGRAM_CATEGORY_HASH),programCategoryMap);
    +            redisCache.putHash(RedisKeyBuild.createRedisKey(RedisKeyManage.PROGRAM_CATEGORY_HASH),programCategoryMap);
             }
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramDocumentParamName.java b/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramDocumentParamName.java
    index e81cd1f5e4e884cf0868a3218fa549a070146cf6..701cf5f6acf55ec3efe51a69bb09b38cf89c1930 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramDocumentParamName.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramDocumentParamName.java
    @@ -30,6 +30,8 @@ public class ProgramDocumentParamName {
         
         public static final String PARENT_PROGRAM_CATEGORY_ID = "parentProgramCategoryId";
         
    +    public static final String PARENT_PROGRAM_CATEGORY_NAME = "parentProgramCategoryName";
    +    
         public static final String SHOW_TIME = "showTime";
         
         public static final String SHOW_DAY_TIME = "showDayTime";
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramElasticsearchInitData.java b/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramElasticsearchInitData.java
    index cfb4a91aec674983a381d381b9db477ca4fc18f5..56581a96faf414997fccd022c58c55c5966b5387 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramElasticsearchInitData.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramElasticsearchInitData.java
    @@ -1,14 +1,16 @@
     package com.damai.service.init;
     
     import com.damai.BusinessThreadPool;
    +import com.damai.core.SpringUtil;
     import com.damai.dto.EsDocumentMappingDto;
     import com.damai.entity.TicketCategoryAggregate;
    -import com.damai.init.InitData;
    +import com.damai.initialize.base.AbstractApplicationPostConstructHandler;
     import com.damai.service.ProgramService;
     import com.damai.util.BusinessEsHandle;
     import com.damai.vo.ProgramVo;
     import lombok.extern.slf4j.Slf4j;
     import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.context.ConfigurableApplicationContext;
     import org.springframework.stereotype.Component;
     
     import java.util.ArrayList;
    @@ -24,7 +26,7 @@ import java.util.Optional;
      **/
     @Slf4j
     @Component
    -public class ProgramElasticsearchInitData implements InitData {
    +public class ProgramElasticsearchInitData extends AbstractApplicationPostConstructHandler {
         
         @Autowired
         private BusinessEsHandle businessEsHandle;
    @@ -33,103 +35,14 @@ public class ProgramElasticsearchInitData implements InitData {
         private ProgramService programService;
         
         
    -    /**
    -     * 项目启动后,异步将program的数据更新到Elasticsearch中,当数据量特别大时,生产环境绝对不会这么做
    -     * 会每个一个节目到数据库后,就会添加到Elasticsearch中,以及用定时任务来更新到Elasticsearch中
    -     * */
         @Override
    -    public void init() {
    -        BusinessThreadPool.execute(this::initElasticsearchData);
    +    public Integer executeOrder() {
    +        return 3;
         }
    -    public boolean indexAdd(){
    -        boolean result = businessEsHandle.checkIndex(ProgramDocumentParamName.INDEX_NAME, ProgramDocumentParamName.INDEX_TYPE);
    -        if (result) {
    -            return false;
    -        }
    -        List list = new ArrayList<>();
    -        
    -        EsDocumentMappingDto idDto = new EsDocumentMappingDto();
    -        idDto.setParamName(ProgramDocumentParamName.ID);
    -        idDto.setParamType("long");
    -        list.add(idDto);
    -        
    -        EsDocumentMappingDto titleDto = new EsDocumentMappingDto();
    -        titleDto.setParamName(ProgramDocumentParamName.TITLE);
    -        titleDto.setParamType("text");
    -        list.add(titleDto);
    -        
    -        EsDocumentMappingDto actorDto = new EsDocumentMappingDto();
    -        actorDto.setParamName(ProgramDocumentParamName.ACTOR);
    -        actorDto.setParamType("text");
    -        list.add(actorDto);
    -        
    -        EsDocumentMappingDto placeDto = new EsDocumentMappingDto();
    -        placeDto.setParamName(ProgramDocumentParamName.PLACE);
    -        placeDto.setParamType("text");
    -        list.add(placeDto);
    -        
    -        EsDocumentMappingDto itemPictureDto = new EsDocumentMappingDto();
    -        itemPictureDto.setParamName(ProgramDocumentParamName.ITEM_PICTURE);
    -        itemPictureDto.setParamType("text");
    -        list.add(itemPictureDto);
    -        
    -        EsDocumentMappingDto areaIdDto = new EsDocumentMappingDto();
    -        areaIdDto.setParamName(ProgramDocumentParamName.AREA_ID);
    -        areaIdDto.setParamType("long");
    -        list.add(areaIdDto);
    -        
    -        EsDocumentMappingDto areaNameDto = new EsDocumentMappingDto();
    -        areaNameDto.setParamName(ProgramDocumentParamName.AREA_NAME);
    -        areaNameDto.setParamType("text");
    -        list.add(areaNameDto);
    -        
    -        EsDocumentMappingDto programCategoryIdDto = new EsDocumentMappingDto();
    -        programCategoryIdDto.setParamName(ProgramDocumentParamName.PROGRAM_CATEGORY_ID);
    -        programCategoryIdDto.setParamType("long");
    -        list.add(programCategoryIdDto);
    -        
    -        EsDocumentMappingDto parentProgramCategoryIdDto = new EsDocumentMappingDto();
    -        parentProgramCategoryIdDto.setParamName(ProgramDocumentParamName.PARENT_PROGRAM_CATEGORY_ID);
    -        parentProgramCategoryIdDto.setParamType("long");
    -        list.add(parentProgramCategoryIdDto);
    -        
    -        EsDocumentMappingDto programCategoryNameDto = new EsDocumentMappingDto();
    -        programCategoryNameDto.setParamName(ProgramDocumentParamName.PROGRAM_CATEGORY_NAME);
    -        programCategoryNameDto.setParamType("text");
    -        list.add(programCategoryNameDto);
    -        
    -        EsDocumentMappingDto showTimeDto = new EsDocumentMappingDto();
    -        showTimeDto.setParamName(ProgramDocumentParamName.SHOW_TIME);
    -        showTimeDto.setParamType("date");
    -        list.add(showTimeDto);
    -        
    -        EsDocumentMappingDto showDayTimeDto = new EsDocumentMappingDto();
    -        showDayTimeDto.setParamName(ProgramDocumentParamName.SHOW_DAY_TIME);
    -        showDayTimeDto.setParamType("date");
    -        list.add(showDayTimeDto);
    -        
    -        EsDocumentMappingDto showWeekTimeDto = new EsDocumentMappingDto();
    -        showWeekTimeDto.setParamName(ProgramDocumentParamName.SHOW_WEEK_TIME);
    -        showWeekTimeDto.setParamType("text");
    -        list.add(showWeekTimeDto);
    -        
    -        EsDocumentMappingDto minPriceDto = new EsDocumentMappingDto();
    -        minPriceDto.setParamName(ProgramDocumentParamName.MIN_PRICE);
    -        minPriceDto.setParamType("integer");
    -        list.add(minPriceDto);
    -        
    -        EsDocumentMappingDto maxPriceDto = new EsDocumentMappingDto();
    -        maxPriceDto.setParamName(ProgramDocumentParamName.MAX_PRICE);
    -        maxPriceDto.setParamType("integer");
    -        list.add(maxPriceDto);
    -        
    -        try {
    -            businessEsHandle.createIndex(ProgramDocumentParamName.INDEX_NAME, ProgramDocumentParamName.INDEX_TYPE,list);
    -            return true;
    -        }catch (Exception e) {
    -            log.error("createIndex error",e);
    -        }
    -        return false;
    +    
    +    @Override
    +    public void executeInit(final ConfigurableApplicationContext context) {
    +        BusinessThreadPool.execute(this::initElasticsearchData);
         }
         
         public void initElasticsearchData(){
    @@ -137,12 +50,11 @@ public class ProgramElasticsearchInitData implements InitData {
                 return;
             }
             List allProgramIdList = programService.getAllProgramIdList();
    -        //根据节目id统计出票档的最低价和最高价的集合map, key:节目id,value:票档
             Map ticketCategorieMap = programService.selectTicketCategorieMap(allProgramIdList);
             
             for (Long programId : allProgramIdList) {
                 ProgramVo programVo = programService.getDetailFromDb(programId);
    -            Map map = new HashMap<>();
    +            Map map = new HashMap<>(32);
                 map.put(ProgramDocumentParamName.ID,programVo.getId());
                 map.put(ProgramDocumentParamName.TITLE,programVo.getTitle());
                 map.put(ProgramDocumentParamName.ACTOR,programVo.getActor());
    @@ -153,14 +65,57 @@ public class ProgramElasticsearchInitData implements InitData {
                 map.put(ProgramDocumentParamName.PROGRAM_CATEGORY_ID,programVo.getProgramCategoryId());
                 map.put(ProgramDocumentParamName.PROGRAM_CATEGORY_NAME,programVo.getProgramCategoryName());
                 map.put(ProgramDocumentParamName.PARENT_PROGRAM_CATEGORY_ID,programVo.getParentProgramCategoryId());
    +            map.put(ProgramDocumentParamName.PARENT_PROGRAM_CATEGORY_NAME,programVo.getParentProgramCategoryName());
                 map.put(ProgramDocumentParamName.SHOW_TIME, programVo.getShowTime());
                 map.put(ProgramDocumentParamName.SHOW_DAY_TIME,programVo.getShowDayTime());
                 map.put(ProgramDocumentParamName.SHOW_WEEK_TIME,programVo.getShowWeekTime());
    -            //最低价
    -            map.put(ProgramDocumentParamName.MIN_PRICE,Optional.ofNullable(ticketCategorieMap.get(programVo.getId())).map(TicketCategoryAggregate::getMinPrice).orElse(null));
    -            //最高价
    -            map.put(ProgramDocumentParamName.MAX_PRICE,Optional.ofNullable(ticketCategorieMap.get(programVo.getId())).map(TicketCategoryAggregate::getMaxPrice).orElse(null));
    -            businessEsHandle.add(ProgramDocumentParamName.INDEX_NAME, ProgramDocumentParamName.INDEX_TYPE,map);
    +            map.put(ProgramDocumentParamName.MIN_PRICE,
    +                    Optional.ofNullable(ticketCategorieMap.get(programVo.getId()))
    +                            .map(TicketCategoryAggregate::getMinPrice).orElse(null));
    +            map.put(ProgramDocumentParamName.MAX_PRICE,
    +                    Optional.ofNullable(ticketCategorieMap.get(programVo.getId()))
    +                            .map(TicketCategoryAggregate::getMaxPrice).orElse(null));
    +            businessEsHandle.add(SpringUtil.getPrefixDistinctionName() + "-" + 
    +                    ProgramDocumentParamName.INDEX_NAME, ProgramDocumentParamName.INDEX_TYPE,map);
             }
         }
    +    
    +    public boolean indexAdd(){
    +        boolean result = businessEsHandle.checkIndex(SpringUtil.getPrefixDistinctionName() + "-" +
    +                ProgramDocumentParamName.INDEX_NAME, ProgramDocumentParamName.INDEX_TYPE);
    +        if (result) {
    +            return false;
    +        }
    +        try {
    +            businessEsHandle.createIndex(SpringUtil.getPrefixDistinctionName() + "-" +
    +                    ProgramDocumentParamName.INDEX_NAME, ProgramDocumentParamName.INDEX_TYPE,getEsMapping());
    +            return true;
    +        }catch (Exception e) {
    +            log.error("createIndex error",e);
    +        }
    +        return false;
    +    }
    +    
    +    public List getEsMapping(){
    +        List list = new ArrayList<>();
    +        
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.ID,"long"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.TITLE,"text"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.ACTOR,"text"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.PLACE,"text"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.ITEM_PICTURE,"text"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.AREA_ID,"long"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.AREA_NAME,"text"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.PROGRAM_CATEGORY_ID,"long"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.PROGRAM_CATEGORY_NAME,"text"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.PARENT_PROGRAM_CATEGORY_ID,"long"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.PARENT_PROGRAM_CATEGORY_NAME,"text"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.SHOW_TIME,"date"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.SHOW_DAY_TIME,"date"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.SHOW_WEEK_TIME,"text"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.MIN_PRICE,"integer"));
    +        list.add(new EsDocumentMappingDto(ProgramDocumentParamName.MAX_PRICE,"integer"));
    +        
    +        return list;
    +    }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramShowTimeRenewal.java b/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramShowTimeRenewal.java
    index 2a4a192b7eaec2d057d8c711bcb03d9c18072673..7dbf4c9f41956c0f2bcb00712425f6569fdfd914 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramShowTimeRenewal.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/init/ProgramShowTimeRenewal.java
    @@ -1,8 +1,11 @@
     package com.damai.service.init;
     
    -import com.damai.init.InitData;
    +import com.damai.core.SpringUtil;
    +import com.damai.initialize.base.AbstractApplicationPostConstructHandler;
     import com.damai.service.ProgramShowTimeService;
    +import com.damai.util.BusinessEsHandle;
     import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.context.ConfigurableApplicationContext;
     import org.springframework.stereotype.Component;
     
     /**
    @@ -11,16 +14,28 @@ import org.springframework.stereotype.Component;
      * @author: 阿宽不是程序员
      **/
     @Component
    -public class ProgramShowTimeRenewal implements InitData {
    +public class ProgramShowTimeRenewal extends AbstractApplicationPostConstructHandler {
         
         @Autowired
         private ProgramShowTimeService programShowTimeService;
         
    +    @Autowired
    +    private BusinessEsHandle businessEsHandle;
    +    
    +    @Override
    +    public Integer executeOrder() {
    +        return 2;
    +    }
    +    
         /**
          * 项目启动将库中的节目演出时间进行更新,真实生产环境不会这么做的
          * */
         @Override
    -    public void init() {
    -        programShowTimeService.renewal();
    +    public void executeInit(final ConfigurableApplicationContext context) {
    +        boolean flag = programShowTimeService.renewal();
    +        if (flag) {
    +            businessEsHandle.deleteIndex(SpringUtil.getPrefixDistinctionName() + "-" +
    +                    ProgramDocumentParamName.INDEX_NAME);
    +        }
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/lua/ProgramCacheCreateOrderOperate.java b/damai-server/damai-program-service/src/main/java/com/damai/service/lua/ProgramCacheCreateOrderOperate.java
    index 6ac9a3921147ef18823d793cde398f0e4ce5636b..aca54ccb8f2f0cc74482a776a0bef4bad748988f 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/lua/ProgramCacheCreateOrderOperate.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/lua/ProgramCacheCreateOrderOperate.java
    @@ -1,5 +1,6 @@
     package com.damai.service.lua;
     
    +import com.alibaba.fastjson.JSON;
     import com.damai.redis.RedisCache;
     import lombok.extern.slf4j.Slf4j;
     import org.springframework.beans.factory.annotation.Autowired;
    @@ -36,7 +37,8 @@ public class ProgramCacheCreateOrderOperate {
             }
         }
         
    -    public String programCacheOperate(List keys, String[] args){
    -        return (String)redisCache.getInstance().execute(redisScript, keys, args);
    +    public ProgramCacheCreateOrderData programCacheOperate(List keys, String[] args){
    +        Object object = redisCache.getInstance().execute(redisScript, keys, args);
    +        return JSON.parseObject((String)object, ProgramCacheCreateOrderData.class);
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/ProgramConstant.java b/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/ProgramConstant.java
    deleted file mode 100644
    index 1666094279a694ace31546507e94d68cbd64ca6c..0000000000000000000000000000000000000000
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/ProgramConstant.java
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -package com.damai.service.pagestrategy;
    -/**
    - * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 节目查询策略
    - * @author: 阿宽不是程序员
    - **/
    -public class ProgramConstant {
    -    
    -    public static final String DB_TYPE_NAME = "db";
    -    
    -    public static final String ES_TYPE_NAME = "es";
    -}
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/SelectPageWrapper.java b/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/SelectPageWrapper.java
    deleted file mode 100644
    index 03c8bb804c21574d55b4e0f0328289a75ef3b33d..0000000000000000000000000000000000000000
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/SelectPageWrapper.java
    +++ /dev/null
    @@ -1,22 +0,0 @@
    -package com.damai.service.pagestrategy;
    -
    -import com.damai.dto.ProgramPageListDto;
    -import com.damai.page.PageVo;
    -import com.damai.vo.ProgramListVo;
    -import lombok.AllArgsConstructor;
    -/**
    - * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 节目查询策略包装
    - * @author: 阿宽不是程序员
    - **/
    -@AllArgsConstructor
    -public class SelectPageWrapper {
    -    
    -    private String selectPageHandleType;
    -    
    -    private SelectPageStrategyContext selectPageStrategyContext;
    -    
    -    public PageVo selectPage(ProgramPageListDto programPageListDto) {
    -        return selectPageStrategyContext.get(selectPageHandleType).selectPage(programPageListDto);
    -    }
    -}
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/config/ProgramAutoConfig.java b/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/config/ProgramAutoConfig.java
    deleted file mode 100644
    index 5a41a1b763b6ecdc756867f5de29c6691b9a6562..0000000000000000000000000000000000000000
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/config/ProgramAutoConfig.java
    +++ /dev/null
    @@ -1,48 +0,0 @@
    -package com.damai.service.pagestrategy.config;
    -
    -import com.damai.service.pagestrategy.ProgramConstant;
    -import com.damai.service.pagestrategy.SelectPageHandle;
    -import com.damai.service.pagestrategy.SelectPageStrategyContext;
    -import com.damai.service.pagestrategy.SelectPageWrapper;
    -import com.damai.service.pagestrategy.event.SelectPageHandleStrategyInit;
    -import com.damai.service.pagestrategy.impl.SelectPageDbHandle;
    -import com.damai.service.pagestrategy.impl.SelectPageEsHandle;
    -import org.springframework.beans.factory.annotation.Value;
    -import org.springframework.context.ConfigurableApplicationContext;
    -import org.springframework.context.annotation.Bean;
    -
    -/**
    - * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 节目相关配置
    - * @author: 阿宽不是程序员
    - **/
    -public class ProgramAutoConfig {
    -    
    -    @Value("${selectPageHandleType:"+ ProgramConstant.DB_TYPE_NAME +"}")
    -    private String selectPageHandleType;
    -    
    -    @Bean
    -    public SelectPageHandle selectPageDbHandle(){
    -        return new SelectPageDbHandle();
    -    }
    -    
    -    @Bean
    -    public SelectPageHandle selectPageEsHandle(){
    -        return new SelectPageEsHandle();
    -    }
    -    
    -    @Bean
    -    public SelectPageStrategyContext selectPageStrategyContext(ConfigurableApplicationContext applicationContext){
    -        return new SelectPageStrategyContext(applicationContext);
    -    }
    -    
    -    @Bean
    -    public SelectPageHandleStrategyInit selectPageHandleStrategyInit(SelectPageStrategyContext selectPageStrategyContext){
    -        return new SelectPageHandleStrategyInit(selectPageStrategyContext);
    -    }
    -    
    -    @Bean
    -    public SelectPageWrapper selectPageWrapper(SelectPageStrategyContext selectPageStrategyContext){
    -        return new SelectPageWrapper(selectPageHandleType,selectPageStrategyContext);
    -    }
    -}
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/impl/SelectPageDbHandle.java b/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/impl/SelectPageDbHandle.java
    deleted file mode 100644
    index 665610e31656edc90edcc71ea6585a0046df3ced..0000000000000000000000000000000000000000
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/impl/SelectPageDbHandle.java
    +++ /dev/null
    @@ -1,32 +0,0 @@
    -package com.damai.service.pagestrategy.impl;
    -
    -import com.damai.dto.ProgramPageListDto;
    -import com.damai.page.PageVo;
    -import com.damai.service.ProgramService;
    -import com.damai.service.pagestrategy.ProgramConstant;
    -import com.damai.service.pagestrategy.SelectPageHandle;
    -import com.damai.vo.ProgramListVo;
    -import lombok.extern.slf4j.Slf4j;
    -import org.springframework.beans.factory.annotation.Autowired;
    -/**
    - * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 数据库查询
    - * @author: 阿宽不是程序员
    - **/
    -@Slf4j
    -public class SelectPageDbHandle implements SelectPageHandle {
    -    
    -    @Autowired
    -    private ProgramService programService;
    -    
    -    
    -    @Override
    -    public PageVo selectPage(ProgramPageListDto programPageListDto) {
    -        return programService.doSelectPage(programPageListDto);
    -    }
    -    
    -    @Override
    -    public String getType() {
    -        return ProgramConstant.DB_TYPE_NAME;
    -    }
    -}
    diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/tool/SeatMatch.java b/damai-server/damai-program-service/src/main/java/com/damai/service/tool/SeatMatch.java
    index d208641d616e33285adf0df670423f1cbf2e6155..c4fd6813e5b30ec909b617f58fc60be825c32ed5 100644
    --- a/damai-server/damai-program-service/src/main/java/com/damai/service/tool/SeatMatch.java
    +++ b/damai-server/damai-program-service/src/main/java/com/damai/service/tool/SeatMatch.java
    @@ -15,7 +15,6 @@ public class SeatMatch {
         public static List findAdjacentSeatVos(List allSeats, int seatCount) {
             List adjacentSeats = new ArrayList<>();
             
    -        // 对可用座位排序
             allSeats.sort((s1, s2) -> {
                 if (Objects.equals(s1.getRowCode(), s2.getRowCode())) {
                     return s1.getColCode() - s2.getColCode();
    @@ -24,14 +23,14 @@ public class SeatMatch {
                 }
             });
             
    -        // 寻找相邻座位
             for (int i = 0; i < allSeats.size() - seatCount + 1; i++) {
                 boolean seatsFound = true;
                 for (int j = 0; j < seatCount - 1; j++) {
                     SeatVo current = allSeats.get(i + j);
                     SeatVo next = allSeats.get(i + j + 1);
                     
    -                if (!(Objects.equals(current.getRowCode(), next.getRowCode()) && next.getColCode() - current.getColCode() == 1)) {
    +                if (!(Objects.equals(current.getRowCode(), next.getRowCode()) && 
    +                        next.getColCode() - current.getColCode() == 1)) {
                         seatsFound = false;
                         break;
                     }
    @@ -43,7 +42,6 @@ public class SeatMatch {
                     return adjacentSeats;
                 }
             }
    -        // 如果没有找到,返回空列表
             return adjacentSeats;
         }
     }
    diff --git a/damai-server/damai-program-service/src/main/resources/META-INF/spring.factories b/damai-server/damai-program-service/src/main/resources/META-INF/spring.factories
    deleted file mode 100644
    index ae7705c628574cc843b5c75cccacc3d4c999e5ad..0000000000000000000000000000000000000000
    --- a/damai-server/damai-program-service/src/main/resources/META-INF/spring.factories
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
    -  com.damai.service.pagestrategy.config.ProgramAutoConfig
    \ No newline at end of file
    diff --git a/damai-server/damai-program-service/src/main/resources/application.yml b/damai-server/damai-program-service/src/main/resources/application.yml
    new file mode 100644
    index 0000000000000000000000000000000000000000..d76a694d96faf450dc7b34b0bfc5e7f3d010199d
    --- /dev/null
    +++ b/damai-server/damai-program-service/src/main/resources/application.yml
    @@ -0,0 +1,115 @@
    +#服务端口
    +server:
    +  port: 6086
    +# 应用名称
    +spring:
    +  application:
    +    name: ${prefix.distinction.name:damai}-program-service
    +  main:
    +    allow-bean-definition-overriding: true
    +  mvc:
    +    pathmatch:
    +      matching-strategy: ant_path_matcher
    +    servlet:
    +      load-on-startup: 1
    +    jackson:
    +      time-zone: GMT+8
    +      date-format: yyyy-MM-dd HH:mm:ss
    +      generator:
    +        WRITE_NUMBERS_AS_STRINGS: true
    +  datasource:
    +    driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
    +    url: jdbc:shardingsphere:classpath:shardingsphere-program.yaml
    +  redis:
    +    database: 0
    +    host: 127.0.0.1
    +    port: 6379
    +    timeout: 3000
    +  cloud:
    +    nacos:
    +      discovery:
    +        server-addr: 127.0.0.1:8848
    +        username: nacos
    +        password: nacos
    +    sentinel:
    +      transport:
    +        port: 8719
    +        dashboard: 127.0.0.1:8082
    +      datasource:
    +        degrade:
    +          nacos:
    +            server-addr: 127.0.0.1:8848
    +            dataId: ${spring.application.name}-degrade-rules
    +            groupId: SENTINEL_GROUP
    +            dataType: json
    +            rule-type: degrade
    +        flow:
    +          nacos:
    +            server-addr: 127.0.0.1:8848
    +            dataId: ${spring.application.name}-flow-rules
    +            groupId: SENTINEL_GROUP
    +            dataType: json
    +            rule-type: flow
    +      eager: true    
    +mybatis-plus:
    +  mapper-locations: classpath:mapper/*.xml
    +  global-config:
    +    db-config:
    +      logic-delete-field: status
    +      logic-delete-value: 0
    +      logic-not-delete-value: 1
    +  configuration:
    +    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    +    local-cache-scope: statement
    +feign:
    +  sentinel:
    +    enabled: false
    +  hystrix:
    +    enabled: true
    +  httpclient:
    +    enabled: false
    +  okhttp:
    +    enabled: true
    +  compression:
    +    request:
    +      enabled: true
    +      mime-types: text/xml,application/xml,application/json
    +      min-request-size: 512
    +    response:
    +      enabled: true
    +hystrix:
    +  command:
    +    default:
    +      execution:
    +        timeout:
    +          enabled: true
    +        isolation:
    +          thread:
    +            timeoutInMilliseconds: 10000
    +          semaphore:
    +            maxConcurrentRequests: 99999
    +ribbon:
    +  ReadTimeout: 60000
    +  ConnectTimeout: 60000
    +  MaxAutoRetries: 0
    +  MaxAutoRetriesNextServer: 1
    +management:
    +  endpoints:
    +    web:
    +      exposure:
    +        include: '*'
    +    health:
    +      show-details: always
    +  security:
    +    enabled: false
    +  health:
    +    elasticsearch:
    +      enabled: false
    +jasypt:
    +  encryptor:
    +    password: bgtjkjl!%^sdc
    +    algorithm: PBEWithMD5AndDES
    +elasticsearch:
    +  ip: 127.0.0.1:9200
    +  userName: elastic
    +  passWord: elastic    
    \ No newline at end of file
    diff --git a/damai-server/damai-program-service/src/main/resources/bootstrap.yml b/damai-server/damai-program-service/src/main/resources/bootstrap.yml
    deleted file mode 100644
    index 94a269cd60a690c16c5a4f969e7b21113288a029..0000000000000000000000000000000000000000
    --- a/damai-server/damai-program-service/src/main/resources/bootstrap.yml
    +++ /dev/null
    @@ -1,21 +0,0 @@
    -server:
    -  port: 6086
    -spring:
    -  application:
    -    name: ${prefix.distinction.name:damai}-program-service
    -  main:
    -    allow-bean-definition-overriding: true
    -  cloud:
    -    nacos:
    -      discovery:
    -        server-addr: 62.234.31.217:8848
    -        username: nacos
    -        password: nacos
    -      config:
    -        server-addr: 62.234.31.217:8848
    -        file-extension: yaml
    -        shared-configs:
    -          - data-id: common.yaml
    -            refresh: true
    -        username: nacos
    -        password: nacos    
    \ No newline at end of file
    diff --git a/damai-server/damai-program-service/src/main/resources/lua/programData.lua b/damai-server/damai-program-service/src/main/resources/lua/programData.lua
    index 11423726a3556bff26c01371f3943dc4a968589a..53794a672d5bbaf3afc78255774356f870f74135 100644
    --- a/damai-server/damai-program-service/src/main/resources/lua/programData.lua
    +++ b/damai-server/damai-program-service/src/main/resources/lua/programData.lua
    @@ -1,25 +1,14 @@
    --- 票档数量的key
     local program_ticket_remain_number_hash_key = KEYS[1]
     local seat_hash_key_del = KEYS[2]
     local seat_hash_key_add = KEYS[3]
    --- 票档数量数据
     local ticket_category_list = cjson.decode(ARGV[1]) 
    --- 如果是订单创建,那么就扣除未售卖的座位id
    --- 如果是订单取消,那么就扣除锁定的座位id
     local seat_id_list = cjson.decode(ARGV[2])
    --- 如果是订单创建的操作,那么添加到锁定的座位数据
    --- 如果是订单订单的操作,那么添加到未售卖的座位数据
     local seat_data_list = cjson.decode(ARGV[3])
    -
    --- 如果是订单创建,则扣票档数量
    --- 如果是订单取消,则恢复票档数量
     for index,increase_data in ipairs(ticket_category_list) do
         local ticket_category_id = increase_data.ticketCategoryId
         local increase_count = increase_data.count
         redis.call('HINCRBY',program_ticket_remain_number_hash_key,ticket_category_id,increase_count)
     end
    --- 如果是订单创建,将没有售卖的座位删除,再将座位数据添加到锁定的座位中
    --- 如果是订单取消,将锁定的座位删除,再将座位数据添加到没有售卖的座位中
     redis.call('HDEL',seat_hash_key_del,unpack(seat_id_list))
     redis.call('HMSET',seat_hash_key_add,unpack(seat_data_list))
     
    diff --git a/damai-server/damai-program-service/src/main/resources/lua/programDataCreateOrder.lua b/damai-server/damai-program-service/src/main/resources/lua/programDataCreateOrder.lua
    index 5f7c911c005a998640ed5c6fcd51624aeba82d8d..d23c0c6767eff78ceea67ed77784ff2966ea05c6 100644
    --- a/damai-server/damai-program-service/src/main/resources/lua/programDataCreateOrder.lua
    +++ b/damai-server/damai-program-service/src/main/resources/lua/programDataCreateOrder.lua
    @@ -1,24 +1,13 @@
    --- 票档数量的key
     local ticket_remain_number_hash_key = KEYS[1]
    --- 没有售卖的座位key
     local seat_no_sold_hash_key = KEYS[2]
    --- 锁定的座位key
     local seat_lock_hash_key = KEYS[3]
    --- 类型 1 用户选座位 2自动匹配座位
     local type = tonumber(KEYS[4])
    --- 要购买的票档 包括票档id和票档数量
    -local ticket_count_list = cjson.decode(ARGV[1]) 
    --- 过滤后符合条件可以购买的座位集合
    +local ticket_count_list = cjson.decode(ARGV[1])
     local purchase_seat_list = {}
    --- 入参座位价格总和
     local total_seat_dto_price = 0
    --- 缓存座位价格总和
     local total_seat_vo_price = 0
    --- 匹配座位算法 
     local function find_adjacent_seats(all_seats, seat_count)
         local adjacent_seats = {}
    -
    -    -- 对可用座位排序
         table.sort(all_seats, function(s1, s2)
             if s1.rowCode == s2.rowCode then
                 return s1.colCode < s2.colCode
    @@ -26,8 +15,7 @@ local function find_adjacent_seats(all_seats, seat_count)
                 return s1.rowCode < s2.rowCode
             end
         end)
    -
    -    -- 寻找相邻座位
    +    
         for i = 1, #all_seats - seat_count + 1 do
             local seats_found = true
             for j = 0, seat_count - 2 do
    @@ -46,99 +34,71 @@ local function find_adjacent_seats(all_seats, seat_count)
                 return adjacent_seats
             end
         end
    -    -- 如果没有找到,返回空列表
         return adjacent_seats
     end
     
    --- 入参座位存在
     if (type == 1) then
         for index,ticket_count in ipairs(ticket_count_list) do
    -        -- 入参座位的票档id
             local ticket_category_id = ticket_count.ticketCategoryId
    -        -- 入参座位的票档数量
             local count = ticket_count.ticketCount
    -        -- 从缓存中获取相应票档数量
             local remain_number_str = redis.call('hget', ticket_remain_number_hash_key, tostring(ticket_category_id))
    -        -- 如果为空直接返回
             if (remain_number_str == nil) then
                 return string.format('{"%s": %d}', 'code', 40010)
             end
             local remain_number = tonumber(remain_number_str)
    -        -- 入参座位的票档数量大于缓存中获取相应票档数量,说明票档数量不足,直接返回
             if (count > remain_number) then
                 return string.format('{"%s": %d}', 'code', 40011)
             end
         end
    -    -- 入参座位集合
         local seat_dto_list = cjson.decode(ARGV[2])
         for index,seat_dto in ipairs(seat_dto_list) do
    -        -- 入参座位id
             local id = seat_dto.id
    -        -- 入参座位价格
             local seat_dto_price = seat_dto.price
    -        -- 根据座位id从缓存中没有售卖的座位
             local seat_vo_str = redis.call('hget', seat_no_sold_hash_key, tostring(id))
    -        -- 如果从缓存中为空,则直接返回
             if (seat_vo_str == nil) then
                 return string.format('{"%s": %d}', 'code', 40001)
             end
             local seat_vo = cjson.decode(seat_vo_str)
    -        -- 如果从缓存查询的座位状态是锁定的,直接返回
             if (seat_vo.sellStatus == 2) then
                 return string.format('{"%s": %d}', 'code', 40002)
             end
    -        -- 如果从缓存查询的座位状态是已经售卖的,直接返回
             if (seat_vo.sellStatus == 3) then
                 return string.format('{"%s": %d}', 'code', 40003)
             end
             table.insert(purchase_seat_list,seat_vo)
    -        -- 入参座位价格累加
             total_seat_dto_price = total_seat_dto_price + seat_dto_price
    -        -- 缓存座位价格累加
             total_seat_vo_price = total_seat_vo_price + seat_vo.price
             if (total_seat_dto_price > total_seat_vo_price) then
                 return string.format('{"%s": %d}', 'code', 40008)
             end
         end
     end
    --- 入参座位不存在
     if (type == 2) then
    -    -- 这里的外层循环其实就一次
         for index,ticket_count in ipairs(ticket_count_list) do
    -        -- 入参选择的票档id
             local ticket_category_id = ticket_count.ticketCategoryId
    -        -- 入参选择的票档数量
             local count = ticket_count.ticketCount
    -        -- 从缓存中获取相应票档数量
             local remain_number_str = redis.call('hget', ticket_remain_number_hash_key, tostring(ticket_category_id))
    -        -- 如果为空直接返回
             if (remain_number_str == nil) then
                 return string.format('{"%s": %d}', 'code', 40010)
             end
             local remain_number = tonumber(remain_number_str)
    -        -- 入参的票档数量大于缓存中获取相应票档数量,说明票档数量不足,直接返回
             if (count > remain_number) then
                 return string.format('{"%s": %d}', 'code', 40011)
             end
    -        -- 获取没有售卖的座位集合
             local seat_vo_no_sold_str_list = redis.call('hvals',seat_no_sold_hash_key)
             local filter_seat_vo_no_sold_list = {}
    -        -- 这里遍历的原因,座位集合是以hash存储在缓存中,而每个座位是字符串,要把字符串转成对象
             for index,seat_vo_no_sold_str in ipairs(seat_vo_no_sold_str_list) do
                 local seat_vo_no_sold = cjson.decode(seat_vo_no_sold_str)
    -            -- 根据入参选择的票档过滤出相应的没有售卖的座位
                 if (seat_vo_no_sold.ticketCategoryId == ticket_category_id) then
                     table.insert(filter_seat_vo_no_sold_list,seat_vo_no_sold)
                 end
             end
    -        -- 利用算法自动根据人数和票档进行分配相邻座位
             purchase_seat_list = find_adjacent_seats(filter_seat_vo_no_sold_list,count)
             if (#purchase_seat_list < count) then
                 return string.format('{"%s": %d}', 'code', 40004)
             end
         end
     end
    --- 经过以上的验证,说明座位和票档数量是够用的,下面开始真正的锁定座位和扣除票档数量操作
     local seat_id_list = {}
     local seat_data_list = {}
     for index,seat in ipairs(purchase_seat_list) do
    @@ -148,21 +108,12 @@ for index,seat in ipairs(purchase_seat_list) do
         seat.sellStatus = 2
         table.insert(seat_data_list,cjson.encode(seat))
     end
    --- 扣票档数量
     for index,ticket_count in ipairs(ticket_count_list) do
    -    -- 票档id
         local ticket_category_id = ticket_count.ticketCategoryId
    -    -- 票档数量
         local count = ticket_count.ticketCount
         redis.call('hincrby',ticket_remain_number_hash_key,ticket_category_id,"-" .. count)
     end
    --- 将没有售卖的座位删除
     redis.call('hdel',seat_no_sold_hash_key,unpack(seat_id_list))
    --- 再将座位数据添加到锁定的座位中
     redis.call('hmset',seat_lock_hash_key,unpack(seat_data_list))
     
    -return string.format('{"%s": %d, "%s": %s}', 'code', 0, 'purchaseSeatList', cjson.encode(purchase_seat_list))
    -
    -
    -
    -
    +return string.format('{"%s": %d, "%s": %s}', 'code', 0, 'purchaseSeatList', cjson.encode(purchase_seat_list))
    \ No newline at end of file
    diff --git a/damai-server/damai-program-service/src/main/resources/mapper/ProgramMapper.xml b/damai-server/damai-program-service/src/main/resources/mapper/ProgramMapper.xml
    index c973f36998fb76f0aee7191d1ffd68d7187c7415..c2762e57cc6de89ddb7fda5b14bed490ec920302 100644
    --- a/damai-server/damai-program-service/src/main/resources/mapper/ProgramMapper.xml
    +++ b/damai-server/damai-program-service/src/main/resources/mapper/ProgramMapper.xml
    @@ -19,7 +19,27 @@
     
     
         
    -    
    +        
    +            
    +                select * from (
    +                    select
    +                        dp.id,dp.area_id,dp.program_category_id,dp.parent_program_category_id,dp.title,dp.actor,
    +                        dp.place,dp.item_picture
    +                    from
    +                        d_program dp
    +                    where
    +                        dp.program_status = 1
    +                    and
    +                        dp.area_id = #{programListDto.areaId,jdbcType=BIGINT}
    +                    and
    +                        dp.parent_program_category_id = #{parentProgramCategoryId,jdbcType=BIGINT} limit 7
    +                ) as tmp
    +            
    +        
    +    
    +    
    +    
     
    \ No newline at end of file
    diff --git a/damai-server/damai-program-service/src/main/resources/shardingsphere-program.yaml b/damai-server/damai-program-service/src/main/resources/shardingsphere-program.yaml
    index 6e62fbec37d8fa76c2de73b872a2636aedefcc45..3d50d1d1805ad2403292db03c9ae2d6b14f13194 100644
    --- a/damai-server/damai-program-service/src/main/resources/shardingsphere-program.yaml
    +++ b/damai-server/damai-program-service/src/main/resources/shardingsphere-program.yaml
    @@ -2,145 +2,94 @@ dataSources:
       ds_0:
         dataSourceClassName: com.zaxxer.hikari.HikariDataSource
         driverClassName: com.mysql.cj.jdbc.Driver
    -    jdbcUrl: jdbc:mysql://www.cookframe.com:3306/damai_program_0?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai&autoReconnect=true
    +    jdbcUrl: jdbc:mysql://127.0.0.1:3306/damai_program_0?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai&autoReconnect=true
         username: root
    -    password: qaz321qwe!
    +    password: root
     
       ds_1:
         dataSourceClassName: com.zaxxer.hikari.HikariDataSource
         driverClassName: com.mysql.cj.jdbc.Driver
    -    jdbcUrl: jdbc:mysql://www.cookframe.com:3306/damai_program_1?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai&autoReconnect=true
    +    jdbcUrl: jdbc:mysql://127.0.0.1:3306/damai_program_1?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai&autoReconnect=true
         username: root
    -    password: qaz321qwe!
    +    password: root
         
     rules:
       - !SHARDING
         tables:
    -      # 对d_program表进行分库分表
           d_program:
    -        # 库为damai_program_0 damai_program_1 表为d_program_0 至 d_program_1
             actualDataNodes: ds_${0..1}.d_program_${0..1}
    -        # 分库策略
             databaseStrategy:
               standard:
    -            # 使用id作为分片键
                 shardingColumn: id
    -            # 使用id分库算法
    -            shardingAlgorithmName: databaseProgramHashModModel
    -        # 分表策略
    +            shardingAlgorithmName: databaseProgramModModel
             tableStrategy:
               standard:
    -            # 使用id作为分片键
                 shardingColumn: id
    -            # 使用id分表算法
    -            shardingAlgorithmName: tableProgramHashModModel
    -      # 对d_program_show_time表进行分库分表
    +            shardingAlgorithmName: tableProgramModModel
           d_program_show_time:
    -        # 库为damai_program_0 damai_program_1 表为d_program_show_time_0 至 d_program_show_time_1
             actualDataNodes: ds_${0..1}.d_program_show_time_${0..1}
    -        # 分库策略
             databaseStrategy:
               standard:
    -            # 使用id作为分片键
                 shardingColumn: program_id
    -            # 使用id分库算法
    -            shardingAlgorithmName: databaseProgramShowTimeHashModModel
    -        # 分表策略
    +            shardingAlgorithmName: databaseProgramShowTimeModModel
             tableStrategy:
               standard:
    -            # 使用id作为分片键
                 shardingColumn: program_id
    -            # 使用id分表算法
    -            shardingAlgorithmName: tableProgramShowTimeHashModModel
    -      # 对d_seat表进行分库分表
    +            shardingAlgorithmName: tableProgramShowTimeModModel
           d_seat:
    -        # 库为damai_program_0 damai_program_1 表为d_seat_0 至 d_seat_1
             actualDataNodes: ds_${0..1}.d_seat_${0..1}
    -        # 分库策略
             databaseStrategy:
               standard:
    -            # 使用id作为分片键
                 shardingColumn: program_id
    -            # 使用id分库算法
    -            shardingAlgorithmName: databaseSeatHashModModel
    -        # 分表策略
    +            shardingAlgorithmName: databaseSeatModModel
             tableStrategy:
               standard:
    -            # 使用id作为分片键
                 shardingColumn: program_id
    -            # 使用id分表算法
    -            shardingAlgorithmName: tableSeatHashModModel
    -      # 对d_ticket_category表进行分库分表
    +            shardingAlgorithmName: tableSeatModModel
           d_ticket_category:
    -        # 库为damai_program_0 damai_program_1 表为d_ticket_category_0 至 d_ticket_category_1
             actualDataNodes: ds_${0..1}.d_ticket_category_${0..1}
    -        # 分库策略
             databaseStrategy:
               standard:
    -            # 使用id作为分片键
                 shardingColumn: program_id
    -            # 使用id分库算法
    -            shardingAlgorithmName: databaseTicketCategoryHashModModel
    -        # 分表策略
    +            shardingAlgorithmName: databaseTicketCategoryModModel
             tableStrategy:
               standard:
    -            # 使用id作为分片键
                 shardingColumn: program_id
    -            # 使用id分表算法
    -            shardingAlgorithmName: tableTicketCategoryHashModModel      
    -    # 广播表
    +            shardingAlgorithmName: tableTicketCategoryModModel      
         broadcastTables:
           - d_program_category
    -    # 具体的算法
         shardingAlgorithms:
    -      # d_program表分库算法
    -      databaseProgramHashModModel:
    +      databaseProgramModModel:
             type: MOD
             props:
    -          # 分库数量
               sharding-count: 2
    -      # d_program表分表算法
    -      tableProgramHashModModel:
    +      tableProgramModModel:
             type: MOD
             props:
    -          # 分表数量
               sharding-count: 2
    -      # d_program_show_time表分库算法
    -      databaseProgramShowTimeHashModModel:
    +      databaseProgramShowTimeModModel:
             type: MOD
             props:
    -          # 分库数量
               sharding-count: 2
    -      # d_program_show_time表分表算法
    -      tableProgramShowTimeHashModModel:
    +      tableProgramShowTimeModModel:
             type: MOD
             props:
    -          # 分表数量
               sharding-count: 2
    -      # d_seat表分库算法
    -      databaseSeatHashModModel:
    +      databaseSeatModModel:
             type: MOD
             props:
    -          # 分库数量
               sharding-count: 2
    -      # d_seat表分表算法
    -      tableSeatHashModModel:
    +      tableSeatModModel:
             type: MOD
             props:
    -          # 分表数量
               sharding-count: 2
    -      # d_ticket_category表分库算法
    -      databaseTicketCategoryHashModModel:
    +      databaseTicketCategoryModModel:
             type: MOD
             props:
    -          # 分库数量
               sharding-count: 2
    -      # d_ticket_category表分表算法
    -      tableTicketCategoryHashModModel:
    +      tableTicketCategoryModModel:
             type: MOD
             props:
    -          # 分表数量
               sharding-count: 2    
     props:
    -  # 打印真实sql
       sql-show: true
    \ No newline at end of file
    diff --git a/damai-server/damai-single-service/src/main/resources/application.yml b/damai-server/damai-single-service/src/main/resources/application.yml
    new file mode 100644
    index 0000000000000000000000000000000000000000..d9acf6004ac56a823716d7f7a6af4f89fec76699
    --- /dev/null
    +++ b/damai-server/damai-single-service/src/main/resources/application.yml
    @@ -0,0 +1,146 @@
    +#服务端口
    +server:
    +  port: 6070
    +# 应用名称
    +spring:
    +  application:
    +    name: ${prefix.distinction.name:damai}-single-service
    +  main:
    +    allow-bean-definition-overriding: true
    +  mvc:
    +    pathmatch:
    +      matching-strategy: ant_path_matcher
    +    servlet:
    +      load-on-startup: 1
    +    jackson:
    +      time-zone: GMT+8
    +      date-format: yyyy-MM-dd HH:mm:ss
    +      generator:
    +        WRITE_NUMBERS_AS_STRINGS: true
    +  datasource:
    +    driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
    +    url: jdbc:shardingsphere:classpath:shardingsphere-single.yaml
    +  redis:
    +    database: 0
    +    host: 127.0.0.1
    +    port: 6379
    +    timeout: 3000
    +  cloud:
    +    nacos:
    +      discovery:
    +        server-addr: 127.0.0.1:8848
    +        username: nacos
    +        password: nacos
    +    sentinel:
    +      transport:
    +        port: 8719
    +        dashboard: 127.0.0.1:8082
    +      datasource:
    +        degrade:
    +          nacos:
    +            server-addr: 127.0.0.1:8848
    +            dataId: ${spring.application.name}-degrade-rules
    +            groupId: SENTINEL_GROUP
    +            dataType: json
    +            rule-type: degrade
    +        flow:
    +          nacos:
    +            server-addr: 127.0.0.1:8848
    +            dataId: ${spring.application.name}-flow-rules
    +            groupId: SENTINEL_GROUP
    +            dataType: json
    +            rule-type: flow
    +      eager: true    
    +aj:
    +  captcha:
    +    cache-type: redis
    +    type: default
    +    water-mark: \u6211\u7684\u6C34\u5370
    +    slip-offset: 5
    +    aes-status: true
    +    interference-options: 2
    +    font-style: 1
    +    font-size: 25
    +    history-data-clear-enable: false
    +    req-frequency-limit-enable: false
    +    req-get-lock-limit: 5
    +    req-get-lock-seconds: 360
    +    req-get-minute-limit: 30
    +    req-check-minute-limit: 30
    +kafka:
    +  producer:
    +    servers: 127.0.0.1:9092
    +    topic: save_api_data
    +  consumer:
    +    servers: 127.0.0.1:9092
    +    autoCommit: true
    +    autoCommitIntervalMs: 2000
    +    autoOffsetReset: latest
    +    groupId: api_data
    +    topic: save_api_data
    +elasticsearch:
    +  ip: 127.0.0.1:9200
    +  userName: elastic
    +  passWord: elastic
    +bloom-filter:
    +  name: userRegister
    +  expectedInsertions: 1000
    +  falseProbability: 0.01
    +mybatis-plus:
    +  mapper-locations: classpath*:mapper/**/*.xml
    +  global-config:
    +    db-config:
    +      logic-delete-field: status
    +      logic-delete-value: 0
    +      logic-not-delete-value: 1
    +  configuration:
    +    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    +    local-cache-scope: statement
    +feign:
    +  sentinel:
    +    enabled: false
    +  hystrix:
    +    enabled: true
    +  httpclient:
    +    enabled: false
    +  okhttp:
    +    enabled: true
    +  compression:
    +    request:
    +      enabled: true
    +      mime-types: text/xml,application/xml,application/json
    +      min-request-size: 512
    +    response:
    +      enabled: true
    +hystrix:
    +  command:
    +    default:
    +      execution:
    +        timeout:
    +          enabled: true
    +        isolation:
    +          thread:
    +            timeoutInMilliseconds: 10000
    +          semaphore:
    +            maxConcurrentRequests: 99999
    +ribbon:
    +  ReadTimeout: 60000
    +  ConnectTimeout: 60000
    +  MaxAutoRetries: 0
    +  MaxAutoRetriesNextServer: 1
    +management:
    +  endpoints:
    +    web:
    +      exposure:
    +        include: '*'
    +    health:
    +      show-details: always
    +  security:
    +    enabled: false
    +  health:
    +    elasticsearch:
    +      enabled: false
    +jasypt:
    +  encryptor:
    +    password: bgtjkjl!%^sdc
    +    algorithm: PBEWithMD5AndDES
    \ No newline at end of file
    diff --git a/damai-server/damai-single-service/src/main/resources/bootstrap.yml b/damai-server/damai-single-service/src/main/resources/bootstrap.yml
    deleted file mode 100644
    index bbf4ff95103db01c420b5a76acb08b2cb886681e..0000000000000000000000000000000000000000
    --- a/damai-server/damai-single-service/src/main/resources/bootstrap.yml
    +++ /dev/null
    @@ -1,21 +0,0 @@
    -#服务端口
    -server:
    -  port: 6070
    -# 应用名称
    -spring:
    -  application:
    -    name: ${prefix.distinction.name:damai}-single-service
    -  cloud:
    -    nacos:
    -      discovery:
    -        server-addr: 62.234.31.217:8848
    -        username: nacos
    -        password: nacos
    -      config:
    -        server-addr: 62.234.31.217:8848
    -        file-extension: yaml
    -        shared-configs:
    -          - data-id: common.yaml
    -            refresh: true
    -        username: nacos
    -        password: nacos
    \ No newline at end of file
    diff --git a/damai-server/damai-single-service/src/main/resources/log4j2.xml b/damai-server/damai-single-service/src/main/resources/log4j2.xml
    index 01bda486502ff52973a46e25cb2baaa22f82f0d7..ddfbac5d8a5758075f3dc46cc00c4de27910bf4c 100644
    --- a/damai-server/damai-single-service/src/main/resources/log4j2.xml
    +++ b/damai-server/damai-single-service/src/main/resources/log4j2.xml
    @@ -10,10 +10,10 @@
         
             
             .
    -        user-service
    +        single-service
             local
             log
    -        [user-service] [%X{traceId}] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n
    +        [single-service] [%X{traceId}] %d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n
             UTF-8
             com.damai
         
    diff --git a/damai-server/damai-single-service/src/main/resources/shardingsphere-single.yaml b/damai-server/damai-single-service/src/main/resources/shardingsphere-single.yaml
    index 3ad4bb8e81e90874b33b477e56cc98ef29816a4e..e5b41f275a83fa19f91974e12c00ee31daf3506c 100644
    --- a/damai-server/damai-single-service/src/main/resources/shardingsphere-single.yaml
    +++ b/damai-server/damai-single-service/src/main/resources/shardingsphere-single.yaml
    @@ -2,9 +2,9 @@ dataSources:
       ds:
         dataSourceClassName: com.zaxxer.hikari.HikariDataSource
         driverClassName: com.mysql.cj.jdbc.Driver
    -    jdbcUrl: jdbc:mysql://82.157.255.105:3306/damai?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
    +    jdbcUrl: jdbc:mysql://127.0.0.1:3306/damai?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
         username: root
    -    password: qaz321qwe!
    +    password: root
         
     rules:
       # 分库分表规则
    @@ -41,8 +41,8 @@ rules:
               standard:
                 # 使用id作为分片键
                 shardingColumn: id
    -            # 用user_mobile列使用hash取模作为分表算法
    -            shardingAlgorithmName: tableUserHashModModel
    +            # 用user_mobile列使用取模作为分表算法
    +            shardingAlgorithmName: tableUserModModel
           # 对d_ticket_user表进行分表
           d_ticket_user:
             # 库为damai 表为d_ticket_user_0 至 d_ticket_user_1
    @@ -50,10 +50,10 @@ rules:
             # 分表策略      
             tableStrategy:
               standard:
    -            # 使用id作为分片键
    -            shardingColumn: id
    -            # 用user_mobile列使用hash取模作为分表算法
    -            shardingAlgorithmName: tableTicketUserHashModModel
    +            # 使用user_id作为分片键
    +            shardingColumn: user_id
    +            # 用user_id列使用取模作为分表算法
    +            shardingAlgorithmName: tableTicketUserModModel
           # 对d_order表进行分表
           d_order:
             # 库为damai 表为d_order_0 至 d_user_order_3
    @@ -152,13 +152,13 @@ rules:
               # 分表数量
               sharding-count: 2    
           # d_user表分表算法
    -      tableUserHashModModel:
    +      tableUserModModel:
             type: MOD
             props:
               # 分表数量
               sharding-count: 2
           # d_ticket_user表分表算法
    -      tableTicketUserHashModModel:
    +      tableTicketUserModModel:
             type: MOD
             props:
               # 分表数量
    diff --git a/damai-server/damai-user-service/pom.xml b/damai-server/damai-user-service/pom.xml
    index 2ad42833d7fbf16848287fc6e4a7186409092b70..2ac289f50f97da4d7dbb084b3c0edd386a4e14a6 100644
    --- a/damai-server/damai-user-service/pom.xml
    +++ b/damai-server/damai-user-service/pom.xml
    @@ -36,6 +36,11 @@
                 damai-common
                 ${revision}
             
    +        
    +            com.example
    +            damai-service-initialize
    +            ${revision}
    +        
             
                 com.example
                 damai-service-common
    @@ -46,6 +51,11 @@
                 damai-service-lock-framework
                 ${revision}
             
    +        
    +            com.example
    +            damai-bloom-filter-framework
    +            ${revision}
    +        
             
                 com.example
                 damai-user-client
    @@ -134,7 +144,7 @@
                     spring-boot-maven-plugin
                     ${spring-boot.version}
                     
    -                    com.damai.SingleApplication
    +                    com.damai.UserApplication
                         
                         true
                     
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/controller/TicketUserController.java b/damai-server/damai-user-service/src/main/java/com/damai/controller/TicketUserController.java
    index 970b17367c1a69d565d2114438f24bdb483cb5aa..73e9f334a84b9984cec6a0f2ae5638380770b66f 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/controller/TicketUserController.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/controller/TicketUserController.java
    @@ -24,7 +24,7 @@ import java.util.List;
      **/
     @RestController
     @RequestMapping("/ticket/user")
    -@Api(tags = "ticket-user", description = "购票人")
    +@Api(tags = "ticket-user", value = "购票人")
     public class TicketUserController {
         
         @Autowired
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/controller/UserCaptchaController.java b/damai-server/damai-user-service/src/main/java/com/damai/controller/UserCaptchaController.java
    index 92b095f3554cbb843b6aaa081e172621a0db14a9..eb368f7f9fb46d0ef5a19dede17ea927c9cf95f2 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/controller/UserCaptchaController.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/controller/UserCaptchaController.java
    @@ -4,7 +4,7 @@ import com.anji.captcha.model.common.ResponseModel;
     import com.anji.captcha.model.vo.CaptchaVO;
     import com.damai.common.ApiResponse;
     import com.damai.service.UserCaptchaService;
    -import com.damai.vo.CheckVerifyVo;
    +import com.damai.vo.CheckNeedCaptchaDataVo;
     import io.swagger.annotations.Api;
     import io.swagger.annotations.ApiOperation;
     import org.springframework.beans.factory.annotation.Autowired;
    @@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
      **/
     @RestController
     @RequestMapping("/user/captcha")
    -@Api(tags = "captcha", description = "验证码")
    +@Api(tags = "captcha", value = "验证码")
     public class UserCaptchaController {
         
         @Autowired
    @@ -28,7 +28,7 @@ public class UserCaptchaController {
         
         @ApiOperation(value = "检查是否需要验证码")
         @PostMapping(value = "/check/need")
    -    public ApiResponse checkNeedCaptcha(){
    +    public ApiResponse checkNeedCaptcha(){
             return ApiResponse.ok(userCaptchaService.checkNeedCaptcha());
         }
         
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/controller/UserController.java b/damai-server/damai-user-service/src/main/java/com/damai/controller/UserController.java
    index b2fefe902e47856837c20cc38284f3746cbd76fb..483b32c891a798ee5d6d9755753836c5aee7f26b 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/controller/UserController.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/controller/UserController.java
    @@ -6,6 +6,7 @@ import com.damai.dto.UserExistDto;
     import com.damai.dto.UserGetAndTicketUserListDto;
     import com.damai.dto.UserIdDto;
     import com.damai.dto.UserLoginDto;
    +import com.damai.dto.UserLogoutDto;
     import com.damai.dto.UserMobileDto;
     import com.damai.dto.UserRegisterDto;
     import com.damai.dto.UserUpdateDto;
    @@ -32,7 +33,7 @@ import javax.validation.Valid;
      **/
     @RestController
     @RequestMapping("/user")
    -@Api(tags = "user", description = "用户")
    +@Api(tags = "user", value = "用户")
     public class UserController {
         
         @Autowired
    @@ -72,8 +73,8 @@ public class UserController {
         
         @ApiOperation(value = "退出登录")
         @PostMapping(value = "/logout")
    -    public ApiResponse logout(@Valid @RequestBody UserIdDto userIdDto) {
    -        userService.logout(userIdDto);
    +    public ApiResponse logout(@Valid @RequestBody UserLogoutDto userLogoutDto) {
    +        userService.logout(userLogoutDto);
             return ApiResponse.ok();
         }
         
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/entity/TicketUser.java b/damai-server/damai-user-service/src/main/java/com/damai/entity/TicketUser.java
    index 9b21f2160812a159064b1153d6ae5ae45178dbd1..33dd4b8e773c31badc300f847479f12700b38ec5 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/entity/TicketUser.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/entity/TicketUser.java
    @@ -1,7 +1,7 @@
     package com.damai.entity;
     
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -13,7 +13,7 @@ import java.io.Serializable;
      **/
     @Data
     @TableName("d_ticket_user")
    -public class TicketUser extends BaseData implements Serializable {
    +public class TicketUser extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/entity/User.java b/damai-server/damai-user-service/src/main/java/com/damai/entity/User.java
    index 6d2cbf27f696df1022f8c912b933f00532af866a..0b072901ed7a3486c0a117c64abd94965ef79e57 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/entity/User.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/entity/User.java
    @@ -1,7 +1,7 @@
     package com.damai.entity;
     
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -13,7 +13,7 @@ import java.io.Serializable;
      **/
     @Data
     @TableName("d_user")
    -public class User extends BaseData implements Serializable {
    +public class User extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/entity/UserEmail.java b/damai-server/damai-user-service/src/main/java/com/damai/entity/UserEmail.java
    index 5b0a29babf2cddef755bbcc7f486049eeae6eed8..e9e9c70d1aa12f777148b78b5ad1354483512f68 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/entity/UserEmail.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/entity/UserEmail.java
    @@ -1,7 +1,7 @@
     package com.damai.entity;
     
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -13,7 +13,7 @@ import java.io.Serializable;
      **/
     @Data
     @TableName("d_user_email")
    -public class UserEmail extends BaseData implements Serializable {
    +public class UserEmail extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/entity/UserMobile.java b/damai-server/damai-user-service/src/main/java/com/damai/entity/UserMobile.java
    index 10c8aa46e43c6b4ff60019f5cc857aa42bca8962..fe0421f33eba5e834557289633bd295835fa467e 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/entity/UserMobile.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/entity/UserMobile.java
    @@ -1,7 +1,7 @@
     package com.damai.entity;
     
     import com.baomidou.mybatisplus.annotation.TableName;
    -import com.damai.data.BaseData;
    +import com.damai.data.BaseTableData;
     import lombok.Data;
     
     import java.io.Serializable;
    @@ -13,7 +13,7 @@ import java.io.Serializable;
      **/
     @Data
     @TableName("d_user_mobile")
    -public class UserMobile extends BaseData implements Serializable {
    +public class UserMobile extends BaseTableData implements Serializable {
     
         private static final long serialVersionUID = 1L;
     
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/service/TicketUserService.java b/damai-server/damai-user-service/src/main/java/com/damai/service/TicketUserService.java
    index b3733743272f6ef424c1ce1a0f0ae4eb2edb9833..8caddfe91b52929f28bb5ff3db09b95424b789f2 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/service/TicketUserService.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/service/TicketUserService.java
    @@ -2,10 +2,12 @@ package com.damai.service;
     
     
     import cn.hutool.core.bean.BeanUtil;
    +import cn.hutool.core.collection.CollectionUtil;
     import com.baidu.fsg.uid.UidGenerator;
     import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
     import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    +import com.damai.core.RedisKeyManage;
     import com.damai.dto.TicketUserDto;
     import com.damai.dto.TicketUserIdDto;
     import com.damai.dto.TicketUserListDto;
    @@ -15,6 +17,8 @@ import com.damai.enums.BaseCode;
     import com.damai.exception.DaMaiFrameException;
     import com.damai.mapper.TicketUserMapper;
     import com.damai.mapper.UserMapper;
    +import com.damai.redis.RedisCache;
    +import com.damai.redis.RedisKeyBuild;
     import com.damai.vo.TicketUserVo;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Service;
    @@ -40,7 +44,16 @@ public class TicketUserService extends ServiceImpl
         @Autowired
         private UidGenerator uidGenerator;
         
    +    @Autowired
    +    private RedisCache redisCache;
    +    
         public List select(TicketUserListDto ticketUserListDto) {
    +        //先从缓存中查询
    +        List ticketUserVoList = redisCache.getValueIsList(RedisKeyBuild.createRedisKey(
    +                RedisKeyManage.TICKET_USER_LIST, ticketUserListDto.getUserId()), TicketUserVo.class);
    +        if (CollectionUtil.isNotEmpty(ticketUserVoList)) {
    +            return ticketUserVoList;
    +        }
             LambdaQueryWrapper ticketUserLambdaQueryWrapper = Wrappers.lambdaQuery(TicketUser.class)
                     .eq(TicketUser::getUserId, ticketUserListDto.getUserId());
             List ticketUsers = ticketUserMapper.selectList(ticketUserLambdaQueryWrapper);
    @@ -48,7 +61,7 @@ public class TicketUserService extends ServiceImpl
         }
         
         @Transactional(rollbackFor = Exception.class)
    -    public void add(final TicketUserDto ticketUserDto) {
    +    public void add(TicketUserDto ticketUserDto) {
             User user = userMapper.selectById(ticketUserDto.getUserId());
             if (Objects.isNull(user)) {
                 throw new DaMaiFrameException(BaseCode.USER_EMPTY);
    @@ -63,15 +76,21 @@ public class TicketUserService extends ServiceImpl
             }
             TicketUser addTicketUser = new TicketUser();
             BeanUtil.copyProperties(ticketUserDto,addTicketUser);
    -        addTicketUser.setId(uidGenerator.getUID());
    +        addTicketUser.setId(uidGenerator.getUid());
             ticketUserMapper.insert(addTicketUser);
    +        delTicketUserVoListCache(String.valueOf(ticketUserDto.getUserId()));
         }
         @Transactional(rollbackFor = Exception.class)
    -    public void delete(final TicketUserIdDto ticketUserIdDto) {
    +    public void delete(TicketUserIdDto ticketUserIdDto) {
             TicketUser ticketUser = ticketUserMapper.selectById(ticketUserIdDto.getId());
             if (Objects.isNull(ticketUser)) {
                 throw new DaMaiFrameException(BaseCode.TICKET_USER_EMPTY);
             }
             ticketUserMapper.deleteById(ticketUserIdDto.getId());
    +        delTicketUserVoListCache(String.valueOf(ticketUser.getUserId()));
    +    }
    +    
    +    public void delTicketUserVoListCache(String userId){
    +        redisCache.del(RedisKeyBuild.createRedisKey(RedisKeyManage.TICKET_USER_LIST, userId));
         }
     }
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/service/TokenService.java b/damai-server/damai-user-service/src/main/java/com/damai/service/TokenService.java
    index f887511f63ce02516c63ca09f741fdaa13013897..69de8951a23e1537814a91817bb557a80b477175 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/service/TokenService.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/service/TokenService.java
    @@ -1,13 +1,13 @@
     package com.damai.service;
     
     import com.alibaba.fastjson.JSONObject;
    -import com.damai.core.RedisKeyEnum;
    -import com.damai.core.StringUtil;
    +import com.damai.core.RedisKeyManage;
    +import com.damai.util.StringUtil;
     import com.damai.enums.BaseCode;
     import com.damai.exception.DaMaiFrameException;
     import com.damai.jwt.TokenUtil;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
     import com.damai.vo.UserVo;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Component;
    @@ -40,7 +40,7 @@ public class TokenService {
             UserVo userVo = null;
             String userId = parseToken(token);
             if (StringUtil.isNotEmpty(userId)) {
    -            userVo = redisCache.get(RedisKeyWrap.createRedisKey(RedisKeyEnum.USER_ID, userId), UserVo.class);
    +            userVo = redisCache.get(RedisKeyBuild.createRedisKey(RedisKeyManage.USER_LOGIN, userId), UserVo.class);
             }
             return Optional.ofNullable(userVo).orElseThrow(() -> new DaMaiFrameException(BaseCode.USER_EMPTY));
         }
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/service/UserCaptchaService.java b/damai-server/damai-user-service/src/main/java/com/damai/service/UserCaptchaService.java
    index 40e14435255784ce45549c2e33381f834879e5f1..c959eb85c18b4fb24c0f15be0a846a8a0c74579b 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/service/UserCaptchaService.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/service/UserCaptchaService.java
    @@ -2,33 +2,61 @@ package com.damai.service;
     
     import com.anji.captcha.model.common.ResponseModel;
     import com.anji.captcha.model.vo.CaptchaVO;
    -import com.damai.service.tool.RequestCounter;
    -import com.damai.vo.CheckVerifyVo;
    +import com.baidu.fsg.uid.UidGenerator;
    +import com.damai.core.RedisKeyManage;
    +import com.damai.redis.RedisKeyBuild;
    +import com.damai.service.lua.CheckNeedCaptchaOperate;
    +import com.damai.vo.CheckNeedCaptchaDataVo;
     import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.beans.factory.annotation.Value;
     import org.springframework.stereotype.Service;
     
    +import java.util.ArrayList;
    +import java.util.List;
    +
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 验证码 service
    + * @description: 判断是否需要验证码
      * @author: 阿宽不是程序员
      **/
     @Service
     public class UserCaptchaService {
         
    +    @Value("${verify_captcha_threshold:10}")
    +    private int verifyCaptchaThreshold;
    +    
    +    @Value("${verify_captcha_id_expire_time:60}")
    +    private int verifyCaptchaIdExpireTime;
    +    
    +    @Value("${always_verify_captcha:0}")
    +    private int alwaysVerifyCaptcha;
    +    
         @Autowired
         private CaptchaHandle captchaHandle;
         
         @Autowired
    -    private RequestCounter requestCounter;
    -    
    -    public CheckVerifyVo checkNeedCaptcha() {
    -        CheckVerifyVo checkVerifyVo = new CheckVerifyVo();
    -        checkVerifyVo.setType(0);
    -        boolean result = requestCounter.onRequest();
    -        if (result) {
    -            checkVerifyVo.setType(1);
    -        }
    -        return checkVerifyVo;
    +    private UidGenerator uidGenerator;
    +    
    +    @Autowired
    +    private CheckNeedCaptchaOperate checkNeedCaptchaOperate;
    +    
    +    public CheckNeedCaptchaDataVo checkNeedCaptcha() {
    +        long currentTimeMillis = System.currentTimeMillis();
    +        long id = uidGenerator.getUid();
    +        List keys = new ArrayList<>();
    +        keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.COUNTER_COUNT).getRelKey());
    +        keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.COUNTER_TIMESTAMP).getRelKey());
    +        keys.add(RedisKeyBuild.createRedisKey(RedisKeyManage.VERIFY_CAPTCHA_ID,id).getRelKey());
    +        String[] data = new String[4];
    +        data[0] = String.valueOf(verifyCaptchaThreshold);
    +        data[1] = String.valueOf(currentTimeMillis);
    +        data[2] = String.valueOf(verifyCaptchaIdExpireTime);
    +        data[3] = String.valueOf(alwaysVerifyCaptcha);
    +        Boolean result = checkNeedCaptchaOperate.checkNeedCaptchaOperate(keys, data);
    +        CheckNeedCaptchaDataVo checkNeedCaptchaDataVo = new CheckNeedCaptchaDataVo();
    +        checkNeedCaptchaDataVo.setCaptchaId(id);
    +        checkNeedCaptchaDataVo.setVerifyCaptcha(result);
    +        return checkNeedCaptchaDataVo;
         }
         
         public ResponseModel getCaptcha(CaptchaVO captchaVO) {
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/service/UserService.java b/damai-server/damai-user-service/src/main/java/com/damai/service/UserService.java
    index 8c2664a1e7188efba5735f0fc1affe755f18d99d..3bf1fca7b4f266c3374575c980badef5ce40466c 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/service/UserService.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/service/UserService.java
    @@ -7,14 +7,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
     import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
     import com.baomidou.mybatisplus.core.toolkit.Wrappers;
     import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    -import com.damai.composite.CompositeContainer;
    -import com.damai.core.RedisKeyEnum;
    -import com.damai.core.StringUtil;
    +import com.damai.client.BaseDataClient;
    +import com.damai.common.ApiResponse;
    +import com.damai.core.RedisKeyManage;
    +import com.damai.util.StringUtil;
    +import com.damai.dto.GetChannelDataByCodeDto;
     import com.damai.dto.UserAuthenticationDto;
     import com.damai.dto.UserExistDto;
     import com.damai.dto.UserGetAndTicketUserListDto;
     import com.damai.dto.UserIdDto;
     import com.damai.dto.UserLoginDto;
    +import com.damai.dto.UserLogoutDto;
     import com.damai.dto.UserMobileDto;
     import com.damai.dto.UserRegisterDto;
     import com.damai.dto.UserUpdateDto;
    @@ -29,16 +32,18 @@ import com.damai.enums.BaseCode;
     import com.damai.enums.BusinessStatus;
     import com.damai.enums.CompositeCheckType;
     import com.damai.exception.DaMaiFrameException;
    +import com.damai.handler.BloomFilterHandler;
    +import com.damai.initialize.impl.composite.CompositeContainer;
     import com.damai.jwt.TokenUtil;
     import com.damai.mapper.TicketUserMapper;
     import com.damai.mapper.UserEmailMapper;
     import com.damai.mapper.UserMapper;
     import com.damai.mapper.UserMobileMapper;
     import com.damai.redis.RedisCache;
    -import com.damai.redis.RedisKeyWrap;
    +import com.damai.redis.RedisKeyBuild;
     import com.damai.servicelock.LockType;
     import com.damai.servicelock.annotion.ServiceLock;
    -import com.damai.util.RBloomFilterUtil;
    +import com.damai.vo.GetChannelDataVo;
     import com.damai.vo.TicketUserVo;
     import com.damai.vo.UserGetAndTicketUserListVo;
     import com.damai.vo.UserVo;
    @@ -66,8 +71,6 @@ import static com.damai.core.DistributedLockConstants.REGISTER_USER_LOCK;
     @Service
     public class UserService extends ServiceImpl {
         
    -    private static final String TOKEN_SECRET = "CSYZWECHAT";
    -    
         @Autowired
         private UserMapper userMapper;
         
    @@ -87,12 +90,15 @@ public class UserService extends ServiceImpl {
         private TicketUserMapper ticketUserMapper;
         
         @Autowired
    -    private RBloomFilterUtil rBloomFilterUtil;
    +    private BloomFilterHandler bloomFilterHandler;
         
         @Autowired
         private CompositeContainer compositeContainer;
         
    -    @Value("${token.expire.time:86400000}")
    +    @Autowired
    +    private BaseDataClient baseDataClient;
    +    
    +    @Value("${token.expire.time:40}")
         private Long tokenExpireTime;
         
         @Transactional(rollbackFor = Exception.class)
    @@ -102,15 +108,15 @@ public class UserService extends ServiceImpl {
             //用户表添加
             User user = new User();
             BeanUtils.copyProperties(userRegisterDto,user);
    -        user.setId(uidGenerator.getUID());
    +        user.setId(uidGenerator.getUid());
             userMapper.insert(user);
             //用户手机表添加
             UserMobile userMobile = new UserMobile();
    -        userMobile.setId(uidGenerator.getUID());
    +        userMobile.setId(uidGenerator.getUid());
             userMobile.setUserId(user.getId());
             userMobile.setMobile(userRegisterDto.getMobile());
             userMobileMapper.insert(userMobile);
    -        rBloomFilterUtil.add(userMobile.getMobile());
    +        bloomFilterHandler.add(userMobile.getMobile());
         }
         
         @ServiceLock(lockType= LockType.Read,name = REGISTER_USER_LOCK,keys = {"#mobile"})
    @@ -119,7 +125,7 @@ public class UserService extends ServiceImpl {
         }
         
         public void doExist(String mobile){
    -        boolean contains = rBloomFilterUtil.contains(mobile);
    +        boolean contains = bloomFilterHandler.contains(mobile);
             if (contains) {
                 LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(UserMobile.class)
                         .eq(UserMobile::getMobile, mobile);
    @@ -131,8 +137,10 @@ public class UserService extends ServiceImpl {
         }
         
         public String login(UserLoginDto userLoginDto) {
    +        String code = userLoginDto.getCode();
             String mobile = userLoginDto.getMobile();
             String email = userLoginDto.getEmail();
    +        String password = userLoginDto.getPassword();
             if (StringUtil.isEmpty(mobile) && StringUtil.isEmpty(email)) {
                 throw new DaMaiFrameException(BaseCode.USER_MOBILE_AND_EMAIL_NOT_EXIST);
             }
    @@ -155,30 +163,54 @@ public class UserService extends ServiceImpl {
                 userId = userEmail.getUserId();
             }
             
    -        Boolean loginResult = redisCache.hasKey(RedisKeyWrap.createRedisKey(RedisKeyEnum.USER_ID,userId));
    +        Boolean loginResult = redisCache.hasKey(RedisKeyBuild.createRedisKey(RedisKeyManage.USER_LOGIN,code,userId));
             if (loginResult) {
                 throw new DaMaiFrameException(BaseCode.USER_LOG_IN);
             }
    -        User user = userMapper.selectById(userId);
    +        LambdaQueryWrapper queryUserWrapper = Wrappers.lambdaQuery(User.class)
    +                .eq(User::getId, userId).eq(User::getPassword, password);
    +        User user = userMapper.selectOne(queryUserWrapper);
             if (Objects.isNull(user)) {
    -            throw new DaMaiFrameException(BaseCode.USER_EMPTY);
    +            throw new DaMaiFrameException(BaseCode.NAME_PASSWORD_ERROR);
    +        }
    +        redisCache.set(RedisKeyBuild.createRedisKey(RedisKeyManage.USER_LOGIN,code,user.getId()),user,
    +                tokenExpireTime,TimeUnit.MINUTES);
    +        return createToken(user.getId(),getChannelDataByCode(code).getTokenSecret());
    +    }
    +    private GetChannelDataVo getChannelDataByCode(String code){
    +        GetChannelDataVo channelDataVo = getChannelDataByRedis(code);
    +        if (Objects.isNull(channelDataVo)) {
    +            channelDataVo = getChannelDataByClient(code);
             }
    -        redisCache.set(RedisKeyWrap.createRedisKey(RedisKeyEnum.USER_ID,user.getId()),user,tokenExpireTime + 1000,TimeUnit.MILLISECONDS);
    -        return createToken(user.getId());
    +        return channelDataVo;
         }
         
    -    public String createToken(Long userId){
    +    private GetChannelDataVo getChannelDataByRedis(String code){
    +        return redisCache.get(RedisKeyBuild.createRedisKey(RedisKeyManage.CHANNEL_DATA,code),GetChannelDataVo.class);
    +    }
    +    
    +    private GetChannelDataVo getChannelDataByClient(String code){
    +        GetChannelDataByCodeDto getChannelDataByCodeDto = new GetChannelDataByCodeDto();
    +        getChannelDataByCodeDto.setCode(code);
    +        ApiResponse getChannelDataApiResponse = baseDataClient.getByCode(getChannelDataByCodeDto);
    +        if (Objects.equals(getChannelDataApiResponse.getCode(), BaseCode.SUCCESS.getCode())) {
    +            return getChannelDataApiResponse.getData();
    +        }
    +        throw new DaMaiFrameException("没有找到ChannelData");
    +    }
    +    
    +    public String createToken(Long userId,String tokenSecret){
             Map map = new HashMap<>(4);
             map.put("userId",userId);
    -        return TokenUtil.createToken(String.valueOf(uidGenerator.getUID()), JSON.toJSONString(map),tokenExpireTime,TOKEN_SECRET);
    +        return TokenUtil.createToken(String.valueOf(uidGenerator.getUid()), JSON.toJSONString(map),tokenExpireTime * 60 * 1000,tokenSecret);
         }
         
    -    public void logout(UserIdDto userIdDto) {
    -        User user = userMapper.selectById(userIdDto.getId());
    +    public void logout(UserLogoutDto userLogoutDto) {
    +        User user = userMapper.selectById(userLogoutDto.getId());
             if (Objects.isNull(user)) {
                 throw new DaMaiFrameException(BaseCode.USER_EMPTY);
             }
    -        redisCache.del(RedisKeyWrap.createRedisKey(RedisKeyEnum.USER_ID,user.getId()));
    +        redisCache.del(RedisKeyBuild.createRedisKey(RedisKeyManage.USER_LOGIN,userLogoutDto.getCode(),user.getId()));
         }
         @Transactional(rollbackFor = Exception.class)
         public void update(UserUpdateDto userUpdateDto){
    @@ -217,7 +249,7 @@ public class UserService extends ServiceImpl {
             UserEmail userEmail = userEmailMapper.selectOne(userEmailLambdaQueryWrapper);
             if (Objects.isNull(userEmail)) {
                 userEmail = new UserEmail();
    -            userEmail.setId(uidGenerator.getUID());
    +            userEmail.setId(uidGenerator.getUid());
                 userEmail.setUserId(user.getId());
                 userEmail.setEmail(userUpdateEmailDto.getEmail());
                 userEmailMapper.insert(userEmail);
    @@ -231,29 +263,29 @@ public class UserService extends ServiceImpl {
         }
         
         @Transactional(rollbackFor = Exception.class)
    -    public void updateMobile(UserUpdateMobileDto UserUpdateMobileDto){
    -        User user = userMapper.selectById(UserUpdateMobileDto.getId());
    +    public void updateMobile(UserUpdateMobileDto userUpdateMobileDto){
    +        User user = userMapper.selectById(userUpdateMobileDto.getId());
             if (Objects.isNull(user)) {
                 throw new DaMaiFrameException(BaseCode.USER_EMPTY);
             }
             String oldMobile = user.getMobile();
             User updateUser = new User();
    -        BeanUtil.copyProperties(UserUpdateMobileDto,updateUser);
    +        BeanUtil.copyProperties(userUpdateMobileDto,updateUser);
             userMapper.updateById(updateUser);
             LambdaQueryWrapper userMobileLambdaQueryWrapper = Wrappers.lambdaQuery(UserMobile.class)
    -                .eq(UserMobile::getMobile, UserUpdateMobileDto.getMobile());
    +                .eq(UserMobile::getMobile, userUpdateMobileDto.getMobile());
             UserMobile userMobile = userMobileMapper.selectOne(userMobileLambdaQueryWrapper);
             if (Objects.isNull(userMobile)) {
                 userMobile = new UserMobile();
    -            userMobile.setId(uidGenerator.getUID());
    +            userMobile.setId(uidGenerator.getUid());
                 userMobile.setUserId(user.getId());
    -            userMobile.setMobile(UserUpdateMobileDto.getMobile());
    +            userMobile.setMobile(userUpdateMobileDto.getMobile());
                 userMobileMapper.insert(userMobile);
             }else {
                 LambdaUpdateWrapper userMobileLambdaUpdateWrapper = Wrappers.lambdaUpdate(UserMobile.class)
                         .eq(UserMobile::getMobile, oldMobile);
                 UserMobile updateUserMobile = new UserMobile();
    -            updateUserMobile.setMobile(UserUpdateMobileDto.getMobile());
    +            updateUserMobile.setMobile(userUpdateMobileDto.getMobile());
                 userMobileMapper.update(updateUserMobile,userMobileLambdaUpdateWrapper);
             }
         }
    @@ -308,7 +340,7 @@ public class UserService extends ServiceImpl {
             UserVo userVo = getById(userIdDto);
             
             LambdaQueryWrapper ticketUserLambdaQueryWrapper = Wrappers.lambdaQuery(TicketUser.class)
    -                .in(TicketUser::getId, userGetAndTicketUserListDto.getTicketUserIdList());
    +                .eq(TicketUser::getUserId, userGetAndTicketUserListDto.getUserId());
             List ticketUserList = ticketUserMapper.selectList(ticketUserLambdaQueryWrapper);
             List ticketUserVoList = BeanUtil.copyToList(ticketUserList, TicketUserVo.class);
             
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/service/composite/register/AbstractUserRegisterCheckHandler.java b/damai-server/damai-user-service/src/main/java/com/damai/service/composite/register/AbstractUserRegisterCheckHandler.java
    new file mode 100644
    index 0000000000000000000000000000000000000000..d331d68e73ec2031a22fc3abd3a8af5eb7130334
    --- /dev/null
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/service/composite/register/AbstractUserRegisterCheckHandler.java
    @@ -0,0 +1,20 @@
    +package com.damai.service.composite.register;
    +
    +
    +import com.damai.dto.UserRegisterDto;
    +import com.damai.enums.CompositeCheckType;
    +import com.damai.initialize.impl.composite.AbstractComposite;
    +
    +
    +/**
    + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    + * @description: 用户注册验证基类,用户注册的相关验证逻辑继承此类
    + * @author: 阿宽不是程序员
    + **/
    +public abstract class AbstractUserRegisterCheckHandler extends AbstractComposite {
    +    
    +    @Override
    +    public String type() {
    +        return CompositeCheckType.USER_REGISTER_CHECK.getValue();
    +    }
    +}
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/service/composite/UserExistCheckHandler.java b/damai-server/damai-user-service/src/main/java/com/damai/service/composite/register/impl/UserExistCheckHandler.java
    similarity index 68%
    rename from damai-server/damai-user-service/src/main/java/com/damai/service/composite/UserExistCheckHandler.java
    rename to damai-server/damai-user-service/src/main/java/com/damai/service/composite/register/impl/UserExistCheckHandler.java
    index d8d21848aee1b6cb157179e0185386b2ed2a1553..33f31a1c85ec13c110072385de6ad5f7e236e120 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/service/composite/UserExistCheckHandler.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/service/composite/register/impl/UserExistCheckHandler.java
    @@ -1,9 +1,8 @@
    -package com.damai.service.composite;
    +package com.damai.service.composite.register.impl;
     
    -import com.damai.composite.AbstractComposite;
     import com.damai.dto.UserRegisterDto;
    -import com.damai.enums.CompositeCheckType;
     import com.damai.service.UserService;
    +import com.damai.service.composite.register.AbstractUserRegisterCheckHandler;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Component;
     
    @@ -13,23 +12,15 @@ import org.springframework.stereotype.Component;
      * @author: 阿宽不是程序员
      **/
     @Component
    -public class UserExistCheckHandler extends AbstractComposite {
    +public class UserExistCheckHandler extends AbstractUserRegisterCheckHandler {
     
         @Autowired
         private UserService userService;
    -
    -    /**
    -     * 验证是否已注册用户
    -     * */
    +    
         @Override
         public void execute(final UserRegisterDto userRegisterDto) {
             userService.doExist(userRegisterDto.getMobile());
         }
    -
    -    @Override
    -    public String type() {
    -        return CompositeCheckType.USER_REGISTER_CHECK.getValue();
    -    }
         
         @Override
         public Integer executeParentOrder() {
    @@ -38,7 +29,7 @@ public class UserExistCheckHandler extends AbstractComposite {
         
         @Override
         public Integer executeTier() {
    -        return 2;
    +        return 3;
         }
     
         @Override
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/service/composite/UserRegisterCountCheckHandler.java b/damai-server/damai-user-service/src/main/java/com/damai/service/composite/register/impl/UserRegisterCountCheckHandler.java
    similarity index 68%
    rename from damai-server/damai-user-service/src/main/java/com/damai/service/composite/UserRegisterCountCheckHandler.java
    rename to damai-server/damai-user-service/src/main/java/com/damai/service/composite/register/impl/UserRegisterCountCheckHandler.java
    index b74019a6b983e95d9f1aaddb0028ca6519e0135f..7c5be083bd22c543eb6e2fa12a0fed876491e6a4 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/service/composite/UserRegisterCountCheckHandler.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/service/composite/register/impl/UserRegisterCountCheckHandler.java
    @@ -1,28 +1,24 @@
    -package com.damai.service.composite;
    +package com.damai.service.composite.register.impl;
     
    -import com.damai.composite.AbstractComposite;
     import com.damai.dto.UserRegisterDto;
     import com.damai.enums.BaseCode;
    -import com.damai.enums.CompositeCheckType;
     import com.damai.exception.DaMaiFrameException;
    +import com.damai.service.composite.register.AbstractUserRegisterCheckHandler;
     import com.damai.service.tool.RequestCounter;
     import org.springframework.beans.factory.annotation.Autowired;
     import org.springframework.stereotype.Component;
     
     /**
      * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: 用户注册tps检查
    + * @description: 用户注册请求数检查
      * @author: 阿宽不是程序员
      **/
     @Component
    -public class UserRegisterCountCheckHandler extends AbstractComposite {
    +public class UserRegisterCountCheckHandler extends AbstractUserRegisterCheckHandler {
         
         @Autowired
         private RequestCounter requestCounter;
         
    -    /**
    -     * 验证每秒用户注册请求是否超过最大限制
    -     * */
         @Override
         protected void execute(final UserRegisterDto param) {
             boolean result = requestCounter.onRequest();
    @@ -31,19 +27,14 @@ public class UserRegisterCountCheckHandler extends AbstractComposite {
    +public class UserRegisterVerifyCaptcha extends AbstractUserRegisterCheckHandler {
         
         @Autowired
         private CaptchaHandle captchaHandle;
         
    -    /**
    -     * 验证验证码是否正确
    -     * */
    +    @Autowired
    +    private RedisCache redisCache;
    +    
         @Override
         protected void execute(UserRegisterDto param) {
    -        if (StringUtil.isNotEmpty(param.getCaptchaType())) {
    +        String verifyCaptcha = redisCache.get(RedisKeyBuild.createRedisKey(RedisKeyManage.VERIFY_CAPTCHA_ID,param.getCaptchaId()), String.class);
    +        if (StringUtil.isEmpty(verifyCaptcha)) {
    +            throw new DaMaiFrameException(BaseCode.VERIFY_CAPTCHA_ID_NOT_EXIST);
    +        }
    +        if (VerifyCaptcha.YES.getValue().equals(verifyCaptcha)) {
    +            if (StringUtil.isEmpty(param.getCaptchaType())) {
    +                throw new DaMaiFrameException(BaseCode.CAPTCHA_TYPE_EMPTY);
    +            }
    +            if (StringUtil.isEmpty(param.getPointJson())) {
    +                throw new DaMaiFrameException(BaseCode.POINT_JSON_EMPTY);
    +            }
    +            if (StringUtil.isEmpty(param.getToken())) {
    +                throw new DaMaiFrameException(BaseCode.CAPTCHA_TOKEN_JSON_EMPTY);
    +            }
                 CaptchaVO captchaVO = new CaptchaVO();
                 captchaVO.setCaptchaType(param.getCaptchaType());
                 captchaVO.setPointJson(param.getPointJson());
    @@ -39,19 +56,14 @@ public class UserRegisterVerifyCaptcha extends AbstractComposite redisScript;
    +    
    +    @Override
    +    public Integer executeOrder() {
    +        return 1;
    +    }
    +    
    +    @Override
    +    public void executeInit(final ConfigurableApplicationContext context) {
    +        try {
    +            redisScript = new DefaultRedisScript<>();
    +            redisScript.setScriptSource(new ResourceScriptSource(new ClassPathResource("lua/checkNeedCaptcha.lua")));
    +            redisScript.setResultType(String.class);
    +        } catch (Exception e) {
    +            log.error("redisScript init lua error",e);
    +        }
    +    }
    +    
    +    public Boolean checkNeedCaptchaOperate(List keys, String[] args){
    +        Object object = redisCache.getInstance().execute(redisScript, keys, args);
    +        return Boolean.parseBoolean((String)object);
    +    }
    +}
    diff --git a/damai-server/damai-user-service/src/main/java/com/damai/service/tool/RequestCounter.java b/damai-server/damai-user-service/src/main/java/com/damai/service/tool/RequestCounter.java
    index 444e5c4dc11605c57a5e9a61b71a692ef989302d..443d4a334bba719fd468938056beb285f009e626 100644
    --- a/damai-server/damai-user-service/src/main/java/com/damai/service/tool/RequestCounter.java
    +++ b/damai-server/damai-user-service/src/main/java/com/damai/service/tool/RequestCounter.java
    @@ -1,5 +1,6 @@
     package com.damai.service.tool;
     
    +import lombok.extern.slf4j.Slf4j;
     import org.springframework.beans.factory.annotation.Value;
     import org.springframework.stereotype.Component;
     
    @@ -10,27 +11,26 @@ import java.util.concurrent.atomic.AtomicLong;
      * @description: 计数器
      * @author: 阿宽不是程序员
      **/
    +@Slf4j
     @Component
     public class RequestCounter {
         
         private final AtomicInteger count = new AtomicInteger(0);
         private final AtomicLong lastResetTime = new AtomicLong(System.currentTimeMillis());
    -    @Value("${request_count_threshold:100}")
    -    private int MAX_REQUESTS_PER_SECOND = 100;
    -    
    +    @Value("${request_count_threshold:1000}")
    +    private int maxRequestsPerSecond = 1000;
         
         public synchronized boolean onRequest() {
             long currentTime = System.currentTimeMillis();
    -        // 如果当前时间和上次重置时间差超过1秒
    -        if (currentTime - lastResetTime.get() >= 1000) {
    -            count.set(0); // 重置计数器
    -            lastResetTime.set(currentTime); // 更新重置时间
    +        long differenceValue = 1000;
    +        if (currentTime - lastResetTime.get() >= differenceValue) {
    +            count.set(0);
    +            lastResetTime.set(currentTime);
             }
             
    -        if (count.incrementAndGet() > MAX_REQUESTS_PER_SECOND) {
    -            System.out.println("请求超过每秒100次限制");
    -            count.set(0); // 超过限制后重置计数器
    -            // 更新重置时间
    +        if (count.incrementAndGet() > maxRequestsPerSecond) {
    +            log.warn("请求超过每秒{}次限制",maxRequestsPerSecond);
    +            count.set(0);
                 lastResetTime.set(System.currentTimeMillis());
                 return true;
             }
    diff --git a/damai-server/damai-user-service/src/main/resources/application.yml b/damai-server/damai-user-service/src/main/resources/application.yml
    new file mode 100644
    index 0000000000000000000000000000000000000000..5efce8cfdd3c99f0efc463e0189fb588830cb1a8
    --- /dev/null
    +++ b/damai-server/damai-user-service/src/main/resources/application.yml
    @@ -0,0 +1,112 @@
    +#服务端口
    +server:
    +  port: 6082
    +# 应用名称
    +spring:
    +  application:
    +    name: ${prefix.distinction.name:damai}-user-service
    +  main:
    +    allow-bean-definition-overriding: true
    +  mvc:
    +    pathmatch:
    +      matching-strategy: ant_path_matcher
    +    servlet:
    +      load-on-startup: 1
    +    jackson:
    +      time-zone: GMT+8
    +      date-format: yyyy-MM-dd HH:mm:ss
    +      generator:
    +        WRITE_NUMBERS_AS_STRINGS: true
    +  datasource:
    +    driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
    +    url: jdbc:shardingsphere:classpath:shardingsphere-user.yaml
    +  redis:
    +    database: 0
    +    host: 127.0.0.1
    +    port: 6379
    +    timeout: 3000
    +  cloud:
    +    nacos:
    +      discovery:
    +        server-addr: 127.0.0.1:8848
    +        username: nacos
    +        password: nacos
    +bloom-filter:
    +  name: userRegister
    +  expectedInsertions: 1000
    +  falseProbability: 0.01
    +aj:
    +  captcha:
    +    cache-type: redis
    +    type: default
    +    water-mark: \u6211\u7684\u6C34\u5370
    +    slip-offset: 5
    +    aes-status: true
    +    interference-options: 2
    +    font-style: 1
    +    font-size: 25
    +    history-data-clear-enable: false
    +    req-frequency-limit-enable: false
    +    req-get-lock-limit: 5
    +    req-get-lock-seconds: 360
    +    req-get-minute-limit: 30
    +    req-check-minute-limit: 30  
    +mybatis-plus:
    +  mapper-locations: classpath:mapper/*.xml
    +  global-config:
    +    db-config:
    +      logic-delete-field: status
    +      logic-delete-value: 0
    +      logic-not-delete-value: 1
    +  configuration:
    +    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    +    local-cache-scope: statement
    +feign:
    +  sentinel:
    +    enabled: false
    +  hystrix:
    +    enabled: true
    +  httpclient:
    +    enabled: false
    +  okhttp:
    +    enabled: true
    +  compression:
    +    request:
    +      enabled: true
    +      mime-types: text/xml,application/xml,application/json
    +      min-request-size: 512
    +    response:
    +      enabled: true
    +hystrix:
    +  command:
    +    default:
    +      execution:
    +        timeout:
    +          enabled: true
    +        isolation:
    +          thread:
    +            timeoutInMilliseconds: 10000
    +          semaphore:
    +            maxConcurrentRequests: 99999
    +ribbon:
    +  ReadTimeout: 60000
    +  ConnectTimeout: 60000
    +  MaxAutoRetries: 0
    +  MaxAutoRetriesNextServer: 1
    +management:
    +  endpoints:
    +    web:
    +      exposure:
    +        include: '*'
    +    health:
    +      show-details: always
    +  security:
    +    enabled: false
    +  health:
    +    elasticsearch:
    +      enabled: false
    +jasypt:
    +  encryptor:
    +    password: bgtjkjl!%^sdc
    +    algorithm: PBEWithMD5AndDES
    +    
    \ No newline at end of file
    diff --git a/damai-server/damai-user-service/src/main/resources/bootstrap.yml b/damai-server/damai-user-service/src/main/resources/bootstrap.yml
    deleted file mode 100644
    index 8767d9131f3bdc4e506b9a77a077fb7bc63bcd6c..0000000000000000000000000000000000000000
    --- a/damai-server/damai-user-service/src/main/resources/bootstrap.yml
    +++ /dev/null
    @@ -1,22 +0,0 @@
    -#服务端口
    -server:
    -  port: 6082
    -# 应用名称
    -spring:
    -  application:
    -    name: ${prefix.distinction.name:damai}-user-service
    -  cloud:
    -    nacos:
    -      discovery:
    -        server-addr: 62.234.31.217:8848
    -        username: nacos
    -        password: nacos
    -      config:
    -        server-addr: 62.234.31.217:8848
    -        file-extension: yaml
    -        shared-configs:
    -          - data-id: common.yaml
    -            refresh: true
    -        username: nacos
    -        password: nacos
    -    
    \ No newline at end of file
    diff --git a/damai-server/damai-user-service/src/main/resources/lua/checkNeedCaptcha.lua b/damai-server/damai-user-service/src/main/resources/lua/checkNeedCaptcha.lua
    new file mode 100644
    index 0000000000000000000000000000000000000000..3a9c37d9b6a8b5c3c61aa9e9128dbb40d1361cf5
    --- /dev/null
    +++ b/damai-server/damai-user-service/src/main/resources/lua/checkNeedCaptcha.lua
    @@ -0,0 +1,33 @@
    +local counter_count_key = KEYS[1]
    +local counter_timestamp_key = KEYS[2]
    +local verify_captcha_id = KEYS[3]
    +local verify_captcha_threshold = tonumber(ARGV[1])
    +local current_time_millis = tonumber(ARGV[2])
    +local verify_captcha_id_expire_time = tonumber(ARGV[3])
    +local always_verify_captcha = tonumber(ARGV[4])
    +local differenceValue = 1000
    +if always_verify_captcha == 1 then
    +    redis.call('set', verify_captcha_id,'yes')
    +    redis.call('expire',verify_captcha_id,verify_captcha_id_expire_time)
    +    return 'true'
    +end
    +local count = tonumber(redis.call('get', counter_count_key) or "0")
    +local lastResetTime = tonumber(redis.call('get', counter_timestamp_key) or "0")
    +if current_time_millis - lastResetTime > differenceValue then
    +    count = 0
    +    redis.call('set', counter_count_key, count)
    +    redis.call('set', counter_timestamp_key, current_time_millis)
    +end
    +count = count + 1
    +if count > verify_captcha_threshold then
    +    count = 0
    +    redis.call('set', counter_count_key, count)
    +    redis.call('set', counter_timestamp_key, current_time_millis)
    +    redis.call('set', verify_captcha_id,'yes')
    +    redis.call('expire',verify_captcha_id,verify_captcha_id_expire_time)
    +    return 'true'
    +end
    +redis.call('set', counter_count_key, count)
    +redis.call('set',verify_captcha_id,'no')
    +redis.call('expire',verify_captcha_id,verify_captcha_id_expire_time)
    +return 'false'
    diff --git a/damai-server/damai-user-service/src/main/resources/shardingsphere-user.yaml b/damai-server/damai-user-service/src/main/resources/shardingsphere-user.yaml
    index 9d799f2ac3a8fa47350bf9b42c2e0b011ce362d6..23f45bfb17b01e9545f48be5556306f86ed1db47 100644
    --- a/damai-server/damai-user-service/src/main/resources/shardingsphere-user.yaml
    +++ b/damai-server/damai-user-service/src/main/resources/shardingsphere-user.yaml
    @@ -1,185 +1,115 @@
    -dataSources:    
    +dataSources:
       ds_0:
         dataSourceClassName: com.zaxxer.hikari.HikariDataSource
         driverClassName: com.mysql.cj.jdbc.Driver
    -    jdbcUrl: jdbc:mysql://www.cookframe.com:3306/damai_user_0?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
    +    jdbcUrl: jdbc:mysql://127.0.0.1:3306/damai_user_0?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
         username: root
    -    password: qaz321qwe!
    -
    +    password: root
       ds_1:
         dataSourceClassName: com.zaxxer.hikari.HikariDataSource
         driverClassName: com.mysql.cj.jdbc.Driver
    -    jdbcUrl: jdbc:mysql://www.cookframe.com:3306/damai_user_1?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
    +    jdbcUrl: jdbc:mysql://127.0.0.1:3306/damai_user_1?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
         username: root
    -    password: qaz321qwe!
    +    password: root
         
     rules:
    -  # 分库分表规则
       - !SHARDING
         tables:
    -      # 对d_user_mobile表进行分库分表
           d_user_mobile:
    -        # 库为damai_user_0 damai_user_1 表为d_user_mobile_0 至 d_user_mobile_1
             actualDataNodes: ds_${0..1}.d_user_mobile_${0..1}
    -        # 分库策略
             databaseStrategy:
               standard:
    -            # 使用user_mobile作为分片键
                 shardingColumn: mobile
    -            # 用user_mobile列使用hash取模作为分库算法
    -            shardingAlgorithmName: databaseUserMobileHashModModel
    -        # 分表策略      
    +            shardingAlgorithmName: databaseUserMobileHashModModel     
             tableStrategy:
               standard:
    -            # 使用user_mobile作为分片键
                 shardingColumn: mobile
    -            # 用user_mobile列使用hash取模作为分表算法
                 shardingAlgorithmName: tableUserMobileHashMod
    -      # 对d_user_email表进行分库分表
           d_user_email:
    -        # 库为damai_user_0 damai_user_1 表为d_user_email_0 至 d_user_email_1
             actualDataNodes: ds_${0..1}.d_user_email_${0..1}
    -        # 分库策略
             databaseStrategy:
               standard:
    -            # 使用email作为分片键
                 shardingColumn: email
    -            # 用user_mobile列使用hash取模作为分库算法
    -            shardingAlgorithmName: databaseUserEmailHashModModel
    -        # 分表策略      
    +            shardingAlgorithmName: databaseUserEmailHashModModel     
             tableStrategy:
               standard:
    -            # 使用email作为分片键
                 shardingColumn: email
    -            # 用user_mobile列使用hash取模作为分表算法
                 shardingAlgorithmName: tableUserEmailHashMod      
    -      # 对d_user表进行分库分表
           d_user:
    -        # 库为damai_user_0 damai_user_1 表为d_user_0 至 d_user_1
             actualDataNodes: ds_${0..1}.d_user_${0..1}
    -        # 分库策略
             databaseStrategy:
               standard:
    -            # 使用id作为分片键
                 shardingColumn: id
    -            # 用user_mobile列使用hash取模作为分库算法
    -            shardingAlgorithmName: databaseUserHashModModel
    -        # 分表策略      
    +            shardingAlgorithmName: databaseUserModModel 
             tableStrategy:
               standard:
    -            # 使用id作为分片键
                 shardingColumn: id
    -            # 用user_mobile列使用hash取模作为分表算法
    -            shardingAlgorithmName: tableUserHashModModel
    -      # 对d_ticket_user表进行分库分表
    +            shardingAlgorithmName: tableUserModModel
           d_ticket_user:
    -        # 库为damai_user_0 damai_user_1 表为d_ticket_user_0 至 d_ticket_user_1
             actualDataNodes: ds_${0..1}.d_ticket_user_${0..1}
    -        # 分库策略
             databaseStrategy:
               standard:
    -            # 使用id作为分片键
    -            shardingColumn: id
    -            # 用user_mobile列使用hash取模作为分库算法
    -            shardingAlgorithmName: databaseTicketUserHashModModel
    -        # 分表策略      
    +            shardingColumn: user_id
    +            shardingAlgorithmName: databaseTicketUserModModel    
             tableStrategy:
               standard:
    -            # 使用id作为分片键
    -            shardingColumn: id
    -            # 用user_mobile列使用hash取模作为分表算法
    -            shardingAlgorithmName: tableTicketUserHashModModel      
    -    # 具体的算法        
    +            shardingColumn: user_id
    +            shardingAlgorithmName: tableTicketUserModModel            
         shardingAlgorithms:
    -      # d_user_mobile表分库算法
           databaseUserMobileHashModModel:
             type: HASH_MOD
             props:
    -          # 分库数量
               sharding-count: 2
    -      # d_user_mobile表分表算法
           tableUserMobileHashMod:
             type: HASH_MOD
             props:
    -          # 分表数量
               sharding-count: 2
    -      # d_user_email表分库算法
           databaseUserEmailHashModModel:
             type: HASH_MOD
             props:
    -          # 分库数量
               sharding-count: 2
    -      # d_user_email表分表算法
           tableUserEmailHashMod:
             type: HASH_MOD
             props:
    -          # 分表数量
               sharding-count: 2    
    -      # d_user表分库算法
    -      databaseUserHashModModel:
    +      databaseUserModModel:
             type: MOD
             props:
    -          # 分库数量
               sharding-count: 2
    -      # d_user表分表算法
    -      tableUserHashModModel:
    +      tableUserModModel:
             type: MOD
             props:
    -          # 分表数量
               sharding-count: 2
    -      # d_ticket_user表分库算法
    -      databaseTicketUserHashModModel:
    +      databaseTicketUserModModel:
             type: MOD
             props:
    -          # 分库数量
               sharding-count: 2
    -      # d_ticket_user表分表算法
    -      tableTicketUserHashModModel:
    +      tableTicketUserModModel:
             type: MOD
             props:
    -          # 分表数量
               sharding-count: 2
    -  # 加密规则
       - !ENCRYPT
         tables:
    -      # d_user表
           d_user:
             columns:
    -          # 对mobile列进行加密
               mobile:
    -            # 密文列mobile
                 cipherColumn: mobile
    -            # 自定义的加密算法
                 encryptorName: user_encryption_algorithm
    -          # 对password列进行加密
               password:
    -            # 密文列password
                 cipherColumn: password
    -            # 自定义的加密算法
                 encryptorName: user_encryption_algorithm
    -          # 对id_number列进行加密
               id_number:
    -            # 密文列id_number
                 cipherColumn: id_number
    -            # 自定义的加密算法
                 encryptorName: user_encryption_algorithm  
    -      # d_user_mobile表
           d_user_mobile:
             columns:
    -          # 对mobile列进行加密
               mobile:
    -            # 密文列id_number
                 cipherColumn: mobile
    -            # 自定义的加密算法
                 encryptorName: user_encryption_algorithm
    -      # d_ticket_user表
           d_ticket_user:
             columns:
    -          # 对id_number列进行加密
               id_number:
    -            # 密文列id_number
                 cipherColumn: id_number
    -            # 自定义的加密算法
                 encryptorName: user_encryption_algorithm      
         encryptors:
           user_encryption_algorithm:
    @@ -190,6 +120,5 @@ rules:
               sm4-iv: 1afc7fdce9ebc393f693cd3d23e35ed2
               sm4-padding: PKCS7Padding
     props:
    -  # 打印真实sql
       sql-show: true      
           
    \ No newline at end of file
    diff --git a/damai-spring-cloud-framework/damai-job-async/src/main/java/com/damai/callback/JobRunCallBack.java b/damai-spring-cloud-framework/damai-job-async/src/main/java/com/damai/callback/JobRunCallBack.java
    index 9b08699d8bd657a1f81e75768142b7089d020614..06bc990d3edcf3334dcaeea65b8a4448018fc328 100644
    --- a/damai-spring-cloud-framework/damai-job-async/src/main/java/com/damai/callback/JobRunCallBack.java
    +++ b/damai-spring-cloud-framework/damai-job-async/src/main/java/com/damai/callback/JobRunCallBack.java
    @@ -3,7 +3,7 @@ package com.damai.callback;
     import com.alibaba.fastjson.JSON;
     import com.damai.client.JobClient;
     import com.damai.common.ApiResponse;
    -import com.damai.core.StringUtil;
    +import com.damai.util.StringUtil;
     import com.damai.dto.JobCallBackDto;
     import com.damai.threadlocal.BaseParameterHolder;
     import lombok.extern.slf4j.Slf4j;
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/.gitignore b/damai-spring-cloud-framework/damai-sentinel-general/.gitignore
    deleted file mode 100644
    index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/.gitignore
    +++ /dev/null
    @@ -1,31 +0,0 @@
    -HELP.md
    -target/
    -!.mvn/wrapper/maven-wrapper.jar
    -!**/src/main/**
    -!**/src/test/**
    -
    -### STS ###
    -.apt_generated
    -.classpath
    -.factorypath
    -.project
    -.settings
    -.springBeans
    -.sts4-cache
    -
    -### IntelliJ IDEA ###
    -.idea
    -*.iws
    -*.iml
    -*.ipr
    -
    -### NetBeans ###
    -/nbproject/private/
    -/nbbuild/
    -/dist/
    -/nbdist/
    -/.nb-gradle/
    -build/
    -
    -### VS Code ###
    -.vscode/
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/.gitignore b/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/.gitignore
    deleted file mode 100644
    index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/.gitignore
    +++ /dev/null
    @@ -1,31 +0,0 @@
    -HELP.md
    -target/
    -!.mvn/wrapper/maven-wrapper.jar
    -!**/src/main/**
    -!**/src/test/**
    -
    -### STS ###
    -.apt_generated
    -.classpath
    -.factorypath
    -.project
    -.settings
    -.springBeans
    -.sts4-cache
    -
    -### IntelliJ IDEA ###
    -.idea
    -*.iws
    -*.iml
    -*.ipr
    -
    -### NetBeans ###
    -/nbproject/private/
    -/nbbuild/
    -/dist/
    -/nbdist/
    -/.nb-gradle/
    -build/
    -
    -### VS Code ###
    -.vscode/
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeSlot.java b/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeSlot.java
    deleted file mode 100644
    index 6181652dd7d76608705a11d17ce9f12ee26dee62..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeSlot.java
    +++ /dev/null
    @@ -1,98 +0,0 @@
    -/*
    - * Copyright 1999-2018 Alibaba Group Holding Ltd.
    - *
    - * Licensed under the Apache License, Version 2.0 (the "License");
    - * you may not use this file except in compliance with the License.
    - * You may obtain a copy of the License at
    - *
    - *      http://www.apache.org/licenses/LICENSE-2.0
    - *
    - * Unless required by applicable law or agreed to in writing, software
    - * distributed under the License is distributed on an "AS IS" BASIS,
    - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    - * See the License for the specific language governing permissions and
    - * limitations under the License.
    - */
    -package com.alibaba.csp.sentinel.slots.block.degrade;
    -
    -import com.alibaba.csp.sentinel.Constants;
    -import com.alibaba.csp.sentinel.Entry;
    -import com.alibaba.csp.sentinel.constant.SentinelConstant;
    -import com.alibaba.csp.sentinel.context.Context;
    -import com.alibaba.csp.sentinel.node.DefaultNode;
    -import com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot;
    -import com.alibaba.csp.sentinel.slotchain.ResourceWrapper;
    -import com.alibaba.csp.sentinel.slots.block.BlockException;
    -import com.alibaba.csp.sentinel.slots.block.degrade.circuitbreaker.CircuitBreaker;
    -import com.alibaba.csp.sentinel.spi.Spi;
    -
    -import java.util.List;
    -
    -/**
    - * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: sentinel熔断统计
    - * @author: 阿宽不是程序员
    - **/
    -@Spi(order = Constants.ORDER_DEGRADE_SLOT)
    -public class DegradeSlot extends AbstractLinkedProcessorSlot {
    -
    -    @Override
    -    public void entry(Context context, ResourceWrapper resourceWrapper, DefaultNode node, int count,
    -                      boolean prioritized, Object... args) throws Throwable {
    -        // 完成熔断降级检测
    -        performChecking(context, resourceWrapper);
    -        // 触发下一个节点
    -        fireEntry(context, resourceWrapper, node, count, prioritized, args);
    -    }
    -
    -    void performChecking(Context context, ResourceWrapper r) throws BlockException {
    -        // 获取到当前资源的所有熔断器
    -        List circuitBreakers = DegradeRuleManager.getCircuitBreakers(r.getName());
    -        if (circuitBreakers == null || circuitBreakers.size() == 0) {
    -            //上一步拿不到资源所对应的熔断后,这里拿取通用的熔断
    -            circuitBreakers = DegradeRuleManager.getCircuitBreakers(SentinelConstant.GENERAL_URL);
    -            if (circuitBreakers != null) {
    -                for (CircuitBreaker circuitBreaker : circuitBreakers) {
    -                    DegradeRule rule = circuitBreaker.getRule();
    -                    if (rule != null) {
    -                        rule.setResource(r.getName());
    -                    }
    -                }
    -            }
    -        }
    -        // 若熔断器为空,则直结束
    -        if (circuitBreakers == null || circuitBreakers.isEmpty()) {
    -            return;
    -        }
    -        // 逐个尝试所有熔断器
    -        for (CircuitBreaker cb : circuitBreakers) {
    -            // 若没有通过当前熔断器,则直接抛出异常
    -            if (!cb.tryPass(context)) {
    -                throw new DegradeException(cb.getRule().getLimitApp(), cb.getRule());
    -            }
    -        }
    -    }
    -
    -    @Override
    -    public void exit(Context context, ResourceWrapper r, int count, Object... args) {
    -        Entry curEntry = context.getCurEntry();
    -        if (curEntry.getBlockError() != null) {
    -            fireExit(context, r, count, args);
    -            return;
    -        }
    -        List circuitBreakers = DegradeRuleManager.getCircuitBreakers(r.getName());
    -        if (circuitBreakers == null || circuitBreakers.isEmpty()) {
    -            fireExit(context, r, count, args);
    -            return;
    -        }
    -
    -        if (curEntry.getBlockError() == null) {
    -            // passed request
    -            for (CircuitBreaker circuitBreaker : circuitBreakers) {
    -                circuitBreaker.onRequestComplete(context);
    -            }
    -        }
    -
    -        fireExit(context, r, count, args);
    -    }
    -}
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/FlowSlot.java b/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/FlowSlot.java
    deleted file mode 100644
    index 53c7b77c620a5bdde84d3f945813a4a620ad96f7..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/FlowSlot.java
    +++ /dev/null
    @@ -1,100 +0,0 @@
    -/*
    - * Copyright 1999-2018 Alibaba Group Holding Ltd.
    - *
    - * Licensed under the Apache License, Version 2.0 (the "License");
    - * you may not use this file except in compliance with the License.
    - * You may obtain a copy of the License at
    - *
    - *      http://www.apache.org/licenses/LICENSE-2.0
    - *
    - * Unless required by applicable law or agreed to in writing, software
    - * distributed under the License is distributed on an "AS IS" BASIS,
    - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    - * See the License for the specific language governing permissions and
    - * limitations under the License.
    - */
    -package com.alibaba.csp.sentinel.slots.block.flow;
    -
    -import com.alibaba.csp.sentinel.Constants;
    -import com.alibaba.csp.sentinel.constant.SentinelConstant;
    -import com.alibaba.csp.sentinel.context.Context;
    -import com.alibaba.csp.sentinel.node.DefaultNode;
    -import com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot;
    -import com.alibaba.csp.sentinel.slotchain.ResourceWrapper;
    -import com.alibaba.csp.sentinel.slots.block.BlockException;
    -import com.alibaba.csp.sentinel.spi.Spi;
    -import com.alibaba.csp.sentinel.util.AssertUtil;
    -import com.alibaba.csp.sentinel.util.function.Function;
    -
    -import java.util.Collection;
    -import java.util.List;
    -import java.util.Map;
    -
    -/**
    - * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: sentinel流控统计
    - * @author: 阿宽不是程序员
    - **/
    -@Spi(order = Constants.ORDER_FLOW_SLOT)
    -public class FlowSlot extends AbstractLinkedProcessorSlot {
    -
    -    private final FlowRuleChecker checker;
    -
    -    public FlowSlot() {
    -        this(new FlowRuleChecker());
    -    }
    -
    -    /**
    -     * Package-private for test.
    -     *
    -     * @param checker flow rule checker
    -     * @since 1.6.1
    -     */
    -    FlowSlot(FlowRuleChecker checker) {
    -        AssertUtil.notNull(checker, "flow checker should not be null");
    -        this.checker = checker;
    -    }
    -
    -    @Override
    -    public void entry(Context context, ResourceWrapper resourceWrapper, DefaultNode node, int count,
    -                      boolean prioritized, Object... args) throws Throwable {
    -        // 检测并应用流控规则
    -        checkFlow(resourceWrapper, context, node, count, prioritized);
    -        // 触发下一个Slot
    -        fireEntry(context, resourceWrapper, node, count, prioritized, args);
    -    }
    -
    -    void checkFlow(ResourceWrapper resource, Context context, DefaultNode node, int count, boolean prioritized)
    -        throws BlockException {
    -        checker.checkFlow(ruleProvider, resource, context, node, count, prioritized);
    -    }
    -
    -    @Override
    -    public void exit(Context context, ResourceWrapper resourceWrapper, int count, Object... args) {
    -        fireExit(context, resourceWrapper, count, args);
    -    }
    -
    -    private final Function> ruleProvider = new Function>() {
    -        @Override
    -        public Collection apply(String resource) {
    -            // Flow rule map should not be null.
    -            // 获取到所有资源的流控规则
    -            // map的key为资源名称,value为该资源上加载的所有流控规则
    -            Map> flowRules = FlowRuleManager.getFlowRuleMap();
    -            // 获取指定资源的所有流控规则
    -            List flowRuleList = flowRules.get(resource);
    -            
    -            if (flowRuleList == null || flowRuleList.size() == 0) {
    -                //如果没有找到属于本资源的,那么找通用的
    -                flowRuleList = flowRules.get(SentinelConstant.GENERAL_URL);
    -            }
    -            if (flowRuleList != null) {
    -                for (final FlowRule flowRule : flowRuleList) {
    -                    //将真正的资源路径替换通用的
    -                    flowRule.setResource(resource);
    -                }
    -            }
    -            return flowRuleList;
    -        }
    -    };
    -}
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/src/main/resources/META-INF/spring.factories b/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/src/main/resources/META-INF/spring.factories
    deleted file mode 100644
    index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/.gitignore b/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/.gitignore
    deleted file mode 100644
    index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/.gitignore
    +++ /dev/null
    @@ -1,31 +0,0 @@
    -HELP.md
    -target/
    -!.mvn/wrapper/maven-wrapper.jar
    -!**/src/main/**
    -!**/src/test/**
    -
    -### STS ###
    -.apt_generated
    -.classpath
    -.factorypath
    -.project
    -.settings
    -.springBeans
    -.sts4-cache
    -
    -### IntelliJ IDEA ###
    -.idea
    -*.iws
    -*.iml
    -*.ipr
    -
    -### NetBeans ###
    -/nbproject/private/
    -/nbbuild/
    -/dist/
    -/nbdist/
    -/.nb-gradle/
    -build/
    -
    -### VS Code ###
    -.vscode/
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/README.md b/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/README.md
    deleted file mode 100644
    index 04afd0ee6ab10ea3d70b54c1e32de2440b771c3b..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/README.md
    +++ /dev/null
    @@ -1,5 +0,0 @@
    -### 需要添加的配置项
    -```properties
    -spring.cloud.sentinel.eager = true
    -spring.cloud.sentinel.filter.enabled = false
    -```
    \ No newline at end of file
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/pom.xml b/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/pom.xml
    deleted file mode 100644
    index 6fb4a990018e2d48c2b4b4d458cb2d5b5791f86c..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/pom.xml
    +++ /dev/null
    @@ -1,36 +0,0 @@
    -
    -
    -    4.0.0
    -
    -    
    -        com.example
    -        damai-sentinel-general
    -        ${revision}
    -    
    -    damai-sentinel-gateway-general
    -    sentinel-gateway-general
    -    sentinel gateway支持全局配置组件
    -
    -    
    -        
    -            com.example
    -            damai-common
    -            ${revision}
    -        
    -        
    -            com.example
    -            damai-sentinel-common-general
    -            ${revision}
    -        
    -        
    -            com.alibaba.csp
    -            sentinel-spring-cloud-gateway-adapter
    -        
    -        
    -            org.springframework.cloud
    -            spring-cloud-starter-gateway
    -        
    -    
    -
    -
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/src/main/java/com/alibaba/csp/sentinel/adapter/gateway/sc/SentinelGatewayFilter.java b/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/src/main/java/com/alibaba/csp/sentinel/adapter/gateway/sc/SentinelGatewayFilter.java
    deleted file mode 100644
    index e9c9b77a52c783f64020a6f08e23385d54fdd8b5..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/src/main/java/com/alibaba/csp/sentinel/adapter/gateway/sc/SentinelGatewayFilter.java
    +++ /dev/null
    @@ -1,108 +0,0 @@
    -/*
    - * Copyright 1999-2019 Alibaba Group Holding Ltd.
    - *
    - * Licensed under the Apache License, Version 2.0 (the "License");
    - * you may not use this file except in compliance with the License.
    - * You may obtain a copy of the License at
    - *
    - *      http://www.apache.org/licenses/LICENSE-2.0
    - *
    - * Unless required by applicable law or agreed to in writing, software
    - * distributed under the License is distributed on an "AS IS" BASIS,
    - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    - * See the License for the specific language governing permissions and
    - * limitations under the License.
    - */
    -package com.alibaba.csp.sentinel.adapter.gateway.sc;
    -
    -import com.alibaba.csp.sentinel.EntryType;
    -import com.alibaba.csp.sentinel.ResourceTypeConstants;
    -import com.alibaba.csp.sentinel.adapter.gateway.common.SentinelGatewayConstants;
    -import com.alibaba.csp.sentinel.adapter.gateway.common.param.GatewayParamParser;
    -import com.alibaba.csp.sentinel.adapter.gateway.sc.api.GatewayApiMatcherManager;
    -import com.alibaba.csp.sentinel.adapter.gateway.sc.api.matcher.WebExchangeApiMatcher;
    -import com.alibaba.csp.sentinel.adapter.gateway.sc.callback.GatewayCallbackManager;
    -import com.alibaba.csp.sentinel.adapter.reactor.ContextConfig;
    -import com.alibaba.csp.sentinel.adapter.reactor.EntryConfig;
    -import com.alibaba.csp.sentinel.adapter.reactor.SentinelReactorTransformer;
    -import org.springframework.cloud.gateway.filter.GatewayFilter;
    -import org.springframework.cloud.gateway.filter.GatewayFilterChain;
    -import org.springframework.cloud.gateway.filter.GlobalFilter;
    -import org.springframework.cloud.gateway.route.Route;
    -import org.springframework.cloud.gateway.support.ServerWebExchangeUtils;
    -import org.springframework.core.Ordered;
    -import org.springframework.web.server.ServerWebExchange;
    -import reactor.core.publisher.Mono;
    -
    -import java.util.Optional;
    -import java.util.Set;
    -import java.util.stream.Collectors;
    -
    -/**
    - * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: sentinel gateway过滤器
    - * @author: 阿宽不是程序员
    - **/
    -public class SentinelGatewayFilter implements GatewayFilter, GlobalFilter, Ordered {
    -
    -    private final int order;
    -
    -    public SentinelGatewayFilter() {
    -        this(Ordered.HIGHEST_PRECEDENCE);
    -    }
    -
    -    public SentinelGatewayFilter(int order) {
    -        this.order = order;
    -    }
    -
    -    private final GatewayParamParser paramParser = new GatewayParamParser<>(
    -        new ServerWebExchangeItemParser());
    -
    -    @Override
    -    public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) {
    -        Route route = exchange.getAttribute(ServerWebExchangeUtils.GATEWAY_ROUTE_ATTR);
    -        String uri = exchange.getRequest().getPath().value();
    -        Mono asyncResult = chain.filter(exchange);
    -        if (route != null) {
    -            String routeId = route.getId();
    -            Object[] params = paramParser.parseParameterFor(uri, exchange,
    -                r -> r.getResourceMode() == SentinelGatewayConstants.RESOURCE_MODE_ROUTE_ID);
    -            String origin = Optional.ofNullable(GatewayCallbackManager.getRequestOriginParser())
    -                .map(f -> f.apply(exchange))
    -                .orElse("");
    -            asyncResult = asyncResult.transform(
    -                new SentinelReactorTransformer<>(new EntryConfig(uri, ResourceTypeConstants.COMMON_API_GATEWAY,
    -                    EntryType.IN, 1, params, new ContextConfig(contextName(uri), origin)))
    -            );
    -        }
    -
    -        Set matchingApis = pickMatchingApiDefinitions(exchange);
    -        for (String apiName : matchingApis) {
    -            Object[] params = paramParser.parseParameterFor(apiName, exchange,
    -                r -> r.getResourceMode() == SentinelGatewayConstants.RESOURCE_MODE_CUSTOM_API_NAME);
    -            asyncResult = asyncResult.transform(
    -                new SentinelReactorTransformer<>(new EntryConfig(apiName, ResourceTypeConstants.COMMON_API_GATEWAY,
    -                    EntryType.IN, 1, params))
    -            );
    -        }
    -
    -        return asyncResult;
    -    }
    -
    -    private String contextName(String route) {
    -        return SentinelGatewayConstants.GATEWAY_CONTEXT_ROUTE_PREFIX + route;
    -    }
    -
    -    Set pickMatchingApiDefinitions(ServerWebExchange exchange) {
    -        return GatewayApiMatcherManager.getApiMatcherMap().values()
    -            .stream()
    -            .filter(m -> m.test(exchange))
    -            .map(WebExchangeApiMatcher::getApiName)
    -            .collect(Collectors.toSet());
    -    }
    -
    -    @Override
    -    public int getOrder() {
    -        return order;
    -    }
    -}
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/src/main/resources/META-INF/spring.factories b/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/src/main/resources/META-INF/spring.factories
    deleted file mode 100644
    index dcb03d1166e12565272d0da6a564de0faaf83f78..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-gateway-general/src/main/resources/META-INF/spring.factories
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
    -  com.damai.sentinel.GatewayConfiguration
    \ No newline at end of file
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-web-general/.gitignore b/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-web-general/.gitignore
    deleted file mode 100644
    index a2a3040aa86debfd8826d9c2b5c816314c17d9fe..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-web-general/.gitignore
    +++ /dev/null
    @@ -1,31 +0,0 @@
    -HELP.md
    -target/
    -!.mvn/wrapper/maven-wrapper.jar
    -!**/src/main/**
    -!**/src/test/**
    -
    -### STS ###
    -.apt_generated
    -.classpath
    -.factorypath
    -.project
    -.settings
    -.springBeans
    -.sts4-cache
    -
    -### IntelliJ IDEA ###
    -.idea
    -*.iws
    -*.iml
    -*.ipr
    -
    -### NetBeans ###
    -/nbproject/private/
    -/nbbuild/
    -/dist/
    -/nbdist/
    -/.nb-gradle/
    -build/
    -
    -### VS Code ###
    -.vscode/
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-web-general/pom.xml b/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-web-general/pom.xml
    deleted file mode 100644
    index 51aa33d55dad0d707639a407522e0dfd7d16d20d..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-web-general/pom.xml
    +++ /dev/null
    @@ -1,35 +0,0 @@
    -
    -
    -    4.0.0
    -
    -    
    -        com.example
    -        damai-sentinel-general
    -        ${revision}
    -    
    -    damai-sentinel-web-general
    -    sentinel-web-general
    -    sentinel web支持全局配置组件
    -    
    -
    -    
    -        
    -            com.example
    -            damai-common
    -            ${revision}
    -        
    -        
    -            org.springframework.boot
    -            spring-boot-starter-web
    -            true
    -        
    -        
    -            com.example
    -            damai-sentinel-common-general
    -            ${revision}
    -        
    -    
    -    
    -
    -
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-web-general/src/main/java/com/alibaba/csp/sentinel/adapter/spring/webmvc/SentinelWebInterceptor.java b/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-web-general/src/main/java/com/alibaba/csp/sentinel/adapter/spring/webmvc/SentinelWebInterceptor.java
    deleted file mode 100644
    index 122623b9fe82b45852c0625662c79f1483fc2053..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-web-general/src/main/java/com/alibaba/csp/sentinel/adapter/spring/webmvc/SentinelWebInterceptor.java
    +++ /dev/null
    @@ -1,86 +0,0 @@
    -/*
    - * Copyright 1999-2019 Alibaba Group Holding Ltd.
    - *
    - * Licensed under the Apache License, Version 2.0 (the "License");
    - * you may not use this file except in compliance with the License.
    - * You may obtain a copy of the License at
    - *
    - *      https://www.apache.org/licenses/LICENSE-2.0
    - *
    - * Unless required by applicable law or agreed to in writing, software
    - * distributed under the License is distributed on an "AS IS" BASIS,
    - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    - * See the License for the specific language governing permissions and
    - * limitations under the License.
    - */
    -package com.alibaba.csp.sentinel.adapter.spring.webmvc;
    -
    -import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.UrlCleaner;
    -import com.alibaba.csp.sentinel.adapter.spring.webmvc.config.SentinelWebMvcConfig;
    -import com.alibaba.csp.sentinel.util.StringUtil;
    -import com.damai.core.SpringUtil;
    -import org.springframework.web.servlet.HandlerMapping;
    -
    -import javax.servlet.http.HttpServletRequest;
    -import java.util.Optional;
    -
    -import static com.alibaba.csp.sentinel.constant.SentinelConstant.SPLIT_RESOURCE;
    -
    -
    -/**
    - * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 
    - * @description: sentinel web统计
    - * @author: 阿宽不是程序员
    - **/
    -public class SentinelWebInterceptor extends AbstractSentinelInterceptor {
    -
    -    private final SentinelWebMvcConfig config;
    -
    -    public SentinelWebInterceptor() {
    -        this(new SentinelWebMvcConfig());
    -    }
    -
    -    public SentinelWebInterceptor(SentinelWebMvcConfig config) {
    -        super(config);
    -        if (config == null) {
    -            // Use the default config by default.
    -            this.config = new SentinelWebMvcConfig();
    -        } else {
    -            this.config = config;
    -        }
    -    }
    -
    -    @Override
    -    protected String getResourceName(HttpServletRequest request) {
    -        // Resolve the Spring Web URL pattern from the request attribute.
    -        Object resourceNameObject = request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE);
    -        if (resourceNameObject == null || !(resourceNameObject instanceof String)) {
    -            return null;
    -        }
    -        String resourceName = (String) resourceNameObject;
    -        UrlCleaner urlCleaner = config.getUrlCleaner();
    -        if (urlCleaner != null) {
    -            resourceName = urlCleaner.clean(resourceName);
    -        }
    -        // Add method specification if necessary
    -        if (StringUtil.isNotEmpty(resourceName) && config.isHttpMethodSpecify()) {
    -            resourceName = request.getMethod().toUpperCase() + ":" + resourceName;
    -        }
    -        Optional applicationNameOptional = Optional.ofNullable(SpringUtil.getProperty("spring.application.name"))
    -                .filter(com.damai.core.StringUtil::isNotEmpty);
    -        if (applicationNameOptional.isPresent()) {
    -            String applicationName = applicationNameOptional.get();
    -            resourceName = applicationName + SPLIT_RESOURCE + resourceName;
    -        }
    -        return resourceName;
    -    }
    -
    -    @Override
    -    protected String getContextName(HttpServletRequest request) {
    -        if (config.isWebContextUnify()) {
    -            return super.getContextName(request);
    -        }
    -
    -        return getResourceName(request);
    -    }
    -}
    diff --git a/damai-spring-cloud-framework/damai-sentinel-general/pom.xml b/damai-spring-cloud-framework/damai-sentinel-general/pom.xml
    deleted file mode 100644
    index 25bbb49470c6985e84f8b4f202590b587bc2181e..0000000000000000000000000000000000000000
    --- a/damai-spring-cloud-framework/damai-sentinel-general/pom.xml
    +++ /dev/null
    @@ -1,23 +0,0 @@
    -
    -
    -    4.0.0
    -
    -    
    -        com.example
    -        damai-spring-cloud-framework
    -        ${revision}
    -    
    -
    -    damai-sentinel-general
    -    sentinel-general
    -    sentinel支持全局通用组件
    -    pom
    -
    -    
    -        damai-sentinel-common-general
    -        damai-sentinel-web-general
    -        damai-sentinel-gateway-general
    -    
    -
    -
    diff --git a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/data/BaseData.java b/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/data/BaseTableData.java
    similarity index 96%
    rename from damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/data/BaseData.java
    rename to damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/data/BaseTableData.java
    index 3a4a02cbf67e57fddb0d463844697033d6071b83..507219689d443ae5c285ac893a2295ba9518bad7 100644
    --- a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/data/BaseData.java
    +++ b/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/data/BaseTableData.java
    @@ -11,7 +11,7 @@ import java.util.Date;
      * @author: 阿宽不是程序员
      **/
     @Data
    -public class BaseData {
    +public class BaseTableData {
     
         /**
          * 创建时间
    diff --git a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/page/PageVo.java b/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/page/PageVo.java
    index 950370dff903b7cfec146db55fb7b4b232eb88d2..e13e5c7e249e88464e902e8b83c9dfc47ff1d10e 100644
    --- a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/page/PageVo.java
    +++ b/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/page/PageVo.java
    @@ -33,32 +33,20 @@ import java.util.List;
     @Data
     @NoArgsConstructor
     @AllArgsConstructor
    -@ApiModel(value="UserVo", description ="用户数据")
    +@ApiModel(value="UserVo", description ="分页返回数据")
     public class PageVo implements Serializable {
     
         private static final long serialVersionUID = 1L;
    -
    -    /**
    -     * 页码
    -     */
    +    
         @ApiModelProperty(name ="pageNum", dataType ="String", value ="页码")
         private long pageNum;
    -
    -    /**
    -     * 页大小
    -     */
    +    
         @ApiModelProperty(name ="pageSize", dataType ="String", value ="页大小")
         private long pageSize;
    -
    -    /**
    -     * 记录总数
    -     */
    +    
         @ApiModelProperty(name ="totalSize", dataType ="String", value ="记录总数")
         private long totalSize;
    -
    -    /**
    -     * 数据
    -     */
    +    
         @ApiModelProperty(name ="list", dataType ="List", value ="数据")
         private List list;
     }
    diff --git a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/shardingsphere/DatabaseOrderComplexGeneArithmetic.java b/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/shardingsphere/DatabaseOrderComplexGeneArithmetic.java
    index 474a1af1829867bed8c6396c83812c6213525b9e..13b916b2d1ece18068c6b06d8e9e3ead675ba306 100644
    --- a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/shardingsphere/DatabaseOrderComplexGeneArithmetic.java
    +++ b/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/shardingsphere/DatabaseOrderComplexGeneArithmetic.java
    @@ -18,24 +18,12 @@ import java.util.Properties;
      * @author: 阿宽不是程序员
      **/
     public class DatabaseOrderComplexGeneArithmetic implements ComplexKeysShardingAlgorithm {
    -    /**
    -     * 属性分库名
    -     * */
         private static final String SHARDING_COUNT_KEY_NAME = "sharding-count";
         
    -    /**
    -     * 属性分库名
    -     * */
         private static final String TABLE_SHARDING_COUNT_KEY_NAME = "table-sharding-count";
         
    -    /**
    -     * 分库数量
    -     * */
         private int shardingCount;
         
    -    /**
    -     * 分表数量
    -     * */
         private int tableShardingCount;
         
         @Override
    @@ -45,43 +33,35 @@ public class DatabaseOrderComplexGeneArithmetic implements ComplexKeysShardingAl
         }
         @Override
         public Collection doSharding(Collection allActualSplitDatabaseNames, ComplexKeysShardingValue complexKeysShardingValue) {
    -        //返回的真实库名集合
             List actualDatabaseNames = new ArrayList<>(allActualSplitDatabaseNames.size());
    -        //查询中的列名和值
             Map> columnNameAndShardingValuesMap = complexKeysShardingValue.getColumnNameAndShardingValuesMap();
    -        //如果没有条件查询,那么就查所有的分表
             if (CollectionUtil.isEmpty(columnNameAndShardingValuesMap)) {
                 return actualDatabaseNames;
             }
             
             Collection orderNumberValues = columnNameAndShardingValuesMap.get("order_number");
    -        
             Collection userIdValues = columnNameAndShardingValuesMap.get("user_id");
             
             Long value = null;
    -        //如果是order_number查询
             if (CollectionUtil.isNotEmpty(orderNumberValues)) {
                 value = orderNumberValues.stream().findFirst().orElseThrow(() -> new DaMaiFrameException(BaseCode.ORDER_NUMBER_NOT_EXIST));
    -            //如果是user_id查询
             } else if (CollectionUtil.isNotEmpty(userIdValues)) {
    -            value = orderNumberValues.stream().findFirst().orElseThrow(() -> new DaMaiFrameException(BaseCode.USER_ID_NOT_EXIST));
    +            value = userIdValues.stream().findFirst().orElseThrow(() -> new DaMaiFrameException(BaseCode.USER_ID_NOT_EXIST));
             }
    -        //如果order_number或者user_id的值存在
             if (Objects.nonNull(value)) {
    -            //这里和分表数量进行取模,是因为订单编号中在插入user_id的基因时,是和表数量进行取模的
                 long tableIndex = value % tableShardingCount;
    -            //获得值后再获得实际的分库的索引
                 long databaseIndex = calculateDatabaseIndex(shardingCount,tableIndex,tableShardingCount);
                 String databaseIndexStr = String.valueOf(databaseIndex);
                 for (String actualSplitDatabaseName : allActualSplitDatabaseNames) {
    -                //将所有的分库名和得到的分库索引进行匹配
                     if (actualSplitDatabaseName.contains(databaseIndexStr)) {
                         actualDatabaseNames.add(actualSplitDatabaseName);
                         break;
                     }
                 }
    +            return actualDatabaseNames;
    +        }else {
    +            return allActualSplitDatabaseNames;
             }
    -        return actualDatabaseNames;
         }
         
         /**
    @@ -93,18 +73,13 @@ public class DatabaseOrderComplexGeneArithmetic implements ComplexKeysShardingAl
          * @return 分配到的数据库编号
          */
         public long calculateDatabaseIndex(long databaseCount, long tableIndex, long tableCount) {
    -        // 每个数据库平均分配到的表数量(向下取整)
             long tablesPerDatabase = tableCount / databaseCount;
    -        // 不能均匀分配的表的数量
             long remainder = tableCount % databaseCount;
             
    -        // 计算当前tableIndex应分配到的数据库编号
             long databaseIndex;
             if (tableIndex < (tablesPerDatabase + 1) * remainder) {
    -            // 如果tableIndex在能均匀分配的表的范围内
                 databaseIndex = tableIndex / (tablesPerDatabase + 1);
             } else {
    -            // 如果tableIndex在不能均匀分配的表的范围内
                 databaseIndex = remainder + (tableIndex - (tablesPerDatabase + 1) * remainder) / tablesPerDatabase;
             }
             
    diff --git a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/shardingsphere/TableOrderComplexGeneArithmetic.java b/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/shardingsphere/TableOrderComplexGeneArithmetic.java
    index fc67848ae2598e6f6a4421ed481660e3b079bfa4..4291dee218392b9e433f80f85f472f5a8a59b3ba 100644
    --- a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/shardingsphere/TableOrderComplexGeneArithmetic.java
    +++ b/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/shardingsphere/TableOrderComplexGeneArithmetic.java
    @@ -19,13 +19,9 @@ import java.util.Properties;
      **/
     public class TableOrderComplexGeneArithmetic implements ComplexKeysShardingAlgorithm {
         
    -    /**
    -     * 属性分表名
    -     * */
    +   
         private static final String SHARDING_COUNT_KEY_NAME = "sharding-count";
    -    /**
    -     * 分表数量
    -     * */
    +    
         private int shardingCount;
         
         @Override
    @@ -34,33 +30,25 @@ public class TableOrderComplexGeneArithmetic implements ComplexKeysShardingAlgor
         }
         @Override
         public Collection doSharding(Collection allActualSplitTableNames, ComplexKeysShardingValue complexKeysShardingValue) {
    -        //返回的真实表名集合
             List actualTableNames = new ArrayList<>(allActualSplitTableNames.size());
    -        //逻辑表名
             String logicTableName = complexKeysShardingValue.getLogicTableName();
    -        //查询中的列名和值
             Map> columnNameAndShardingValuesMap = complexKeysShardingValue.getColumnNameAndShardingValuesMap();
    -        //如果没有条件查询,那么就查所有的分表
             if (CollectionUtil.isEmpty(columnNameAndShardingValuesMap)) {
    -            return actualTableNames;
    +            return allActualSplitTableNames;
             }
    -        
             Collection orderNumberValues = columnNameAndShardingValuesMap.get("order_number");
    -        
             Collection userIdValues = columnNameAndShardingValuesMap.get("user_id");
             
             Long value = null;
    -        //如果是order_number查询
             if (CollectionUtil.isNotEmpty(orderNumberValues)) {
                 value = orderNumberValues.stream().findFirst().orElseThrow(() -> new DaMaiFrameException(BaseCode.ORDER_NUMBER_NOT_EXIST));
    -          //如果是user_id查询
             } else if (CollectionUtil.isNotEmpty(userIdValues)) {
    -            value = orderNumberValues.stream().findFirst().orElseThrow(() -> new DaMaiFrameException(BaseCode.USER_ID_NOT_EXIST));
    +            value = userIdValues.stream().findFirst().orElseThrow(() -> new DaMaiFrameException(BaseCode.USER_ID_NOT_EXIST));
             }
    -        //如果order_number或者user_id的值存在
             if (Objects.nonNull(value)) {
                 actualTableNames.add(logicTableName + "_" + value % shardingCount);
    +            return actualTableNames;
             }
    -        return actualTableNames;
    +        return allActualSplitTableNames;
         }
     }
    diff --git a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/swagger/SwaggerConfiguration.java b/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/swagger/SwaggerConfiguration.java
    index 5f7aaeea625a9e890394449576aea289020fdf58..aa13798eaef31666b69e7eff3c35d19a97ca76f8 100644
    --- a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/swagger/SwaggerConfiguration.java
    +++ b/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/swagger/SwaggerConfiguration.java
    @@ -1,18 +1,17 @@
     package com.damai.swagger;
     
     import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
    -import com.google.common.base.Predicate;
     import com.google.common.collect.Lists;
     import io.swagger.annotations.Api;
     import io.swagger.annotations.ApiOperation;
     import org.springframework.context.annotation.Bean;
     import org.springframework.core.annotation.Order;
    -import springfox.documentation.RequestHandler;
     import springfox.documentation.builders.ApiInfoBuilder;
     import springfox.documentation.builders.PathSelectors;
     import springfox.documentation.service.ApiInfo;
     import springfox.documentation.service.ApiKey;
     import springfox.documentation.service.AuthorizationScope;
    +import springfox.documentation.service.Contact;
     import springfox.documentation.service.SecurityReference;
     import springfox.documentation.spi.DocumentationType;
     import springfox.documentation.spi.service.contexts.SecurityContext;
    @@ -34,22 +33,16 @@ public class SwaggerConfiguration {
         @Order(value = 1)
         public Docket groupRestApi() {
             
    -        Predicate predicate = (requestHandler) -> {
    -            boolean controllerStandardDocument = requestHandler.findControllerAnnotation(Api.class).isPresent();
    -            boolean methodStandardDocument = requestHandler.findAnnotation(ApiOperation.class).isPresent();
    -            if (controllerStandardDocument || methodStandardDocument) {
    -                return true;
    -            }else {
    -                return false;
    -            }
    -        };
    -        
             return new Docket(DocumentationType.SWAGGER_2)
                     .apiInfo(groupApiInfo())
                     .useDefaultResponseMessages(false)
                     .forCodeGeneration(true)
                     .select()
    -                .apis(predicate)
    +                .apis((requestHandler) -> {
    +                    boolean controllerStandardDocument = requestHandler.findControllerAnnotation(Api.class).isPresent();
    +                    boolean methodStandardDocument = requestHandler.findAnnotation(ApiOperation.class).isPresent();
    +                    return controllerStandardDocument || methodStandardDocument;
    +                })
                     .build();
         }
     
    @@ -58,7 +51,7 @@ public class SwaggerConfiguration {
                     .title("swagger文档")
                     .description("
    前端开发人员使用
    ") .termsOfServiceUrl("http://www.group.com/") - .contact("kuan") + .contact(new Contact("阿宽不是程序员", "", "")) .version("1.0") .build(); } diff --git a/damai-spring-cloud-framework/damai-service-common/src/main/resources/META-INF/spring.factories b/damai-spring-cloud-framework/damai-service-common/src/main/resources/META-INF/spring.factories index edd2dd06a24d37c52272cafecdd89b6fa5886387..493bbafaa8eaae3e6894f2b8b5ac919bd0d904a5 100644 --- a/damai-spring-cloud-framework/damai-service-common/src/main/resources/META-INF/spring.factories +++ b/damai-spring-cloud-framework/damai-service-common/src/main/resources/META-INF/spring.factories @@ -1,4 +1,3 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ com.damai.swagger.SwaggerConfiguration,\ - com.damai.mybatisplus.MybatisPlusAutoConfiguration,\ - com.damai.composite.CompositeAutoConfiguration \ No newline at end of file + com.damai.mybatisplus.MybatisPlusAutoConfiguration \ No newline at end of file diff --git a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/CustomAwarePredicate.java b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/CustomAwarePredicate.java index 39b4a6ab407954899ffe8c04d549d0379d86a48c..83ff7b351e4900fb07929254e20d1fe50d4a7a76 100644 --- a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/CustomAwarePredicate.java +++ b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/CustomAwarePredicate.java @@ -2,81 +2,95 @@ package com.damai.balance; import cn.hutool.core.collection.CollectionUtil; import com.alibaba.cloud.nacos.ribbon.NacosServer; +import com.damai.enums.BaseCode; +import com.damai.exception.DaMaiFrameException; import com.damai.threadlocal.BaseParameterHolder; +import com.damai.util.StringUtil; import com.netflix.loadbalancer.AbstractServerPredicate; +import com.netflix.loadbalancer.ILoadBalancer; import com.netflix.loadbalancer.PredicateKey; +import com.netflix.loadbalancer.Server; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringUtils; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; -import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; -import static com.damai.constant.Constant.MARK_FLAG_FALSE; -import static com.damai.constant.Constant.MARK_FLAG_TRUE; -import static com.damai.constant.Constant.MARK_PARAMETER; +import static com.damai.constant.Constant.GRAY_FLAG_FALSE; +import static com.damai.constant.Constant.GRAY_FLAG_TRUE; +import static com.damai.constant.Constant.GRAY_PARAMETER; /** - * @program: cook-frame + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 * @description: 灰度版本选择负载均衡选择器 - * @author: 星哥 - * @create: 2023-04-17 + * @author: 阿宽不是程序员 **/ @Slf4j public class CustomAwarePredicate extends AbstractServerPredicate{ - private String mark; + private final String gray; private CustomEnabledRule customEnabledRule; - public CustomAwarePredicate(String mark, CustomEnabledRule customEnabledRule){ + private final Map map = new HashMap<>(); + + public CustomAwarePredicate(String gray, CustomEnabledRule customEnabledRule){ super(customEnabledRule); - this.mark = mark; + this.gray = gray; this.customEnabledRule = customEnabledRule; + this.map.put(GRAY_FLAG_FALSE, GRAY_FLAG_FALSE); + this.map.put(GRAY_FLAG_TRUE, GRAY_FLAG_TRUE); } @Override public boolean apply(PredicateKey input) { boolean result; try { - RequestAttributes ra = RequestContextHolder.getRequestAttributes(); - String markFromRequest = null; - if (ra != null) { - ServletRequestAttributes sra = (ServletRequestAttributes) ra; - HttpServletRequest request = sra.getRequest(); - markFromRequest = request.getHeader(MARK_PARAMETER); - }else { - markFromRequest = BaseParameterHolder.getParameter(MARK_PARAMETER); - } - if (StringUtils.isEmpty(markFromRequest)) { - markFromRequest = mark; - } + RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); + String grayFromRequest = Optional.ofNullable(requestAttributes) + .map(ra -> (ServletRequestAttributes) ra) + .map(sra -> sra.getRequest().getHeader(GRAY_PARAMETER)) + .filter(StringUtil::isNotEmpty) + .orElseGet(() -> BaseParameterHolder.getParameter(GRAY_PARAMETER)); + grayFromRequest = Optional.ofNullable(grayFromRequest).filter(StringUtil::isNotEmpty).orElse(gray); NacosServer nacosServer = (NacosServer) input.getServer(); - Map metadata = nacosServer.getInstance().getMetadata(); - String markFromMetaData; - if (CollectionUtil.isEmpty(metadata)) { - markFromMetaData = MARK_FLAG_FALSE; - }else { - markFromMetaData = metadata.get(MARK_PARAMETER); - } + String grayFromMetaData = Optional.ofNullable(nacosServer.getInstance().getMetadata()) + .filter(CollectionUtil::isNotEmpty) + .map(metadata -> metadata.get(GRAY_PARAMETER)) + .filter(StringUtil::isNotEmpty) + .orElse(GRAY_FLAG_FALSE); + grayFromMetaData = Optional.ofNullable(map.get(grayFromMetaData.toLowerCase())).orElse(GRAY_FLAG_FALSE); + grayFromRequest = Optional.ofNullable(map.get(grayFromRequest.toLowerCase())).orElse(GRAY_FLAG_FALSE); + result = grayFromMetaData.equalsIgnoreCase(grayFromRequest); - if(Objects.isNull(markFromMetaData) || !(markFromMetaData.equalsIgnoreCase(MARK_FLAG_FALSE) || markFromMetaData.equalsIgnoreCase(MARK_FLAG_TRUE))) { - markFromMetaData = MARK_FLAG_FALSE; + if (!result && grayFromRequest.equalsIgnoreCase(GRAY_FLAG_TRUE)) { + List servers = Optional.ofNullable(customEnabledRule) + .map(CustomEnabledRule::getLoadBalancer) + .map(ILoadBalancer::getReachableServers) + .filter(CollectionUtil::isNotEmpty) + .orElseThrow(() -> new DaMaiFrameException(BaseCode.SERVER_LIST_NOT_EXIST)); + Map map = new HashMap<>(servers.size()); + for (Server server : servers) { + NacosServer nacosServerInstance = (NacosServer) server; + String balanceGray = nacosServerInstance.getInstance().getMetadata().get(GRAY_PARAMETER); + if (StringUtil.isEmpty(balanceGray) || Objects.isNull(map.get(balanceGray.toLowerCase()))) { + balanceGray = GRAY_FLAG_FALSE; + } + map.put(balanceGray,balanceGray); + } + if(Objects.isNull(map.get(GRAY_FLAG_TRUE))) { + result = true; + } } - - if(Objects.isNull(markFromRequest) || !(markFromRequest.equalsIgnoreCase(MARK_FLAG_FALSE) || markFromRequest.equalsIgnoreCase(MARK_FLAG_FALSE))) { - markFromRequest = MARK_FLAG_FALSE; - } - result = markFromMetaData.equalsIgnoreCase(markFromRequest); - }catch (Exception e) { result = false; log.error("CustomAwarePredicate#apply error",e); - } - return result; + } return result; } } diff --git a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/CustomEnabledRule.java b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/CustomEnabledRule.java index 350cfc01c12b3361cad9d0bb73e2c30da68efd84..38fd702bdaf625bab884e3d28fa92c15c620fba3 100644 --- a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/CustomEnabledRule.java +++ b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/CustomEnabledRule.java @@ -6,30 +6,40 @@ import com.netflix.loadbalancer.CompositePredicate; import com.netflix.loadbalancer.PredicateBasedRule; import org.springframework.util.Assert; +/** + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 灰度版本选择负载均衡选择器适配 + * @author: 阿宽不是程序员 + **/ public class CustomEnabledRule extends PredicateBasedRule { /** * 这里为静态的原因是ribbon在定时任务执行时是直接调用DiscoveryEnabledRule的无参构造方法,而不是从spring中获得 * */ - private static String mark; + private static String gray; - private CompositePredicate predicate = null; + private final CompositePredicate predicate; public CustomEnabledRule(ExtraRibbonProperties extraRibbonProperties){ super(); - mark = extraRibbonProperties.getMark(); - CustomAwarePredicate metadataAwarePredicate = new CustomAwarePredicate(mark, this); + gray = extraRibbonProperties.getGray(); + CustomAwarePredicate metadataAwarePredicate = new CustomAwarePredicate(gray, this); Assert.notNull(metadataAwarePredicate, "参数 'abstractServerPredicate' 不能为 null"); predicate = createCompositePredicate(metadataAwarePredicate, new AvailabilityPredicate(this, null)); } + /** + * 保留此构造方法的原因是Ribbon在定时任务中,会创建此适配器,而创建的方法是使用反射来构建 + * */ public CustomEnabledRule(){ super(); - CustomAwarePredicate metadataAwarePredicate = new CustomAwarePredicate(mark, this); + CustomAwarePredicate metadataAwarePredicate = new CustomAwarePredicate(gray, this); Assert.notNull(metadataAwarePredicate, "参数 'abstractServerPredicate' 不能为 null"); predicate = createCompositePredicate(metadataAwarePredicate, new AvailabilityPredicate(this, null)); } - + /** + * 当请求执行到Ribbon时,会执行到 过滤器适配器的获得过滤器方法 {@link PredicateBasedRule#choose(Object)} + * */ @Override public AbstractServerPredicate getPredicate() { return predicate; diff --git a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/ExtraRibbonAutoConfiguration.java b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/ExtraRibbonAutoConfiguration.java index 4288e24fa31b96109be9883f0695ce21b7a6995c..5b50bdf02b7e640e366d9fcd371bdc07e6030248 100644 --- a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/ExtraRibbonAutoConfiguration.java +++ b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/ExtraRibbonAutoConfiguration.java @@ -1,24 +1,25 @@ package com.damai.balance; +import com.damai.feign.ExtraFeignAutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration; +import org.springframework.context.annotation.Bean; /** - * @program: cook-frame - * @description: - * @author: 星哥 - * @create: 2023-04-17 + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 灰度版本选择相关配置 + * @author: 阿宽不是程序员 **/ -@AutoConfigureBefore(RibbonClientConfiguration.class) +@AutoConfigureBefore(value = {RibbonClientConfiguration.class, ExtraFeignAutoConfiguration.class}) @ConditionalOnProperty(value = "ribbon.filter.metadata.enabled", matchIfMissing = true) @EnableConfigurationProperties(ExtraRibbonProperties.class) public class ExtraRibbonAutoConfiguration { -// @Bean -// public CustomEnabledRule discoveryEnabledRule(ExtraRibbonProperties extraRibbonProperties){ -// return new CustomEnabledRule(extraRibbonProperties); -// } + @Bean + public CustomEnabledRule discoveryEnabledRule(ExtraRibbonProperties extraRibbonProperties){ + return new CustomEnabledRule(extraRibbonProperties); + } } diff --git a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/ExtraRibbonProperties.java b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/ExtraRibbonProperties.java index efc2636a071ed3f4e4ee5d93f393e1a384e6f456..2860e7222a5c4123d9b6b96b2965148a5c991baf 100644 --- a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/ExtraRibbonProperties.java +++ b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/balance/ExtraRibbonProperties.java @@ -4,14 +4,13 @@ import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; /** - * @program: cook-frame - * @description: - * @author: 星哥 - * @create: 2023-04-17 + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 灰度标识 + * @author: 阿宽不是程序员 **/ @ConfigurationProperties("spring.cloud.nacos.discovery.metadata") @Data public class ExtraRibbonProperties { - private String mark; + private String gray = "false"; } diff --git a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/feign/ExtraFeignAutoConfiguration.java b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/feign/ExtraFeignAutoConfiguration.java index dfe142021529feb2364b11762af9491ab5e53ac7..0a11e33ec7455c71e9cc1b1c45911c21068b3a47 100644 --- a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/feign/ExtraFeignAutoConfiguration.java +++ b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/feign/ExtraFeignAutoConfiguration.java @@ -1,5 +1,6 @@ package com.damai.feign; +import com.damai.balance.ExtraRibbonProperties; import org.springframework.context.annotation.Bean; @@ -12,7 +13,7 @@ import org.springframework.context.annotation.Bean; public class ExtraFeignAutoConfiguration { @Bean - public FeignRequestInterceptor feignRequestInterceptor (){ - return new FeignRequestInterceptor(); + public FeignRequestInterceptor feignRequestInterceptor(ExtraRibbonProperties extraRibbonProperties){ + return new FeignRequestInterceptor(extraRibbonProperties); } } diff --git a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/feign/FeignRequestInterceptor.java b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/feign/FeignRequestInterceptor.java index 1a0ba3b0930f8d8328cd94278e840eba969ad994..6920612fe550b111bbe151b31fbb46addcae9e5c 100644 --- a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/feign/FeignRequestInterceptor.java +++ b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/feign/FeignRequestInterceptor.java @@ -1,7 +1,10 @@ package com.damai.feign; +import com.damai.balance.ExtraRibbonProperties; +import com.damai.util.StringUtil; import feign.RequestInterceptor; import feign.RequestTemplate; +import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; @@ -9,7 +12,10 @@ import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; +import java.util.Objects; + import static com.damai.constant.Constant.CODE; +import static com.damai.constant.Constant.GRAY_PARAMETER; import static com.damai.constant.Constant.TRACE_ID; @@ -20,19 +26,27 @@ import static com.damai.constant.Constant.TRACE_ID; **/ @Slf4j +@AllArgsConstructor public class FeignRequestInterceptor implements RequestInterceptor { + private final ExtraRibbonProperties extraRibbonProperties; + @Override - public void apply(final RequestTemplate template) { + public void apply(RequestTemplate template) { try { RequestAttributes ra = RequestContextHolder.getRequestAttributes(); - if (ra != null) { + if (Objects.nonNull(ra)) { ServletRequestAttributes sra = (ServletRequestAttributes) ra; HttpServletRequest request = sra.getRequest(); String traceId = request.getHeader(TRACE_ID); String code = request.getHeader(CODE); + String gray = request.getHeader(GRAY_PARAMETER); + if (StringUtil.isEmpty(gray)) { + gray = extraRibbonProperties.getGray(); + } template.header(TRACE_ID,traceId); template.header(CODE,code); + template.header(GRAY_PARAMETER,gray); } }catch (Exception e) { log.error("FeignRequestInterceptor apply error",e); diff --git a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/filter/BaseParameterFilter.java b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/filter/BaseParameterFilter.java index f785a23c6d99e1082fce383b4a87e169a71f0069..131faa35bdea48c18a6ca978bf75f3d22d9538d9 100644 --- a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/filter/BaseParameterFilter.java +++ b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/filter/BaseParameterFilter.java @@ -1,6 +1,6 @@ package com.damai.filter; -import com.damai.core.StringUtil; +import com.damai.util.StringUtil; import com.damai.threadlocal.BaseParameterHolder; import lombok.extern.slf4j.Slf4j; import org.slf4j.MDC; @@ -12,8 +12,10 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import static com.damai.constant.Constant.MARK_PARAMETER; +import static com.damai.constant.Constant.CODE; +import static com.damai.constant.Constant.GRAY_PARAMETER; import static com.damai.constant.Constant.TRACE_ID; +import static com.damai.constant.Constant.USER_ID; /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 @@ -26,22 +28,36 @@ public class BaseParameterFilter extends OncePerRequestFilter { protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response, final FilterChain filterChain) throws ServletException, IOException { log.info("current thread doFilterInternal : {}",Thread.currentThread().getName()); String traceId = request.getHeader(TRACE_ID); - String mark = request.getHeader(MARK_PARAMETER); + String gray = request.getHeader(GRAY_PARAMETER); + String userId = request.getHeader(USER_ID); + String code = request.getHeader(CODE); try { if (StringUtil.isNotEmpty(traceId)) { - BaseParameterHolder.setParameter(TRACE_ID,traceId); + BaseParameterHolder.setParameter(TRACE_ID,traceId); MDC.put(TRACE_ID,traceId); } - if (StringUtil.isNotEmpty(mark)) { - BaseParameterHolder.setParameter(MARK_PARAMETER,mark); - MDC.put(MARK_PARAMETER,mark); + if (StringUtil.isNotEmpty(gray)) { + BaseParameterHolder.setParameter(GRAY_PARAMETER,gray); + MDC.put(GRAY_PARAMETER,gray); + } + if (StringUtil.isNotEmpty(userId)) { + BaseParameterHolder.setParameter(USER_ID,userId); + MDC.put(USER_ID,userId); + } + if (StringUtil.isNotEmpty(code)) { + BaseParameterHolder.setParameter(CODE,code); + MDC.put(CODE,code); } filterChain.doFilter(request, response); }finally { BaseParameterHolder.removeParameter(TRACE_ID); MDC.remove(TRACE_ID); - BaseParameterHolder.removeParameter(MARK_PARAMETER); - MDC.remove(MARK_PARAMETER); + BaseParameterHolder.removeParameter(GRAY_PARAMETER); + MDC.remove(GRAY_PARAMETER); + BaseParameterHolder.removeParameter(USER_ID); + MDC.remove(USER_ID); + BaseParameterHolder.removeParameter(CODE); + MDC.remove(CODE); } } } diff --git a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/registercenter/EurekaAutoConfigurationBean.java b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/registercenter/EurekaAutoConfigurationBean.java index 0e8c90a3c19677f0c14acda33d8b8408a17efbb8..4a927721d37694c1e16b77855c0dddcde231e910 100644 --- a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/registercenter/EurekaAutoConfigurationBean.java +++ b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/registercenter/EurekaAutoConfigurationBean.java @@ -10,30 +10,30 @@ import java.util.Map; **/ public class EurekaAutoConfigurationBean { - private static final String DiscoveryClientOptionalArgsConfiguration = "org.springframework.cloud.netflix.eureka.config.DiscoveryClientOptionalArgsConfiguration"; + private static final String DISCOVERY_CLIENT_OPTIONAL_ARGS_CONFIGURATION = "org.springframework.cloud.netflix.eureka.config.DiscoveryClientOptionalArgsConfiguration"; - private static final String EurekaClientAutoConfiguration = "org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration"; + private static final String EUREKA_CLIENT_AUTO_CONFIGURATION = "org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration"; - private static final String RibbonEurekaAutoConfiguration = "org.springframework.cloud.netflix.ribbon.eureka.RibbonEurekaAutoConfiguration"; + private static final String RIBBON_EUREKA_AUTO_CONFIGURATION = "org.springframework.cloud.netflix.ribbon.eureka.RibbonEurekaAutoConfiguration"; - private static final String EurekaDiscoveryClientConfiguration = "org.springframework.cloud.netflix.eureka.EurekaDiscoveryClientConfiguration"; + private static final String EUREKA_DISCOVERY_CLIENT_CONFIGURATION = "org.springframework.cloud.netflix.eureka.EurekaDiscoveryClientConfiguration"; - private static final String EurekaReactiveDiscoveryClientConfiguration = "org.springframework.cloud.netflix.eureka.reactive.EurekaReactiveDiscoveryClientConfiguration"; + private static final String EUREKA_REACTIVE_DISCOVERY_CLIENT_CONFIGURATION = "org.springframework.cloud.netflix.eureka.reactive.EurekaReactiveDiscoveryClientConfiguration"; - private static final String LoadBalancerEurekaAutoConfiguration = "org.springframework.cloud.netflix.eureka.loadbalancer.LoadBalancerEurekaAutoConfiguration"; + private static final String LOAD_BALANCER_EUREKA_AUTO_CONFIGURATION = "org.springframework.cloud.netflix.eureka.loadbalancer.LoadBalancerEurekaAutoConfiguration"; - private static final Map map = new HashMap<>(10); + private static final Map MAP = new HashMap<>(10); static { - map.put(DiscoveryClientOptionalArgsConfiguration,DiscoveryClientOptionalArgsConfiguration); - map.put(EurekaClientAutoConfiguration,EurekaClientAutoConfiguration); - map.put(RibbonEurekaAutoConfiguration,RibbonEurekaAutoConfiguration); - map.put(EurekaDiscoveryClientConfiguration,EurekaDiscoveryClientConfiguration); - map.put(EurekaReactiveDiscoveryClientConfiguration,EurekaReactiveDiscoveryClientConfiguration); - map.put(LoadBalancerEurekaAutoConfiguration,LoadBalancerEurekaAutoConfiguration); + MAP.put(DISCOVERY_CLIENT_OPTIONAL_ARGS_CONFIGURATION, DISCOVERY_CLIENT_OPTIONAL_ARGS_CONFIGURATION); + MAP.put(EUREKA_CLIENT_AUTO_CONFIGURATION, EUREKA_CLIENT_AUTO_CONFIGURATION); + MAP.put(RIBBON_EUREKA_AUTO_CONFIGURATION, RIBBON_EUREKA_AUTO_CONFIGURATION); + MAP.put(EUREKA_DISCOVERY_CLIENT_CONFIGURATION, EUREKA_DISCOVERY_CLIENT_CONFIGURATION); + MAP.put(EUREKA_REACTIVE_DISCOVERY_CLIENT_CONFIGURATION, EUREKA_REACTIVE_DISCOVERY_CLIENT_CONFIGURATION); + MAP.put(LOAD_BALANCER_EUREKA_AUTO_CONFIGURATION, LOAD_BALANCER_EUREKA_AUTO_CONFIGURATION); } public static Map autoConfigurationBeanNameMap() { - return map; + return MAP; } } diff --git a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/registercenter/NacosAutoConfigurationBean.java b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/registercenter/NacosAutoConfigurationBean.java index 2544332d4dfbb543ab39aeba600b856e6630171a..227033e9d8e0acc77cd8451fe54088eab406f202 100644 --- a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/registercenter/NacosAutoConfigurationBean.java +++ b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/registercenter/NacosAutoConfigurationBean.java @@ -10,42 +10,42 @@ import java.util.Map; **/ public class NacosAutoConfigurationBean { - private static final String nacosDiscoveryAutoConfiguration = "com.alibaba.cloud.nacos.discovery.NacosDiscoveryAutoConfiguration"; + private static final String NACOS_DISCOVERY_AUTO_CONFIGURATION = "com.alibaba.cloud.nacos.discovery.NacosDiscoveryAutoConfiguration"; - private static final String ribbonNacosAutoConfiguration = "com.alibaba.cloud.nacos.ribbon.RibbonNacosAutoConfiguration"; + private static final String RIBBON_NACOS_AUTO_CONFIGURATION = "com.alibaba.cloud.nacos.ribbon.RibbonNacosAutoConfiguration"; - private static final String nacosDiscoveryEndpointAutoConfiguration = "com.alibaba.cloud.nacos.endpoint.NacosDiscoveryEndpointAutoConfiguration"; + private static final String NACOS_DISCOVERY_ENDPOINT_AUTO_CONFIGURATION = "com.alibaba.cloud.nacos.endpoint.NacosDiscoveryEndpointAutoConfiguration"; - private static final String nacosServiceRegistryAutoConfiguration = "com.alibaba.cloud.nacos.registry.NacosServiceRegistryAutoConfiguration"; + private static final String NACOS_SERVICE_REGISTRY_AUTO_CONFIGURATION = "com.alibaba.cloud.nacos.registry.NacosServiceRegistryAutoConfiguration"; - private static final String nacosDiscoveryClientConfiguration = "com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientConfiguration"; + private static final String NACOS_DISCOVERY_CLIENT_CONFIGURATION = "com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientConfiguration"; - private static final String nacosReactiveDiscoveryClientConfiguration = "com.alibaba.cloud.nacos.discovery.reactive.NacosReactiveDiscoveryClientConfiguration"; + private static final String NACOS_REACTIVE_DISCOVERY_CLIENT_CONFIGURATION = "com.alibaba.cloud.nacos.discovery.reactive.NacosReactiveDiscoveryClientConfiguration"; - private static final String nacosConfigServerAutoConfiguration = "com.alibaba.cloud.nacos.discovery.configclient.NacosConfigServerAutoConfiguration"; + private static final String NACOS_CONFIG_SERVER_AUTO_CONFIGURATION = "com.alibaba.cloud.nacos.discovery.configclient.NacosConfigServerAutoConfiguration"; - private static final String nacosServiceAutoConfiguration = "com.alibaba.cloud.nacos.NacosServiceAutoConfiguration"; + private static final String NACOS_SERVICE_AUTO_CONFIGURATION = "com.alibaba.cloud.nacos.NacosServiceAutoConfiguration"; - private static final String nacosDiscoveryClientConfigServiceBootstrapConfiguration = "com.alibaba.cloud.nacos.discovery.configclient.NacosDiscoveryClientConfigServiceBootstrapConfiguration"; + private static final String NACOS_DISCOVERY_CLIENT_CONFIG_SERVICE_BOOTSTRAP_CONFIGURATION = "com.alibaba.cloud.nacos.discovery.configclient.NacosDiscoveryClientConfigServiceBootstrapConfiguration"; - private static final String nacosServiceConfig = "com.nacosrefresh.conf.NacosServiceConfig"; + private static final String NACOS_SERVICE_CONFIG = "com.nacosrefresh.conf.NacosServiceConfig"; - private static final Map map = new HashMap<>(10); + private static final Map MAP = new HashMap<>(10); static { - map.put(nacosDiscoveryAutoConfiguration,nacosDiscoveryAutoConfiguration); - map.put(ribbonNacosAutoConfiguration,ribbonNacosAutoConfiguration); - map.put(nacosDiscoveryEndpointAutoConfiguration,nacosDiscoveryEndpointAutoConfiguration); - map.put(nacosServiceRegistryAutoConfiguration,nacosServiceRegistryAutoConfiguration); - map.put(nacosDiscoveryClientConfiguration,nacosDiscoveryClientConfiguration); - map.put(nacosReactiveDiscoveryClientConfiguration,nacosReactiveDiscoveryClientConfiguration); - map.put(nacosConfigServerAutoConfiguration,nacosConfigServerAutoConfiguration); - map.put(nacosServiceAutoConfiguration,nacosServiceAutoConfiguration); - map.put(nacosDiscoveryClientConfigServiceBootstrapConfiguration,nacosDiscoveryClientConfigServiceBootstrapConfiguration); - map.put(nacosServiceConfig,nacosServiceConfig); + MAP.put(NACOS_DISCOVERY_AUTO_CONFIGURATION, NACOS_DISCOVERY_AUTO_CONFIGURATION); + MAP.put(RIBBON_NACOS_AUTO_CONFIGURATION, RIBBON_NACOS_AUTO_CONFIGURATION); + MAP.put(NACOS_DISCOVERY_ENDPOINT_AUTO_CONFIGURATION, NACOS_DISCOVERY_ENDPOINT_AUTO_CONFIGURATION); + MAP.put(NACOS_SERVICE_REGISTRY_AUTO_CONFIGURATION, NACOS_SERVICE_REGISTRY_AUTO_CONFIGURATION); + MAP.put(NACOS_DISCOVERY_CLIENT_CONFIGURATION, NACOS_DISCOVERY_CLIENT_CONFIGURATION); + MAP.put(NACOS_REACTIVE_DISCOVERY_CLIENT_CONFIGURATION, NACOS_REACTIVE_DISCOVERY_CLIENT_CONFIGURATION); + MAP.put(NACOS_CONFIG_SERVER_AUTO_CONFIGURATION, NACOS_CONFIG_SERVER_AUTO_CONFIGURATION); + MAP.put(NACOS_SERVICE_AUTO_CONFIGURATION, NACOS_SERVICE_AUTO_CONFIGURATION); + MAP.put(NACOS_DISCOVERY_CLIENT_CONFIG_SERVICE_BOOTSTRAP_CONFIGURATION, NACOS_DISCOVERY_CLIENT_CONFIG_SERVICE_BOOTSTRAP_CONFIGURATION); + MAP.put(NACOS_SERVICE_CONFIG, NACOS_SERVICE_CONFIG); } public static Map autoConfigurationBeanNameMap() { - return map; + return MAP; } } diff --git a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/registercenter/RegisterCenterAutoConfigurationImportFilter.java b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/registercenter/RegisterCenterAutoConfigurationImportFilter.java index ec5fc310257bcf570d1e6fcf37971b1356fdb0dc..094f8bc2779d8e70de092ba0e16a2a906c8dba33 100644 --- a/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/registercenter/RegisterCenterAutoConfigurationImportFilter.java +++ b/damai-spring-cloud-framework/damai-service-component/src/main/java/com/damai/registercenter/RegisterCenterAutoConfigurationImportFilter.java @@ -1,6 +1,6 @@ package com.damai.registercenter; -import com.damai.core.StringUtil; +import com.damai.util.StringUtil; import org.springframework.boot.autoconfigure.AutoConfigurationImportFilter; import org.springframework.boot.autoconfigure.AutoConfigurationMetadata; import org.springframework.context.EnvironmentAware; @@ -22,9 +22,9 @@ public class RegisterCenterAutoConfigurationImportFilter implements AutoConfigur private static final String EUREKA = "eureka"; - private static final Map eurekaAutoConfigurationBeanNameMap = EurekaAutoConfigurationBean.autoConfigurationBeanNameMap(); + private static final Map EUREKA_AUTO_CONFIGURATION_BEAN_NAME_MAP = EurekaAutoConfigurationBean.autoConfigurationBeanNameMap(); - private static final Map nacosAutoConfigurationBeanNameMap = NacosAutoConfigurationBean.autoConfigurationBeanNameMap(); + private static final Map NACOS_AUTO_CONFIGURATION_BEAN_NAME_MAP = NacosAutoConfigurationBean.autoConfigurationBeanNameMap(); @Override @@ -35,11 +35,11 @@ public class RegisterCenterAutoConfigurationImportFilter implements AutoConfigur if (NACOS.equals(type)) { for (int i = 0; i < autoConfigurationClasses.length; i++) { - match[i] = eurekaAutoConfigurationBeanNameMap.get(autoConfigurationClasses[i]) == null; + match[i] = EUREKA_AUTO_CONFIGURATION_BEAN_NAME_MAP.get(autoConfigurationClasses[i]) == null; } }else if (EUREKA.equals(type)) { for (int i = 0; i < autoConfigurationClasses.length; i++) { - match[i] = nacosAutoConfigurationBeanNameMap.get(autoConfigurationClasses[i]) == null; + match[i] = NACOS_AUTO_CONFIGURATION_BEAN_NAME_MAP.get(autoConfigurationClasses[i]) == null; } }else { for (int i = 0; i < autoConfigurationClasses.length; i++) { diff --git a/api-stat/api-stat-common/.gitignore b/damai-spring-cloud-framework/damai-service-initialize/.gitignore similarity index 100% rename from api-stat/api-stat-common/.gitignore rename to damai-spring-cloud-framework/damai-service-initialize/.gitignore diff --git a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/pom.xml b/damai-spring-cloud-framework/damai-service-initialize/pom.xml similarity index 66% rename from damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/pom.xml rename to damai-spring-cloud-framework/damai-service-initialize/pom.xml index 76fed79d13398feffcdf351dcc0a6f1d33ad711c..a0c62010f11db3734100f716284636fa06e6d699 100644 --- a/damai-spring-cloud-framework/damai-sentinel-general/damai-sentinel-common-general/pom.xml +++ b/damai-spring-cloud-framework/damai-service-initialize/pom.xml @@ -5,12 +5,13 @@ com.example - damai-sentinel-general + damai-spring-cloud-framework ${revision} - damai-sentinel-common-general - sentinel-common-general - sentinel common支持全局配置组件 + + damai-service-initialize + service-initialize + service容器初始化行为操作 @@ -20,8 +21,8 @@ ${revision}
    - com.alibaba.cloud - spring-cloud-starter-alibaba-sentinel + org.springframework.boot + spring-boot-starter-web diff --git a/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/AbstractApplicationCommandLineRunnerHandler.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/AbstractApplicationCommandLineRunnerHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..6cec80a00cc3646872a7eb97b2381844ad0d9061 --- /dev/null +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/AbstractApplicationCommandLineRunnerHandler.java @@ -0,0 +1,18 @@ +package com.damai.initialize.base; + +import org.springframework.boot.CommandLineRunner; + +import static com.damai.initialize.constant.InitializeHandlerType.APPLICATION_POST_CONSTRUCT; + +/** + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 用于处理 {@link CommandLineRunner} 类型 初始化执行 抽象 + * @author: 阿宽不是程序员 + **/ +public abstract class AbstractApplicationCommandLineRunnerHandler implements InitializeHandler { + + @Override + public String type() { + return APPLICATION_POST_CONSTRUCT; + } +} diff --git a/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/AbstractApplicationInitializingBeanHandler.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/AbstractApplicationInitializingBeanHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..19b09e367fa6c624ab7667c0263090fad9880176 --- /dev/null +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/AbstractApplicationInitializingBeanHandler.java @@ -0,0 +1,18 @@ +package com.damai.initialize.base; + +import org.springframework.beans.factory.InitializingBean; + +import static com.damai.initialize.constant.InitializeHandlerType.APPLICATION_INITIALIZING_BEAN; + +/** + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 用于处理 {@link InitializingBean} 类型 初始化执行 抽象 + * @author: 阿宽不是程序员 + **/ +public abstract class AbstractApplicationInitializingBeanHandler implements InitializeHandler { + + @Override + public String type() { + return APPLICATION_INITIALIZING_BEAN; + } +} diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/SelectPageHandle.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/AbstractApplicationPostConstructHandler.java similarity index 32% rename from damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/SelectPageHandle.java rename to damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/AbstractApplicationPostConstructHandler.java index 3b746d6b3bbe693aba85f918b4d0070cd050f24f..c3ac5449c59a283a3ef607da64e339c7c5d10d74 100644 --- a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/SelectPageHandle.java +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/AbstractApplicationPostConstructHandler.java @@ -1,16 +1,18 @@ -package com.damai.service.pagestrategy; +package com.damai.initialize.base; + +import javax.annotation.PostConstruct; + +import static com.damai.initialize.constant.InitializeHandlerType.APPLICATION_POST_CONSTRUCT; -import com.damai.dto.ProgramPageListDto; -import com.damai.page.PageVo; -import com.damai.vo.ProgramListVo; /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 - * @description: 节目查询方法抽象 + * @description: 用于处理 {@link PostConstruct} 类型 初始化执行 抽象 * @author: 阿宽不是程序员 **/ -public interface SelectPageHandle { - - PageVo selectPage(ProgramPageListDto programPageListDto); +public abstract class AbstractApplicationPostConstructHandler implements InitializeHandler { - String getType(); + @Override + public String type() { + return APPLICATION_POST_CONSTRUCT; + } } diff --git a/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/AbstractApplicationStartEventListenerHandler.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/AbstractApplicationStartEventListenerHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..818fa5014d82efc19c3a295d02e1264bd9f89588 --- /dev/null +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/AbstractApplicationStartEventListenerHandler.java @@ -0,0 +1,18 @@ +package com.damai.initialize.base; + +import org.springframework.beans.factory.InitializingBean; + +import static com.damai.initialize.constant.InitializeHandlerType.APPLICATION_EVENT_LISTENER; + +/** + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 用于处理 {@link InitializingBean} 类型 初始化执行 抽象 + * @author: 阿宽不是程序员 + **/ +public abstract class AbstractApplicationStartEventListenerHandler implements InitializeHandler { + + @Override + public String type() { + return APPLICATION_EVENT_LISTENER; + } +} diff --git a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/init/InitDataContainer.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/InitializeHandler.java similarity index 38% rename from damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/init/InitDataContainer.java rename to damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/InitializeHandler.java index 1218bd7815d0e72c497c0fb542dddef69f55204f..802e2ae73966542d7fd542285dff8fb2ef47630b 100644 --- a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/init/InitDataContainer.java +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/base/InitializeHandler.java @@ -1,23 +1,29 @@ -package com.damai.init; +package com.damai.initialize.base; import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.stereotype.Component; -import java.util.Map; /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 - * @description: 初始化操作执行 + * @description: 初始化执行 顶级抽象 接口 * @author: 阿宽不是程序员 **/ -@Component -public class InitDataContainer { +public interface InitializeHandler { + /** + * 初始化执行 类型 + * @return 类型 + * */ + String type(); + + /** + * 执行顺序 + * @return 顺序 + * */ + Integer executeOrder(); /** - * 初始化数据 + * 执行逻辑 + * @param context 容器上下文 * */ - public void initData(ConfigurableApplicationContext applicationContext){ - // 获取所有 InitData 类型的 Bean - Map initDataMap = applicationContext.getBeansOfType(InitData.class); - initDataMap.forEach((k,v) -> v.init()); - } + void executeInit(ConfigurableApplicationContext context); + } diff --git a/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/config/InitializeAutoConfig.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/config/InitializeAutoConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..48045e6f9db1cba8756a12991cecc76754515ccf --- /dev/null +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/config/InitializeAutoConfig.java @@ -0,0 +1,40 @@ +package com.damai.initialize.config; + +import com.damai.initialize.execute.ApplicationCommandLineRunnerExecute; +import com.damai.initialize.execute.ApplicationInitializingBeanExecute; +import com.damai.initialize.execute.ApplicationPostConstructExecute; +import com.damai.initialize.execute.ApplicationStartEventListenerExecute; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.Bean; + +/** + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 初始化执行 相关配置 + * @author: 阿宽不是程序员 + **/ +public class InitializeAutoConfig { + + @Bean + public ApplicationInitializingBeanExecute applicationInitializingBeanExecute( + ConfigurableApplicationContext applicationContext){ + return new ApplicationInitializingBeanExecute(applicationContext); + } + + @Bean + public ApplicationPostConstructExecute applicationPostConstructExecute( + ConfigurableApplicationContext applicationContext){ + return new ApplicationPostConstructExecute(applicationContext); + } + + @Bean + public ApplicationStartEventListenerExecute applicationStartEventListenerExecute( + ConfigurableApplicationContext applicationContext){ + return new ApplicationStartEventListenerExecute(applicationContext); + } + + @Bean + public ApplicationCommandLineRunnerExecute applicationCommandLineRunnerExecute( + ConfigurableApplicationContext applicationContext){ + return new ApplicationCommandLineRunnerExecute(applicationContext); + } +} diff --git a/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/constant/InitializeHandlerType.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/constant/InitializeHandlerType.java new file mode 100644 index 0000000000000000000000000000000000000000..3721d51dbcc0753a32036bdd8537ee2c822b9acb --- /dev/null +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/constant/InitializeHandlerType.java @@ -0,0 +1,17 @@ +package com.damai.initialize.constant; + +/** + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 初始化执行 不同策略类型 + * @author: 阿宽不是程序员 + **/ +public class InitializeHandlerType { + + public static final String APPLICATION_EVENT_LISTENER = "application_event_listener"; + + public static final String APPLICATION_POST_CONSTRUCT = "application_post_construct"; + + public static final String APPLICATION_INITIALIZING_BEAN = "application_initializing_bean"; + + public static final String APPLICATION_COMMAND_LINE_RUNNER = "application_command_line_runner"; +} diff --git a/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/ApplicationCommandLineRunnerExecute.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/ApplicationCommandLineRunnerExecute.java new file mode 100644 index 0000000000000000000000000000000000000000..e33a5c730b1e9c7b9b09d7fcaadb06b85f20192a --- /dev/null +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/ApplicationCommandLineRunnerExecute.java @@ -0,0 +1,29 @@ +package com.damai.initialize.execute; + +import com.damai.initialize.execute.base.AbstractApplicationExecute; +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.ConfigurableApplicationContext; + +import static com.damai.initialize.constant.InitializeHandlerType.APPLICATION_COMMAND_LINE_RUNNER; + +/** + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 用于处理 {@link CommandLineRunner} 应用程序启动事件。 + * @author: 阿宽不是程序员 + **/ +public class ApplicationCommandLineRunnerExecute extends AbstractApplicationExecute implements CommandLineRunner { + + public ApplicationCommandLineRunnerExecute(ConfigurableApplicationContext applicationContext){ + super(applicationContext); + } + + @Override + public void run(final String... args) { + execute(); + } + + @Override + public String type() { + return APPLICATION_COMMAND_LINE_RUNNER; + } +} diff --git a/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/ApplicationInitializingBeanExecute.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/ApplicationInitializingBeanExecute.java new file mode 100644 index 0000000000000000000000000000000000000000..1e153069b3c99ee891f588391e6907c9e228f6d4 --- /dev/null +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/ApplicationInitializingBeanExecute.java @@ -0,0 +1,30 @@ +package com.damai.initialize.execute; + +import com.damai.initialize.execute.base.AbstractApplicationExecute; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.ConfigurableApplicationContext; + +import static com.damai.initialize.constant.InitializeHandlerType.APPLICATION_INITIALIZING_BEAN; + +/** + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 用于处理 {@link InitializingBean} 应用程序启动事件。 + * @author: 阿宽不是程序员 + **/ + +public class ApplicationInitializingBeanExecute extends AbstractApplicationExecute implements InitializingBean { + + public ApplicationInitializingBeanExecute(ConfigurableApplicationContext applicationContext){ + super(applicationContext); + } + + @Override + public void afterPropertiesSet() { + execute(); + } + + @Override + public String type() { + return APPLICATION_INITIALIZING_BEAN; + } +} diff --git a/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/ApplicationPostConstructExecute.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/ApplicationPostConstructExecute.java new file mode 100644 index 0000000000000000000000000000000000000000..635fc0ff4af6448684e371c0831b4ce8a0363cfb --- /dev/null +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/ApplicationPostConstructExecute.java @@ -0,0 +1,30 @@ +package com.damai.initialize.execute; + +import com.damai.initialize.execute.base.AbstractApplicationExecute; +import org.springframework.context.ConfigurableApplicationContext; + +import javax.annotation.PostConstruct; + +import static com.damai.initialize.constant.InitializeHandlerType.APPLICATION_POST_CONSTRUCT; + +/** + * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 + * @description: 用于处理 {@link PostConstruct} 应用程序启动事件。 + * @author: 阿宽不是程序员 + **/ +public class ApplicationPostConstructExecute extends AbstractApplicationExecute { + + public ApplicationPostConstructExecute(ConfigurableApplicationContext applicationContext){ + super(applicationContext); + } + + @PostConstruct + public void postConstructExecute() { + execute(); + } + + @Override + public String type() { + return APPLICATION_POST_CONSTRUCT; + } +} diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/event/SelectPageHandleStrategyInit.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/ApplicationStartEventListenerExecute.java similarity index 33% rename from damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/event/SelectPageHandleStrategyInit.java rename to damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/ApplicationStartEventListenerExecute.java index 236cb185b2c2e61f56ea38eeefaa0b0161ea3996..7e7bcf0000d219e4aaa96102e8e2749f1c055d0a 100644 --- a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/event/SelectPageHandleStrategyInit.java +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/ApplicationStartEventListenerExecute.java @@ -1,30 +1,30 @@ -package com.damai.service.pagestrategy.event; +package com.damai.initialize.execute; -import com.damai.service.pagestrategy.SelectPageHandle; -import com.damai.service.pagestrategy.SelectPageStrategyContext; -import lombok.AllArgsConstructor; +import com.damai.initialize.execute.base.AbstractApplicationExecute; import org.springframework.boot.context.event.ApplicationStartedEvent; import org.springframework.context.ApplicationListener; +import org.springframework.context.ConfigurableApplicationContext; -import java.util.Map; -import java.util.Map.Entry; +import static com.damai.initialize.constant.InitializeHandlerType.APPLICATION_EVENT_LISTENER; /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 - * @description: 节目查询策略初始化 + * @description: 用于处理 {@link ApplicationStartedEvent} 应用程序启动事件。 * @author: 阿宽不是程序员 **/ -@AllArgsConstructor -public class SelectPageHandleStrategyInit implements ApplicationListener { +public class ApplicationStartEventListenerExecute extends AbstractApplicationExecute implements ApplicationListener { - private final SelectPageStrategyContext selectPageStrategyContext; + public ApplicationStartEventListenerExecute(ConfigurableApplicationContext applicationContext){ + super(applicationContext); + } @Override public void onApplicationEvent(ApplicationStartedEvent event) { - Map selectPageHandleMap = event.getApplicationContext().getBeansOfType(SelectPageHandle.class); - for (Entry entry : selectPageHandleMap.entrySet()) { - SelectPageHandle selectPageHandle = entry.getValue(); - selectPageStrategyContext.put(selectPageHandle.getType(),selectPageHandle); - } + execute(); + } + + @Override + public String type() { + return APPLICATION_EVENT_LISTENER; } } diff --git a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/SelectPageStrategyContext.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/base/AbstractApplicationExecute.java similarity index 33% rename from damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/SelectPageStrategyContext.java rename to damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/base/AbstractApplicationExecute.java index 4fec9f59ce8e76a48ddbcac2f4d3d57358a20e8c..57a9e9758369e2acf4252b98e42c1ba790733e57 100644 --- a/damai-server/damai-program-service/src/main/java/com/damai/service/pagestrategy/SelectPageStrategyContext.java +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/execute/base/AbstractApplicationExecute.java @@ -1,28 +1,35 @@ -package com.damai.service.pagestrategy; +package com.damai.initialize.execute.base; -import com.damai.service.pagestrategy.impl.SelectPageDbHandle; +import com.damai.initialize.base.InitializeHandler; import lombok.AllArgsConstructor; import org.springframework.context.ConfigurableApplicationContext; -import java.util.HashMap; +import java.util.Comparator; import java.util.Map; -import java.util.Optional; + /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 - * @description: 节目查询策略上下文 + * @description: 用于处理应用程序启动执行的基类 * @author: 阿宽不是程序员 **/ @AllArgsConstructor -public class SelectPageStrategyContext { +public abstract class AbstractApplicationExecute { private final ConfigurableApplicationContext applicationContext; - private final Map selectPageHandleMap = new HashMap<>(); - - public void put(String type,SelectPageHandle selectPageHandle){ - selectPageHandleMap.put(type,selectPageHandle); - } - public SelectPageHandle get(String type){ - return Optional.ofNullable(selectPageHandleMap.get(type)).orElse(applicationContext.getBean(SelectPageDbHandle.class)); + public void execute(){ + Map initializeHandlerMap = applicationContext.getBeansOfType(InitializeHandler.class); + initializeHandlerMap.values() + .stream() + .filter(initializeHandler -> initializeHandler.type().equals(type())) + .sorted(Comparator.comparingInt(InitializeHandler::executeOrder)) + .forEach(initializeHandler -> { + initializeHandler.executeInit(applicationContext); + }); } + /** + * 初始化执行 类型 + * @return 类型 + * */ + public abstract String type(); } diff --git a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/composite/AbstractComposite.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/impl/composite/AbstractComposite.java similarity index 73% rename from damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/composite/AbstractComposite.java rename to damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/impl/composite/AbstractComposite.java index 2f95f2d7e45a7b7ea72182923ae8d9a75a962900..cb3774dab87f95b3602ef3e4cbf80f122b258816 100644 --- a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/composite/AbstractComposite.java +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/impl/composite/AbstractComposite.java @@ -1,4 +1,4 @@ -package com.damai.composite; +package com.damai.initialize.impl.composite; import java.util.ArrayList; import java.util.LinkedList; @@ -7,7 +7,7 @@ import java.util.Queue; /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 - * @description: 抽象类 AbstractComposite 表示组合接口,用于构建和执行具有层级结构的业务逻辑 + * @description: 抽象类 AbstractComposite 表示组合接口,用于构建和执行具有树结构的业务逻辑 * @param 泛型参数,表示执行业务时传递的参数类型 * @author: 阿宽不是程序员 **/ @@ -26,55 +26,58 @@ public abstract class AbstractComposite { protected abstract void execute(T param); /** + * 获取返回组件的类型 * @return 返回组件的类型。 */ public abstract String type(); /** + * 返回父级执行顺序,用于建立层级关系.(根节点的话返回值为0) * @return 返回父级执行顺序,用于建立层级关系.(根节点的话返回值为0) */ public abstract Integer executeParentOrder(); /** - * @return 返回组件的执行层级。 + * 返回组件的执行层级 + * @return 返回组件的执行层级 */ public abstract Integer executeTier(); /** - * @return 返回组件在同一层级中的执行顺序。 + * 返回组件在同一层级中的执行顺序 + * @return 返回组件在同一层级中的执行顺序 */ public abstract Integer executeOrder(); /** - * 将子组件添加到当前组件的子列表中。 - * @param abstractComposite 子组件实例。 + * 将子组件添加到当前组件的子列表中 + * @param abstractComposite 子组件实例 */ public void add(AbstractComposite abstractComposite) { list.add(abstractComposite); } /** - * 按层次结构执行每个组件的业务逻辑。 - * @param param 泛型参数,用于业务执行。 + * 按层次结构执行每个组件的业务逻辑 + * @param param 泛型参数,用于业务执行 */ public void allExecute(T param) { Queue> queue = new LinkedList<>(); - // 将当前对象加入队列 + queue.add(this); while (!queue.isEmpty()) { - // 当前层的大小 + int levelSize = queue.size(); for (int i = 0; i < levelSize; i++) { - // 从队列中取出一个元素 + AbstractComposite current = queue.poll(); - // 执行当前元素的业务逻辑 + assert current != null; current.execute(param); - // 将当前元素的子元素加入队列,以便在下一次迭代中处理 queue.addAll(current.list); } } diff --git a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/composite/CompositeAutoConfiguration.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/impl/composite/CompositeAutoConfiguration.java similarity index 56% rename from damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/composite/CompositeAutoConfiguration.java rename to damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/impl/composite/CompositeAutoConfiguration.java index 0dda4a525bec3d4c13cb61dfaf8cf4cdb6dc5b60..44a5c09e9fc66a682211486cb8e43a87002ff501 100644 --- a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/composite/CompositeAutoConfiguration.java +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/impl/composite/CompositeAutoConfiguration.java @@ -1,7 +1,6 @@ -package com.damai.composite; +package com.damai.initialize.impl.composite; -import com.damai.event.ApplicationStartedEventHandler; -import com.damai.init.InitDataContainer; +import com.damai.initialize.impl.composite.init.CompositeInit; import org.springframework.context.annotation.Bean; /** @@ -12,12 +11,12 @@ import org.springframework.context.annotation.Bean; public class CompositeAutoConfiguration { @Bean - public ApplicationStartedEventHandler applicationStartedEventHandler(CompositeContainer compositeContainer, InitDataContainer initDataContainer){ - return new ApplicationStartedEventHandler(compositeContainer,initDataContainer); + public CompositeContainer compositeContainer(){ + return new CompositeContainer(); } @Bean - public CompositeContainer compositeContainer(){ - return new CompositeContainer(); + public CompositeInit compositeInit(CompositeContainer compositeContainer){ + return new CompositeInit(compositeContainer); } } diff --git a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/composite/CompositeContainer.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/impl/composite/CompositeContainer.java similarity index 84% rename from damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/composite/CompositeContainer.java rename to damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/impl/composite/CompositeContainer.java index 705baedebfabc1d2c064d56803211372e59a4cd4..2970ad1bfc7427cc83f6034716a999154cc7a789 100644 --- a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/composite/CompositeContainer.java +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/impl/composite/CompositeContainer.java @@ -1,4 +1,4 @@ -package com.damai.composite; +package com.damai.initialize.impl.composite; import com.damai.enums.BaseCode; import com.damai.exception.DaMaiFrameException; @@ -22,14 +22,11 @@ public class CompositeContainer { private final Map allCompositeInterfaceMap = new HashMap<>(); public void init(ConfigurableApplicationContext applicationEvent){ - // 获取所有 AbstractComposite 类型的 Bean Map compositeInterfaceMap = applicationEvent.getBeansOfType(AbstractComposite.class); Map> collect = compositeInterfaceMap.values().stream().collect(Collectors.groupingBy(AbstractComposite::type)); collect.forEach((k,v) -> { - // 构建组件树结构 AbstractComposite root = build(v); - // 如果根节点存在,则执行业务逻辑 if (Objects.nonNull(root)) { allCompositeInterfaceMap.put(k, root); } @@ -52,7 +49,6 @@ public class CompositeContainer { Map nextLevelComponents = groupedByTier.get(currentTier + 1); if (currentLevelComponents == null) { - // 当前层级没有组件时,直接返回 return; } @@ -60,18 +56,14 @@ public class CompositeContainer { for (AbstractComposite child : nextLevelComponents.values()) { Integer parentOrder = child.executeParentOrder(); if (parentOrder == null || parentOrder == 0) { - // 跳过根节点 continue; } AbstractComposite parent = currentLevelComponents.get(parentOrder); if (parent != null) { - // 将子节点添加到父节点的子列表中 parent.add(child); } } } - - // 递归构建下一层级的树结构 buildTree(groupedByTier, currentTier + 1); } @@ -81,26 +73,20 @@ public class CompositeContainer { * @return 根节点。 */ private static AbstractComposite build(Collection components) { - // 按层级和执行顺序组织组件 Map> groupedByTier = new TreeMap<>(); for (AbstractComposite component : components) { - groupedByTier.computeIfAbsent(component.executeTier(), k -> new HashMap<>()) - // 使用 executeOrder 作为键 + groupedByTier.computeIfAbsent(component.executeTier(), k -> new HashMap<>(16)) .put(component.executeOrder(), component); } - // 找到最小层级 Integer minTier = groupedByTier.keySet().stream().min(Integer::compare).orElse(null); if (minTier == null) { - // 没有组件时返回空 return null; } - // 构建组件树 buildTree(groupedByTier, minTier); - // 找到并返回根节点 return groupedByTier.get(minTier).values().stream() .filter(c -> c.executeParentOrder() == null || c.executeParentOrder() == 0) .findFirst() diff --git a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/event/ApplicationStartedEventHandler.java b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/impl/composite/init/CompositeInit.java similarity index 32% rename from damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/event/ApplicationStartedEventHandler.java rename to damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/impl/composite/init/CompositeInit.java index 1a3b5633038ee2e567fbe481e7093951f48d8e15..fad5ff367db063c4794ec9bc946bbc0251f58304 100644 --- a/damai-spring-cloud-framework/damai-service-common/src/main/java/com/damai/event/ApplicationStartedEventHandler.java +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/java/com/damai/initialize/impl/composite/init/CompositeInit.java @@ -1,29 +1,27 @@ -package com.damai.event; +package com.damai.initialize.impl.composite.init; -import com.damai.composite.CompositeContainer; -import com.damai.init.InitDataContainer; +import com.damai.initialize.base.AbstractApplicationStartEventListenerHandler; +import com.damai.initialize.impl.composite.CompositeContainer; import lombok.AllArgsConstructor; -import org.springframework.boot.context.event.ApplicationStartedEvent; -import org.springframework.context.ApplicationListener; +import org.springframework.context.ConfigurableApplicationContext; /** * @program: 极度真实还原大麦网高并发实战项目。 添加 阿宽不是程序员 微信,添加时备注 damai 来获取项目的完整资料 - * @description: ApplicationStartedEventHandler 类用于处理应用程序启动事件。 + * @description: 组合模式初始化操作执行 * @author: 阿宽不是程序员 **/ @AllArgsConstructor -public class ApplicationStartedEventHandler implements ApplicationListener { +public class CompositeInit extends AbstractApplicationStartEventListenerHandler { private final CompositeContainer compositeContainer; - private final InitDataContainer initDataContainer; - @Override - public void onApplicationEvent(final ApplicationStartedEvent event) { - compositeContainer.init(event.getApplicationContext()); - - initDataContainer.initData(event.getApplicationContext()); + public Integer executeOrder() { + return 1; } - + @Override + public void executeInit(ConfigurableApplicationContext context) { + compositeContainer.init(context); + } } diff --git a/api-stat/api-stat-reported/api-stat-reported-cloud-service/src/main/resources/META-INF/spring.factories b/damai-spring-cloud-framework/damai-service-initialize/src/main/resources/META-INF/spring.factories similarity index 35% rename from api-stat/api-stat-reported/api-stat-reported-cloud-service/src/main/resources/META-INF/spring.factories rename to damai-spring-cloud-framework/damai-service-initialize/src/main/resources/META-INF/spring.factories index 4a4618f4023d06f2f34a6e24198a4cb7b70cd828..839c9054f5cc2066c7f86a1ebe1a3deac1293650 100644 --- a/api-stat/api-stat-reported/api-stat-reported-cloud-service/src/main/resources/META-INF/spring.factories +++ b/damai-spring-cloud-framework/damai-service-initialize/src/main/resources/META-INF/spring.factories @@ -1,2 +1,3 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - com.damai.config.ApiStatCloudAutoConfig \ No newline at end of file + com.damai.initialize.config.InitializeAutoConfig,\ + com.damai.initialize.impl.composite.CompositeAutoConfiguration \ No newline at end of file diff --git a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/alibaba/cloud/nacos/ribbon/NacosServerList.java b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/alibaba/cloud/nacos/ribbon/NacosServerList.java index de17df0ea0915f2f64d3f95a59274931ee0533d3..11ef07b3869e5bc736b93a3a894ff9fd4bb12452 100644 --- a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/alibaba/cloud/nacos/ribbon/NacosServerList.java +++ b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/alibaba/cloud/nacos/ribbon/NacosServerList.java @@ -17,10 +17,12 @@ package com.alibaba.cloud.nacos.ribbon; import com.alibaba.cloud.nacos.NacosDiscoveryProperties; +import com.alibaba.cloud.nacos.NacosServiceManager; import com.alibaba.nacos.api.naming.pojo.Instance; import com.alibaba.nacos.client.naming.utils.CollectionUtils; import com.netflix.client.config.IClientConfig; import com.netflix.loadbalancer.AbstractServerList; +import org.springframework.beans.factory.annotation.Autowired; import java.util.ArrayList; import java.util.List; @@ -36,6 +38,9 @@ public class NacosServerList extends AbstractServerList { private String serviceId; + @Autowired + private NacosServiceManager nacosServiceManager; + public NacosServerList(NacosDiscoveryProperties discoveryProperties) { this.discoveryProperties = discoveryProperties; } @@ -53,7 +58,7 @@ public class NacosServerList extends AbstractServerList { private List getServers() { try { String group = discoveryProperties.getGroup(); - List instances = discoveryProperties.namingServiceInstance() + List instances = nacosServiceManager.getNamingService(discoveryProperties.getNacosProperties()) .selectInstances(serviceId, group, true,false); return instancesToServerList(instances); } diff --git a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/alibaba/nacos/api/naming/pojo/ServiceInfo.java b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/alibaba/nacos/api/naming/pojo/ServiceInfo.java index f2106c83f28db9941df8a7533e48d97c9c463278..a486e3594d26918c6d632984d5581ef32641caaf 100644 --- a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/alibaba/nacos/api/naming/pojo/ServiceInfo.java +++ b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/alibaba/nacos/api/naming/pojo/ServiceInfo.java @@ -66,6 +66,8 @@ public class ServiceInfo { private String notifyService; + private ServiceInfo changeServiceInfo; + public ServiceInfo() { } @@ -307,4 +309,12 @@ public class ServiceInfo { public void setNotifyService(String notifyService) { this.notifyService = notifyService; } + + public ServiceInfo getChangeServiceInfo() { + return changeServiceInfo; + } + + public void setChangeServiceInfo(final ServiceInfo changeServiceInfo) { + this.changeServiceInfo = changeServiceInfo; + } } diff --git a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/alibaba/nacos/client/naming/cache/ServiceInfoHolder.java b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/alibaba/nacos/client/naming/cache/ServiceInfoHolder.java index c31644813e164737ba756d3f284fd37fcd951965..510a0bde8c420ec7d2788f4c09cd76499cc10341 100644 --- a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/alibaba/nacos/client/naming/cache/ServiceInfoHolder.java +++ b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/alibaba/nacos/client/naming/cache/ServiceInfoHolder.java @@ -158,19 +158,28 @@ public class ServiceInfoHolder implements Closeable { //empty or error push, just ignore return oldService; } + // 缓存服务信息 serviceInfoMap.put(serviceInfo.getKey(), serviceInfo); + // 判断注册的实例信息是否已变更 boolean changed = isChangedServiceInfo(oldService, serviceInfo); if (StringUtils.isBlank(serviceInfo.getJsonFromServer())) { serviceInfo.setJsonFromServer(JacksonUtils.toJson(serviceInfo)); } + // 监控服务监控缓存Map的大小 MetricsMonitor.getServiceInfoMapSizeMonitor().set(serviceInfoMap.size()); - if (changed || (StringUtils.isNotEmpty(notifyService) && "yes".equals(notifyService))) { -// NAMING_LOGGER.info("current ips:(" + serviceInfo.ipCount() + ") service: " + serviceInfo.getKey() + " -> " -// + JacksonUtils.toJson(serviceInfo.getHosts())); -// System.out.println("current ips:(" + serviceInfo.ipCount() + ") service: " + serviceInfo.getKey() + " -> " -// + JacksonUtils.toJson(serviceInfo.getHosts())); + // 服务实例以更变 + String yes = "yes"; + if (changed || yes.equals(notifyService)) { + ServiceInfo changeServiceInfo = serviceInfo.getChangeServiceInfo(); + if (changeServiceInfo != null) { + //更新nacos本地缓存 + NAMING_LOGGER.info("changeServiceInfo : "+JacksonUtils.toJson(changeServiceInfo)); + serviceInfoMap.put(changeServiceInfo.getKey(), changeServiceInfo); + } + // 添加实例变更事件,会被订阅者执行 NotifyCenter.publishEvent(new InstancesChangeEvent(serviceInfo.getName(), serviceInfo.getGroupName(), serviceInfo.getClusters(), serviceInfo.getHosts())); + // 记录Service本地文件 DiskCache.write(serviceInfo, cacheDir); } return serviceInfo; diff --git a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/controller/RefreshController.java b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/controller/RefreshController.java index 5ea3eccb3bdcfbd5dd81d0a90adeb678af903148..1dc7b9919f999c7b4643eed9c83d01fad30bad4b 100644 --- a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/controller/RefreshController.java +++ b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/controller/RefreshController.java @@ -22,6 +22,7 @@ public class RefreshController { @Autowired(required = false) private NacosAndRibbonCustom nacosAndRibbonCustom; + @Autowired(required = false) private NacosCustom nacosCustom; @@ -32,9 +33,9 @@ public class RefreshController { @RequestMapping(value = "/refreshNacosAndRibbonCache", method = RequestMethod.POST) public Boolean refreshNacosAndRibbonCache() { if (nacosAndRibbonCustom != null) { - nacosAndRibbonCustom.refreshNacosAndRibbonCache(); + return nacosAndRibbonCustom.refreshNacosAndRibbonCache(); } - return true; + return false; } @@ -42,11 +43,11 @@ public class RefreshController { * 获取ribbon和nacos缓存服务列表 * */ @RequestMapping(value = "/getNacosAndRibbonCacheList", method = RequestMethod.POST) - public Map getNacosAndRibbonCacheList() { + public Map getNacosAndRibbonCacheList() { if (nacosAndRibbonCustom != null) { - nacosAndRibbonCustom.getNacosAndRibbonCacheList(); + return nacosAndRibbonCustom.getNacosAndRibbonCacheList(); } - return new HashMap(); + return new HashMap<>(2); } /** @@ -60,7 +61,7 @@ public class RefreshController { return false; } if (nacosCustom != null) { - return nacosCustom.LogoutService(); + return nacosCustom.logoutService(); } return false; } diff --git a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/conf/NacosLifecycle.java b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/conf/NacosLifecycle.java index 75f94337aee0e4c658472499ab409908c3bbf119..7e82f43814c8e0c400f7f3505276ba839a8c8eeb 100644 --- a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/conf/NacosLifecycle.java +++ b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/conf/NacosLifecycle.java @@ -4,7 +4,7 @@ package com.damai.refresh.conf; import com.alibaba.cloud.nacos.NacosDiscoveryProperties; import com.alibaba.nacos.api.naming.NamingFactory; import com.alibaba.nacos.api.naming.NamingService; -import com.damai.refresh.custom.NacosAndRibbonCustom; +import com.damai.refresh.custom.RibbonCustom; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.SmartLifecycle; @@ -20,9 +20,9 @@ import java.util.concurrent.atomic.AtomicBoolean; @AllArgsConstructor public class NacosLifecycle implements SmartLifecycle { - private static final AtomicBoolean running = new AtomicBoolean(false); + private static final AtomicBoolean RUNNING = new AtomicBoolean(false); - private final NacosAndRibbonCustom nacosAndRibbonCustom; + private final RibbonCustom ribbonCustom; private final NacosDiscoveryProperties properties; @@ -35,12 +35,11 @@ public class NacosLifecycle implements SmartLifecycle { @Override public void start(){ - if (running.compareAndSet(false, true)) { + if (RUNNING.compareAndSet(false, true)) { try { NamingService naming = NamingFactory.createNamingService(properties.getNacosProperties()); naming.subscribe(properties.getService(),event -> { - //log.warn("refreshNacosAndRibbonCache finish ..."); - new Thread(nacosAndRibbonCustom::refreshNacosAndRibbonCache,"service-refresher-thread").start(); + new Thread(ribbonCustom::updateRibbonCache,"service-refresher-thread").start(); }); }catch (Exception e) { log.error("ServiceRefresher subscribe failed, properties:{}", properties, e); @@ -50,12 +49,11 @@ public class NacosLifecycle implements SmartLifecycle { @Override public void stop() { - if (running.compareAndSet(true, false)) { + if (RUNNING.compareAndSet(true, false)) { try { NamingService naming = NamingFactory.createNamingService(properties.getNacosProperties()); naming.unsubscribe(properties.getService(),event -> { - //log.warn("updateNacosAndRibbonCache completed ..."); - new Thread(nacosAndRibbonCustom::refreshNacosAndRibbonCache,"service-refresher-thread").start(); + new Thread(ribbonCustom::updateRibbonCache,"service-refresher-thread").start(); }); }catch (Exception e) { log.error("ServiceRefresher unsubscribe failed, properties:{}", properties, e); @@ -65,7 +63,7 @@ public class NacosLifecycle implements SmartLifecycle { @Override public boolean isRunning() { - return running.get(); + return RUNNING.get(); } @Override diff --git a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/conf/RefreshConfig.java b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/conf/RefreshConfig.java index 409112c10b89e3d92fb80a2d690f4020db835da5..6d0d283dc48356ca7720bebf2e3402dbc72f211d 100644 --- a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/conf/RefreshConfig.java +++ b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/conf/RefreshConfig.java @@ -1,6 +1,7 @@ package com.damai.refresh.conf; import com.alibaba.cloud.nacos.NacosDiscoveryProperties; +import com.alibaba.cloud.nacos.NacosServiceManager; import com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration; import com.damai.refresh.custom.NacosAndRibbonCustom; import com.damai.refresh.custom.NacosCustom; @@ -19,8 +20,10 @@ import org.springframework.context.annotation.Bean; public class RefreshConfig { @Bean - public NacosCustom nacosCustom(NacosDiscoveryProperties discoveryProperties, NacosAutoServiceRegistration nacosAutoServiceRegistration){ - return new NacosCustom(discoveryProperties,nacosAutoServiceRegistration); + public NacosCustom nacosCustom(NacosDiscoveryProperties discoveryProperties, + NacosAutoServiceRegistration nacosAutoServiceRegistration, + NacosServiceManager nacosServiceManager){ + return new NacosCustom(discoveryProperties,nacosAutoServiceRegistration,nacosServiceManager); } @Bean @@ -34,7 +37,7 @@ public class RefreshConfig { } @Bean - public NacosLifecycle nacosLifecycle(NacosAndRibbonCustom nacosAndRibbonCustom, NacosDiscoveryProperties properties){ - return new NacosLifecycle(nacosAndRibbonCustom,properties); + public NacosLifecycle nacosLifecycle(RibbonCustom ribbonCustom, NacosDiscoveryProperties properties){ + return new NacosLifecycle(ribbonCustom,properties); } } diff --git a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/custom/NacosAndRibbonCustom.java b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/custom/NacosAndRibbonCustom.java index 6b58914df0708af25ac16fd20b2f922d1d7cf151..625857db776dfbed26d0447a1d6cd0be30004092 100644 --- a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/custom/NacosAndRibbonCustom.java +++ b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/custom/NacosAndRibbonCustom.java @@ -1,6 +1,10 @@ package com.damai.refresh.custom; +import com.alibaba.nacos.api.naming.pojo.ServiceInfo; +import com.netflix.loadbalancer.Server; + import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -25,10 +29,10 @@ public class NacosAndRibbonCustom { return true; } - public Map getNacosAndRibbonCacheList() { - Map nacosCache = nacosCustom.getNacosCache(); - Map ribbonCache = ribbonCustom.getRibbonCache(); - Map map = new HashMap(); + public Map getNacosAndRibbonCacheList() { + Map nacosCache = nacosCustom.getNacosCache(); + Map>> ribbonCache = ribbonCustom.getRibbonCache(); + Map> map = new HashMap<>(8); map.put("nacosCache",nacosCache); map.put("ribbonCache",ribbonCache); return map; diff --git a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/custom/NacosCustom.java b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/custom/NacosCustom.java index 61af542ef007224809ee0cd3a04e068cd0b5ce11..2920d60e24dc46e3d5ea474825fcbf07b897aedb 100644 --- a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/custom/NacosCustom.java +++ b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/custom/NacosCustom.java @@ -1,6 +1,7 @@ package com.damai.refresh.custom; import com.alibaba.cloud.nacos.NacosDiscoveryProperties; +import com.alibaba.cloud.nacos.NacosServiceManager; import com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration; import com.alibaba.nacos.api.naming.NamingService; import com.alibaba.nacos.api.naming.pojo.ServiceInfo; @@ -37,11 +38,13 @@ public class NacosCustom { private final NacosAutoServiceRegistration nacosAutoServiceRegistration; + private final NacosServiceManager nacosServiceManager; + - private Map getNacosCacheMap(){ - Map map = new HashMap(); + private Map getNacosCacheMap(){ + Map map = new HashMap<>(8); try { - NamingService namingService = discoveryProperties.namingServiceInstance(); + NamingService namingService = nacosServiceManager.getNamingService(discoveryProperties.getNacosProperties()); if (namingService instanceof NacosNamingService) { NacosNamingService nacosNamingService = (NacosNamingService)namingService; Class nacosNamingServiceClass = nacosNamingService.getClass(); @@ -76,7 +79,7 @@ public class NacosCustom { } public void clearNacosCache(){ - Map map = getNacosCacheMap(); + Map map = getNacosCacheMap(); Map> futureMap = (Map>)map.get(FUTURE_MAP_FIELD); Map serviceInfoMap = (Map)map.get("serviceInfoMap"); synchronized (futureMap) { @@ -84,12 +87,12 @@ public class NacosCustom { } } - public Map getNacosCache(){ - Map map = getNacosCacheMap(); + public Map getNacosCache(){ + Map map = getNacosCacheMap(); return (Map)map.get("serviceInfoMap"); } - public Boolean LogoutService(){ + public Boolean logoutService(){ try { log.info("stop service"); nacosAutoServiceRegistration.stop(); diff --git a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/custom/RibbonCustom.java b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/custom/RibbonCustom.java index 28da4e2b594280ad4b2784adc5154a0364cd37b0..ed342dad025017d3f9c10e478fe56c1e0342a8ad 100644 --- a/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/custom/RibbonCustom.java +++ b/damai-spring-cloud-framework/damai-service-lossless/src/main/java/com/damai/refresh/custom/RibbonCustom.java @@ -32,7 +32,7 @@ public class RibbonCustom { private static final String UP_SERVER_LIST_FIELD = "upServerList"; private Map zoneAwareLoadBalancerMap(){ - Map zoneAwareLoadBalancerMap = new HashMap<>(); + Map zoneAwareLoadBalancerMap = new HashMap<>(256); try{ SpringClientFactory springClientFactory = SpringUtil.getBean(SpringClientFactory.class); if (springClientFactory != null) { @@ -75,8 +75,8 @@ public class RibbonCustom { } - public Map getRibbonCache(){ - Map taotalMap = new HashMap(); + public Map>> getRibbonCache(){ + Map>> taotalMap = new HashMap(256); try { Map zoneAwareLoadBalancerMap = zoneAwareLoadBalancerMap(); for (Map.Entry entry : zoneAwareLoadBalancerMap.entrySet()) { @@ -89,7 +89,7 @@ public class RibbonCustom { Field upServerListField = aClass1.getSuperclass().getSuperclass().getDeclaredField(UP_SERVER_LIST_FIELD); upServerListField.setAccessible(true); List upServerList = (List)upServerListField.get(balancer); - Map mapServerList = new HashMap(); + Map> mapServerList = new HashMap(8); mapServerList.put(ALL_SERVER_LIST_FIELD,allServerList); mapServerList.put(UP_SERVER_LIST_FIELD,upServerList); taotalMap.put(serverName,mapServerList); diff --git a/damai-spring-cloud-framework/pom.xml b/damai-spring-cloud-framework/pom.xml index 97bc4ced37ceb325015a5921e45e101fb9ef7d6f..eaab94a8aa7b1a5a24c8ba2a4156967a63dac262 100644 --- a/damai-spring-cloud-framework/pom.xml +++ b/damai-spring-cloud-framework/pom.xml @@ -18,9 +18,9 @@ damai-job-async damai-service-component damai-service-common - damai-sentinel-general damai-service-lossless damai-service-hystrix + damai-service-initialize diff --git a/damai-thread-pool-framework/src/main/java/com/damai/BusinessThreadPool.java b/damai-thread-pool-framework/src/main/java/com/damai/BusinessThreadPool.java index dfd621307054e991028d692855848da9496eebed..d1595cbf590c528acae9d1cff95f04c3177c0ff3 100644 --- a/damai-thread-pool-framework/src/main/java/com/damai/BusinessThreadPool.java +++ b/damai-thread-pool-framework/src/main/java/com/damai/BusinessThreadPool.java @@ -6,6 +6,7 @@ import com.damai.namefactory.BusinessNameThreadFactory; import com.damai.rejectedexecutionhandler.ThreadPoolRejectedExecutionHandler; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.Callable; import java.util.concurrent.Future; @@ -41,7 +42,7 @@ public class BusinessThreadPool extends BaseThreadPool { private static Integer maximumPoolSize() { return new BigDecimal(Runtime.getRuntime().availableProcessors()) - .divide(new BigDecimal("0.2"), 0, BigDecimal.ROUND_HALF_UP).intValue(); + .divide(new BigDecimal("0.2"), 0, RoundingMode.HALF_UP).intValue(); } diff --git a/damai-thread-pool-framework/src/main/java/com/damai/base/BaseThreadPool.java b/damai-thread-pool-framework/src/main/java/com/damai/base/BaseThreadPool.java index 78517add6a9477d01d5e97489cedc72b0c7352e9..31e78cbe88f1adda5b5bb8ab3d1650f879d7befd 100644 --- a/damai-thread-pool-framework/src/main/java/com/damai/base/BaseThreadPool.java +++ b/damai-thread-pool-framework/src/main/java/com/damai/base/BaseThreadPool.java @@ -49,7 +49,7 @@ public class BaseThreadPool { } private static Map> preprocess(final Map parentMdcContext, final Map parentHoldContext){ - Map> map = new HashMap<>(); + Map> map = new HashMap<>(8); Map holdContext = BaseParameterHolder.getParameterMap(); Map mdcContext = MDC.getCopyOfContextMap(); if (parentMdcContext == null) { diff --git a/damai-thread-pool-framework/src/main/java/com/damai/filter/RequestParamContextFilter.java b/damai-thread-pool-framework/src/main/java/com/damai/filter/RequestParamContextFilter.java index 16164712444012114ba05b00fccfe2da087d5ac1..8f697e8ca9b0417454a0c056db0a61e3441abd09 100644 --- a/damai-thread-pool-framework/src/main/java/com/damai/filter/RequestParamContextFilter.java +++ b/damai-thread-pool-framework/src/main/java/com/damai/filter/RequestParamContextFilter.java @@ -1,7 +1,7 @@ package com.damai.filter; -import com.damai.core.StringUtil; +import com.damai.util.StringUtil; import org.slf4j.MDC; import org.springframework.web.filter.OncePerRequestFilter; diff --git a/damai-thread-pool-framework/src/main/java/com/damai/namefactory/AbstractNameThreadFactory.java b/damai-thread-pool-framework/src/main/java/com/damai/namefactory/AbstractNameThreadFactory.java index 357aaac633db3940ccc5f860deb55745b83111de..6a1caa32de0f0f72caacf51c530c5acdb298e826 100644 --- a/damai-thread-pool-framework/src/main/java/com/damai/namefactory/AbstractNameThreadFactory.java +++ b/damai-thread-pool-framework/src/main/java/com/damai/namefactory/AbstractNameThreadFactory.java @@ -10,7 +10,7 @@ import java.util.concurrent.atomic.AtomicLong; **/ public abstract class AbstractNameThreadFactory implements ThreadFactory { - protected static final AtomicLong poolNum = new AtomicLong(1); + protected static final AtomicLong POOL_NUM = new AtomicLong(1); private final ThreadGroup group; private final AtomicLong threadNum = new AtomicLong(1); private String namePrefix = ""; diff --git a/damai-thread-pool-framework/src/main/java/com/damai/namefactory/BusinessNameThreadFactory.java b/damai-thread-pool-framework/src/main/java/com/damai/namefactory/BusinessNameThreadFactory.java index 1b1ccbfbcf108ec9bf2775586d67639a4d77df89..cfa9a74b49b2ee290ddeb648760a0424dea8a070 100644 --- a/damai-thread-pool-framework/src/main/java/com/damai/namefactory/BusinessNameThreadFactory.java +++ b/damai-thread-pool-framework/src/main/java/com/damai/namefactory/BusinessNameThreadFactory.java @@ -14,6 +14,6 @@ public class BusinessNameThreadFactory extends AbstractNameThreadFactory { */ @Override public String getNamePrefix() { - return "task-pool" + "--" + poolNum.getAndIncrement(); + return "task-pool" + "--" + POOL_NUM.getAndIncrement(); } } diff --git a/pom.xml b/pom.xml index ce8a9935cd96f3ded234b9c552ea49b797b653ed..8d6973dec02cde9a789e257dc278b1dd913900ef 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,11 @@ pom ${project.artifactId} - 大麦网 + + 诚意推荐 真实还原生产环境的微服务企业级高并发项目 + SpringBoot + SpringCloudAlibaba + 多线程 + Redis + Kafka + ELK + Docker + Sentinel 等技术 + 包括完整的各种组件配置、高并发下的支付订单解决方案、使用设计模式进行解耦、完整的配套文档和视频 + damai-common @@ -38,7 +42,6 @@ damai-redisson-framework damai-server damai-server-client - api-stat damai-captcha-framework @@ -84,6 +87,7 @@ 1.33 1.3.0 2.9.3 + 2.22.1 @@ -129,6 +133,30 @@ ${project.sourceEncoding} + + + + + + + + + + + + + + + + + + + + + + + + org.apache.maven.plugins maven-resources-plugin diff --git a/spotless/license-header b/spotless/license-header new file mode 100644 index 0000000000000000000000000000000000000000..ce04a833071655aa1756f5f3c8575d87957437ba --- /dev/null +++ b/spotless/license-header @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + diff --git a/spotless/spotless.xml b/spotless/spotless.xml new file mode 100644 index 0000000000000000000000000000000000000000..339a5c7cb5086cb59d4d58a7f99d54540a027468 --- /dev/null +++ b/spotless/spotless.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sql/dababase.sql b/sql/dababase.sql new file mode 100644 index 0000000000000000000000000000000000000000..7f7e98ec60dec1d6b5b1b40694dde44cb4fa30db --- /dev/null +++ b/sql/dababase.sql @@ -0,0 +1,16 @@ +-- 创建数据库 +create database if not exists damai character set utf8mb4; +create database if not exists damai_base_data character set utf8mb4; +create database if not exists damai_customize character set utf8mb4; +create database if not exists damai_order_0 character set utf8mb4; +create database if not exists damai_order_1 character set utf8mb4; +create database if not exists damai_order character set utf8mb4; +create database if not exists damai_pay_0 character set utf8mb4; +create database if not exists damai_pay_1 character set utf8mb4; +create database if not exists damai_pay character set utf8mb4; +create database if not exists damai_program_0 character set utf8mb4; +create database if not exists damai_program_1 character set utf8mb4; +create database if not exists damai_program character set utf8mb4; +create database if not exists damai_user_0 character set utf8mb4; +create database if not exists damai_user_1 character set utf8mb4; +create database if not exists damai_user character set utf8mb4; \ No newline at end of file diff --git a/sql/procedure_insert_pay.sql b/sql/procedure_insert_pay.sql deleted file mode 100644 index c51c8485d4007858325d166709918529e090d58b..0000000000000000000000000000000000000000 --- a/sql/procedure_insert_pay.sql +++ /dev/null @@ -1,31 +0,0 @@ -DELIMITER // -CREATE DEFINER=`root`@`localhost` PROCEDURE `toolkit`.`insert_pay`() -BEGIN - DECLARE paramter_user_id VARCHAR(32); - DECLARE paramter_id int; - DECLARE i INT DEFAULT 5; - - WHILE i <= 9000 DO - SET paramter_user_id = CONCAT(i, "12345"); - - SET paramter_id = i; - - -INSERT INTO `pay` ( - id, user_id, type, status, amount, origin, pay_time, department_id, create_time, refund_mark -) -VALUES(paramter_id, - paramter_user_id, - 1, - 2, - round(rand() * 100, 0), - 1, - now(), - paramter_id, - now(), - '测试备注' - ); -SET i=i+1; -END WHILE; -end // -DELIMITER ; \ No newline at end of file diff --git a/sql/procedure_insert_test.sql b/sql/procedure_insert_test.sql deleted file mode 100644 index 9eda8670f1595d308c512a6bdb2baa324f355f5f..0000000000000000000000000000000000000000 --- a/sql/procedure_insert_test.sql +++ /dev/null @@ -1,26 +0,0 @@ -DELIMITER // -CREATE DEFINER=`root`@`localhost` PROCEDURE `toolkit`.`insert_test`() -BEGIN - DECLARE paramter_id int; - DECLARE i INT DEFAULT 5; - - WHILE i <= 15 DO - SET paramter_id = i; - - -INSERT INTO `test` ( - id, column1, column2, column3, column4, column5, column6, number -) -VALUES(paramter_id, - paramter_id, - paramter_id, - paramter_id, - CONCAT(i, "_4"), - CONCAT(i, "_5"), - CONCAT(i, "_6"), - paramter_id - ); -SET i=i+1; -END WHILE; -end // -DELIMITER ; \ No newline at end of file diff --git a/sql/table.sql b/sql/table.sql deleted file mode 100644 index d1c3ef6deae0aabf495491bcddb120cc6b063bb9..0000000000000000000000000000000000000000 --- a/sql/table.sql +++ /dev/null @@ -1,121 +0,0 @@ -CREATE DATABASE `toolkit`; --- toolkit.channel_data definition - -CREATE TABLE `channel_data` ( - `id` varchar(50) NOT NULL COMMENT 'id', - `name` varchar(50) DEFAULT NULL COMMENT '名称', - `code` varchar(50) DEFAULT NULL COMMENT '编码', - `introduce` varchar(500) DEFAULT NULL COMMENT '介绍描述', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `status` int(1) DEFAULT '1' COMMENT '状态 1:启用 -1:禁用', - `public_key` text COMMENT 'rsa公钥', - `secret_key` text COMMENT 'rsa密码', - `aes_key` text COMMENT 'aes秘钥', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='渠道基础数据信息'; - - --- toolkit.department definition - -CREATE TABLE `department` ( - `id` varchar(50) NOT NULL COMMENT 'id', - `name` varchar(50) DEFAULT NULL COMMENT '名称', - `type_code` varchar(50) DEFAULT NULL COMMENT '分类编码', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `status` int(1) DEFAULT '1' COMMENT '状态 1:启用 -1:禁用', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门信息'; - - --- toolkit.pay definition - -CREATE TABLE `pay` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '[ID]', - `user_id` varchar(32) DEFAULT NULL COMMENT '[用户ID]', - `type` int(2) DEFAULT NULL COMMENT '[支付方式]1.支付宝 2.微信', - `status` int(1) DEFAULT NULL COMMENT '[状态]1:待支付 2:已支付 3:支付失败', - `amount` decimal(15,4) DEFAULT NULL COMMENT '[支付总金额]', - `origin` int(1) DEFAULT NULL COMMENT '[支付来源]1:安卓 2:iPhone 3:pc', - `pay_time` datetime DEFAULT NULL COMMENT '[支付时间]', - `department_id` varchar(32) DEFAULT NULL COMMENT '[部门id]', - `create_time` datetime DEFAULT NULL COMMENT '[创建时间]', - `refund_status` int(1) DEFAULT '1' COMMENT '[退款状态]1.不退款 2.应退款 3.退款成功 -1.退款失败', - `refund_amount` decimal(15,4) DEFAULT NULL COMMENT '[退款金额]', - `refund_time` datetime DEFAULT NULL COMMENT '[退款时间]', - `refund_mark` text COMMENT '[退款原因]', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='[支付]'; - - --- toolkit.product definition - -CREATE TABLE `product` ( - `id` varchar(50) NOT NULL COMMENT 'id', - `name` varchar(32) DEFAULT NULL COMMENT '[产品名字]', - `price` decimal(16,6) DEFAULT NULL COMMENT '[产品单价]', - `stock` int(11) DEFAULT NULL COMMENT '[库存数量]', - `status` int(11) DEFAULT '0' COMMENT '[状态 -1:已删除 0:正常]', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='产品表'; - - --- toolkit.product_order definition - -CREATE TABLE `product_order` ( - `id` varchar(50) NOT NULL COMMENT 'id', - `product_id` varchar(50) NOT NULL COMMENT '[产品id]', - `product_name` varchar(32) DEFAULT NULL COMMENT '[产品名字]', - `product_price` decimal(16,6) DEFAULT NULL COMMENT '[产品单价]', - `product_amount` int(11) DEFAULT NULL COMMENT '[产品数量]', - `product_total_price` decimal(16,6) DEFAULT NULL COMMENT '[产品总价]', - `order_id` varchar(50) NOT NULL COMMENT '[订单id]', - `status` int(11) DEFAULT '0' COMMENT '[状态 -1:已删除 0:正常]', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='产品订单关联表'; - - --- toolkit.ps_order definition - -CREATE TABLE `ps_order` ( - `id` varchar(50) NOT NULL COMMENT 'id', - `pay_order_id` varchar(32) DEFAULT NULL COMMENT '[支付单ID]ID值来自<支付单表>', - `pay_amount` decimal(16,6) NOT NULL COMMENT '[缴费金额]', - `pay_channel_type` int(11) DEFAULT NULL COMMENT '[支付方式1.支付宝 2.微信]', - `pay_time` datetime DEFAULT NULL COMMENT '[支付完成时间]', - `status` int(11) DEFAULT '0' COMMENT '[状态 -1:已删除 0:待支付 1:正在支付 2:支付完成 3:超时取消 4:手动取消]', - `create_time` datetime DEFAULT NULL COMMENT '[创建时间]', - `user_id` varchar(32) DEFAULT NULL COMMENT '[用户id]', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单表'; - - --- toolkit.test definition - -CREATE TABLE `test` ( - `id` bigint(11) NOT NULL, - `column1` int(11) DEFAULT NULL, - `column2` int(11) DEFAULT NULL, - `column3` int(11) DEFAULT NULL, - `column4` varchar(255) DEFAULT NULL, - `column5` varchar(255) DEFAULT NULL, - `column6` varchar(255) DEFAULT NULL, - `number` int(11) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `idx_column1_2_3` (`column1`,`column2`,`column3`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - - --- toolkit.`user` definition - -CREATE TABLE `user` ( - `id` varchar(50) NOT NULL, - `name` varchar(255) DEFAULT NULL, - `password` varchar(255) DEFAULT NULL, - `age` int(11) DEFAULT NULL, - `status` int(1) NOT NULL DEFAULT '1', - `create_time` datetime DEFAULT NULL COMMENT '[创建时间]', - `mobile` varchar(14) DEFAULT NULL COMMENT '手机号', - `edit_time` datetime DEFAULT NULL COMMENT '编辑时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; \ No newline at end of file