韦二铭 5 tahun lalu
induk
melakukan
5a7ceffe52
50 mengubah file dengan 984 tambahan dan 26 penghapusan
  1. 1 0
      README.md
  2. 36 0
      base-springframework-starter/pom.xml
  3. 8 0
      base-springframework/base-springframework-constant/src/main/java/com/wei/base/springframework/constant/vo/RestfulVO.java
  4. 10 3
      base-springframework/base-springframework-core/src/main/java/com/wei/base/springframework/core/swagger/Swagger3Config.java
  5. 227 0
      base-springframework/base-springframework-core/src/main/java/com/wei/base/springframework/core/swagger/Swagger3ServiceModelToOpenApiMapperImpl.java
  6. 15 0
      base-springframework/base-springframework-core/src/main/java/com/wei/base/springframework/core/web/config/ResponseHandlerConfigure.java
  7. 2 1
      base-springframework/base-springframework-core/src/main/java/com/wei/base/springframework/core/web/handler/ResponseHandler.java
  8. 10 1
      base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/env/InitializeCustomConfiguration.java
  9. 26 0
      base-springframework/base-springframework-util/base-springframework-util.iml
  10. 9 0
      base-springframework/base-springframework-util/src/main/java/com/wei/base/springframework/util/StringUtil.java
  11. 36 0
      base-springframework/pom.xml
  12. TEMPAT SAMPAH
      consul/consul_1.8.0_linux_amd64.zip
  13. 39 0
      pom.xml
  14. 54 0
      wei-developer-platform/pom.xml
  15. 47 0
      wei-developer-platform/wei-developer-platform-api/pom.xml
  16. 14 0
      wei-developer-platform/wei-developer-platform-api/src/main/java/com/wei/user/api/ApiService.java
  17. TEMPAT SAMPAH
      wei-developer-platform/wei-developer-platform-api/target/classes/com/wei/cloud/api/ApiService.class
  18. 5 0
      wei-developer-platform/wei-developer-platform-api/target/maven-archiver/pom.properties
  19. 1 0
      wei-developer-platform/wei-developer-platform-api/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  20. 1 0
      wei-developer-platform/wei-developer-platform-api/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  21. TEMPAT SAMPAH
      wei-developer-platform/wei-developer-platform-api/target/wei-user-api-0.0.1-SNAPSHOT.jar
  22. 56 0
      wei-developer-platform/wei-developer-platform-app/pom.xml
  23. 12 0
      wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/DeveloperPlatformApplication.java
  24. 65 0
      wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/controller/UserController.java
  25. 55 0
      wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/entity/User.java
  26. 16 0
      wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/mapper/UserMapper.java
  27. 14 0
      wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/mapstruct/UserMapstruct.java
  28. 16 0
      wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/service/UserService.java
  29. 24 0
      wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/service/impl/UserServiceImpl.java
  30. 59 0
      wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/vo/UserVO.java
  31. 23 0
      wei-developer-platform/wei-developer-platform-app/src/main/resources/bootstrap.yml
  32. 16 0
      wei-developer-platform/wei-developer-platform-app/src/main/resources/mappers/UserMapper.xml
  33. 23 0
      wei-developer-platform/wei-developer-platform-app/target/classes/bootstrap.yml
  34. TEMPAT SAMPAH
      wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/UserApplication.class
  35. TEMPAT SAMPAH
      wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/controller/UserController.class
  36. TEMPAT SAMPAH
      wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/entity/User.class
  37. TEMPAT SAMPAH
      wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/mapper/UserMapper.class
  38. TEMPAT SAMPAH
      wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/mapstruct/UserMapstruct.class
  39. TEMPAT SAMPAH
      wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/mapstruct/UserMapstructImpl.class
  40. TEMPAT SAMPAH
      wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/service/UserService.class
  41. TEMPAT SAMPAH
      wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/service/impl/UserServiceImpl.class
  42. TEMPAT SAMPAH
      wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/vo/UserVO.class
  43. 13 0
      wei-developer-platform/wei-developer-platform-app/target/generated-sources/annotations/com/wei/user/mapstruct/UserMapstructImpl.java
  44. 5 0
      wei-developer-platform/wei-developer-platform-app/target/maven-archiver/pom.properties
  45. 9 0
      wei-developer-platform/wei-developer-platform-app/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  46. 8 0
      wei-developer-platform/wei-developer-platform-app/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  47. TEMPAT SAMPAH
      wei-developer-platform/wei-developer-platform-app/target/wei-user-app-0.0.1-SNAPSHOT.jar
  48. 19 19
      wei-gateway/src/main/java/com/wei/gateway/config/GatewayConfigure.java
  49. 7 0
      wei-gateway/src/main/resources/bootstrap.yml
  50. 3 2
      wei-user/wei-user-app/src/main/resources/bootstrap.yml

+ 1 - 0
README.md

@@ -3,6 +3,7 @@
 
 #base-framework
 用于处理jar包版本统一依赖
+base-framework下每个项目都有一个application.yml文件里面配置着默认的配置,如果在自己的项目中配置相同配置的话会覆盖默认配置
 
 #consul
 consul安装教程

