Browse Source

feature 集成nacos软件包

黎有为 1 year ago
parent
commit
56bbb180e2
30 changed files with 40 additions and 36 deletions
  1. 2 0
      .gitignore
  2. 0 0
      base-boot/.gitignore
  3. 0 0
      base-boot/.mvn/wrapper/maven-wrapper.jar
  4. 0 0
      base-boot/.mvn/wrapper/maven-wrapper.properties
  5. 0 0
      base-boot/mvnw
  6. 0 0
      base-boot/mvnw.cmd
  7. 3 3
      Provider/pom.xml
  8. 3 3
      Provider/src/main/java/com/citygis/provider/ProviderApplication.java
  9. 1 1
      Provider/src/main/java/com/citygis/provider/config/NacosConfigInfo.java
  10. 2 2
      Provider/src/main/java/com/citygis/provider/controller/EchoController.java
  11. 1 1
      Provider/src/main/resources/bootstrap.properties
  12. 2 2
      Consumer/src/test/java/com/citygis/consumer/ConsumerApplicationTests.java
  13. 0 0
      cim-domain/.gitignore
  14. 0 0
      cim-domain/.mvn/wrapper/maven-wrapper.jar
  15. 0 0
      cim-domain/.mvn/wrapper/maven-wrapper.properties
  16. 0 0
      cim-domain/mvnw
  17. 0 0
      cim-domain/mvnw.cmd
  18. 3 3
      Consumer/pom.xml
  19. 3 3
      Consumer/src/main/java/com/citygis/consumer/ConsumerApplication.java
  20. 3 3
      Consumer/src/main/java/com/citygis/consumer/controller/NacosController.java
  21. 3 3
      Consumer/src/main/java/com/citygis/consumer/facade/EchoService.java
  22. 2 2
      Consumer/src/main/java/com/citygis/consumer/facade/configuration/FeignConfiguration.java
  23. 2 2
      Consumer/src/main/java/com/citygis/consumer/facade/impl/EchoServiceFallback.java
  24. 1 1
      Consumer/src/main/java/com/citygis/consumer/service/TestService.java
  25. 2 2
      Consumer/src/main/java/com/citygis/consumer/service/impl/TestServiceImpl.java
  26. 1 1
      Consumer/src/main/resources/bootstrap.properties
  27. 2 2
      Provider/src/test/java/com/citygis/provider/ProviderApplicationTests.java
  28. 2 2
      pom.xml
  29. 0 0
      start.bat
  30. 2 0
      start.sh

+ 2 - 0
.gitignore

@@ -31,3 +31,5 @@ build/
 
 ### VS Code ###
 .vscode/
+
+nacos/logs/

Consumer/.gitignore → base-boot/.gitignore


Consumer/.mvn/wrapper/maven-wrapper.jar → base-boot/.mvn/wrapper/maven-wrapper.jar


Consumer/.mvn/wrapper/maven-wrapper.properties → base-boot/.mvn/wrapper/maven-wrapper.properties


Consumer/mvnw → base-boot/mvnw


Consumer/mvnw.cmd → base-boot/mvnw.cmd


+ 3 - 3
Provider/pom.xml

@@ -7,10 +7,10 @@
         <groupId>com.citygis</groupId>
         <version>0.0.1-SNAPSHOT</version>
     </parent>
-    <artifactId>Provider</artifactId>
+    <artifactId>base-boot</artifactId>
     <version>0.0.1-SNAPSHOT</version>
-    <name>Provider</name>
-    <description>Provider</description>
+    <name>base-boot</name>
+    <description>base-boot</description>
     <packaging>jar</packaging>
 
     <dependencies>

+ 3 - 3
Provider/src/main/java/com/citygis/provider/ProviderApplication.java

@@ -1,4 +1,4 @@
-package com.citygis.provider;
+package com.citygis.base.boot;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -6,9 +6,9 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 
 @SpringBootApplication
 @EnableDiscoveryClient
