Browse Source

first version

huodongdong 7 years atrás
parent
commit
2f57ba34a8
64 changed files with 289 additions and 452 deletions
  1. 0 12
      api-web/src/main/java/cn/rankin/apiweb/ApiWebApplication.java
  2. 0 0
      api-web/src/main/resources/application.properties
  3. 0 24
      cms-gateway/.gitignore
  4. BIN
      cms-gateway/.mvn/wrapper/maven-wrapper.jar
  5. 0 1
      cms-gateway/.mvn/wrapper/maven-wrapper.properties
  6. 0 225
      cms-gateway/mvnw
  7. 0 143
      cms-gateway/mvnw.cmd
  8. 0 0
      cms-gateway/src/main/resources/application.properties
  9. 0 0
      cms-web/src/main/resources/application.properties
  10. 0 5
      config-service/src/main/resources/application.properties
  11. 0 6
      eureka-service/src/main/resources/application.properties
  12. 10 10
      pom.xml
  13. 0 0
      product-service/src/main/resources/application.properties
  14. 0 6
      product-service/src/main/resources/bootstrap.properties
  15. 2 2
      api-gateway/pom.xml
  16. 2 0
      api-gateway/src/main/java/cn/rankin/apigateway/ApiGatewayApplication.java
  17. 0 0
      rankin-api-gateway/src/main/resources/application.properties
  18. 11 0
      rankin-api-gateway/src/main/resources/bootstrap.yml
  19. 0 0
      rankin-api-gateway/src/test/java/cn/rankin/apigateway/ApiGatewayApplicationTests.java
  20. 6 2
      api-web/pom.xml
  21. 16 0
      rankin-api-web/src/main/java/cn/rankin/apiweb/ApiWebApplication.java
  22. 20 0
      rankin-api-web/src/main/java/cn/rankin/apiweb/controller/TestFeignClient.java
  23. 11 0
      rankin-api-web/src/main/java/cn/rankin/apiweb/feign/ProductClient.java
  24. 11 0
      rankin-api-web/src/main/resources/bootstrap.yml
  25. 0 0
      rankin-api-web/src/test/java/cn/rankin/apiweb/ApiWebApplicationTests.java
  26. 2 2
      cms-gateway/pom.xml
  27. 0 0
      rankin-cms-gateway/src/main/java/cn/rankin/cmsgateway/CmsGatewayApplication.java
  28. 11 0
      rankin-cms-gateway/src/main/resources/bootstrap.yml
  29. 0 0
      rankin-cms-gateway/src/test/java/cn/rankin/cmsgateway/CmsGatewayApplicationTests.java
  30. 2 2
      cms-web/pom.xml
  31. 0 0
      rankin-cms-web/src/main/java/cn/rankin/cmsweb/CmsWebApplication.java
  32. 11 0
      rankin-cms-web/src/main/resources/bootstrap.yml
  33. 0 0
      rankin-cms-web/src/test/java/cn/rankin/cmsweb/CmsWebApplicationTests.java
  34. 2 2
      config-service/pom.xml
  35. 0 0
      rankin-config-service/src/main/java/cn/rankin/configservice/ConfigServiceApplication.java
  36. 13 0
      rankin-config-service/src/main/resources/bootstrap.yml
  37. 0 0
      rankin-config-service/src/test/java/cn/rankin/configservice/ConfigServerApplicationTests.java
  38. 2 2
      eureka-service/pom.xml
  39. 0 0
      rankin-eureka-service/src/main/java/cn/rankin/eurekaservice/EurekaServiceApplication.java
  40. 13 0
      rankin-eureka-service/src/main/resources/bootstrap.yml
  41. 0 0
      rankin-eureka-service/src/test/java/cn/rankin/eurekaservice/EurekaServerApplicationTests.java
  42. 16 2
      product-service/pom.xml
  43. 3 0
      product-service/src/main/java/cn/rankin/productservice/ProductServiceApplication.java
  44. 26 0
      rankin-product-service/src/main/java/cn/rankin/productservice/controller/TestController.java
  45. 27 0
      rankin-product-service/src/main/java/cn/rankin/productservice/entity/Test.java
  46. 13 0
      rankin-product-service/src/main/java/cn/rankin/productservice/repository/BasicRepository.java
  47. 9 0
      rankin-product-service/src/main/java/cn/rankin/productservice/repository/TestRepository.java
  48. 11 0
      rankin-product-service/src/main/resources/bootstrap.yml
  49. 0 0
      rankin-product-service/src/test/java/cn/rankin/productservice/ProductServiceApplicationTests.java
  50. 2 2
      resource-service/pom.xml
  51. 0 0
      rankin-resource-service/src/main/java/cn/rankin/resourceservice/ResourceServiceApplication.java
  52. 11 0
      rankin-resource-service/src/main/resources/bootstrap.yml
  53. 0 0
      rankin-resource-service/src/test/java/cn/rankin/resourceservice/ResourceServiceApplicationTests.java
  54. 2 2
      trade-service/pom.xml
  55. 0 0
      rankin-trade-service/src/main/java/cn/rankin/tradeservice/TradeServiceApplication.java
  56. 11 0
      rankin-trade-service/src/main/resources/bootstrap.yml
  57. 0 0
      rankin-trade-service/src/test/java/cn/rankin/tradeservice/TradeServiceApplicationTests.java
  58. 2 2
      user-service/pom.xml
  59. 0 0
      rankin-user-service/src/main/java/cn/rankin/userservice/UserServiceApplication.java
  60. 11 0
      rankin-user-service/src/main/resources/bootstrap.yml
  61. 0 0
      rankin-user-service/src/test/java/cn/rankin/userservice/UserServiceApplicationTests.java
  62. 0 0
      resource-service/src/main/resources/application.properties
  63. 0 0
      trade-service/src/main/resources/application.properties
  64. 0 0
      user-service/src/main/resources/application.properties

