飞滴出行网约车2022-api-boss项目创建以及服务注册到Nacos

master
yh 3 years ago
parent 1cbdb8f04d
commit 53b069d0d9

@ -0,0 +1,48 @@
# .gitignore
### IntelliJ IDEA Project ###
.idea
*.iws
*.iml
*.ipr
/.idea
target
src/test/
!**/src/test/**/target/
#!**/src/main/**/target/
### Maven template
HELP.md
README.md
.mvn
mvnw
mvnw.cmd
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
timing.properties
#.mvn/wrapper/maven-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>online-taxi-public</artifactId>
<groupId>com.mashibing</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>api-boss</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,11 @@
package com.mashibing.apiboss;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ApiBossApplication {
public static void main(String[] args) {
SpringApplication.run(ApiBossApplication.class);
}
}

@ -0,0 +1,18 @@
package com.mashibing.apiboss.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestControler {
@Value("${spring.application.name}")
private String serviceName;
@GetMapping("/")
public String test() {
return serviceName;
}
}

@ -0,0 +1,9 @@
server:
port: 8087
spring:
application:
name: api-boss
cloud:
nacos:
discovery:
server-addr: localhost:8848

@ -30,6 +30,7 @@
<module>service-price</module>
<module>service-map</module>
<module>service-driver-user</module>
<module>api-boss</module>
</modules>
<dependencyManagement>

@ -5,4 +5,5 @@
| service-passenger-user|8083|
| service-price|8084|
|service-map|8085|
|service-driver-user|8086|
|service-driver-user|8086|
|api-boss|8087|
Loading…
Cancel
Save