-public class ProviderApplication {
+public class BaseBootApplication {
 
     public static void main(String[] args) {
-        SpringApplication.run(ProviderApplication.class, args);
+        SpringApplication.run(BaseBootApplication.class, args);
     }
 }

+ 1 - 1
Provider/src/main/java/com/citygis/provider/config/NacosConfigInfo.java

@@ -1,4 +1,4 @@
-package com.citygis.provider.config;
+package com.citygis.base.boot.config;
 
 import lombok.Getter;
 import lombok.Setter;

+ 2 - 2
Provider/src/main/java/com/citygis/provider/controller/EchoController.java

@@ -1,7 +1,7 @@
-package com.citygis.provider.controller;
+package com.citygis.base.boot.controller;
 
 import com.alibaba.csp.sentinel.annotation.SentinelResource;
-import com.citygis.provider.config.NacosConfigInfo;
+import com.citygis.base.boot.config.NacosConfigInfo;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.springframework.beans.factory.annotation.Autowired;

+ 1 - 1
Provider/src/main/resources/bootstrap.properties

@@ -1,3 +1,3 @@
 server.port=8761
-spring.application.name=provider
+spring.application.name=base-boot
 spring.cloud.nacos.config.server-addr=localhost:8848

+ 2 - 2
Consumer/src/test/java/com/citygis/consumer/ConsumerApplicationTests.java

@@ -1,10 +1,10 @@
-package com.citygis.consumer;
+package com.citygis.base.boot;
 
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.test.context.SpringBootTest;
 
 @SpringBootTest
-class ConsumerApplicationTests {
+class BaseBootApplicationTests {
 
     @Test
     void contextLoads() {

Provider/.gitignore → cim-domain/.gitignore


Provider/.mvn/wrapper/maven-wrapper.jar → cim-domain/.mvn/wrapper/maven-wrapper.jar


Provider/.mvn/wrapper/maven-wrapper.properties → cim-domain/.mvn/wrapper/maven-wrapper.properties


Provider/mvnw → cim-domain/mvnw


Provider/mvnw.cmd → cim-domain/mvnw.cmd


+ 3 - 3
Consumer/pom.xml

@@ -7,10 +7,10 @@
         <groupId>com.citygis</groupId>
         <version>0.0.1-SNAPSHOT</version>
     </parent>
-    <artifactId>Consumer</artifactId>
+    <artifactId>cim-domain</artifactId>
     <version>0.0.1-SNAPSHOT</version>
-    <name>Consumer</name>
-    <description>Consumer</description>
+    <name>cim-domain</name>
+    <description>cim-domain</description>
     <packaging>jar</packaging>
 
     <dependencies>

+ 3 - 3
Consumer/src/main/java/com/citygis/consumer/ConsumerApplication.java

@@ -1,4 +1,4 @@
-package com.citygis.consumer;
+package com.citygis.cim.domain;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -9,10 +9,10 @@ import org.springframework.web.client.RestTemplate;
 
 @SpringBootApplication
 @EnableDiscoveryClient
-public class ConsumerApplication {
+public class CIMDomainApplication {
 
     public static void main(String[] args) {
-        SpringApplication.run(ConsumerApplication.class, args);
+        SpringApplication.run(CIMDomainApplication.class, args);
     }
 
     @Bean

+ 3 - 3
Consumer/src/main/java/com/citygis/consumer/controller/NacosController.java

@@ -1,7 +1,7 @@
-package com.citygis.consumer.controller;
+package com.citygis.cim.domain.controller;
 
-import com.citygis.consumer.facade.EchoService;
-import com.citygis.consumer.service.TestService;
+import com.citygis.cim.domain.facade.EchoService;
+import com.citygis.cim.domain.service.TestService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;

+ 3 - 3
Consumer/src/main/java/com/citygis/consumer/facade/EchoService.java

@@ -1,7 +1,7 @@
-package com.citygis.consumer.facade;
+package com.citygis.cim.domain.facade;
 
-import com.citygis.consumer.facade.configuration.FeignConfiguration;
-import com.citygis.consumer.facade.impl.EchoServiceFallback;
+import com.citygis.cim.domain.facade.configuration.FeignConfiguration;
+import com.citygis.cim.domain.facade.impl.EchoServiceFallback;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;

+ 2 - 2
Consumer/src/main/java/com/citygis/consumer/facade/configuration/FeignConfiguration.java

@@ -1,6 +1,6 @@
-package com.citygis.consumer.facade.configuration;
+package com.citygis.cim.domain.facade.configuration;
 
-import com.citygis.consumer.facade.impl.EchoServiceFallback;
+import com.citygis.cim.domain.facade.impl.EchoServiceFallback;
 import org.springframework.context.annotation.Bean;
 
 public class FeignConfiguration {

+ 2 - 2
Consumer/src/main/java/com/citygis/consumer/facade/impl/EchoServiceFallback.java

@@ -1,6 +1,6 @@
-package com.citygis.consumer.facade.impl;
+package com.citygis.cim.domain.facade.impl;
 
-import com.citygis.consumer.facade.EchoService;
+import com.citygis.cim.domain.facade.EchoService;
 import org.springframework.stereotype.Service;
 import org.springframework.web.bind.annotation.PathVariable;
 

+ 1 - 1
Consumer/src/main/java/com/citygis/consumer/service/TestService.java

@@ -1,4 +1,4 @@
-package com.citygis.consumer.service;
+package com.citygis.cim.domain.service;
 
 public interface TestService {
     String echo();

+ 2 - 2
Consumer/src/main/java/com/citygis/consumer/service/impl/TestServiceImpl.java

@@ -1,6 +1,6 @@
-package com.citygis.consumer.service.impl;
+package com.citygis.cim.domain.service.impl;
 
-import com.citygis.consumer.service.TestService;
+import com.citygis.cim.domain.service.TestService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cloud.client.ServiceInstance;

+ 1 - 1
Consumer/src/main/resources/bootstrap.properties

@@ -1,3 +1,3 @@
 server.port=8762
-spring.application.name=consumer
+spring.application.name=cim-domain
 spring.cloud.nacos.config.server-addr=localhost:8848

+ 2 - 2
Provider/src/test/java/com/citygis/provider/ProviderApplicationTests.java

@@ -1,10 +1,10 @@
-package com.citygis.provider;
+package com.citygis.cim.domain;
 
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.test.context.SpringBootTest;
 
 @SpringBootTest
-class ProviderApplicationTests {
+class CIMDomainApplicationTests {
 
     @Test
     void contextLoads() {

+ 2 - 2
pom.xml

@@ -16,8 +16,8 @@
     <description>citygis-boot</description>
     <packaging>pom</packaging>
     <modules>
-        <module>Provider</module>
-        <module>Consumer</module>
+        <module>base-boot</module>
+        <module>cim-domain</module>
     </modules>
     <properties>
         <java.version>1.8</java.version>

+ 0 - 0
start.bat


+ 2 - 0
start.sh

@@ -0,0 +1,2 @@
+nohup java -jar /root/SFTP/base-boot-0.0.1-SNAPSHOT.jar > /root/SFTP/base-boot.log&
+nohup java -jar /root/SFTP/cim-domain-0.0.1-SNAPSHOT.jar > /root/SFTP/cim-domain.log&