Browse Source

first commit

15810770710@163.com 3 years ago
parent
commit
b525c977b8
24 changed files with 2150 additions and 0 deletions
  1. 118 0
      .mvn/wrapper/MavenWrapperDownloader.java
  2. 2 0
      .mvn/wrapper/maven-wrapper.properties
  3. 9 0
      HELP.md
  4. 310 0
      mvnw
  5. 182 0
      mvnw.cmd
  6. 328 0
      pom.xml
  7. 33 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/App.java
  8. 32 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/SwaggerConfig.java
  9. 62 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/action/ChannelAction.java
  10. 26 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/constant/CommonConstant.java
  11. 32 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/exception/ServiceException.java
  12. 23 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/model/CommonRequestObject.java
  13. 25 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/model/CommonResponseObject.java
  14. 24 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/model/CreditScoreRequestParam.java
  15. 20 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/model/TokenResponseObject.java
  16. 15 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/service/ChannelService.java
  17. 281 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/service/impl/ChannelServiceImpl.java
  18. 41 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/task/TokenTask.java
  19. 317 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/util/Des3Util.java
  20. 85 0
      src/main/java/info/aspirecn/iov/sjjh/supplier10000053/util/HttpUtil.java
  21. 119 0
      src/main/resources/config/application.yml
  22. 3 0
      src/main/resources/config/banner.txt
  23. 26 0
      src/main/resources/config/bootstrap.yml
  24. 37 0
      src/main/resources/config/logback-spring.xml

+ 118 - 0
.mvn/wrapper/MavenWrapperDownloader.java

@@ -0,0 +1,118 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * 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.
+ */
+
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+    private static final String WRAPPER_VERSION = "0.5.6";
+    /**
+     * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+     */
+    private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+            + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+    /**
+     * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+     * use instead of the default one.
+     */
+    private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+            ".mvn/wrapper/maven-wrapper.properties";
+
+    /**
+     * Path where the maven-wrapper.jar will be saved to.
+     */
+    private static final String MAVEN_WRAPPER_JAR_PATH =
+            ".mvn/wrapper/maven-wrapper.jar";
+
+    /**
+     * Name of the property which should be used to override the default download url for the wrapper.
+     */
+    private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+    public static void main(String args[]) {
+        System.out.println("- Downloader started");
+        File baseDirectory = new File(args[0]);
+        System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+        // If the maven-wrapper.properties exists, read it and check if it contains a custom
+        // wrapperUrl parameter.
+        File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+        String url = DEFAULT_DOWNLOAD_URL;
+        if (mavenWrapperPropertyFile.exists()) {
+            FileInputStream mavenWrapperPropertyFileInputStream = null;
+            try {
+                mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+                Properties mavenWrapperProperties = new Properties();
+                mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+                url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+            } catch (IOException e) {
+                System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+            } finally {
+                try {
+                    if (mavenWrapperPropertyFileInputStream != null) {
+                        mavenWrapperPropertyFileInputStream.close();
+                    }
+                } catch (IOException e) {
+                    // Ignore ...
+                }
+            }
+        }
+        System.out.println("- Downloading from: " + url);
+
+        File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+        if (!outputFile.getParentFile().exists()) {
+            if (!outputFile.getParentFile().mkdirs()) {
+                System.out.println(
+                        "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+            }
+        }
+        System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+        try {
+            downloadFileFromURL(url, outputFile);
+            System.out.println("Done");
+            System.exit(0);
+        } catch (Throwable e) {
+            System.out.println("- Error downloading");
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+
+    private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+        if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+            String username = System.getenv("MVNW_USERNAME");
+            char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+            Authenticator.setDefault(new Authenticator() {
+                @Override
+                protected PasswordAuthentication getPasswordAuthentication() {
+                    return new PasswordAuthentication(username, password);
+                }
+            });
+        }
+        URL website = new URL(urlString);
+        ReadableByteChannel rbc;
+        rbc = Channels.newChannel(website.openStream());
+        FileOutputStream fos = new FileOutputStream(destination);
+        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+        fos.close();
+        rbc.close();
+    }
+
+}

+ 2 - 0
.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

+ 9 - 0
HELP.md

@@ -0,0 +1,9 @@
+# Getting Started
+
+### Reference Documentation
+For further reference, please consider the following sections:
+
+* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
+* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.5.4/maven-plugin/reference/html/)
+* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.5.4/maven-plugin/reference/html/#build-image)
+

+ 310 - 0
mvnw

@@ -0,0 +1,310 @@
+#!/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-config --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 "$@"

+ 182 - 0
mvnw.cmd

@@ -0,0 +1,182 @@
+@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%

+ 328 - 0
pom.xml