+ 0 - 12
api-web/src/main/java/cn/rankin/apiweb/ApiWebApplication.java

@@ -1,12 +0,0 @@
-package cn.rankin.apiweb;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class ApiWebApplication {
-
-	public static void main(String[] args) {
-		SpringApplication.run(ApiWebApplication.class, args);
-	}
-}

+ 0 - 0
api-web/src/main/resources/application.properties


+ 0 - 24
cms-gateway/.gitignore

@@ -1,24 +0,0 @@
-target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-nbproject/private/
-build/
-nbbuild/
-dist/
-nbdist/
-.nb-gradle/

BIN
cms-gateway/.mvn/wrapper/maven-wrapper.jar


+ 0 - 1
cms-gateway/.mvn/wrapper/maven-wrapper.properties

@@ -1 +0,0 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip

+ 0 - 225
cms-gateway/mvnw

@@ -1,225 +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
-#
-#    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.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven2 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 Migwn, 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)`"
-  # TODO classpath?
-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
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-echo $MAVEN_PROJECTBASEDIR
-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
-
-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 "$@"

+ 0 - 143
cms-gateway/mvnw.cmd

@@ -1,143 +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    http://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 Maven2 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 key stroke 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 enable echoing my 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
-
-%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%

+ 0 - 0
cms-gateway/src/main/resources/application.properties


+ 0 - 0
cms-web/src/main/resources/application.properties


+ 0 - 5
config-service/src/main/resources/application.properties

@@ -1,5 +0,0 @@
-spring.application.name=config-server
-server.port=8921
-
-spring.cloud.config.server.git.uri=http://gogs.efunbox.cn:3000/Rankin/setting.git
-spring.cloud.config.server.git.search-paths=develop, product

+ 0 - 6
eureka-service/src/main/resources/application.properties

@@ -1,6 +0,0 @@
-server.port=8821
-
-eureka.instance.hostname=discovery.rankin.com
-eureka.client.register-with-eureka=false
-eureka.client.fetch-registry=false
-eureka.client.service-url.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/

+ 10 - 10
pom.xml

@@ -25,16 +25,16 @@
 	</properties>
 
     <modules>
-        <module>eureka-service</module>
-        <module>config-service</module>
-        <module>product-service</module>
-        <module>user-service</module>
-        <module>resource-service</module>
-        <module>trade-service</module>
-        <module>cms-web</module>
-        <module>api-web</module>
-        <module>api-gateway</module>
-        <module>cms-gateway</module>
+        <module>rankin-eureka-service</module>
+        <module>rankin-config-service</module>
+        <module>rankin-product-service</module>
+        <module>rankin-user-service</module>
+        <module>rankin-resource-service</module>
+        <module>rankin-trade-service</module>
+        <module>rankin-cms-web</module>
+        <module>rankin-api-web</module>
+        <module>rankin-api-gateway</module>
+        <module>rankin-cms-gateway</module>
     </modules>
 
 	<dependencies>