+ 36 - 0
base-springframework-starter/pom.xml

@@ -23,6 +23,7 @@
         <lombok.version>1.18.12</lombok.version>
         <spring-boot-starter.version>2.3.1.RELEASE</spring-boot-starter.version>
         <spring.version>5.2.7.RELEASE</spring.version>
+        <kotlin.version>1.4.10</kotlin.version>
     </properties>
 
     <dependencies>
@@ -36,6 +37,17 @@
             <artifactId>base-springframework-cloud</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.jetbrains.kotlin</groupId>
+            <artifactId>kotlin-stdlib-jdk8</artifactId>
+            <version>${kotlin.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jetbrains.kotlin</groupId>
+            <artifactId>kotlin-test</artifactId>
+            <version>${kotlin.version}</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <dependencyManagement>
@@ -69,6 +81,30 @@
                     <target>${maven.compiler.target}</target>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.jetbrains.kotlin</groupId>
+                <artifactId>kotlin-maven-plugin</artifactId>
+                <version>${kotlin.version}</version>
+                <executions>
+                    <execution>
+                        <id>compile</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>test-compile</id>
+                        <phase>test-compile</phase>
+                        <goals>
+                            <goal>test-compile</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <jvmTarget>1.8</jvmTarget>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 

+ 8 - 0
base-springframework/base-springframework-constant/src/main/java/com/wei/base/springframework/constant/vo/RestfulVO.java

@@ -36,6 +36,14 @@ public class RestfulVO<T> implements Serializable {
         this.data = data;
     }
 
+    public RestfulVO<T> success(T data) {
+        code = RestfulEnum.SUCCESS.code;
+        message = RestfulEnum.SUCCESS.msg;
+        this.data = data;
+
+        return this;
+    }
+
     public RestfulVO<T> fail(T data) {
         code = RestfulEnum.FAIL.code;
         message = RestfulEnum.FAIL.msg;

+ 10 - 3
base-springframework/base-springframework-core/src/main/java/com/wei/base/springframework/core/config/Swagger3Config.java → base-springframework/base-springframework-core/src/main/java/com/wei/base/springframework/core/swagger/Swagger3Config.java

@@ -1,4 +1,4 @@
-package com.wei.base.springframework.core.config;
+package com.wei.base.springframework.core.swagger;
 
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Value;
@@ -7,13 +7,20 @@ import org.springframework.context.annotation.Configuration;
 import springfox.documentation.builders.ApiInfoBuilder;
 import springfox.documentation.builders.PathSelectors;
 import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.oas.annotations.EnableOpenApi;
 import springfox.documentation.service.ApiInfo;
 import springfox.documentation.service.Contact;
 import springfox.documentation.spi.DocumentationType;
 import springfox.documentation.spring.web.plugins.Docket;
 
-@EnableOpenApi
+/**
+ * swagger页面配置
+ * 如果想关闭swagger需要在对应的配置文件中加上
+ * springfox.documentation.swagger-ui.enabled: false
+ * 即可
+ *
+ * @author : weierming
+ * @date : 2020/9/16
+ */
 @Configuration
 public class Swagger3Config {
 

+ 227 - 0
base-springframework/base-springframework-core/src/main/java/com/wei/base/springframework/core/swagger/Swagger3ServiceModelToOpenApiMapperImpl.java

@@ -0,0 +1,227 @@
+package com.wei.base.springframework.core.swagger;
+
+import com.google.common.collect.Maps;
+import com.wei.base.springframework.core.web.config.ResponseHandlerConfigure;
+import com.wei.base.springframework.util.StringUtil;
+import io.swagger.v3.oas.models.*;
+import io.swagger.v3.oas.models.media.Content;
+import io.swagger.v3.oas.models.media.MediaType;
+import io.swagger.v3.oas.models.media.Schema;
+import io.swagger.v3.oas.models.responses.ApiResponse;
+import io.swagger.v3.oas.models.responses.ApiResponses;
+import org.apache.commons.collections4.MapUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cglib.core.ReflectUtils;
+import org.springframework.context.annotation.Primary;
+import org.springframework.http.HttpStatus;
+import org.springframework.stereotype.Component;
+import springfox.documentation.oas.mappers.ServiceModelToOpenApiMapperImpl;
+import springfox.documentation.service.Documentation;
+
+import java.beans.PropertyDescriptor;
+import java.util.Map;
+
+/**
+ * swagger页面展示包装类封装
+ *
+ * @author : weierming
+ * @date : 2020/9/16
+ */
+@Primary
+@Component
+public class Swagger3ServiceModelToOpenApiMapperImpl extends ServiceModelToOpenApiMapperImpl {
+
+    @Autowired
+    private ResponseHandlerConfigure responseHandlerConfigure;
+
+    // 返回包装对象类型
+    private static final String RESTFUL_SCHEMA_TYPE = "object";
+
+    // 请求路径对象地址
+    private static final String COMPONENTS_SCHEMAS_PATH = "#/components/schemas/%s";
+
+    @Override
+    public OpenAPI mapDocumentation(Documentation from) {
+        OpenAPI openAPI = super.mapDocumentation(from);
+        Components components = openAPI.getComponents();
+        Map<String, Schema> schemas = components.getSchemas();
+
+        Class<?> restfulClass = responseHandlerConfigure.getRestfulVO().getClass();
+        Map<String, String> pathsResponsesObjectMap = getPathsResponsesObjectMap(schemas, restfulClass);
+        replacePathsPathsResponsesObject(openAPI.getPaths(), pathsResponsesObjectMap, restfulClass);
+        return openAPI;
+    }
+
+    /**
+     * 获取路径返回对象转换ma
+     *
+     * @param schemas      Components中的schemas
+     * @param restfulClass 返回对象class
+     * @return key 路径原对象 value 封装后的对象
+     */
+    private Map<String, String> getPathsResponsesObjectMap(Map<String, Schema> schemas, Class<?> restfulClass) {
+        if (MapUtils.isEmpty(schemas)) {
+            return Maps.newHashMap();
+        }
+
+        Map<String, String> map = Maps.newHashMapWithExpectedSize(schemas.size());
+        String restfulVOName = responseHandlerConfigure.getRestfulVOName();
+        for (Map.Entry<String, Schema> entry : schemas.entrySet()) {
+            Schema schema = entry.getValue();
+            // 判断返回对象是否已经包含默认包装类格式
+            if (StringUtil.containsIgnoreCase(entry.getKey(), restfulVOName)) {
+                continue;
+            }
+
+            // 判断对象集合里该对象是否已存在
+            String restfulSchemaName = restfulVOName + String.format("«%s»", schema.getName());
+            String schemaName = String.format(COMPONENTS_SCHEMAS_PATH, schema.getName());
+            map.put(schemaName, String.format(COMPONENTS_SCHEMAS_PATH, restfulSchemaName));
+            // 判断转换的对象在Components的schemas中是否存在,如果存在则不用继续往schemas中添加对象
+            if (schemas.containsKey(restfulSchemaName)) {
+                continue;
+            }
+
+            Schema restfulSchema = getRestfulSchema(schema, restfulClass);
+            schemas.put(restfulSchemaName, restfulSchema);
+        }
+
+        return map;
+    }
+
+    /**
+     * 获取自定义封装返回的schema对象
+     *
+     * @param schema       原路径返回的schema
+     * @param restfulClass 返回对象类
+     * @return 自定义封装返回的schema对象
+     */
+    private Schema getRestfulSchema(Schema schema, Class<?> restfulClass) {
+        // 通过反射获取返回对象的属性
+        PropertyDescriptor[] propertyDescriptors = ReflectUtils.getBeanProperties(restfulClass);
+        Schema restfulSchema = new Schema();
+        if (propertyDescriptors == null) {
+            return restfulSchema;
+        }
+
+        Map<String, Schema> restfulVOProperties = Maps.newHashMap();
+        for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
+            String name = propertyDescriptor.getName();
+            // 如果schema为空则把data去掉只返回状态码和内容
+            if (schema == null && StringUtil.equals(name, "data")) {
+                continue;
+            }
+
+            Schema restfulPropertiesSchema = new Schema();
+
+            restfulPropertiesSchema.setName(name);
+            restfulPropertiesSchema.setTitle(name);
+            String typeName = propertyDescriptor.getPropertyType().getTypeName();
+            restfulPropertiesSchema.setType(StringUtil.lowerCase(StringUtil.getClassName(typeName)));
+            restfulVOProperties.put(name, restfulPropertiesSchema);
+        }
+
+        // 返回自定义返回对象名称
+        String restfulSchemaName = StringUtil.getClassName(restfulClass.getTypeName());
+        if (schema != null) {
+            // 拼接泛型对象
+            restfulSchemaName += String.format("«%s»", schema.getName());
+        }
+
+        restfulSchema.setName(restfulSchemaName);
+        restfulSchema.setTitle(restfulSchemaName);
+        restfulSchema.setType(RESTFUL_SCHEMA_TYPE);
+        restfulSchema.setProperties(restfulVOProperties);
+        return restfulSchema;
+    }
+
+    /**
+     * 替换 路径中的Responses返回对象
+     *
+     * @param paths                   路径对象
+     * @param pathsResponsesObjectMap 路径替换对象map,key 路径原对象 value 封装后的对象
+     * @param restfulClass            返回对象class
+     */
+    private void replacePathsPathsResponsesObject(Paths paths, Map<String, String> pathsResponsesObjectMap,
+                                                  Class<?> restfulClass) {
+        if (MapUtils.isEmpty(paths)) {
+            return;
+        }
+
+        for (Map.Entry<String, PathItem> mapEntry : paths.entrySet()) {
+            Operation operation = getOperation(mapEntry.getValue());
+            if (operation == null) {
+                continue;
+            }
+
+            Content content = getContent(operation, restfulClass);
+            if (content == null) {
+                continue;
+            }
+
+            for (Map.Entry<String, MediaType> contentEntry : content.entrySet()) {
+                Schema mediaTypeSchema = contentEntry.getValue().getSchema();
+                String ref = mediaTypeSchema.get$ref();
+                if (!pathsResponsesObjectMap.containsKey(ref)) {
+                    continue;
+                }
+
+                mediaTypeSchema.set$ref(pathsResponsesObjectMap.get(ref));
+            }
+        }
+    }
+
+    /**
+     * 根据请求方式获取请求地址对应的Operation
+     *
+     * @param pathItem 路径对象
+     * @return 返回路径对用的请求操作对象
+     */
+    private Operation getOperation(PathItem pathItem) {
+        if (pathItem.getGet() != null) {
+            return pathItem.getGet();
+        } else if (pathItem.getPost() != null) {
+            return pathItem.getPost();
+        } else if (pathItem.getPut() != null) {
+            return pathItem.getPut();
+        } else if (pathItem.getDelete() != null) {
+            return pathItem.getDelete();
+        } else if (pathItem.getOptions() != null) {
+            return pathItem.getOptions();
+        } else if (pathItem.getHead() != null) {
+            return pathItem.getHead();
+        } else if (pathItem.getPatch() != null) {
+            return pathItem.getPatch();
+        } else if (pathItem.getTrace() != null) {
+            return pathItem.getTrace();
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * 获取Content
+     *
+     * @param operation
+     * @return
+     */
+    private Content getContent(Operation operation, Class<?> restfulClass) {
+        if (operation == null) {
+            return null;
+        }
+
+        ApiResponses responses = operation.getResponses();
+        ApiResponse apiResponse = responses.get(String.valueOf(HttpStatus.OK.value()));
+        Content content = apiResponse.getContent();
+        // 方法放回viod时content会为空
+        if (content.isEmpty()) {
+            MediaType mediaType = new MediaType();
+            mediaType.schema(getRestfulSchema(null, restfulClass));
+
+            // 添加返回对象
+            content.addMediaType(org.springframework.http.MediaType.ALL_VALUE, mediaType);
+        }
+
+        return content;
+    }
+}

+ 15 - 0
base-springframework/base-springframework-core/src/main/java/com/wei/base/springframework/core/web/config/ResponseHandlerConfigure.java

@@ -1,5 +1,7 @@
 package com.wei.base.springframework.core.web.config;
 
+import com.wei.base.springframework.constant.vo.RestfulVO;
+import com.wei.base.springframework.util.StringUtil;
 import lombok.Data;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.context.annotation.Configuration;
@@ -23,4 +25,17 @@ public class ResponseHandlerConfigure {
      * 返回值时间格式
      */
     private String dateFormat = "yyyy-MM-dd HH:mm:ss";
+
+    /**
+     * 返回值时间格式
+     */
+    private RestfulVO restfulVO = new RestfulVO();
+
+    public String getRestfulVOClassName() {
+        return restfulVO.getClass().getName();
+    }
+
+    public String getRestfulVOName() {
+        return StringUtil.getClassName(getRestfulVOClassName());
+    }
 }

+ 2 - 1
base-springframework/base-springframework-core/src/main/java/com/wei/base/springframework/core/web/handler/ResponseHandler.java

@@ -48,6 +48,7 @@ public class ResponseHandler implements ResponseBodyAdvice<Object> {
     public Object beforeBodyWrite(Object t, MethodParameter methodParameter, MediaType mediaType,
                                   Class<? extends HttpMessageConverter<?>> httpMessageConverter,
                                   ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse) {
-        return new RestfulVO<>(t);
+        RestfulVO restfulVO = responseHandlerConfigure.getRestfulVO();
+        return restfulVO.success(t);
     }
 }

+ 10 - 1
base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/env/InitializeCustomConfiguration.java

@@ -5,6 +5,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.env.EnvironmentPostProcessor;
 import org.springframework.boot.env.YamlPropertySourceLoader;
+import org.springframework.core.Ordered;
 import org.springframework.core.env.ConfigurableEnvironment;
 import org.springframework.core.env.MutablePropertySources;
 import org.springframework.core.env.PropertiesPropertySource;
@@ -22,7 +23,7 @@ import java.util.Properties;
  * @author : weierming
  * @date : 2020/7/13
  */
-public class InitializeCustomConfiguration implements EnvironmentPostProcessor {
+public class InitializeCustomConfiguration implements EnvironmentPostProcessor, Ordered {
 
     //自定义配置文件地址
     private static final List<String> PROFILES = Lists.newArrayList("application-mysql.yml");
@@ -82,4 +83,12 @@ public class InitializeCustomConfiguration implements EnvironmentPostProcessor {
             throw new IllegalStateException("加载配置文件失败" + resource, ex);
         }
     }
+
+    @Override
+    public int getOrder() {
+//        return Ordered.HIGHEST_PRECEDENCE + 1;
+//        return Ordered.HIGHEST_PRECEDENCE - 1;
+//        return Ordered.LOWEST_PRECEDENCE + 100;
+        return -1;
+    }
 }

+ 26 - 0
base-springframework/base-springframework-util/base-springframework-util.iml

@@ -9,6 +9,25 @@
         <webroots />
       </configuration>
     </facet>
+    <facet type="kotlin-language" name="Kotlin">
+      <configuration version="3" platform="JVM 1.8" allPlatforms="JVM [1.8]" useProjectSettings="false">
+        <compilerSettings />
+        <compilerArguments>
+          <option name="jvmTarget" value="1.8" />
+          <option name="languageVersion" value="1.4" />
+          <option name="apiVersion" value="1.4" />
+          <option name="pluginOptions">
+            <array />
+          </option>
+          <option name="pluginClasspaths">
+            <array />
+          </option>
+          <option name="errors">
+            <ArgumentParseErrors />
+          </option>
+        </compilerArguments>
+      </configuration>
+    </facet>
   </component>
   <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
     <output url="file://$MODULE_DIR$/target/classes" />
@@ -63,5 +82,12 @@
     <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.10" level="project" />
     <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
     <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+    <orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10" level="project" />
+    <orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.4.10" level="project" />
+    <orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10" level="project" />
+    <orderEntry type="library" name="Maven: org.jetbrains:annotations:13.0" level="project" />
+    <orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.jetbrains.kotlin:kotlin-test:1.4.10" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.jetbrains.kotlin:kotlin-test-common:1.4.10" level="project" />
   </component>
 </module>

+ 9 - 0
base-springframework/base-springframework-util/src/main/java/com/wei/base/springframework/util/StringUtil.java

@@ -122,4 +122,13 @@ public class StringUtil extends StringUtils {
     public static List<String> splitList(String str) {
         return splitList(str, ",");
     }
+
+    public static String getClassName(String typeName) {
+        String[] split = StringUtil.split(typeName, ".");
+        if (split == null || split.length <= 0) {
+            return typeName;
+        }
+
+        return split[split.length - 1];
+    }
 }

+ 36 - 0
base-springframework/pom.xml

@@ -31,6 +31,7 @@
         <commons-lang3.version>3.10</commons-lang3.version>
         <commons-collections4.version>4.4</commons-collections4.version>
         <commons-io.version>1.3.2</commons-io.version>
+        <kotlin.version>1.4.10</kotlin.version>
     </properties>
 
     <dependencies>
@@ -75,6 +76,17 @@
             <artifactId>commons-io</artifactId>
             <version>${commons-io.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.jetbrains.kotlin</groupId>
+            <artifactId>kotlin-stdlib-jdk8</artifactId>
+            <version>${kotlin.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jetbrains.kotlin</groupId>
+            <artifactId>kotlin-test</artifactId>
+            <version>${kotlin.version}</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
     <build>
         <plugins>
@@ -87,6 +99,30 @@
                     <target>${maven.compiler.target}</target>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.jetbrains.kotlin</groupId>
+                <artifactId>kotlin-maven-plugin</artifactId>
+                <version>${kotlin.version}</version>
+                <executions>
+                    <execution>
+                        <id>compile</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>test-compile</id>
+                        <phase>test-compile</phase>
+                        <goals>
+                            <goal>test-compile</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <jvmTarget>1.8</jvmTarget>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 

TEMPAT SAMPAH
consul/consul_1.8.0_linux_amd64.zip


+ 39 - 0
pom.xml

@@ -24,8 +24,23 @@
         <maven.compiler.target>1.8</maven.compiler.target>
         <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
         <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
+        <kotlin.version>1.4.10</kotlin.version>
     </properties>
 
+    <dependencies>
+        <dependency>
+            <groupId>org.jetbrains.kotlin</groupId>
+            <artifactId>kotlin-stdlib-jdk8</artifactId>
+            <version>${kotlin.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jetbrains.kotlin</groupId>
+            <artifactId>kotlin-test</artifactId>
+            <version>${kotlin.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
     <build>
         <finalName>${project.artifactId}</finalName>
         <plugins>
@@ -46,6 +61,30 @@
                     <target>${maven.compiler.target}</target>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.jetbrains.kotlin</groupId>
+                <artifactId>kotlin-maven-plugin</artifactId>
+                <version>${kotlin.version}</version>
+                <executions>
+                    <execution>
+                        <id>compile</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>test-compile</id>
+                        <phase>test-compile</phase>
+                        <goals>
+                            <goal>test-compile</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <jvmTarget>1.8</jvmTarget>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 

+ 54 - 0
wei-developer-platform/pom.xml

@@ -0,0 +1,54 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>com.wei</groupId>
+        <artifactId>base-springframework-starter</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+
+    <packaging>pom</packaging>
+    <artifactId>wei-developer-platform</artifactId>
+
+    <modules>
+        <module>wei-developer-platform-api</module>
+        <module>wei-developer-platform-app</module>
+    </modules>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <!--	<repositories>
+            <repository>
+                <id></id>
+                <url></url>
+            </repository>
+        </repositories>
+        <pluginRepositories>
+            <pluginRepository>
+                <id></id>
+                <url></url>
+            </pluginRepository>
+        </pluginRepositories>
+        <distributionManagement>
+            <repository>
+                <id></id>
+                <url></url>
+            </repository>
+            <snapshotRepository>
+                <id></id>
+                <url></url>
+            </snapshotRepository>
+        </distributionManagement>-->
+</project>

+ 47 - 0
wei-developer-platform/wei-developer-platform-api/pom.xml

@@ -0,0 +1,47 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>com.wei</groupId>
+        <artifactId>wei-developer-platform</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>wei-developer-platform-api</artifactId>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <!--	<repositories>
+            <repository>
+                <id></id>
+                <url></url>
+            </repository>
+        </repositories>
+        <pluginRepositories>
+            <pluginRepository>
+                <id></id>
+                <url></url>
+            </pluginRepository>
+        </pluginRepositories>
+        <distributionManagement>
+            <repository>
+                <id></id>
+                <url></url>
+            </repository>
+            <snapshotRepository>
+                <id></id>
+                <url></url>
+            </snapshotRepository>
+        </distributionManagement>-->
+</project>

+ 14 - 0
wei-developer-platform/wei-developer-platform-api/src/main/java/com/wei/user/api/ApiService.java

@@ -0,0 +1,14 @@
+package com.wei.cloud.api;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@FeignClient(name = "wei-test-cloud")
+@RequestMapping("/apiService")
+public interface ApiService {
+
+    @GetMapping("/test")
+    String test(@RequestHeader("Filter-Enabled") String filterEnabled);
+}

TEMPAT SAMPAH
wei-developer-platform/wei-developer-platform-api/target/classes/com/wei/cloud/api/ApiService.class


+ 5 - 0
wei-developer-platform/wei-developer-platform-api/target/maven-archiver/pom.properties

@@ -0,0 +1,5 @@
+#Generated by Maven
+#Tue Sep 08 10:38:57 CST 2020
+version=0.0.1-SNAPSHOT
+groupId=com.wei
+artifactId=wei-user-api

+ 1 - 0
wei-developer-platform/wei-developer-platform-api/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1 @@
+com\wei\cloud\api\ApiService.class

+ 1 - 0
wei-developer-platform/wei-developer-platform-api/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1 @@
+E:\git_work\base-framework\wei-user\wei-user-api\src\main\java\com\wei\user\api\ApiService.java

TEMPAT SAMPAH
wei-developer-platform/wei-developer-platform-api/target/wei-user-api-0.0.1-SNAPSHOT.jar


+ 56 - 0
wei-developer-platform/wei-developer-platform-app/pom.xml

@@ -0,0 +1,56 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>com.wei</groupId>
+        <artifactId>wei-developer-platform</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>wei-developer-platform-app</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-jwt</artifactId>
+            <version>1.1.1.RELEASE</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <!--	<repositories>
+            <repository>
+                <id></id>
+                <url></url>
+            </repository>
+        </repositories>
+        <pluginRepositories>
+            <pluginRepository>
+                <id></id>
+                <url></url>
+            </pluginRepository>
+        </pluginRepositories>
+        <distributionManagement>
+            <repository>
+                <id></id>
+                <url></url>
+            </repository>
+            <snapshotRepository>
+                <id></id>
+                <url></url>
+            </snapshotRepository>
+        </distributionManagement>-->
+</project>

+ 12 - 0
wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/DeveloperPlatformApplication.java

@@ -0,0 +1,12 @@
+package com.wei.developer.platform;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class DeveloperPlatformApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(DeveloperPlatformApplication.class, args);
+    }
+}

+ 65 - 0
wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/controller/UserController.java

@@ -0,0 +1,65 @@
+package com.wei.developer.platform.controller;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.wei.base.springframework.constant.vo.RestfulVO;
+import com.wei.base.springframework.redis.utils.RedisLock;
+import com.wei.developer.platform.entity.User;
+import com.wei.developer.platform.service.UserService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ * 用户信息表 前端控制器
+ * </p>
+ *
+ * @author wei
+ * @since 2020-08-13
+ */
+@Api(tags = "test")
+@RestController
+@RequestMapping("/user")
+public class UserController {
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private RedisLock redisLock;
+
+    @ApiOperation("分页查询所有数据")
+    @GetMapping("/test")
+    public User test(User user) {
+        return userService.getById(1);
+    }
+
+    @ApiOperation("分页查询所有数据")
+    @GetMapping("/test2")
+    public RestfulVO<User> test2(@RequestParam(value = "test") String test) {
+        return new RestfulVO(userService.getById(1));
+    }
+
+    @ApiOperation("分页查询所有数据")
+    @GetMapping("/test1")
+    public RestfulVO<String> test1() {
+        return new RestfulVO("1111");
+    }
+
+    @ApiOperation("分页查询所有数据")
+    @PostMapping("/test3")
+    public void test1(@RequestBody UserVO user) {
+        System.err.println(redisLock.lock("test"));
+        System.err.println(11111);
+        System.err.println(redisLock.unlock("test"));
+        return;
+    }
+
+    @ApiOperation("分页查询所有数据")
+    @GetMapping("/test4")
+    public void test1(Object object) throws JsonProcessingException {
+        System.err.println(object.toString());
+        return;
+    }
+}

+ 55 - 0
wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/entity/User.java

@@ -0,0 +1,55 @@
+package com.wei.developer.platform.entity;
+
+import java.util.Date;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 用户信息表
+ * </p>
+ *
+ * @author wei
+ * @since 2020-08-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class User implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    /**
+     * 用户名称
+     */
+    private String name;
+
+    /**
+     * 用户手机号
+     */
+    private String mobilePhone;
+
+    /**
+     * 用户邮箱
+     */
+    private String email;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 用户头像地址
+     */
+    private String pictureUrl;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+
+}

+ 16 - 0
wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/mapper/UserMapper.java

@@ -0,0 +1,16 @@
+package com.wei.developer.platform.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.wei.developer.platform.entity.User;
+
+/**
+ * <p>
+ * 用户信息表 Mapper 接口
+ * </p>
+ *
+ * @author wei
+ * @since 2020-08-13
+ */
+public interface UserMapper extends BaseMapper<User> {
+
+}

+ 14 - 0
wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/mapstruct/UserMapstruct.java

@@ -0,0 +1,14 @@
+package com.wei.developer.platform.mapstruct;
+
+import org.mapstruct.Mapper;
+
+/**
+* 用户信息表 服务类型实体转换
+*
+* @author wei
+* @since 2020-08-13
+*/
+@Mapper(componentModel = "spring")
+public interface UserMapstruct {
+
+}

+ 16 - 0
wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/service/UserService.java

@@ -0,0 +1,16 @@
+package com.wei.developer.platform.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.wei.developer.platform.entity.User;
+
+/**
+ * <p>
+ * 用户信息表 服务类
+ * </p>
+ *
+ * @author wei
+ * @since 2020-08-13
+ */
+public interface UserService extends IService<User> {
+
+}

+ 24 - 0
wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/service/impl/UserServiceImpl.java

@@ -0,0 +1,24 @@
+package com.wei.developer.platform.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.wei.developer.platform.entity.User;
+import com.wei.developer.platform.mapper.UserMapper;
+import com.wei.developer.platform.service.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 用户信息表 服务实现类
+ * </p>
+ *
+ * @author wei
+ * @since 2020-08-13
+ */
+@Service
+public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
+
+    @Autowired
+    private UserMapper userMapper;
+
+}

+ 59 - 0
wei-developer-platform/wei-developer-platform-app/src/main/java/com/wei/developer/platform/vo/UserVO.java

@@ -0,0 +1,59 @@
+package com.wei.developer.platform.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * 用户信息表
+ * </p>
+ *
+ * @author wei
+ * @since 2020-08-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class UserVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    /**
+     * 用户名称
+     */
+    private String name;
+
+    /**
+     * 用户手机号
+     */
+    private String mobilePhone;
+
+    /**
+     * 用户邮箱
+     */
+    private String email;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 用户头像地址
+     */
+    private String pictureUrl;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    List<UserVO> user;
+
+    List<String> list;
+}

+ 23 - 0
wei-developer-platform/wei-developer-platform-app/src/main/resources/bootstrap.yml

@@ -0,0 +1,23 @@
+server:
+  port: 8201
+
+spring:
+  application:
+    name: wei-user
+  cloud:
+    consul:
+      # consul的IP
+      host: 192.168.11.128
+      # consul启动端口
+      port: 8500
+
+  profiles:
+    active: dev
+
+  datasource:
+    url: jdbc:mysql://192.168.11.128:3306/wei_user?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT
+    username: root
+    password: 123456
+  redis:
+    host: 192.168.11.128
+    port: 6379

+ 16 - 0
wei-developer-platform/wei-developer-platform-app/src/main/resources/mappers/UserMapper.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.wei.developer.platform.mapper.UserMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.wei.developer.platform.entity.User">
+        <id column="id" property="id" />
+        <result column="name" property="name" />
+        <result column="mobile_phone" property="mobilePhone" />
+        <result column="email" property="email" />
+        <result column="password" property="password" />
+        <result column="picture_url" property="pictureUrl" />
+        <result column="create_time" property="createTime" />
+    </resultMap>
+
+</mapper>

+ 23 - 0
wei-developer-platform/wei-developer-platform-app/target/classes/bootstrap.yml

@@ -0,0 +1,23 @@
+server:
+  port: 8201
+
+spring:
+  application:
+    name: wei-user
+  cloud:
+    consul:
+      # consul的IP
+      host: 192.168.11.128
+      # consul启动端口
+      port: 8500
+
+  profiles:
+    active: dev
+
+  datasource:
+    url: jdbc:mysql://192.168.11.128:3306/wei_user?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT
+    username: root
+    password: 123456
+  redis:
+    host: 192.168.11.128
+    port: 6379

TEMPAT SAMPAH
wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/UserApplication.class


TEMPAT SAMPAH
wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/controller/UserController.class


TEMPAT SAMPAH
wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/entity/User.class


TEMPAT SAMPAH
wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/mapper/UserMapper.class


TEMPAT SAMPAH
wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/mapstruct/UserMapstruct.class


TEMPAT SAMPAH
wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/mapstruct/UserMapstructImpl.class


TEMPAT SAMPAH
wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/service/UserService.class


TEMPAT SAMPAH
wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/service/impl/UserServiceImpl.class


TEMPAT SAMPAH
wei-developer-platform/wei-developer-platform-app/target/classes/com/wei/user/vo/UserVO.class


+ 13 - 0
wei-developer-platform/wei-developer-platform-app/target/generated-sources/annotations/com/wei/user/mapstruct/UserMapstructImpl.java

@@ -0,0 +1,13 @@
+package com.wei.user.mapstruct;
+
+import javax.annotation.Generated;
+import org.springframework.stereotype.Component;
+
+@Generated(
+    value = "org.mapstruct.ap.MappingProcessor",
+    date = "2020-09-08T14:54:36+0800",
+    comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
+)
+@Component
+public class UserMapstructImpl implements UserMapstruct {
+}

+ 5 - 0
wei-developer-platform/wei-developer-platform-app/target/maven-archiver/pom.properties

@@ -0,0 +1,5 @@
+#Generated by Maven
+#Tue Sep 08 10:44:07 CST 2020
+version=0.0.1-SNAPSHOT
+groupId=com.wei
+artifactId=wei-user-app

+ 9 - 0
wei-developer-platform/wei-developer-platform-app/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1,9 @@
+com\wei\user\mapper\UserMapper.class
+com\wei\user\mapstruct\UserMapstruct.class
+com\wei\user\controller\UserController.class
+com\wei\user\service\impl\UserServiceImpl.class
+com\wei\user\service\UserService.class
+com\wei\user\UserApplication.class
+com\wei\user\mapstruct\UserMapstructImpl.class
+com\wei\user\entity\User.class
+com\wei\user\vo\UserVO.class

+ 8 - 0
wei-developer-platform/wei-developer-platform-app/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1,8 @@
+E:\git_work\base-framework\wei-user\wei-user-app\src\main\java\com\wei\user\service\UserService.java
+E:\git_work\base-framework\wei-user\wei-user-app\src\main\java\com\wei\user\service\impl\UserServiceImpl.java
+E:\git_work\base-framework\wei-user\wei-user-app\src\main\java\com\wei\user\controller\UserController.java
+E:\git_work\base-framework\wei-user\wei-user-app\src\main\java\com\wei\user\entity\User.java
+E:\git_work\base-framework\wei-user\wei-user-app\src\main\java\com\wei\user\mapper\UserMapper.java
+E:\git_work\base-framework\wei-user\wei-user-app\src\main\java\com\wei\user\vo\UserVO.java
+E:\git_work\base-framework\wei-user\wei-user-app\src\main\java\com\wei\user\mapstruct\UserMapstruct.java
+E:\git_work\base-framework\wei-user\wei-user-app\src\main\java\com\wei\user\UserApplication.java

TEMPAT SAMPAH
wei-developer-platform/wei-developer-platform-app/target/wei-user-app-0.0.1-SNAPSHOT.jar


+ 19 - 19
wei-gateway/src/main/java/com/wei/gateway/config/GatewayConfigure.java

@@ -1,19 +1,19 @@
-package com.wei.gateway.config;
-
-import lombok.Data;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Configuration;
-
-@Data
-@Configuration
-public class GatewayConfigure {
-
-    @Value("${filter.path}")
-    private String filterPath;
-
-    @Value("${login.invalidTime}")
-    private Long loginInvalidTime;
-
-    @Value("${login.token}")
-    private String loginToken;
-}
+//package com.wei.gateway.config;
+//
+//import lombok.Data;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.context.annotation.Configuration;
+//
+//@Data
+//@Configuration
+//public class GatewayConfigure {
+//
+//    @Value("${filter.path}")
+//    private String filterPath;
+//
+//    @Value("${login.invalidTime}")
+//    private Long loginInvalidTime;
+//
+//    @Value("${login.token}")
+//    private String loginToken;
+//}

+ 7 - 0
wei-gateway/src/main/resources/bootstrap.yml

@@ -11,5 +11,12 @@ spring:
       # consul启动端口
       port: 8500
 
+    gateway:
+      routes:
+        - id: wei-user
+          uri: lb://wei-user
+          predicates:
+            - Path=/wei-user/**
+
   profiles:
     active: dev

+ 3 - 2
wei-user/wei-user-app/src/main/resources/bootstrap.yml

@@ -2,6 +2,7 @@ server:
   port: 8201
 
 spring:
+
   application:
     name: wei-user
   cloud:
@@ -12,7 +13,7 @@ spring:
       port: 8500
 
   profiles:
-    active: dev
+    active: ttt
 
   datasource:
     url: jdbc:mysql://192.168.11.128:3306/wei_user?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT
@@ -20,4 +21,4 @@ spring:
     password: 123456
   redis:
     host: 192.168.11.128
-    port: 6379
+    port: 6379