Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
Yangkai.Shen 7294038de4 | 4 years ago | |
---|---|---|
.. | ||
src | 4 years ago | |
.gitignore | 4 years ago | |
README.md | 4 years ago | |
pom.xml | 4 years ago |
此 module 主要是服务提供方示例
<?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>spring-boot-demo-dubbo</artifactId>
<groupId>com.xkcoding</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-boot-demo-dubbo-provider</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.spring.boot</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>${dubbo.starter.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spring-boot-demo-dubbo-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.101tec</groupId>
<artifactId>zkclient</artifactId>
<version>${zkclient.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>spring-boot-demo-dubbo-provider</finalName>
</build>
</project>
server:
port: 9090
servlet:
context-path: /demo
spring:
dubbo:
application:
name: spring-boot-demo-dubbo-provider
registry: zookeeper://localhost:2181
/**
* <p>
* 启动器
* </p>
*
* @package: com.xkcoding.dubbo.provider
* @description: 启动器
* @author: yangkai.shen
* @date: Created in 2018-12-25 16:49
* @copyright: Copyright (c) 2018
* @version: V1.0
* @modified: yangkai.shen
*/
@EnableDubboConfiguration
@SpringBootApplication
public class SpringBootDemoDubboProviderApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootDemoDubboProviderApplication.class, args);
}
}
/**
* <p>
* Hello服务实现
* </p>
*
* @package: com.xkcoding.dubbo.provider.service
* @description: Hello服务实现
* @author: yangkai.shen
* @date: Created in 2018-12-25 16:58
* @copyright: Copyright (c) 2018
* @version: V1.0
* @modified: yangkai.shen
*/
@Service
@Component
@Slf4j
public class HelloServiceImpl implements HelloService {
/**
* 问好
*
* @param name 姓名
* @return 问好
*/
@Override
public String sayHello(String name) {
log.info("someone is calling me......");
return "say hello to: " + name;
}
}
一个用来深度学习并实战 spring boot 的项目,目前总共包含 66 个集成demo,已经完成 55 个。
Java SVG CSS JavaScript SQL other