@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>yuncredit-public</artifactId>
+        <groupId>com.xinhuadata.yuncredit</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>credit-biz</artifactId>
+    <version>1.0.5</version>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <jackson.version>2.2.2</jackson.version>
+        <credit-common.version>1.2.1</credit-common.version>
+    </properties>
+    <dependencies>
+        <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.60</version>
+        </dependency>
+        <dependency>
+            <groupId>com.codahale.metrics</groupId>
+            <artifactId>metrics-core</artifactId>
+            <version>3.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5</version>
+        </dependency>
+        <dependency>
+            <groupId>com.yuncredit.extend</groupId>
+            <artifactId>wndc-commons</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore</artifactId>
+            <version>4.4.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.xinhuadata.yuncredit</groupId>
+            <artifactId>credit-common</artifactId>
+            <version>${credit-common.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.zookeeper</groupId>
+            <artifactId>zookeeper</artifactId>
+            <version>3.4.6</version>
+        </dependency>
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.rabbitmq</groupId>
+            <artifactId>amqp-client</artifactId>
+            <version>3.6.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tomcat.maven</groupId>
+            <artifactId>tomcat7-maven-plugin</artifactId>
+            <version>2.2</version>
+        </dependency>
+        <dependency>
+            <groupId>etc-commons-logging</groupId>
+            <artifactId>etc-commons-logging</artifactId>
+            <version>1.2</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/etc-commons-logging-1.2.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>etc.httpclient</groupId>
+            <artifactId>etc.httpclient</artifactId>
+            <version>4.5</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/etc-httpclient-4.5.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>etc.httpcore</groupId>
+            <artifactId>etc.httpcore</artifactId>
+            <version>4.4</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/etc-httpcore-4.4.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>etc.httpmime</groupId>
+            <artifactId>etc.httpmime</artifactId>
+            <version>4.5</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/etc-httpmime-4.5.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>etc.jackson.annotations</groupId>
+            <artifactId>etc.jackson.annotations</artifactId>
+            <version>2.8</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/etc-jackson-annotations-2.8.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>etc.jackson.core</groupId>
+            <artifactId>etc.jackson.core</artifactId>
+            <version>2.8</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/etc-jackson-core-2.8.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>etc.jackson.databind</groupId>
+            <artifactId>etc.jackson.databind</artifactId>
+            <version>2.8</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/etc-jackson-databind-2.8.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>etc.jackson.datatype.jsr310</groupId>
+            <artifactId>etc.jackson.datatype.jsr310</artifactId>
+            <version>2.8</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/etc-jackson-datatype-jsr310-2.8.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>etc.sdk.common</groupId>
+            <artifactId>etc.sdk.common</artifactId>
+            <version>1.0</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/sdk-common-1.0.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>slf4j.api</groupId>
+            <artifactId>slf4j.api</artifactId>
+            <version>1.7</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/slf4j-api-1.7.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>validation.api</groupId>
+            <artifactId>validation.api</artifactId>
+            <version>1.1.0</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/validation-api-1.1.0.Final.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>sdk.b2b.protocol</groupId>
+            <artifactId>sdk.b2b.protocol</artifactId>
+            <version>1.4</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/sdk-b2b-protocol-1.4.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>sdk-analysis-protocol</groupId>
+            <artifactId>sdk-analysis-protocol</artifactId>
+            <version>3.1</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/sdk-analysis-protocol-3.1.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>sdk.external.waybill.protocol</groupId>
+            <artifactId>sdk.external.waybill.protocol</artifactId>
+            <version>1.1.4</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/sdk-external-waybill-protocol-1.1.4.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>sdk.waybill.protocol</groupId>
+            <artifactId>sdk.waybill.protocol</artifactId>
+            <version>1.3.4</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/sdk-waybill-protocol-1.3.10.jar</systemPath>
+        </dependency>
+        <dependency>
+            <groupId>axis</groupId>
+            <artifactId>axis</artifactId>
+            <version>1.4</version>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun.api.gateway</groupId>
+            <artifactId>sdk-core-java</artifactId>
+            <version>1.1.3</version>
+        </dependency>
+        <dependency>
+            <groupId>net.coobird</groupId>
+            <artifactId>thumbnailator</artifactId>
+            <version>0.4.8</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+            <version>3.11.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.quartz-scheduler</groupId>
+            <artifactId>quartz</artifactId>
+            <version>2.3.0</version>
+        </dependency>
+    </dependencies>
+    <profiles>
+        <profile>
+            <id>dev</id>
+            <properties>
+                <profile.name>dev</profile.name>
+            </properties>
+        </profile>
+        <profile>
+            <id>test</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <properties>
+                <profile.name>test</profile.name>
+            </properties>
+        </profile>
+        <profile>
+            <id>stable</id>
+            <properties>
+                <profile.name>stable</profile.name>
+            </properties>
+        </profile>
+        <profile>
+            <id>online</id>
+            <properties>
+                <profile.name>online</profile.name>
+            </properties>
+        </profile>
+        <profile>
+            <id>online-stand</id>
+            <properties>
+                <profile.name>online-stand</profile.name>
+            </properties>
+        </profile>
+        <profile>
+            <id>perf</id>
+            <properties>
+                <profile.name>perf</profile.name>
+            </properties>
+        </profile>
+    </profiles>
+    <build>
+        <filters> <!-- 指定使用的 filter -->
+            <filter>setting/settings-${profile.name}.properties</filter>
+        </filters>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>settings.properties</include>
+                    <include>log4j.xml</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>false</filtering>
+                <excludes>
+                    <exclude>settings.properties</exclude>
+                    <exclude>log4j.xml</exclude>
+                </excludes>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <descriptors>
+                        <descriptor>assembly/assembly.xml</descriptor>
+                    </descriptors>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                    <encoding>UTF-8</encoding>
+                </configuration>
+                <!-- <dependencies> <dependency> <groupId>org.codehaus.plexus</groupId>
+                    <artifactId>plexus-compiler-eclipse</artifactId> <version>1.9.1</version>
+                    </dependency> </dependencies> -->
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.9</version>
+
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>src/main/resources</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 33 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/App.java

@@ -0,0 +1,33 @@
+package info.aspirecn.iov.sjjh.supplier10000053;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+import org.springframework.context.ApplicationContext;
+import org.springframework.core.env.Environment;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.util.StopWatch;
+
+@SpringBootApplication
+@EnableConfigurationProperties
+@EnableScheduling
+@Slf4j
+@EnableEurekaClient
+public class App {
+
+    public static void main(String[] args) {
+        StopWatch watch = new StopWatch();
+        watch.start();
+
+        ApplicationContext context = SpringApplication.run(App.class, args);
+        Environment environment = context.getBean(Environment.class);
+        String applicationName = environment.getProperty("spring.application.name");
+
+
+        watch.stop();
+        log.info("{} 启动完毕,times={}s", applicationName, watch.getTotalTimeSeconds());
+    }
+
+}

+ 32 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/SwaggerConfig.java

@@ -0,0 +1,32 @@
+package info.aspirecn.iov.sjjh.supplier10000053;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+/**
+ * @author minmin
+ */
+@Configuration
+@EnableSwagger2
+public class SwaggerConfig {
+    private boolean swaggerShow = true;
+
+    @Bean
+    public Docket createRestApi() {
+
+        return new Docket(DocumentationType.SWAGGER_2).enable(swaggerShow).apiInfo(apiInfo()).select()
+                .apis(RequestHandlerSelectors.basePackage("info.aspirecn.iov.sjjh.supplier10000053.action"))
+                .paths(PathSelectors.any()).build();
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder().title("10000053通道接口").description("").termsOfServiceUrl("").version("1.0.0").build();
+    }
+}

+ 62 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/action/ChannelAction.java

@@ -0,0 +1,62 @@
+package info.aspirecn.iov.sjjh.supplier10000053.action;
+
+import info.aspirecn.iov.sjjh.commons.lang.ChannelTypeHandleResponseObject;
+import info.aspirecn.iov.sjjh.commons.lang.Constant;
+import info.aspirecn.iov.sjjh.supplier10000053.constant.CommonConstant;
+import info.aspirecn.iov.sjjh.supplier10000053.service.ChannelService;
+import info.aspirecn.rdc.aspirecloud.node.except.utils.ErrorUtils;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.tomcat.util.codec.binary.Base64;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Slf4j
+@RestController
+public class ChannelAction {
+    @Autowired
+    ChannelService channelService;
+
+    @ApiOperation(value = "信用分查询接口", notes = "")
+    @PostMapping(value = "/creditScoreQuery.do")
+    public ChannelTypeHandleResponseObject creditScoreQuery(
+            @ApiParam(value = "通道ID") @RequestHeader(name = "channelId") String channelId,
+            @ApiParam(value = "超时时间,单位:毫秒", example = "10000") @RequestParam(name = "outTime", required = true) int outTime,
+            @ApiParam(value = "请求参数JSON串") @RequestParam(name = "customBody", required = true) String customBody) {
+        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
+                .getRequest();
+
+        ChannelTypeHandleResponseObject ret = channelService.creditScoreQuery(request, customBody, outTime);
+
+        //把接口参数、调用结果和是否收费放入访问日志中
+        if (ret.getCode() != Constant.SUCCESS) {
+            request.setAttribute(CommonConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
+        } else {
+            request.setAttribute(CommonConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
+        }
+        request.setAttribute(CommonConstant.Charge_Log_Key, ret.getIsCharge());
+
+        try {
+            request.setAttribute(Constant.CHANNEL_LOG_QUERY,
+                    Base64.encodeBase64String(customBody.getBytes(CommonConstant.PARA_ENCODE)));
+
+        } catch (Exception ex) {
+            ErrorUtils.captureException(ex);
+            log.error("creditScoreQuery.encodeBase64String.Exception=", ex);
+        }
+        request.setAttribute(Constant.CHANNEL_TYPE_KEY, Constant.CHANNEL_TYPE_SYNC);
+        return ret;
+    }
+}

+ 26 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/constant/CommonConstant.java

@@ -0,0 +1,26 @@
+package info.aspirecn.iov.sjjh.supplier10000053.constant;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+public class CommonConstant {
+    public static final String REDIS_TOKEN_KEY = "supplier10000053-access-token-key";
+
+    // code 是 2000  这边返回的是1 卓望公司内 用域名访问是1 用ip访问是2000
+    public static final String GET_TOKEN_SUCCESS_CODE = "1";
+
+    public static final int PARA_ZERO = 0;
+
+    public static String Charge_Log_Key = "isCharge";
+
+    public static String Charge_Log_ResponseCode = "respnoseCode";
+
+    public static final String PARA_ENCODE = "UTF-8";
+
+    public static final String RESPONSE_CODE_1 = "1";
+
+    public static final String RESPONSE_CODE_8 = "8";
+
+    public static final String QUERY_SUCCESS_MESSAGE = "查询成功,返回结果";
+}

+ 32 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/exception/ServiceException.java

@@ -0,0 +1,32 @@
+package info.aspirecn.iov.sjjh.supplier10000053.exception;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author: xusonglin
+ * @version: V1.0
+ **/
+@Data
+@EqualsAndHashCode
+public class ServiceException extends RuntimeException {
+    private Integer errorCode;
+
+    public ServiceException(String message) {
+        super(message);
+    }
+
+    public ServiceException(Integer errorCode, String message) {
+        super(message);
+        this.errorCode = errorCode;
+    }
+
+    public ServiceException(String message, Throwable exception) {
+        super(message, exception);
+    }
+
+    public ServiceException(Integer errorCode, String message, Throwable exception) {
+        super(message, exception);
+        this.errorCode = errorCode;
+    }
+}

+ 23 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/model/CommonRequestObject.java

@@ -0,0 +1,23 @@
+package info.aspirecn.iov.sjjh.supplier10000053.model;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Data
+@ToString
+public class CommonRequestObject implements Serializable {
+
+    private static final long serialVersionUID = -5854235202091243403L;
+
+    private String productId;
+
+    private String accessId;
+
+    private Object customBody;
+}

+ 25 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/model/CommonResponseObject.java

@@ -0,0 +1,25 @@
+package info.aspirecn.iov.sjjh.supplier10000053.model;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Data
+@ToString
+public class CommonResponseObject implements Serializable {
+
+    private static final long serialVersionUID = -464465123055998578L;
+
+    private String resultCode;
+
+    private String resultBody;
+
+    private String accessId;
+
+    private String transationId;
+}

+ 24 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/model/CreditScoreRequestParam.java

@@ -0,0 +1,24 @@
+package info.aspirecn.iov.sjjh.supplier10000053.model;
+
+import lombok.Data;
+import lombok.ToString;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Data
+@ToString
+public class CreditScoreRequestParam implements Serializable {
+    private static final long serialVersionUID = 4231289579640332693L;
+    // 手机号
+    @NotNull(message = "参数名错误")
+    private String mobile;
+
+    // 20位授权记录号(必须唯一),yymmddhhmmss+8位随机数(字母+数字,不区分大小写)
+    @NotNull(message = "参数名错误")
+    private String empowerNo;
+}

+ 20 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/model/TokenResponseObject.java

@@ -0,0 +1,20 @@
+package info.aspirecn.iov.sjjh.supplier10000053.model;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Data
+@ToString
+public class TokenResponseObject implements Serializable {
+    private static final long serialVersionUID = -2706529637706131951L;
+
+    private String code;
+    private String message;
+    private String token;
+}

+ 15 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/service/ChannelService.java

@@ -0,0 +1,15 @@
+package info.aspirecn.iov.sjjh.supplier10000053.service;
+
+import info.aspirecn.iov.sjjh.commons.lang.ChannelTypeHandleResponseObject;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+public interface ChannelService {
+    ChannelTypeHandleResponseObject creditScoreQuery(HttpServletRequest request, String customBody, int outTime);
+
+    String queryAccessToken(int outTime);
+}

+ 281 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/service/impl/ChannelServiceImpl.java

@@ -0,0 +1,281 @@
+package info.aspirecn.iov.sjjh.supplier10000053.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import info.aspirecn.iov.sjjh.commons.lang.ChannelTypeHandleResponseObject;
+import info.aspirecn.iov.sjjh.commons.lang.Constant;
+import info.aspirecn.iov.sjjh.commons.lang.PatternTools;
+import info.aspirecn.iov.sjjh.supplier10000053.constant.CommonConstant;
+import info.aspirecn.iov.sjjh.supplier10000053.exception.ServiceException;
+import info.aspirecn.iov.sjjh.supplier10000053.model.CommonRequestObject;
+import info.aspirecn.iov.sjjh.supplier10000053.model.CommonResponseObject;
+import info.aspirecn.iov.sjjh.supplier10000053.model.CreditScoreRequestParam;
+import info.aspirecn.iov.sjjh.supplier10000053.model.TokenResponseObject;
+import info.aspirecn.iov.sjjh.supplier10000053.service.ChannelService;
+import info.aspirecn.iov.sjjh.supplier10000053.util.Des3Util;
+import info.aspirecn.iov.sjjh.supplier10000053.util.HttpUtil;
+import info.aspirecn.rdc.aspirecloud.node.except.utils.ErrorUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.ConstraintViolation;
+import javax.validation.Validation;
+import javax.validation.Validator;
+import javax.validation.ValidatorFactory;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Service
+@Slf4j
+public class ChannelServiceImpl implements ChannelService {
+    @Value("${supplier.token.url}")
+    private String tokenUrl;
+    @Value("${supplier.token.appId}")
+    private String appId;
+    @Value("${supplier.token.appSecret}")
+    private String appSecret;
+    @Value("${supplier.interface.url}")
+    private String interfaceUrl;
+    @Value("${supplier.productId.creditScore}")
+    private String creditScore;
+    @Value("${supplier.des.key}")
+    private String desKey;
+
+    @Autowired
+    StringRedisTemplate stringRedisTemplate;
+    @Autowired
+    private ObjectMapper objectMapper;
+
+    @Override
+    public String queryAccessToken(int outTime) {
+        StringBuffer buffer = new StringBuffer(tokenUrl)
+                .append("?")
+                .append("appId=")
+                .append(appId)
+                .append("&appSecret=")
+                .append(appSecret);
+
+        String responseContext = "";
+
+        try {
+            responseContext = HttpUtil.doGet(outTime, buffer.toString());
+        } catch (IOException e) {
+            log.info("supplier10000053.getToken调用接口异常-Exception:{}", e);
+            ErrorUtils.captureException(e);
+            return null;
+        }
+
+        log.info("supplier10000053.getToken返回结果:{}", responseContext);
+        TokenResponseObject responseObject = JSONObject.toJavaObject(
+                JSON.parseObject(responseContext), TokenResponseObject.class);
+        if (responseObject != null && responseObject.getCode().equals(CommonConstant.GET_TOKEN_SUCCESS_CODE)) {
+            String token = responseObject.getToken() + "&&" + System.currentTimeMillis();
+            stringRedisTemplate.opsForValue().set(CommonConstant.REDIS_TOKEN_KEY, token, 30, TimeUnit.MINUTES);
+            return responseObject.getToken();
+        } else {
+            return null;
+        }
+    }
+
+    private String getAccessToken(int outTime) {
+        String redisToken = stringRedisTemplate.opsForValue().get(CommonConstant.REDIS_TOKEN_KEY);
+        String token;
+        if (StringUtils.isNotBlank(redisToken)) {
+            String[] redisTokenArray = redisToken.split("&&");
+            String accessTokenTimestamp = redisTokenArray[1];
+            if (System.currentTimeMillis() - Long.parseLong(accessTokenTimestamp) >= 1680000) {
+                // 超过2小时,重新获取token
+                token = queryAccessToken(outTime);
+                log.info("超过28分钟,重新获取token");
+            } else {
+                // 从redis中获取token
+                token = redisTokenArray[0];
+                log.info("从redis中获取token");
+            }
+        } else {
+            // token不存在,获取token
+            token = queryAccessToken(outTime);
+            log.info("token不存在,获取token");
+        }
+        return token;
+    }
+
+    @Override
+    public ChannelTypeHandleResponseObject creditScoreQuery(HttpServletRequest request, String customBody, int outTime) {
+        ChannelTypeHandleResponseObject ret = new ChannelTypeHandleResponseObject();
+        ret.setIsCharge(Constant.INTERFACE_QUERY_NO_FEE);
+        String upstreamCode = "" + Constant.LOG_UPSTREAM_DEFAULT_RESPONSE_CODE;
+        request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
+        String returnType = request.getHeader(Constant.CUSTOMER_RETURN_TYPE_PARA);
+        if (StringUtils.isBlank(returnType)) {
+            returnType = Constant.CUSTOMER_RETURN_ZW;
+        }
+        if (outTime <= CommonConstant.PARA_ZERO) {
+            outTime = Constant.HTTPCLIENT_CONNECTTIMEOUT;
+        }
+        log.info("supplier10000053.creditScoreQuery---customBody={},outTime={}", customBody, outTime);
+        CreditScoreRequestParam requestParam = new CreditScoreRequestParam();
+        try {
+            requestParam = objectMapper.readValue(customBody, CreditScoreRequestParam.class);
+        } catch (IOException ioe) {
+            log.info("supplier10000053.creditScoreQuery接口-IOException:{}", ioe);
+            ErrorUtils.captureException(ioe);
+            ret.setCode(Constant.FAIL);
+        }
+        // 参数校验
+        if (!validateParams(ret, returnType, requestParam)) {
+            ret.setCode(Constant.SUCCESS);
+            request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
+            return ret;
+        }
+
+        CommonRequestObject requestObject = new CommonRequestObject();
+        String traceId = request.getHeader("x-b3-traceid");
+//        String traceId = System.currentTimeMillis() + "test";
+//        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyMMddhhmmss");
+//        requestParam.setEmpowerNo(simpleDateFormat.format(new Date()) + (String.valueOf(System.currentTimeMillis()).substring(0, 8)));
+
+        String encryptParam = Des3Util.encode(desKey, JSON.toJSONString(requestParam));
+        JSONObject encryptParamObject = new JSONObject();
+        encryptParamObject.put("params", encryptParam);
+
+        requestObject.setAccessId(traceId);
+        requestObject.setProductId(creditScore);
+        requestObject.setCustomBody(encryptParamObject);
+
+        String token = getAccessToken(outTime);
+        try {
+            CommonResponseObject responseObject = getCommonResponseObject("creditScoreQuery", token, outTime, JSON.toJSONString(requestObject));
+            if (responseObject != null) {
+                setCreditScoreResponseObject(responseObject, ret);
+                upstreamCode = responseObject.getResultCode();
+            } else {
+                ret.setCode(Constant.FAIL);
+            }
+        } catch (ServiceException se) {
+            if (se.getErrorCode().equals(Constant.REQUEST_TIMEOUT)) {
+                log.info("supplier10000053.creditScoreQuery-SocketTimeoutException:", se);
+                ErrorUtils.captureException(se);
+                ret.setCode(Constant.REQUEST_TIMEOUT);
+            } else {
+                log.info("supplier10000053.creditScoreQuery接口-Exception:", se);
+                ErrorUtils.captureException(se);
+                ret.setCode(Constant.FAIL);
+            }
+        }
+        request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
+        return ret;
+    }
+
+    private void setCreditScoreResponseObject(CommonResponseObject commonResponseObject, ChannelTypeHandleResponseObject ret) {
+        if (commonResponseObject.getResultCode().equals(CommonConstant.RESPONSE_CODE_1)) {
+            JSONObject resultBody = JSON.parseObject(commonResponseObject.getResultBody());
+            String jxbScore = resultBody.getString("jxbScore3");
+            if (jxbScore.equals("-1")) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_1190);
+                ret.setResultBody(Constant.RETURN_MESSAGE_137);
+                ret.setResultDesc(Constant.RETURN_MESSAGE_137);
+            } else if (jxbScore.equals("-2")) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_1191);
+                ret.setResultBody(Constant.RETURN_MESSAGE_138);
+                ret.setResultDesc(Constant.RETURN_MESSAGE_138);
+            } else {
+                ret.setResultCode(Constant.JK_RETURN_CODE_MATCH);
+                ret.setResultBody(jxbScore);
+                ret.setResultDesc(CommonConstant.QUERY_SUCCESS_MESSAGE);
+                ret.setIsCharge(Constant.INTERFACE_QUERY_FEE);
+            }
+        } else if (commonResponseObject.getResultCode().equals(CommonConstant.RESPONSE_CODE_8)) {
+            ret.setResultCode(Constant.JK_RETURN_CODE_INVALID_PARAMETER);
+            ret.setResultDesc(Constant.INVALID_PARAMETER);
+            ret.setResultBody(Constant.INVALID_PARAMETER);
+        } else {
+            ret.setResultCode(Constant.JK_RETURN_CODE_OTHER_ERROR);
+            ret.setResultBody(Constant.OTHER_ERROR);
+            ret.setResultDesc(Constant.OTHER_ERROR);
+        }
+    }
+
+    private CommonResponseObject getCommonResponseObject(String method, String token, int outTime, String body) {
+        String responseContext;
+        try {
+            log.info("supplier10000053.{}---requestBody:{}", method, body);
+            responseContext = HttpUtil.doPost(interfaceUrl, body, outTime, token);
+            log.info("supplier10000053.{}---上游返回结果:{}", method, responseContext);
+        } catch (ServiceException se) {
+            log.info("supplier10000053.请求上游结果-ServiceException:", se);
+            throw se;
+        }
+        if (StringUtils.isBlank(responseContext)) {
+            return null;
+        }
+
+        return JSON.toJavaObject(JSON.parseObject(responseContext), CommonResponseObject.class);
+    }
+
+    private boolean validateParams(ChannelTypeHandleResponseObject ret, String returnType, CreditScoreRequestParam requestObject) {
+        if (!validateParamNullValue(requestObject)) {
+            if (Constant.CUSTOMER_RETURN_ZW.equals(returnType)) {
+                ret.setResultCode(Constant.INVALID_PARAMETER_CODE);
+                ret.setResultBody(Constant.PARAMETER_NAME_ERROR);
+                ret.setResultDesc(Constant.PARAMETER_NAME_ERROR);
+            } else {
+                ret.setResultCode(Constant.JK_RETURN_CODE_INVALID_PARAMETER);
+                ret.setResultBody(Constant.PARAMETER_NAME_ERROR);
+                ret.setResultDesc(Constant.PARAMETER_NAME_ERROR);
+            }
+            return false;
+        } else if (StringUtils.isBlank(requestObject.getMobile()) ||
+                !PatternTools.checkResult(Constant.PATTERN_MOBILE_REGEX, requestObject.getMobile())) {
+            if (Constant.CUSTOMER_RETURN_ZW.equals(returnType)) {
+                ret.setResultCode(Constant.MOBILE_FORMAT_ERROR_CODE);
+                ret.setResultDesc(Constant.MOBILE_FORMAT_ERROR);
+                ret.setResultBody(Constant.MOBILE_FORMAT_ERROR);
+            } else {
+                ret.setResultCode(Constant.JK_MOBILE_FORMAT_ERROR_CODE);
+                ret.setResultDesc(Constant.JK_MOBILE_FORMAT_ERROR);
+                ret.setResultBody(Constant.JK_MOBILE_FORMAT_ERROR);
+            }
+            return false;
+        } else if (StringUtils.isBlank(requestObject.getEmpowerNo())
+                || requestObject.getEmpowerNo().length() != 20) {
+            if (Constant.CUSTOMER_RETURN_ZW.equals(returnType)) {
+                ret.setResultCode(Constant.INVALID_PARAMETER_CODE);
+                ret.setResultDesc(Constant.INVALID_PARAMETER);
+                ret.setResultBody(Constant.INVALID_PARAMETER);
+            } else {
+                ret.setResultCode(Constant.JK_RETURN_CODE_INVALID_PARAMETER);
+                ret.setResultDesc(Constant.INVALID_PARAMETER);
+                ret.setResultBody(Constant.INVALID_PARAMETER);
+            }
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    private boolean validateParamNullValue(Object jsonResolveObject) {
+        ValidatorFactory vf = Validation.buildDefaultValidatorFactory();
+        Validator validator = vf.getValidator();
+        Set<ConstraintViolation<Object>> set = validator.validate(jsonResolveObject);
+        for (ConstraintViolation<Object> con : set) {
+            if (StringUtils.isNotBlank(con.getMessage())) {
+                return false;
+            }
+        }
+        return true;
+    }
+}

+ 41 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/task/TokenTask.java

@@ -0,0 +1,41 @@
+package info.aspirecn.iov.sjjh.supplier10000053.task;
+
+import info.aspirecn.iov.sjjh.supplier10000053.constant.CommonConstant;
+import info.aspirecn.iov.sjjh.supplier10000053.service.ChannelService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Component
+@Slf4j
+public class TokenTask {
+    @Autowired
+    StringRedisTemplate stringRedisTemplate;
+    @Autowired
+    ChannelService channelService;
+
+    @Scheduled(cron = "0 0/10 * * * ?")
+    public void tokenTask() {
+        String redisToken = stringRedisTemplate.opsForValue().get(CommonConstant.REDIS_TOKEN_KEY);
+        if (StringUtils.isNotBlank(redisToken)) {
+            String[] redisTokenArray = redisToken.split("&&");
+            String accessTokenTimestamp = redisTokenArray[1];
+            if (System.currentTimeMillis() - Long.parseLong(accessTokenTimestamp) >= 1800000) {
+                String token = channelService.queryAccessToken(1500);
+                log.info("supplier10000053.tokenTask-token即将过期,间隔{},重新获取token:{}", System.currentTimeMillis() - Long.parseLong(accessTokenTimestamp), token);
+            } else {
+                log.info("supplier10000053.tokenTask-还在有效期内,token间隔毫秒:{}", System.currentTimeMillis() - Long.parseLong(accessTokenTimestamp));
+            }
+        } else {
+            String token = channelService.queryAccessToken(1500);
+            log.info("supplier10000053.tokenTask-token不存在,重新获取token:{}", token);
+        }
+    }
+}

File diff suppressed because it is too large
+ 317 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/util/Des3Util.java


+ 85 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000053/util/HttpUtil.java

@@ -0,0 +1,85 @@
+package info.aspirecn.iov.sjjh.supplier10000053.util;
+
+import info.aspirecn.iov.sjjh.commons.lang.Constant;
+import info.aspirecn.iov.sjjh.supplier10000053.exception.ServiceException;
+import lombok.extern.slf4j.Slf4j;
+import okhttp3.*;
+
+import java.io.IOException;
+import java.net.SocketTimeoutException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Slf4j
+public class HttpUtil {
+    private static OkHttpClient okHttpClient = new OkHttpClient.Builder().build();
+
+    public static String doGet(int outTime, String url) throws IOException {
+        Request request = new Request.Builder()
+                .url(url)
+                .build();
+        OkHttpClient client = okHttpClient.newBuilder()
+                .connectTimeout(outTime, TimeUnit.MILLISECONDS)
+                .readTimeout(outTime, TimeUnit.MILLISECONDS)
+                .writeTimeout(outTime, TimeUnit.MILLISECONDS)
+                .build();
+
+        String responseContext = "";
+        Response response = client.newCall(request).execute();
+        if (response.body() != null) {
+            responseContext = response.body().string();
+        }
+        return responseContext;
+    }
+
+    private static final String MEDIA_TYPE = "application/json;charset=UTF-8";
+
+    public static String doPost(String url, String body, long timeOut, String authorization) {
+        OkHttpClient okHttpClient = new OkHttpClient.Builder().build();
+        MediaType mediaType = MediaType.parse(MEDIA_TYPE);
+        RequestBody requestBody = RequestBody.create(mediaType, body);
+
+        Request okRequest = new Request.Builder()
+                .post(requestBody)
+                .header("token", authorization)
+                .url(url)
+                .build();
+        OkHttpClient client = okHttpClient.newBuilder()
+                .connectTimeout(timeOut, TimeUnit.MILLISECONDS)
+                .readTimeout(timeOut, TimeUnit.MILLISECONDS)
+                .writeTimeout(timeOut, TimeUnit.MILLISECONDS)
+                .build();
+
+        String responseContext = "";
+        try {
+            Response response = client.newCall(okRequest).execute();
+
+            if (response.body() != null) {
+                responseContext = response.body().string();
+            }
+
+        } catch (SocketTimeoutException ste) {
+            log.info("supplier10000053.doPost-SocketTimeoutException:{}", ste);
+            throw new ServiceException(Constant.REQUEST_TIMEOUT, String.format("调用上游超时,失败原因: %s", ste.getMessage()), ste);
+        } catch (IOException ioe) {
+            log.info("supplier10000053.doPost-IOException:{}", ioe);
+            throw new ServiceException(Constant.FAIL, String.format("调用上游失败,失败原因: %s", ioe.getMessage()), ioe);
+        } catch (Exception e) {
+            log.info("supplier10000053.doPost-Exception:{}", e);
+            throw new ServiceException(Constant.FAIL, String.format("调用上游失败,失败原因: %s", e.getMessage()), e);
+
+        }
+        return responseContext;
+    }
+
+    public static void main(String[] args) {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyMMddhhmmss");
+        System.out.println(simpleDateFormat.format(new Date()) + (String.valueOf(System.currentTimeMillis()).substring(0, 8)));
+        System.out.println();
+    }
+}

+ 119 - 0
src/main/resources/config/application.yml

@@ -0,0 +1,119 @@
+server:
+  tomcat:
+    accesslog:
+      buffered: false
+      enabled: true
+      pattern: '{"DateTime":"%{yyyy-MM-dd''T''HH:mm:ss.SSSZZ}t","ClientIP":"%a","Method":"%m","URI":"%U","RequestProtocol":"%H","ResponseCode":%s,
+                  "ResponseTime":%D,"UserAgent":"-","X-Forwarded-For":"-","X-User-IP":"%{X-Real-IP}i","traceId":"%{x-b3-traceid}r","id":"%{x-b3-spanid}r",
+                  "parentId":"%{x-b3-parentspanid}r","ApplicationName":"${spring.application.name}","MG-IsCharge":%{x-isCharge}r,"MG-Upstream-ResponseCode":"%{upResponseCode}r","MG-ChannelId":%{channelId}r,
+                  "MG-ResponseCode":%{x-responseCode}r,"MG-CustomBody":"%{x-requestQuery}r","MG-SellingPrice":%{price}r,"req_type":"%{req_type}r","MG-ProductId":%{productId}r,"MG-UserId":%{userid}r,"MG-IfCj":"%{ifcj}r"}'
+      prefix: access_${HOSTNAME}_${spring.application.name}_${server.port}
+      directory: ${logging.path}
+  servlet:
+    context-path: /
+
+spring:
+  elasticsearch:
+    jest:
+      read-timeout: 300s
+      connection-timeout: 10s
+      uris: http://iov-sjjh-es-1.iov-sjjh:9200,http://iov-sjjh-es-2.iov-sjjh:9200,http://iov-sjjh-es-3.iov-sjjh:9200
+  sleuth:
+    sampler:
+      probability: 0.1
+    web:
+      additional-skip-pattern: /api/v2/spans
+  zipkin:
+    base-url: http://127.0.0.1:${server.port}
+  mvc:
+    favicon:
+      enabled: false
+  cloud:
+    config:
+      overrideSystemProperties: true
+      allowOverride: true
+      overrideNone: true
+    stream:
+      kafka:
+        binder:
+          brokers: iov-sjjh-kafka-1.iov-sjjh:9092,iov-sjjh-kafka-2.iov-sjjh:9092,iov-sjjh-kafka-3.iov-sjjh:9092
+          auto-add-partitions: true
+          auto-create-topics: true
+          required-acks: 1
+      bindings:
+        output:
+          destination: iov_sjjh_callback_downstream_online
+          content-type: text/plain
+          producer:
+            partitionCount: 3
+            partitionKeyExpression: headers.id
+  redis:
+    host: 127.0.0.1
+    port: 6379
+    jedis:
+      pool:
+        max-active: 8
+        max-wait: -1
+        max-idle: 8
+        min-idle: 0
+
+#management
+management:
+  endpoints:
+    enabled-by-default: true
+    web:
+      exposure:
+        include: '*'
+  endpoint:
+    health:
+      show-details: always
+    shutdown:
+      enabled: true
+
+
+#logging
+logging:
+  file: ${logging.path}/catalina_${spring.cloud.client.hostname}_${spring.application.name}_${server.port}.out
+  config: classpath:config/logback-spring.xml
+  level:
+    info:
+      aspirecn:
+        iov: INFO
+    root: WARN
+  path: /Users/jkxy/root-logs/apps/var/jakarta/logs
+#error logging
+#sleuth logging
+rdc:
+  logging:
+    error-file: ${logging.path}/error_${spring.cloud.client.hostname}_${spring.application.name}_${server.port}.log
+    sleuth-file: ${logging.path}/sleuth_${spring.cloud.client.hostname}_${spring.application.name}_${server.port}.log
+
+#eureka
+eureka:
+  instance:
+    prefer-ip-address: true
+    instance-id: ${spring.cloud.client.ip-address}:${server.port}:${spring.application.name}
+    metadata-map:
+      management:
+        server:
+          port: ${management.server.port}
+    health-check-url: http://${spring.cloud.client.ip-address}:${management.server.port}${eureka.instance.health-check-url-path}
+    health-check-url-path: /actuator/health
+  client:
+    serviceUrl:
+      defaultZone: http://localhost:8888/eureka
+    enabled: true
+
+supplier:
+  token:
+    url: http://admincmasp.jkcredit.com/mrcp/gateway-ct/getToken.do
+    appId: 169349d15c79405f8cf4ac6f84d037aa
+    appSecret: 0c149
+  interface:
+    url: http://admincmasp.jkcredit.com/mrcp/gateway-ct/route/route.do
+  productId:
+    creditScore: 30000107
+  des:
+    key: 123@abc!
+swagger:
+  show: true