+ 0 - 0
product-service/src/main/resources/application.properties


+ 0 - 6
product-service/src/main/resources/bootstrap.properties

@@ -1,6 +0,0 @@
-spring.application.name=product-service
-spring.cloud.config.profile=dev
-spring.cloud.config.label=release
-spring.cloud.config.uri=http://config.rankin.com:8921
-
-server.port=8001

+ 2 - 2
api-gateway/pom.xml

@@ -4,11 +4,11 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>cn.rankin</groupId>
-	<artifactId>api-gateway</artifactId>
+	<artifactId>rankin-api-gateway</artifactId>
 	<version>0.0.1-SNAPSHOT</version>
 	<packaging>jar</packaging>
 
-	<name>api-gateway</name>
+	<name>rankin-api-gateway</name>
 	<description>Api Gateway For Spring Cloud</description>
 
 	<parent>

+ 2 - 0
api-gateway/src/main/java/cn/rankin/apigateway/ApiGatewayApplication.java

@@ -2,7 +2,9 @@ package cn.rankin.apigateway;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
 
+@EnableZuulProxy
 @SpringBootApplication
 public class ApiGatewayApplication {
 

api-gateway/src/main/resources/application.properties → rankin-api-gateway/src/main/resources/application.properties


+ 11 - 0
rankin-api-gateway/src/main/resources/bootstrap.yml

@@ -0,0 +1,11 @@
+spring:
+  application:
+    name: api-gateway
+  cloud:
+    config:
+      uri: http://config.rankin.com:8921
+      label: master
+      profile: dev
+
+server:
+  port: 13000

api-gateway/src/test/java/cn/rankin/apigateway/ApiGatewayApplicationTests.java → rankin-api-gateway/src/test/java/cn/rankin/apigateway/ApiGatewayApplicationTests.java


+ 6 - 2
api-web/pom.xml

@@ -4,11 +4,11 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>cn.rankin</groupId>
-	<artifactId>api-web</artifactId>
+	<artifactId>rankin-api-web</artifactId>
 	<version>0.0.1-SNAPSHOT</version>
 	<packaging>jar</packaging>
 
-	<name>api-web</name>
+	<name>rankin-api-web</name>
 	<description>Api Web For Spring Cloud</description>
 
 	<parent>
@@ -34,6 +34,10 @@
 			<groupId>org.springframework.cloud</groupId>
 			<artifactId>spring-cloud-starter-eureka</artifactId>
 		</dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-feign</artifactId>
+        </dependency>
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-web</artifactId>

+ 16 - 0
rankin-api-web/src/main/java/cn/rankin/apiweb/ApiWebApplication.java

@@ -0,0 +1,16 @@
+package cn.rankin.apiweb;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.netflix.feign.EnableFeignClients;
+
+@EnableFeignClients
+@EnableDiscoveryClient
+@SpringBootApplication
+public class ApiWebApplication {
+
+	public static void main(String[] args) {
+		SpringApplication.run(ApiWebApplication.class, args);
+	}
+}

+ 20 - 0
rankin-api-web/src/main/java/cn/rankin/apiweb/controller/TestFeignClient.java

@@ -0,0 +1,20 @@
+package cn.rankin.apiweb.controller;
+
+import cn.rankin.apiweb.feign.ProductClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class TestFeignClient {
+
+    @Autowired
+    ProductClient productClient;
+
+    @RequestMapping(value = "/test", method = RequestMethod.GET)
+    public String test() {
+        return productClient.hello();
+
+    }
+}

+ 11 - 0
rankin-api-web/src/main/java/cn/rankin/apiweb/feign/ProductClient.java

@@ -0,0 +1,11 @@
+package cn.rankin.apiweb.feign;
+
+import org.springframework.cloud.netflix.feign.FeignClient;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@FeignClient(name = "${service.product.name}")
+public interface ProductClient {
+
+    @RequestMapping(value = "/hello")
+    String hello();
+}

+ 11 - 0
rankin-api-web/src/main/resources/bootstrap.yml

@@ -0,0 +1,11 @@
+spring:
+  application:
+    name: api-web
+  cloud:
+    config:
+      uri: http://config.rankin.com:8921
+      label: master
+      profile: dev
+
+server:
+  port: 8600

api-web/src/test/java/cn/rankin/apiweb/ApiWebApplicationTests.java → rankin-api-web/src/test/java/cn/rankin/apiweb/ApiWebApplicationTests.java


+ 2 - 2
cms-gateway/pom.xml

@@ -4,11 +4,11 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>cn.rankin</groupId>
-	<artifactId>cms-gateway</artifactId>
+	<artifactId>rankin-cms-gateway</artifactId>
 	<version>0.0.1-SNAPSHOT</version>
 	<packaging>jar</packaging>
 
-	<name>cms-gateway</name>
+	<name>rankin-cms-gateway</name>
 	<description>Cms Gateway For Spring Cloud</description>
 
 	<parent>

cms-gateway/src/main/java/cn/rankin/cmsgateway/CmsGatewayApplication.java → rankin-cms-gateway/src/main/java/cn/rankin/cmsgateway/CmsGatewayApplication.java


+ 11 - 0
rankin-cms-gateway/src/main/resources/bootstrap.yml

@@ -0,0 +1,11 @@
+spring:
+  application:
+    name: cms-gateway
+  cloud:
+    config:
+      uri: http://config.rankin.com:8921
+      label: master
+      profile: prod
+
+server:
+  port: 8600

cms-gateway/src/test/java/cn/rankin/cmsgateway/CmsGatewayApplicationTests.java → rankin-cms-gateway/src/test/java/cn/rankin/cmsgateway/CmsGatewayApplicationTests.java


+ 2 - 2
cms-web/pom.xml

@@ -4,11 +4,11 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>cn.rankin</groupId>
-	<artifactId>cms-web</artifactId>
+	<artifactId>rankin-cms-web</artifactId>
 	<version>0.0.1-SNAPSHOT</version>
 	<packaging>jar</packaging>
 
-	<name>cms-web</name>
+	<name>rankin-cms-web</name>
 	<description>Cms Web For Spring Cloud</description>
 
 	<parent>

cms-web/src/main/java/cn/rankin/cmsweb/CmsWebApplication.java → rankin-cms-web/src/main/java/cn/rankin/cmsweb/CmsWebApplication.java


+ 11 - 0
rankin-cms-web/src/main/resources/bootstrap.yml

@@ -0,0 +1,11 @@
+spring:
+  application:
+    name: cms-web
+  cloud:
+    config:
+      uri: http://config.rankin.com:8921
+      label: master
+      profile: prod
+
+server:
+  port: 8500

cms-web/src/test/java/cn/rankin/cmsweb/CmsWebApplicationTests.java → rankin-cms-web/src/test/java/cn/rankin/cmsweb/CmsWebApplicationTests.java


+ 2 - 2
config-service/pom.xml

@@ -4,11 +4,11 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>cn.rankin</groupId>
-	<artifactId>config-service</artifactId>
+	<artifactId>rankin-config-service</artifactId>
 	<version>0.0.1-SNAPSHOT</version>
 	<packaging>jar</packaging>
 
-	<name>config-service</name>
+	<name>rankin-config-service</name>
 	<description>Config Server For Spring Cloud</description>
 
 	<parent>

config-service/src/main/java/cn/rankin/configservice/ConfigServiceApplication.java → rankin-config-service/src/main/java/cn/rankin/configservice/ConfigServiceApplication.java


+ 13 - 0
rankin-config-service/src/main/resources/bootstrap.yml

@@ -0,0 +1,13 @@
+spring:
+  application:
+    name: config-service
+  cloud:
+    config:
+      server:
+        git:
+          uri: http://gogs.efunbox.cn:3000/Rankin/setting.git
+          search-paths: dev, prod
+
+server:
+  port: 8921
+

config-service/src/test/java/cn/rankin/configservice/ConfigServerApplicationTests.java → rankin-config-service/src/test/java/cn/rankin/configservice/ConfigServerApplicationTests.java


+ 2 - 2
eureka-service/pom.xml

@@ -4,11 +4,11 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>cn.rankin</groupId>
-	<artifactId>eureka-service</artifactId>
+	<artifactId>rankin-eureka-service</artifactId>
 	<version>0.0.1-SNAPSHOT</version>
 	<packaging>jar</packaging>
 
-	<name>eureka-service</name>
+	<name>rankin-eureka-service</name>
 	<description>Discovery Service For Spring Cloud</description>
 
 	<parent>

eureka-service/src/main/java/cn/rankin/eurekaservice/EurekaServiceApplication.java → rankin-eureka-service/src/main/java/cn/rankin/eurekaservice/EurekaServiceApplication.java


+ 13 - 0
rankin-eureka-service/src/main/resources/bootstrap.yml

@@ -0,0 +1,13 @@
+server:
+  port: 8821
+
+eureka:
+  instance:
+    hostname: discovery.rankin.com
+  server:
+    enable-self-preservation: false
+  client:
+    register-with-eureka: false
+    fetch-registry: false
+    service-url:
+      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

eureka-service/src/test/java/cn/rankin/eurekaservice/EurekaServerApplicationTests.java → rankin-eureka-service/src/test/java/cn/rankin/eurekaservice/EurekaServerApplicationTests.java


+ 16 - 2
product-service/pom.xml

@@ -4,11 +4,11 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>cn.rankin</groupId>
-	<artifactId>product-service</artifactId>
+	<artifactId>rankin-product-service</artifactId>
 	<version>0.0.1-SNAPSHOT</version>
 	<packaging>jar</packaging>
 
-	<name>product-service</name>
+	<name>rankin-product-service</name>
 	<description>Product Service For Spring Cloud</description>
 
 	<parent>
@@ -34,6 +34,20 @@
 			<groupId>org.springframework.cloud</groupId>
 			<artifactId>spring-cloud-starter-eureka</artifactId>
 		</dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.16.16</version>
+        </dependency>
 
 		<dependency>
 			<groupId>org.springframework.boot</groupId>

+ 3 - 0
product-service/src/main/java/cn/rankin/productservice/ProductServiceApplication.java

@@ -2,7 +2,10 @@ package cn.rankin.productservice;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 
+
+@EnableDiscoveryClient
 @SpringBootApplication
 public class ProductServiceApplication {
 

+ 26 - 0
rankin-product-service/src/main/java/cn/rankin/productservice/controller/TestController.java

@@ -0,0 +1,26 @@
+package cn.rankin.productservice.controller;
+
+import cn.rankin.productservice.entity.Test;
+import cn.rankin.productservice.repository.TestRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class TestController {
+
+    @Autowired
+    private TestRepository testRepository;
+
+    @RequestMapping(value = "/hello", method = RequestMethod.GET)
+    public String sayHello() {
+        Test test = new Test();
+        test.setId(123L);
+        test.setName("huodongdong");
+        test.setAge(12);
+        test.setAddress("beijing");
+        testRepository.save(test);
+        return "hello!";
+    }
+}

+ 27 - 0
rankin-product-service/src/main/java/cn/rankin/productservice/entity/Test.java

@@ -0,0 +1,27 @@
+package cn.rankin.productservice.entity;
+
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+@Data
+@Entity
+public class Test implements Serializable{
+
+    @Id
+    private Long id;
+
+    @Column(name = "name")
+    private String name;
+
+    @Column(name = "age")
+    private Integer age;
+
+    @Column(name = "address")
+    private String address;
+
+}

+ 13 - 0
rankin-product-service/src/main/java/cn/rankin/productservice/repository/BasicRepository.java

@@ -0,0 +1,13 @@
+package cn.rankin.productservice.repository;
+
+import java.io.Serializable;
+import java.util.List;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.repository.NoRepositoryBean;
+
+@NoRepositoryBean
+public interface BasicRepository <E, ID extends Serializable> extends JpaRepository<E, ID> {
+
+}
+

+ 9 - 0
rankin-product-service/src/main/java/cn/rankin/productservice/repository/TestRepository.java

@@ -0,0 +1,9 @@
+package cn.rankin.productservice.repository;
+
+import cn.rankin.productservice.entity.Test;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface TestRepository extends BasicRepository<Test, Long> {
+
+}

+ 11 - 0
rankin-product-service/src/main/resources/bootstrap.yml

@@ -0,0 +1,11 @@
+spring:
+  application:
+    name: product-service
+  cloud:
+    config:
+      uri: http://config.rankin.com:8921
+      label: master
+      profile: dev
+
+server:
+  port: 8100

product-service/src/test/java/cn/rankin/productservice/ProductServiceApplicationTests.java → rankin-product-service/src/test/java/cn/rankin/productservice/ProductServiceApplicationTests.java


+ 2 - 2
resource-service/pom.xml

@@ -4,11 +4,11 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>cn.rankin</groupId>
-	<artifactId>resource-service</artifactId>
+	<artifactId>rankin-resource-service</artifactId>
 	<version>0.0.1-SNAPSHOT</version>
 	<packaging>jar</packaging>
 
-	<name>resource-service</name>
+	<name>rankin-resource-service</name>
 	<description>Resource Service For Spring Cloud</description>
 
 	<parent>

resource-service/src/main/java/cn/rankin/resourceservice/ResourceServiceApplication.java → rankin-resource-service/src/main/java/cn/rankin/resourceservice/ResourceServiceApplication.java


+ 11 - 0
rankin-resource-service/src/main/resources/bootstrap.yml

@@ -0,0 +1,11 @@
+spring:
+  application:
+    name: resource-service
+  cloud:
+    config:
+      uri: http://config.rankin.com:8921
+      label: master
+      profile: prod
+
+server:
+  port: 8200

resource-service/src/test/java/cn/rankin/resourceservice/ResourceServiceApplicationTests.java → rankin-resource-service/src/test/java/cn/rankin/resourceservice/ResourceServiceApplicationTests.java


+ 2 - 2
trade-service/pom.xml

@@ -4,11 +4,11 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>cn.rankin</groupId>
-	<artifactId>trade-service</artifactId>
+	<artifactId>rankin-trade-service</artifactId>
 	<version>0.0.1-SNAPSHOT</version>
 	<packaging>jar</packaging>
 
-	<name>trade-service</name>
+	<name>rankin-trade-service</name>
 	<description>Trade Service For Spring Cloud</description>
 
 	<parent>

trade-service/src/main/java/cn/rankin/tradeservice/TradeServiceApplication.java → rankin-trade-service/src/main/java/cn/rankin/tradeservice/TradeServiceApplication.java


+ 11 - 0
rankin-trade-service/src/main/resources/bootstrap.yml

@@ -0,0 +1,11 @@
+spring:
+  application:
+    name: trade-service
+  cloud:
+    config:
+      uri: http://config.rankin.com:8921
+      label: master
+      profile: prod
+
+server:
+  port: 8300

trade-service/src/test/java/cn/rankin/tradeservice/TradeServiceApplicationTests.java → rankin-trade-service/src/test/java/cn/rankin/tradeservice/TradeServiceApplicationTests.java


+ 2 - 2
user-service/pom.xml

@@ -4,11 +4,11 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>cn.rankin</groupId>
-	<artifactId>user-service</artifactId>
+	<artifactId>rankin-user-service</artifactId>
 	<version>0.0.1-SNAPSHOT</version>
 	<packaging>jar</packaging>
 
-	<name>user-service</name>
+	<name>rankin-user-service</name>
 	<description>User Service For Spring Cloud</description>
 
 	<parent>

user-service/src/main/java/cn/rankin/userservice/UserServiceApplication.java → rankin-user-service/src/main/java/cn/rankin/userservice/UserServiceApplication.java


+ 11 - 0
rankin-user-service/src/main/resources/bootstrap.yml

@@ -0,0 +1,11 @@
+spring:
+  application:
+    name: user-service
+  cloud:
+    config:
+      uri: http://config.rankin.com:8921
+      label: master
+      profile: prod
+
+server:
+  port: 8400

user-service/src/test/java/cn/rankin/userservice/UserServiceApplicationTests.java → rankin-user-service/src/test/java/cn/rankin/userservice/UserServiceApplicationTests.java


+ 0 - 0
resource-service/src/main/resources/application.properties


+ 0 - 0
trade-service/src/main/resources/application.properties


+ 0 - 0
user-service/src/main/resources/application.properties