package com.zy.controller;
|
|
|
import com.zy.entity.User;
|
import com.zy.service.UserService;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
@RestController
|
public class UserController {
|
|
@DubboReference(timeout = 1000)//远程注入
|
private UserService userService;
|
|
|
@GetMapping("/user")
|
public String user() {
|
User user = userService.queryUser();
|
return user.toString();
|
}
|
}
|