+ 3 - 0
src/main/resources/config/banner.txt

@@ -0,0 +1,3 @@
+*******************************************************************************
+	 @project.artifactId@  (version:@project.version@)
+*******************************************************************************

+ 26 - 0
src/main/resources/config/bootstrap.yml

@@ -0,0 +1,26 @@
+spring:
+  application:
+    name: '@project.artifactId@'
+  banner:
+    location: classpath:config/banner.txt
+#  profiles:
+#    active: hwtest
+#  cloud:
+#    config:
+#      discovery:
+#        enabled: false
+#      uri: http://10.8.18.157:32533
+#      label: trunk
+#      name: ${spring.application.name}
+#      profile: ${spring.profiles.active}
+
+server:
+  port: 25110
+management:
+  server:
+    port: 35110
+info:
+  name: '@project.description@'
+  version: '@project.version@'
+
+

+ 37 - 0
src/main/resources/config/logback-spring.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+	<include resource="org/springframework/boot/logging/logback/defaults.xml" />
+	<include
+		resource="org/springframework/boot/logging/logback/console-appender.xml" />
+
+	<property name="LOG_FILE"
+		value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/spring.log}" />
+	<springProperty scope="context" name="LOG_PATH" source="logging.path" defaultValue="/Users/jkxy/root-logs/apps/var/jakarta/logs" />
+	<springProperty scope="context" name="application_name" source="spring.application.name" defaultValue="test-servicenode-supplier-2" />
+	<springProperty scope="context" name="sleuth_file" source="rdc.logging.sleuth-file" defaultValue="${LOG_PATH}/sleuth/sleuth.log" />
+	<springProperty scope="context" name="error_file" source="rdc.logging.error-file" defaultValue="${LOG_PATH}/error/error.log" />
+
+<!--	<include resource="info/aspirecn/rdc/aspirecloud/node/except/xml/defaults.xml" />-->
+	<include resource="info/aspirecn/rdc/aspirecloud/node/brave/xml/defaults.xml" />
+
+	<appender name="TIME_FILE"
+		class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<encoder>
+			<pattern>${FILE_LOG_PATTERN}</pattern>
+		</encoder>
+		<file>${LOG_FILE}</file>
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<fileNamePattern>${LOG_FILE}.%d{yyyy-MM-dd}.%i</fileNamePattern>
+			<maxHistory>8</maxHistory>
+			<timeBasedFileNamingAndTriggeringPolicy
+				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+		</rollingPolicy>
+	</appender>
+
+	<root level="INFO">
+		<appender-ref ref="CONSOLE" />
+		<appender-ref ref="TIME_FILE" />
+	</root>
+</configuration>