升级 Dubbo 到 2.7.1 。目前 Dubbo 引用服务存在 Bug ,所以需要使用 @Autowire 解决下。
This commit is contained in:
@@ -23,6 +23,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
@@ -33,11 +34,14 @@ import java.util.stream.Collectors;
|
||||
@Api("管理员模块")
|
||||
public class AdminController {
|
||||
|
||||
@Reference(validation = "true", lazy = true)
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO Dubbo 2.7.2 移除 bug
|
||||
private ResourceService resourceService;
|
||||
@Reference(validation = "true", lazy = true)
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO Dubbo 2.7.2 移除 bug
|
||||
private AdminService adminService;
|
||||
@Reference(validation = "true", lazy = true)
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO Dubbo 2.7.2 移除 bug
|
||||
private RoleService roleService;
|
||||
|
||||
// =========== 当前管理员相关的资源 API ===========
|
||||
|
||||
@@ -16,6 +16,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -26,7 +27,8 @@ import java.util.List;
|
||||
@Api("数据字典模块")
|
||||
public class DataDictController {
|
||||
|
||||
@Reference(validation = "true", lazy = true)
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO Dubbo 2.7.2 移除 bug
|
||||
private DataDictService dataDictService;
|
||||
|
||||
@GetMapping("/list")
|
||||
|
||||
@@ -10,6 +10,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -20,7 +21,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Api("Admin Passport 模块")
|
||||
public class PassportController {
|
||||
|
||||
@Reference(validation = "true", lazy = true)
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO Dubbo 2.7.2 移除 bug
|
||||
private OAuth2Service oauth2Service;
|
||||
|
||||
@PostMapping("/login")
|
||||
|
||||
@@ -15,6 +15,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -28,7 +29,8 @@ import java.util.stream.Collectors;
|
||||
@Api("资源模块")
|
||||
public class ResourceController {
|
||||
|
||||
@Reference(validation = "true", lazy = true)
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO Dubbo 2.7.2 移除 bug
|
||||
private ResourceService resourceService;
|
||||
|
||||
@SuppressWarnings("Duplicates")
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.apache.dubbo.config.annotation.Reference;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
@@ -29,9 +30,11 @@ import java.util.stream.Collectors;
|
||||
@RequestMapping("admins/role")
|
||||
public class RoleController {
|
||||
|
||||
@Reference(validation = "true", lazy = true)
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO Dubbo 2.7.2 移除 bug
|
||||
private RoleService roleService;
|
||||
@Reference(validation = "true", lazy = true)
|
||||
@Reference(validation = "true")
|
||||
@Autowired // TODO Dubbo 2.7.2 移除 bug
|
||||
private ResourceService resourceService;
|
||||
|
||||
@GetMapping("/page")
|
||||
|
||||
Reference in New Issue
Block a user