mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
sync dubbo example in finchley
This commit is contained in:
parent
7a7cc68c38
commit
eef0e92dd3
@ -95,87 +95,69 @@
|
|||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
<!-- Spring Cloud Nacos Service Discovery -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<profiles>
|
<!-- Spring Cloud Eureka Service Discovery -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Nacos -->
|
<!-- Spring Cloud Zookeeper Service Discovery -->
|
||||||
<profile>
|
<dependency>
|
||||||
<id>nacos</id>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<activation>
|
<artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
|
||||||
<activeByDefault>true</activeByDefault>
|
<version>${spring-cloud-zookeeper.version}</version>
|
||||||
</activation>
|
<exclusions>
|
||||||
<dependencies>
|
<exclusion>
|
||||||
<!-- Nacos Service Discovery -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
<profile>
|
|
||||||
<id>eureka</id>
|
|
||||||
<dependencies>
|
|
||||||
<!-- Eureka Service Discovery -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
<!-- Zookeeper -->
|
|
||||||
<profile>
|
|
||||||
<id>zookeeper</id>
|
|
||||||
<dependencies>
|
|
||||||
<!-- Zookeeper Service Discovery -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
|
|
||||||
<version>${spring-cloud-zookeeper.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.apache.zookeeper</groupId>
|
|
||||||
<artifactId>zookeeper</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.zookeeper</groupId>
|
<groupId>org.apache.zookeeper</groupId>
|
||||||
<artifactId>zookeeper</artifactId>
|
<artifactId>zookeeper</artifactId>
|
||||||
<version>3.4.12</version>
|
</exclusion>
|
||||||
<optional>true</optional>
|
</exclusions>
|
||||||
<exclusions>
|
</dependency>
|
||||||
<exclusion>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.curator</groupId>
|
<groupId>org.apache.zookeeper</groupId>
|
||||||
<artifactId>curator-framework</artifactId>
|
<artifactId>zookeeper</artifactId>
|
||||||
<version>${curator.version}</version>
|
<version>3.4.12</version>
|
||||||
</dependency>
|
<optional>true</optional>
|
||||||
</dependencies>
|
<exclusions>
|
||||||
</profile>
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<profile>
|
<dependency>
|
||||||
<id>consul</id>
|
<groupId>org.apache.curator</groupId>
|
||||||
<dependencies>
|
<artifactId>curator-framework</artifactId>
|
||||||
<!-- Spring Cloud Consul -->
|
<version>${curator.version}</version>
|
||||||
<dependency>
|
</dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
|
||||||
<version>${spring-cloud-consul.version}</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
</profiles>
|
<!-- Spring Cloud Consul Service Discovery -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
||||||
|
<version>${spring-cloud-consul.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -21,6 +21,18 @@
|
|||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring Cloud Open Feign -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring Retry -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.retry</groupId>
|
||||||
|
<artifactId>spring-retry</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Sample API -->
|
<!-- Sample API -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
@ -28,11 +40,14 @@
|
|||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring Cloud Open Feign -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
</project>
|
</project>
|
@ -17,6 +17,7 @@
|
|||||||
package org.springframework.cloud.alibaba.dubbo.bootstrap;
|
package org.springframework.cloud.alibaba.dubbo.bootstrap;
|
||||||
|
|
||||||
import org.apache.dubbo.config.annotation.Reference;
|
import org.apache.dubbo.config.annotation.Reference;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.ApplicationRunner;
|
import org.springframework.boot.ApplicationRunner;
|
||||||
@ -25,6 +26,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
|
|||||||
import org.springframework.cloud.alibaba.dubbo.annotation.DubboTransported;
|
import org.springframework.cloud.alibaba.dubbo.annotation.DubboTransported;
|
||||||
import org.springframework.cloud.alibaba.dubbo.service.RestService;
|
import org.springframework.cloud.alibaba.dubbo.service.RestService;
|
||||||
import org.springframework.cloud.alibaba.dubbo.service.User;
|
import org.springframework.cloud.alibaba.dubbo.service.User;
|
||||||
|
import org.springframework.cloud.alibaba.dubbo.service.UserService;
|
||||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
||||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
@ -52,7 +54,10 @@ import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8_VALUE;
|
|||||||
@EnableFeignClients
|
@EnableFeignClients
|
||||||
public class DubboSpringCloudConsumerBootstrap {
|
public class DubboSpringCloudConsumerBootstrap {
|
||||||
|
|
||||||
@Reference(version = "1.0.0")
|
@Reference
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
|
@Reference(version = "1.0.0", protocol = "dubbo")
|
||||||
private RestService restService;
|
private RestService restService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -94,7 +99,7 @@ public class DubboSpringCloudConsumerBootstrap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@FeignClient("${provider.application.name}")
|
@FeignClient("${provider.application.name}")
|
||||||
@DubboTransported()
|
@DubboTransported(protocol = "dubbo")
|
||||||
public interface DubboFeignRestService {
|
public interface DubboFeignRestService {
|
||||||
|
|
||||||
@GetMapping(value = "/param")
|
@GetMapping(value = "/param")
|
||||||
@ -118,7 +123,28 @@ public class DubboSpringCloudConsumerBootstrap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public ApplicationRunner paramRunner() {
|
public ApplicationRunner userServiceRunner() {
|
||||||
|
return arguments -> {
|
||||||
|
|
||||||
|
User user = new User();
|
||||||
|
user.setId(1L);
|
||||||
|
user.setName("小马哥");
|
||||||
|
user.setAge(33);
|
||||||
|
|
||||||
|
// save User
|
||||||
|
System.out.printf("UserService.save(%s) : %s\n", user, userService.save(user));
|
||||||
|
|
||||||
|
// find all Users
|
||||||
|
System.out.printf("UserService.findAll() : %s\n", user, userService.findAll());
|
||||||
|
|
||||||
|
// remove User
|
||||||
|
System.out.printf("UserService.remove(%d) : %s\n", user.getId(), userService.remove(user.getId()));
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public ApplicationRunner callRunner() {
|
||||||
return arguments -> {
|
return arguments -> {
|
||||||
|
|
||||||
// To call /path-variables
|
// To call /path-variables
|
||||||
@ -191,7 +217,7 @@ public class DubboSpringCloudConsumerBootstrap {
|
|||||||
// Dubbo Service call
|
// Dubbo Service call
|
||||||
System.out.println(restService.requestBodyMap(data, "Hello,World"));
|
System.out.println(restService.requestBodyMap(data, "Hello,World"));
|
||||||
// Spring Cloud Open Feign REST Call (Dubbo Transported)
|
// Spring Cloud Open Feign REST Call (Dubbo Transported)
|
||||||
// System.out.println(dubboFeignRestService.requestBody("Hello,World", data));
|
System.out.println(dubboFeignRestService.requestBody("Hello,World", data));
|
||||||
// Spring Cloud Open Feign REST Call
|
// Spring Cloud Open Feign REST Call
|
||||||
System.out.println(feignRestService.requestBody("Hello,World", data));
|
System.out.println(feignRestService.requestBody("Hello,World", data));
|
||||||
|
|
||||||
|
@ -1,12 +1,18 @@
|
|||||||
dubbo:
|
dubbo:
|
||||||
registry:
|
registry:
|
||||||
# The Spring Cloud Dubbo's registry extension
|
# The Spring Cloud Dubbo's registry extension
|
||||||
|
## the default value of dubbo-provider-services is "*", that means to subscribe all providers,
|
||||||
|
## thus it's optimized if subscriber specifies the required providers.
|
||||||
address: spring-cloud://localhost
|
address: spring-cloud://localhost
|
||||||
# The traditional Dubbo's registry
|
# The traditional Dubbo's registry also is supported
|
||||||
# address: zookeeper://127.0.0.1:2181
|
# address: zookeeper://127.0.0.1:2181
|
||||||
|
cloud:
|
||||||
|
# The subscribed services in consumer side
|
||||||
|
subscribed-services: ${provider.application.name}
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 0
|
port: 0
|
||||||
|
|
||||||
provider:
|
provider:
|
||||||
application:
|
application:
|
||||||
name: spring-cloud-alibaba-dubbo-web-provider
|
name: spring-cloud-alibaba-dubbo-provider
|
@ -17,6 +17,13 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- Resolve the Dubbo REST RPC issue -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Resolve the Spring Cloud registration issue -->
|
<!-- Resolve the Spring Cloud registration issue -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
@ -73,4 +80,13 @@
|
|||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.cloud.alibaba.dubbo.bootstrap;
|
package org.springframework.cloud.alibaba.dubbo.bootstrap;
|
||||||
|
|
||||||
|
import org.springframework.boot.WebApplicationType;
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
@ -30,6 +31,7 @@ public class DubboSpringCloudProviderBootstrap {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
new SpringApplicationBuilder(DubboSpringCloudProviderBootstrap.class)
|
new SpringApplicationBuilder(DubboSpringCloudProviderBootstrap.class)
|
||||||
.properties("spring.profiles.active=nacos")
|
.properties("spring.profiles.active=nacos")
|
||||||
|
.web(WebApplicationType.NONE)
|
||||||
.run(args);
|
.run(args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
package org.springframework.cloud.alibaba.dubbo.service;
|
||||||
|
|
||||||
|
import org.apache.dubbo.config.annotation.Service;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* In-Memory {@link UserService} implementation
|
||||||
|
*/
|
||||||
|
@Service(protocol = "dubbo")
|
||||||
|
public class InMemoryUserService implements UserService {
|
||||||
|
|
||||||
|
private Map<Long, User> usersRepository = new HashMap<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean save(User user) {
|
||||||
|
return usersRepository.put(user.getId(), user) == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean remove(Long userId) {
|
||||||
|
return usersRepository.remove(userId) != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<User> findAll() {
|
||||||
|
return usersRepository.values();
|
||||||
|
}
|
||||||
|
}
|
@ -16,6 +16,12 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- Production Ready features -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
@ -30,4 +36,13 @@
|
|||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
package org.springframework.cloud.alibaba.dubbo.service;
|
||||||
|
|
||||||
|
import org.apache.dubbo.config.annotation.Service;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* In-Memory {@link UserService} implementation
|
||||||
|
*/
|
||||||
|
@Service(protocol = "dubbo")
|
||||||
|
public class InMemoryUserService implements UserService {
|
||||||
|
|
||||||
|
private Map<Long, User> usersRepository = new HashMap<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean save(User user) {
|
||||||
|
return usersRepository.put(user.getId(), user) == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean remove(Long userId) {
|
||||||
|
return usersRepository.remove(userId) != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<User> findAll() {
|
||||||
|
return usersRepository.values();
|
||||||
|
}
|
||||||
|
}
|
@ -16,4 +16,10 @@ feign:
|
|||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 8080
|
port: 8888
|
||||||
|
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
exposure:
|
||||||
|
include: dubborestmetadata
|
@ -1,6 +1,6 @@
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: spring-cloud-alibaba-dubbo-web-provider
|
name: spring-cloud-alibaba-dubbo-provider
|
||||||
main:
|
main:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
|
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
package org.springframework.cloud.alibaba.dubbo.service;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link User} Service
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
|
||||||
|
*/
|
||||||
|
public interface UserService {
|
||||||
|
|
||||||
|
boolean save(User user);
|
||||||
|
|
||||||
|
boolean remove(Long userId);
|
||||||
|
|
||||||
|
Collection<User> findAll();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user