升级 Dubbo 到 2.7.1 。目前 Dubbo 引用服务存在 Bug ,所以需要使用 @Autowire 解决下。

This commit is contained in:
YunaiV 2019-04-30 21:32:05 +08:00
parent 038073d9a8
commit 903489bcc7
80 changed files with 225 additions and 208 deletions

View File

@ -89,7 +89,7 @@ TODO 此处应有一个架构图的装逼 JPG 图。
| [Redis](https://redis.io/) | key-value 数据库 | 暂未引入,等压测后,部分模块 | | [Redis](https://redis.io/) | key-value 数据库 | 暂未引入,等压测后,部分模块 |
| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 暂未引入,等压测后,部分模块 | | [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 暂未引入,等压测后,部分模块 |
| [Elasticsearch](https://www.elastic.co/cn/) | 分布式搜索引擎 | 6.7.1 | | [Elasticsearch](https://www.elastic.co/cn/) | 分布式搜索引擎 | 6.7.1 |
| [Dubbo](http://dubbo.apache.org/) | 分布式 RPC 服务框架 | 2.6.5 | | [Dubbo](http://dubbo.apache.org/) | 分布式 RPC 服务框架 | 2.7.1 |
| [RocketMQ](http://dubbo.apache.org/) | 消息中间件 | 4.3.2 | | [RocketMQ](http://dubbo.apache.org/) | 消息中间件 | 4.3.2 |
| [SkyWalking](http://skywalking.apache.org/) | 分布式应用追踪系统 | 6.0.0 | | [SkyWalking](http://skywalking.apache.org/) | 分布式应用追踪系统 | 6.0.0 |
| [Zookeeper](http://zookeeper.apache.org/) | 分布式系统协调 | 3.4.9 作为注册中心 | | [Zookeeper](http://zookeeper.apache.org/) | 分布式系统协调 | 3.4.9 作为注册中心 |

View File

@ -39,20 +39,6 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.boot</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</dependency>
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId> <artifactId>springfox-swagger2</artifactId>

View File

@ -1,9 +1,12 @@
package cn.iocoder.mall.admin.application.config; package cn.iocoder.mall.admin.application.config;
import cn.iocoder.common.framework.config.GlobalExceptionHandler; import cn.iocoder.common.framework.config.GlobalExceptionHandler;
import cn.iocoder.common.framework.servlet.CorsFilter;
import cn.iocoder.mall.admin.sdk.interceptor.AdminAccessLogInterceptor; import cn.iocoder.mall.admin.sdk.interceptor.AdminAccessLogInterceptor;
import cn.iocoder.mall.admin.sdk.interceptor.AdminSecurityInterceptor; import cn.iocoder.mall.admin.sdk.interceptor.AdminSecurityInterceptor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.config.annotation.*; import org.springframework.web.servlet.config.annotation.*;
@ -37,13 +40,12 @@ public class MVCConfiguration implements WebMvcConfigurer {
registry.addResourceHandler("webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); registry.addResourceHandler("webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
} }
// TODO 芋艿允许跨域 @Bean
@Override public FilterRegistrationBean<CorsFilter> corsFilter() {
public void addCorsMappings(CorsRegistry registry) { FilterRegistrationBean<CorsFilter> registrationBean = new FilterRegistrationBean<>();
registry.addMapping("/**") registrationBean.setFilter(new CorsFilter());
.allowedHeaders("*") registrationBean.addUrlPatterns("/*");
.allowedMethods("*") return registrationBean;
.allowedOrigins("*");
} }
} }

View File

@ -18,11 +18,11 @@ import cn.iocoder.mall.admin.application.vo.AdminPageVO;
import cn.iocoder.mall.admin.application.vo.AdminRoleVO; import cn.iocoder.mall.admin.application.vo.AdminRoleVO;
import cn.iocoder.mall.admin.application.vo.AdminVO; import cn.iocoder.mall.admin.application.vo.AdminVO;
import cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder; import cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
@ -33,11 +33,11 @@ import java.util.stream.Collectors;
@Api("管理员模块") @Api("管理员模块")
public class AdminController { public class AdminController {
@Reference(validation = "true") @Reference(validation = "true", lazy = true)
private ResourceService resourceService; private ResourceService resourceService;
@Reference(validation = "true") @Reference(validation = "true", lazy = true)
private AdminService adminService; private AdminService adminService;
@Reference(validation = "true") @Reference(validation = "true", lazy = true)
private RoleService roleService; private RoleService roleService;
// =========== 当前管理员相关的资源 API =========== // =========== 当前管理员相关的资源 API ===========

View File

@ -9,7 +9,7 @@ import cn.iocoder.mall.admin.application.convert.DataDictConvert;
import cn.iocoder.mall.admin.application.vo.DataDictEnumVO; import cn.iocoder.mall.admin.application.vo.DataDictEnumVO;
import cn.iocoder.mall.admin.application.vo.DataDictVO; import cn.iocoder.mall.admin.application.vo.DataDictVO;
import cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder; import cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.Multimaps; import com.google.common.collect.Multimaps;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -26,7 +26,7 @@ import java.util.List;
@Api("数据字典模块") @Api("数据字典模块")
public class DataDictController { public class DataDictController {
@Reference(validation = "true") @Reference(validation = "true", lazy = true)
private DataDictService dataDictService; private DataDictService dataDictService;
@GetMapping("/list") @GetMapping("/list")

View File

@ -5,11 +5,11 @@ import cn.iocoder.mall.admin.api.OAuth2Service;
import cn.iocoder.mall.admin.api.bo.OAuth2AccessTokenBO; import cn.iocoder.mall.admin.api.bo.OAuth2AccessTokenBO;
import cn.iocoder.mall.admin.application.convert.PassportConvert; import cn.iocoder.mall.admin.application.convert.PassportConvert;
import cn.iocoder.mall.admin.application.vo.PassportLoginVO; import cn.iocoder.mall.admin.application.vo.PassportLoginVO;
import com.alibaba.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
@Api("Admin Passport 模块") @Api("Admin Passport 模块")
public class PassportController { public class PassportController {
@Reference @Reference(validation = "true", lazy = true)
private OAuth2Service oauth2Service; private OAuth2Service oauth2Service;
@PostMapping("/login") @PostMapping("/login")

View File

@ -10,7 +10,7 @@ import cn.iocoder.mall.admin.application.convert.ResourceConvert;
import cn.iocoder.mall.admin.application.vo.ResourceTreeNodeVO; import cn.iocoder.mall.admin.application.vo.ResourceTreeNodeVO;
import cn.iocoder.mall.admin.application.vo.ResourceVO; import cn.iocoder.mall.admin.application.vo.ResourceVO;
import cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder; import cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@ -28,7 +28,7 @@ import java.util.stream.Collectors;
@Api("资源模块") @Api("资源模块")
public class ResourceController { public class ResourceController {
@Reference(validation = "true") @Reference(validation = "true", lazy = true)
private ResourceService resourceService; private ResourceService resourceService;
@SuppressWarnings("Duplicates") @SuppressWarnings("Duplicates")

View File

@ -16,7 +16,7 @@ import cn.iocoder.mall.admin.application.vo.RolePageVO;
import cn.iocoder.mall.admin.application.vo.RoleResourceTreeNodeVO; import cn.iocoder.mall.admin.application.vo.RoleResourceTreeNodeVO;
import cn.iocoder.mall.admin.application.vo.RoleVO; import cn.iocoder.mall.admin.application.vo.RoleVO;
import cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder; import cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -29,9 +29,9 @@ import java.util.stream.Collectors;
@RequestMapping("admins/role") @RequestMapping("admins/role")
public class RoleController { public class RoleController {
@Reference(validation = "true") @Reference(validation = "true", lazy = true)
private RoleService roleService; private RoleService roleService;
@Reference(validation = "true") @Reference(validation = "true", lazy = true)
private ResourceService resourceService; private ResourceService resourceService;
@GetMapping("/page") @GetMapping("/page")

View File

@ -17,19 +17,16 @@
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId> <artifactId>spring-context</artifactId>
<version>5.1.5.RELEASE</version> <version>5.1.5.RELEASE</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
<version>5.1.5.RELEASE</version> <version>5.1.5.RELEASE</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId> <artifactId>dubbo</artifactId>
<version>2.6.5</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -3,9 +3,9 @@ package cn.iocoder.mall.admin.sdk.interceptor;
import cn.iocoder.common.framework.util.HttpUtil; import cn.iocoder.common.framework.util.HttpUtil;
import cn.iocoder.mall.admin.api.AdminAccessLogService; import cn.iocoder.mall.admin.api.AdminAccessLogService;
import cn.iocoder.mall.admin.api.dto.AdminAccessLogAddDTO; import cn.iocoder.mall.admin.api.dto.AdminAccessLogAddDTO;
import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -32,7 +32,7 @@ public class AdminAccessLogInterceptor extends HandlerInterceptorAdapter {
*/ */
private static final ThreadLocal<Integer> ADMIN_ID = new ThreadLocal<>(); private static final ThreadLocal<Integer> ADMIN_ID = new ThreadLocal<>();
@Reference @Reference(lazy = true) // TODO 芋艿初始化时会存在 spring boot 启动时服务无法引用的情况先暂时这么解决
private AdminAccessLogService adminAccessLogService; private AdminAccessLogService adminAccessLogService;
@Override @Override
@ -44,6 +44,9 @@ public class AdminAccessLogInterceptor extends HandlerInterceptorAdapter {
@Override @Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) { public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
if (adminAccessLogService == null) {
throw new IllegalStateException("AdminAccessLogService 服务未引入成功");
}
AdminAccessLogAddDTO accessLog = new AdminAccessLogAddDTO(); AdminAccessLogAddDTO accessLog = new AdminAccessLogAddDTO();
try { try {
accessLog.setAdminId(ADMIN_ID.get()); accessLog.setAdminId(ADMIN_ID.get());

View File

@ -8,7 +8,7 @@ import cn.iocoder.mall.admin.api.bo.OAuth2AuthenticationBO;
import cn.iocoder.mall.admin.api.constant.AdminErrorCodeEnum; import cn.iocoder.mall.admin.api.constant.AdminErrorCodeEnum;
import cn.iocoder.mall.admin.sdk.context.AdminSecurityContext; import cn.iocoder.mall.admin.sdk.context.AdminSecurityContext;
import cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder; import cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
@ -22,7 +22,7 @@ import java.util.Set;
@Component @Component
public class AdminSecurityInterceptor extends HandlerInterceptorAdapter { public class AdminSecurityInterceptor extends HandlerInterceptorAdapter {
@Reference @Reference(lazy = true) // TODO 芋艿初始化时会存在 spring boot 启动时服务无法引用的情况先暂时这么解决
private OAuth2Service oauth2Service; private OAuth2Service oauth2Service;
@Override @Override

View File

@ -3,6 +3,7 @@ package cn.iocoder.mall.admin.api.bo;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
@ -10,7 +11,7 @@ import java.util.Date;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class AdminBO { public class AdminBO implements Serializable {
/** /**
* 管理员编号 * 管理员编号

View File

@ -3,6 +3,7 @@ package cn.iocoder.mall.admin.api.bo;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List; import java.util.List;
/** /**
@ -10,7 +11,7 @@ import java.util.List;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class AdminPageBO { public class AdminPageBO implements Serializable {
/** /**
* 管理员数组 * 管理员数组

View File

@ -3,6 +3,7 @@ package cn.iocoder.mall.admin.api.bo;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
@ -10,7 +11,7 @@ import java.util.Date;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class ResourceBO { public class ResourceBO implements Serializable {
/** /**
* 资源编号 * 资源编号

View File

@ -3,6 +3,7 @@ package cn.iocoder.mall.admin.api.bo;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
@ -10,7 +11,7 @@ import java.util.Date;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class RoleBO { public class RoleBO implements Serializable {
/** /**
* 角色编号 * 角色编号

View File

@ -3,6 +3,7 @@ package cn.iocoder.mall.admin.api.bo;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List; import java.util.List;
/** /**
@ -10,7 +11,7 @@ import java.util.List;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class RolePageBO { public class RolePageBO implements Serializable {
/** /**
* 角色数组 * 角色数组

View File

@ -5,6 +5,7 @@ import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
@ -12,7 +13,7 @@ import java.util.Date;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class AdminAccessLogAddDTO { public class AdminAccessLogAddDTO implements Serializable {
/** /**
* 管理员编号 - * 管理员编号 -

View File

@ -29,9 +29,21 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId> <artifactId>dubbo</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.mybatis.spring.boot</groupId> <groupId>org.mybatis.spring.boot</groupId>

View File

@ -13,7 +13,7 @@ import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class AdminAccessLogServiceImpl implements AdminAccessLogService { public class AdminAccessLogServiceImpl implements AdminAccessLogService {
/** /**

View File

@ -29,7 +29,7 @@ import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class AdminServiceImpl implements AdminService { public class AdminServiceImpl implements AdminService {
@Autowired @Autowired

View File

@ -24,7 +24,7 @@ import java.util.stream.Collectors;
* 数据字典 Service * 数据字典 Service
*/ */
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class DataDictServiceImpl implements DataDictService { public class DataDictServiceImpl implements DataDictService {
@Autowired @Autowired

View File

@ -21,7 +21,7 @@ import java.util.Set;
import java.util.UUID; import java.util.UUID;
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class OAuth2ServiceImpl implements OAuth2Service { public class OAuth2ServiceImpl implements OAuth2Service {
/** /**

View File

@ -24,7 +24,7 @@ import java.util.List;
import java.util.Set; import java.util.Set;
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class ResourceServiceImpl implements ResourceService { public class ResourceServiceImpl implements ResourceService {
@Autowired @Autowired

View File

@ -30,7 +30,7 @@ import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class RoleServiceImpl implements RoleService { public class RoleServiceImpl implements RoleService {
@Autowired @Autowired

View File

@ -21,6 +21,7 @@ public class ExceptionUtil {
// 原因是 // 原因是
// 1. Dubbo 动态代理 Wrapper 会将抛出的异常包装成 InvocationTargetException 异常 // 1. Dubbo 动态代理 Wrapper 会将抛出的异常包装成 InvocationTargetException 异常
// 2. Spring AOP 发现是 InvocationTargetException 异常是非方法定义的异常则会包装成 UndeclaredThrowableException 异常 // 2. Spring AOP 发现是 InvocationTargetException 异常是非方法定义的异常则会包装成 UndeclaredThrowableException 异常
@Deprecated // https://github.com/apache/incubator-dubbo/issues/3386 Dubbo 2.6.5 会触发该问题 2.7.1 版本已经解决
public static ServiceException getServiceException(UndeclaredThrowableException e) { public static ServiceException getServiceException(UndeclaredThrowableException e) {
Throwable undeclaredThrowable = e.getUndeclaredThrowable(); Throwable undeclaredThrowable = e.getUndeclaredThrowable();
if (undeclaredThrowable instanceof InvocationTargetException) { if (undeclaredThrowable instanceof InvocationTargetException) {
@ -33,12 +34,13 @@ public class ExceptionUtil {
return null; return null;
} }
@Deprecated // https://github.com/apache/incubator-dubbo/issues/3386 Dubbo 2.6.5 会触发该问题 2.7.1 版本已经解决
public static ConstraintViolationException getConstraintViolationException(UndeclaredThrowableException e) { public static ConstraintViolationException getConstraintViolationException(UndeclaredThrowableException e) {
Throwable undeclaredThrowable = e.getUndeclaredThrowable(); Throwable undeclaredThrowable = e.getUndeclaredThrowable();
if (undeclaredThrowable instanceof InvocationTargetException) { if (undeclaredThrowable instanceof InvocationTargetException) {
InvocationTargetException invocationTargetException = (InvocationTargetException) undeclaredThrowable; InvocationTargetException invocationTargetException = (InvocationTargetException) undeclaredThrowable;
Throwable targetException = invocationTargetException.getTargetException(); Throwable targetException = invocationTargetException.getTargetException();
if (targetException != null && targetException instanceof ConstraintViolationException) { if (targetException instanceof ConstraintViolationException) {
return (ConstraintViolationException) targetException; return (ConstraintViolationException) targetException;
} }
} }

View File

@ -21,7 +21,7 @@ import cn.iocoder.mall.order.application.po.user.OrderCreatePO;
import cn.iocoder.mall.order.application.po.user.OrderReturnApplyPO; import cn.iocoder.mall.order.application.po.user.OrderReturnApplyPO;
import cn.iocoder.mall.order.application.vo.UsersOrderConfirmCreateVO; import cn.iocoder.mall.order.application.vo.UsersOrderConfirmCreateVO;
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder; import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;

View File

@ -10,7 +10,7 @@ import cn.iocoder.mall.order.api.bo.OrderLogisticsInfoWithOrderBO;
import cn.iocoder.mall.order.api.constant.DictKeyConstants; import cn.iocoder.mall.order.api.constant.DictKeyConstants;
import cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum; import cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum;
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder; import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;

View File

@ -9,7 +9,7 @@ import cn.iocoder.mall.order.api.constant.DictKeyConstants;
import cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO; import cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO;
import cn.iocoder.mall.order.application.convert.OrderReturnConvert; import cn.iocoder.mall.order.application.convert.OrderReturnConvert;
import cn.iocoder.mall.order.application.po.user.OrderReturnApplyPO; import cn.iocoder.mall.order.application.po.user.OrderReturnApplyPO;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;

View File

@ -15,7 +15,7 @@ import cn.iocoder.mall.promotion.api.CouponService;
import cn.iocoder.mall.promotion.api.bo.CouponCardAvailableBO; import cn.iocoder.mall.promotion.api.bo.CouponCardAvailableBO;
import cn.iocoder.mall.user.sdk.annotation.PermitAll; import cn.iocoder.mall.user.sdk.annotation.PermitAll;
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder; import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -21,7 +21,7 @@ import cn.iocoder.mall.promotion.api.PromotionActivityService;
import cn.iocoder.mall.promotion.api.bo.CouponCardDetailBO; import cn.iocoder.mall.promotion.api.bo.CouponCardDetailBO;
import cn.iocoder.mall.promotion.api.bo.PromotionActivityBO; import cn.iocoder.mall.promotion.api.bo.PromotionActivityBO;
import cn.iocoder.mall.promotion.api.constant.*; import cn.iocoder.mall.promotion.api.constant.*;
import com.alibaba.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.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert; import org.springframework.util.Assert;
@ -33,7 +33,7 @@ import java.util.stream.Collectors;
* 购物车服务 Service 实现类 * 购物车服务 Service 实现类
*/ */
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class CartServiceImpl implements CartService { public class CartServiceImpl implements CartService {
@Reference(validation = "true") @Reference(validation = "true")

View File

@ -34,7 +34,7 @@ import java.util.stream.Collectors;
* @time 2019-04-12 21:32 * @time 2019-04-12 21:32
*/ */
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class OrderLogisticsServiceImpl implements OrderLogisticsService { public class OrderLogisticsServiceImpl implements OrderLogisticsService {
@Autowired @Autowired

View File

@ -1,7 +1,6 @@
package cn.iocoder.mall.order.biz.service; package cn.iocoder.mall.order.biz.service;
import cn.iocoder.common.framework.constant.DeletedStatusEnum; import cn.iocoder.common.framework.constant.DeletedStatusEnum;
import cn.iocoder.common.framework.exception.ServiceException;
import cn.iocoder.common.framework.util.ServiceExceptionUtil; import cn.iocoder.common.framework.util.ServiceExceptionUtil;
import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.order.api.OrderLogisticsService; import cn.iocoder.mall.order.api.OrderLogisticsService;
@ -13,13 +12,12 @@ import cn.iocoder.mall.order.api.constant.OrderReturnStatusEnum;
import cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO; import cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO;
import cn.iocoder.mall.order.biz.convert.OrderReturnConvert; import cn.iocoder.mall.order.biz.convert.OrderReturnConvert;
import cn.iocoder.mall.order.biz.dao.OrderItemMapper; import cn.iocoder.mall.order.biz.dao.OrderItemMapper;
import cn.iocoder.mall.order.biz.dao.OrderLogisticsMapper;
import cn.iocoder.mall.order.biz.dao.OrderMapper; import cn.iocoder.mall.order.biz.dao.OrderMapper;
import cn.iocoder.mall.order.biz.dao.OrderReturnMapper; import cn.iocoder.mall.order.biz.dao.OrderReturnMapper;
import cn.iocoder.mall.order.biz.dataobject.OrderDO; import cn.iocoder.mall.order.biz.dataobject.OrderDO;
import cn.iocoder.mall.order.biz.dataobject.OrderItemDO; import cn.iocoder.mall.order.biz.dataobject.OrderItemDO;
import cn.iocoder.mall.order.biz.dataobject.OrderReturnDO; import cn.iocoder.mall.order.biz.dataobject.OrderReturnDO;
import com.alibaba.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.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -35,7 +33,7 @@ import java.util.UUID;
* @time 2019-03-30 15:35 * @time 2019-03-30 15:35
*/ */
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class OrderReturnServiceImpl implements OrderReturnService { public class OrderReturnServiceImpl implements OrderReturnService {
@Autowired @Autowired

View File

@ -21,7 +21,7 @@ import cn.iocoder.mall.product.api.bo.ProductSkuDetailBO;
import cn.iocoder.mall.promotion.api.CouponService; import cn.iocoder.mall.promotion.api.CouponService;
import cn.iocoder.mall.user.api.UserAddressService; import cn.iocoder.mall.user.api.UserAddressService;
import cn.iocoder.mall.user.api.bo.UserAddressBO; import cn.iocoder.mall.user.api.bo.UserAddressBO;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -39,7 +39,7 @@ import java.util.stream.Collectors;
* @time 2019-03-16 15:08 * @time 2019-03-16 15:08
*/ */
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class OrderServiceImpl implements OrderService { public class OrderServiceImpl implements OrderService {
/** /**

View File

@ -8,7 +8,7 @@ import cn.iocoder.mall.pay.api.bo.PayTransactionSubmitBO;
import cn.iocoder.mall.pay.api.constant.PayChannelEnum; import cn.iocoder.mall.pay.api.constant.PayChannelEnum;
import cn.iocoder.mall.pay.api.dto.PayTransactionSubmitDTO; import cn.iocoder.mall.pay.api.dto.PayTransactionSubmitDTO;
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder; import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;

View File

@ -1,7 +1,7 @@
import com.alibaba.dubbo.config.ApplicationConfig; import org.apache.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ReferenceConfig; import org.apache.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.config.RegistryConfig; import org.apache.dubbo.config.RegistryConfig;
import com.alibaba.dubbo.rpc.service.GenericService; import org.apache.dubbo.rpc.service.GenericService;
public class DubboGenericInvokerTest { public class DubboGenericInvokerTest {

View File

@ -4,8 +4,8 @@ import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.pay.biz.dataobject.PayRefundDO; import cn.iocoder.mall.pay.biz.dataobject.PayRefundDO;
import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO; import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO;
import cn.iocoder.mall.pay.biz.dataobject.PayTransactionExtensionDO; import cn.iocoder.mall.pay.biz.dataobject.PayTransactionExtensionDO;
import com.alibaba.fastjson.JSON; import org.apache.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import org.apache.fastjson.JSONObject;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.pingplusplus.Pingpp; import com.pingplusplus.Pingpp;
import com.pingplusplus.exception.*; import com.pingplusplus.exception.*;

View File

@ -1,9 +1,9 @@
package cn.iocoder.mall.pay.biz.component; package cn.iocoder.mall.pay.biz.component;
import com.alibaba.dubbo.config.ApplicationConfig; import org.apache.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ReferenceConfig; import org.apache.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.config.RegistryConfig; import org.apache.dubbo.config.RegistryConfig;
import com.alibaba.dubbo.rpc.service.GenericService; import org.apache.dubbo.rpc.service.GenericService;
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader; import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache; import com.google.common.cache.LoadingCache;

View File

@ -9,7 +9,7 @@ import cn.iocoder.mall.pay.biz.dao.PayNotifyLogMapper;
import cn.iocoder.mall.pay.biz.dao.PayNotifyTaskMapper; import cn.iocoder.mall.pay.biz.dao.PayNotifyTaskMapper;
import cn.iocoder.mall.pay.biz.dataobject.PayNotifyLogDO; import cn.iocoder.mall.pay.biz.dataobject.PayNotifyLogDO;
import cn.iocoder.mall.pay.biz.dataobject.PayNotifyTaskDO; import cn.iocoder.mall.pay.biz.dataobject.PayNotifyTaskDO;
import com.alibaba.fastjson.JSON; import org.apache.fastjson.JSON;
import org.apache.rocketmq.spring.core.RocketMQListener; import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;

View File

@ -4,7 +4,7 @@ import cn.iocoder.mall.pay.api.message.PayRefundSuccessMessage;
import cn.iocoder.mall.pay.biz.component.DubboReferencePool; import cn.iocoder.mall.pay.biz.component.DubboReferencePool;
import cn.iocoder.mall.pay.biz.dao.PayRefundMapper; import cn.iocoder.mall.pay.biz.dao.PayRefundMapper;
import cn.iocoder.mall.pay.biz.dataobject.PayRefundDO; import cn.iocoder.mall.pay.biz.dataobject.PayRefundDO;
import com.alibaba.dubbo.rpc.service.GenericService; import org.apache.dubbo.rpc.service.GenericService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener; import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

View File

@ -4,7 +4,7 @@ import cn.iocoder.mall.pay.api.message.PayTransactionSuccessMessage;
import cn.iocoder.mall.pay.biz.component.DubboReferencePool; import cn.iocoder.mall.pay.biz.component.DubboReferencePool;
import cn.iocoder.mall.pay.biz.dao.PayTransactionMapper; import cn.iocoder.mall.pay.biz.dao.PayTransactionMapper;
import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO; import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO;
import com.alibaba.dubbo.rpc.service.GenericService; import org.apache.dubbo.rpc.service.GenericService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener; import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

View File

@ -30,7 +30,7 @@ import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class PayRefundServiceImpl implements PayRefundService { public class PayRefundServiceImpl implements PayRefundService {
private Logger logger = LoggerFactory.getLogger(getClass()); private Logger logger = LoggerFactory.getLogger(getClass());

View File

@ -30,7 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class PayTransactionServiceImpl implements PayTransactionService { public class PayTransactionServiceImpl implements PayTransactionService {
private Logger logger = LoggerFactory.getLogger(getClass()); private Logger logger = LoggerFactory.getLogger(getClass());

32
pom.xml
View File

@ -28,11 +28,13 @@
<properties> <properties>
<springboot.version>2.1.4.RELEASE</springboot.version> <springboot.version>2.1.4.RELEASE</springboot.version>
<com.alibab.dubbo.version>2.6.5</com.alibab.dubbo.version> <!-- <com.alibab.dubbo.version>2.6.5</com.alibab.dubbo.version>-->
<dubbo.version>2.7.1</dubbo.version>
<mysql-connector-java.version>5.1.47</mysql-connector-java.version> <mysql-connector-java.version>5.1.47</mysql-connector-java.version>
<dubbo-spring-boot-starter.version>0.2.1.RELEASE</dubbo-spring-boot-starter.version> <!-- <dubbo-spring-boot-starter.version>0.2.1.RELEASE</dubbo-spring-boot-starter.version>-->
<org.mapstruct.version>1.3.0.Final</org.mapstruct.version> <org.mapstruct.version>1.3.0.Final</org.mapstruct.version>
<curator.version>2.12.0</curator.version> <!-- <curator.version>2.12.0</curator.version>-->
<curator.version>2.13.0</curator.version>
<springfox-swagger.version>2.9.2</springfox-swagger.version> <springfox-swagger.version>2.9.2</springfox-swagger.version>
<mybatis-spring-boot-starter.version>2.0.0</mybatis-spring-boot-starter.version> <mybatis-spring-boot-starter.version>2.0.0</mybatis-spring-boot-starter.version>
<xxl-job.version>2.0.1</xxl-job.version> <xxl-job.version>2.0.1</xxl-job.version>
@ -47,15 +49,26 @@
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>dubbo</artifactId>-->
<!-- <version>${com.alibab.dubbo.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.alibaba.boot</groupId>-->
<!-- <artifactId>dubbo-spring-boot-starter</artifactId>-->
<!-- <version>${dubbo-spring-boot-starter.version}</version>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId> <artifactId>dubbo</artifactId>
<version>${com.alibab.dubbo.version}</version> <version>${dubbo.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba.boot</groupId> <groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId> <artifactId>dubbo-spring-boot-starter</artifactId>
<version>${dubbo-spring-boot-starter.version}</version> <version>${dubbo.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -86,6 +99,11 @@
<artifactId>curator-framework</artifactId> <artifactId>curator-framework</artifactId>
<version>${curator.version}</version> <version>${curator.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>

View File

@ -64,14 +64,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.boot</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId> <artifactId>dubbo-spring-boot-starter</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.curator</groupId> <groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId> <artifactId>curator-framework</artifactId>

View File

@ -13,7 +13,7 @@ import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrPageVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrSimpleVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrSimpleVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrValueVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrValueVO;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;

View File

@ -10,7 +10,7 @@ import cn.iocoder.mall.product.api.dto.ProductCategoryUpdateDTO;
import cn.iocoder.mall.product.application.convert.ProductCategoryConvert; import cn.iocoder.mall.product.application.convert.ProductCategoryConvert;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductCategoryTreeNodeVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductCategoryTreeNodeVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductCategoryVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductCategoryVO;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;

View File

@ -12,7 +12,7 @@ import cn.iocoder.mall.product.api.dto.ProductSpuUpdateDTO;
import cn.iocoder.mall.product.application.convert.ProductSpuConvert; import cn.iocoder.mall.product.application.convert.ProductSpuConvert;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuDetailVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuDetailVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuPageVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuPageVO;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;

View File

@ -6,7 +6,7 @@ import cn.iocoder.mall.product.api.bo.ProductCategoryBO;
import cn.iocoder.mall.product.application.convert.ProductCategoryConvert; import cn.iocoder.mall.product.application.convert.ProductCategoryConvert;
import cn.iocoder.mall.product.application.vo.users.UsersProductCategoryVO; import cn.iocoder.mall.product.application.vo.users.UsersProductCategoryVO;
import cn.iocoder.mall.user.sdk.annotation.PermitAll; import cn.iocoder.mall.user.sdk.annotation.PermitAll;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;

View File

@ -8,7 +8,7 @@ import cn.iocoder.mall.product.application.convert.ProductSpuConvert;
import cn.iocoder.mall.product.application.vo.users.UsersProductSpuDetailVO; import cn.iocoder.mall.product.application.vo.users.UsersProductSpuDetailVO;
import cn.iocoder.mall.product.application.vo.users.UsersProductSpuPageVO; import cn.iocoder.mall.product.application.vo.users.UsersProductSpuPageVO;
import cn.iocoder.mall.user.sdk.annotation.PermitAll; import cn.iocoder.mall.user.sdk.annotation.PermitAll;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;

View File

@ -33,7 +33,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId> <artifactId>dubbo</artifactId>
</dependency> </dependency>

View File

@ -29,7 +29,7 @@ import java.util.stream.Collectors;
* @see cn.iocoder.mall.product.dataobject.ProductAttrValueDO * @see cn.iocoder.mall.product.dataobject.ProductAttrValueDO
*/ */
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class ProductAttrServiceImpl implements ProductAttrService { public class ProductAttrServiceImpl implements ProductAttrService {
@Autowired @Autowired

View File

@ -21,7 +21,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
@Service // 实际上不用添加添加的原因是必须 Spring 报错提示 @Service // 实际上不用添加添加的原因是必须 Spring 报错提示
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class ProductCategoryServiceImpl implements ProductCategoryService { public class ProductCategoryServiceImpl implements ProductCategoryService {
@Autowired @Autowired

View File

@ -31,7 +31,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service // 实际上不用添加添加的原因是必须 Spring 报错提示 @Service // 实际上不用添加添加的原因是必须 Spring 报错提示
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class ProductSpuServiceImpl implements ProductSpuService { public class ProductSpuServiceImpl implements ProductSpuService {
@Autowired @Autowired

View File

@ -10,7 +10,7 @@ import cn.iocoder.mall.promotion.api.dto.BannerUpdateDTO;
import cn.iocoder.mall.promotion.application.convert.BannerConvert; import cn.iocoder.mall.promotion.application.convert.BannerConvert;
import cn.iocoder.mall.promotion.application.vo.admins.AdminsBannerPageVO; import cn.iocoder.mall.promotion.application.vo.admins.AdminsBannerPageVO;
import cn.iocoder.mall.promotion.application.vo.admins.AdminsBannerVO; import cn.iocoder.mall.promotion.application.vo.admins.AdminsBannerVO;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;

View File

@ -12,7 +12,7 @@ import cn.iocoder.mall.promotion.api.dto.CouponTemplatePageDTO;
import cn.iocoder.mall.promotion.application.convert.CouponTemplateConvert; import cn.iocoder.mall.promotion.application.convert.CouponTemplateConvert;
import cn.iocoder.mall.promotion.application.vo.admins.AdminsCouponTemplatePageVO; import cn.iocoder.mall.promotion.application.vo.admins.AdminsCouponTemplatePageVO;
import cn.iocoder.mall.promotion.application.vo.admins.AdminsCouponTemplateVO; import cn.iocoder.mall.promotion.application.vo.admins.AdminsCouponTemplateVO;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;

View File

@ -10,7 +10,7 @@ import cn.iocoder.mall.promotion.api.dto.ProductRecommendUpdateDTO;
import cn.iocoder.mall.promotion.application.convert.ProductRecommendConvert; import cn.iocoder.mall.promotion.application.convert.ProductRecommendConvert;
import cn.iocoder.mall.promotion.application.vo.admins.AdminsProductRecommendPageVO; import cn.iocoder.mall.promotion.application.vo.admins.AdminsProductRecommendPageVO;
import cn.iocoder.mall.promotion.application.vo.admins.AdminsProductRecommendVO; import cn.iocoder.mall.promotion.application.vo.admins.AdminsProductRecommendVO;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;

View File

@ -7,7 +7,7 @@ import cn.iocoder.mall.promotion.api.bo.BannerBO;
import cn.iocoder.mall.promotion.application.convert.BannerConvert; import cn.iocoder.mall.promotion.application.convert.BannerConvert;
import cn.iocoder.mall.promotion.application.vo.users.UsersBannerVO; import cn.iocoder.mall.promotion.application.vo.users.UsersBannerVO;
import cn.iocoder.mall.user.sdk.annotation.PermitAll; import cn.iocoder.mall.user.sdk.annotation.PermitAll;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;

View File

@ -13,7 +13,7 @@ import cn.iocoder.mall.promotion.application.vo.users.UsersCouponCardVO;
import cn.iocoder.mall.promotion.application.vo.users.UsersCouponTemplateVO; import cn.iocoder.mall.promotion.application.vo.users.UsersCouponTemplateVO;
import cn.iocoder.mall.user.sdk.annotation.PermitAll; import cn.iocoder.mall.user.sdk.annotation.PermitAll;
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder; import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;

View File

@ -9,7 +9,7 @@ import cn.iocoder.mall.promotion.api.bo.ProductRecommendBO;
import cn.iocoder.mall.promotion.application.convert.ProductRecommendConvert; import cn.iocoder.mall.promotion.application.convert.ProductRecommendConvert;
import cn.iocoder.mall.promotion.application.vo.users.UsersProductRecommendVO; import cn.iocoder.mall.promotion.application.vo.users.UsersProductRecommendVO;
import cn.iocoder.mall.user.sdk.annotation.PermitAll; import cn.iocoder.mall.user.sdk.annotation.PermitAll;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap; import com.google.common.collect.Multimap;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;

View File

@ -22,7 +22,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
@Service // 实际上不用添加添加的原因是必须 Spring 报错提示 @Service // 实际上不用添加添加的原因是必须 Spring 报错提示
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class BannerServiceImpl implements BannerService { public class BannerServiceImpl implements BannerService {
@Autowired @Autowired

View File

@ -24,7 +24,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service // 实际上不用添加添加的原因是必须 Spring 报错提示 @Service // 实际上不用添加添加的原因是必须 Spring 报错提示
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class CouponServiceImpl implements CouponService { public class CouponServiceImpl implements CouponService {
@Autowired @Autowired

View File

@ -16,7 +16,7 @@ import cn.iocoder.mall.promotion.api.dto.ProductRecommendUpdateDTO;
import cn.iocoder.mall.promotion.biz.convert.ProductRecommendConvert; import cn.iocoder.mall.promotion.biz.convert.ProductRecommendConvert;
import cn.iocoder.mall.promotion.biz.dao.ProductRecommendMapper; import cn.iocoder.mall.promotion.biz.dao.ProductRecommendMapper;
import cn.iocoder.mall.promotion.biz.dataobject.ProductRecommendDO; import cn.iocoder.mall.promotion.biz.dataobject.ProductRecommendDO;
import com.alibaba.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.stereotype.Service; import org.springframework.stereotype.Service;
@ -24,7 +24,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
@Service // 实际上不用添加添加的原因是必须 Spring 报错提示 @Service // 实际上不用添加添加的原因是必须 Spring 报错提示
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class ProductRecommendServiceImpl implements ProductRecommendService { public class ProductRecommendServiceImpl implements ProductRecommendService {
@Reference(validation = "true") @Reference(validation = "true")

View File

@ -18,7 +18,7 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
@Service // 实际上不用添加添加的原因是必须 Spring 报错提示 @Service // 实际上不用添加添加的原因是必须 Spring 报错提示
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class PromotionActivityServiceImpl implements PromotionActivityService { public class PromotionActivityServiceImpl implements PromotionActivityService {
@Autowired @Autowired

View File

@ -8,7 +8,7 @@ import cn.iocoder.mall.search.api.bo.ProductConditionBO;
import cn.iocoder.mall.search.api.bo.ProductPageBO; import cn.iocoder.mall.search.api.bo.ProductPageBO;
import cn.iocoder.mall.search.api.dto.ProductConditionDTO; import cn.iocoder.mall.search.api.dto.ProductConditionDTO;
import cn.iocoder.mall.search.api.dto.ProductSearchPageDTO; import cn.iocoder.mall.search.api.dto.ProductSearchPageDTO;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;

View File

@ -18,7 +18,7 @@ import cn.iocoder.mall.search.api.dto.ProductSearchPageDTO;
import cn.iocoder.mall.search.biz.convert.ProductSearchConvert; import cn.iocoder.mall.search.biz.convert.ProductSearchConvert;
import cn.iocoder.mall.search.biz.dao.ProductRepository; import cn.iocoder.mall.search.biz.dao.ProductRepository;
import cn.iocoder.mall.search.biz.dataobject.ESProductDO; import cn.iocoder.mall.search.biz.dataobject.ESProductDO;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregationBuilders;
@ -37,7 +37,7 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class ProductSearchServiceImpl implements ProductSearchService { public class ProductSearchServiceImpl implements ProductSearchService {
private static final Integer REBUILD_FETCH_PER_SIZE = 100; private static final Integer REBUILD_FETCH_PER_SIZE = 100;

View File

@ -36,15 +36,15 @@
<artifactId>common-framework</artifactId> <artifactId>common-framework</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.iocoder.mall</groupId> <groupId>cn.iocoder.mall</groupId>
<artifactId>user-sdk</artifactId> <artifactId>admin-sdk</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.iocoder.mall</groupId> <groupId>cn.iocoder.mall</groupId>
<artifactId>admin-sdk</artifactId> <artifactId>user-sdk</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@ -58,20 +58,6 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.boot</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</dependency>
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId> <artifactId>springfox-swagger2</artifactId>
@ -80,13 +66,6 @@
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId> <artifactId>springfox-swagger-ui</artifactId>
</dependency> </dependency>
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>admin-sdk</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>

View File

@ -1,17 +1,18 @@
package cn.iocoder.mall.user.application.controller.admins; package cn.iocoder.mall.user.application.controller.admins;
import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.user.application.convert.UserConvert;
import cn.iocoder.mall.user.application.vo.admins.AdminsUserPageVO;
import cn.iocoder.mall.user.api.dto.UserPageDTO;
import cn.iocoder.mall.user.api.dto.UserUpdateDTO;
import cn.iocoder.mall.user.api.UserService; import cn.iocoder.mall.user.api.UserService;
import cn.iocoder.mall.user.api.bo.UserPageBO; import cn.iocoder.mall.user.api.bo.UserPageBO;
import com.alibaba.dubbo.config.annotation.Reference; import cn.iocoder.mall.user.api.dto.UserPageDTO;
import cn.iocoder.mall.user.api.dto.UserUpdateDTO;
import cn.iocoder.mall.user.application.convert.UserConvert;
import cn.iocoder.mall.user.application.vo.admins.AdminsUserPageVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; 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 org.springframework.web.bind.annotation.*;
@RestController @RestController
@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
public class AdminsUserController { public class AdminsUserController {
@Reference(validation = "true") @Reference(validation = "true")
@Autowired // TODO dubbo 2.7.2 删除用于解决 bug
private UserService userService; private UserService userService;
// 分页 // 分页

View File

@ -9,11 +9,12 @@ import cn.iocoder.mall.user.api.OAuth2Service;
import cn.iocoder.mall.user.api.UserService; import cn.iocoder.mall.user.api.UserService;
import cn.iocoder.mall.user.api.bo.OAuth2AccessTokenBO; import cn.iocoder.mall.user.api.bo.OAuth2AccessTokenBO;
import cn.iocoder.mall.user.application.vo.users.UsersMobileRegisterVO; import cn.iocoder.mall.user.application.vo.users.UsersMobileRegisterVO;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -24,11 +25,14 @@ import org.springframework.web.bind.annotation.RestController;
@Api("Passport 模块") @Api("Passport 模块")
public class PassportController { public class PassportController {
@Reference @Reference(validation = "true")
@Autowired // TODO dubbo 2.7.2 删除用于解决 bug
private OAuth2Service oauth2Service; private OAuth2Service oauth2Service;
@Reference @Reference(validation = "true")
@Autowired // TODO dubbo 2.7.2 删除用于解决 bug
private UserService userService; private UserService userService;
@Reference @Reference(validation = "true")
@Autowired // TODO dubbo 2.7.2 删除用于解决 bug
private MobileCodeService mobileCodeService; private MobileCodeService mobileCodeService;
// TODO 功能手机密码登陆 // TODO 功能手机密码登陆

View File

@ -1,16 +1,17 @@
package cn.iocoder.mall.user.application.controller.users; package cn.iocoder.mall.user.application.controller.users;
import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.user.api.UserAddressService;
import cn.iocoder.mall.user.api.bo.UserAddressBO; import cn.iocoder.mall.user.api.bo.UserAddressBO;
import cn.iocoder.mall.user.api.dto.UserAddressAddDTO;
import cn.iocoder.mall.user.api.dto.UserAddressUpdateDTO;
import cn.iocoder.mall.user.application.convert.UserAddressConvert; import cn.iocoder.mall.user.application.convert.UserAddressConvert;
import cn.iocoder.mall.user.application.po.UserAddressAddPO; import cn.iocoder.mall.user.application.po.UserAddressAddPO;
import cn.iocoder.mall.user.application.po.UserAddressUpdatePO; import cn.iocoder.mall.user.application.po.UserAddressUpdatePO;
import cn.iocoder.mall.user.api.dto.UserAddressAddDTO;
import cn.iocoder.mall.user.api.dto.UserAddressUpdateDTO;
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder; import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import cn.iocoder.mall.user.api.UserAddressService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -25,10 +26,11 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping("users/address") @RequestMapping("users/address")
@Api(description = "用户地址API") @Api(value = "用户地址API")
public class UserAddressController { public class UserAddressController {
@Autowired @Reference(validation = "true")
@Autowired // TODO dubbo 2.7.2 删除用于解决 bug
private UserAddressService userAddressService; private UserAddressService userAddressService;
@PostMapping("add") @PostMapping("add")

View File

@ -7,9 +7,10 @@ import cn.iocoder.mall.user.api.dto.UserUpdateDTO;
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder; import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import cn.iocoder.mall.user.application.vo.users.UsersUserVO; import cn.iocoder.mall.user.application.vo.users.UsersUserVO;
import cn.iocoder.mall.user.api.UserService; import cn.iocoder.mall.user.api.UserService;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@RestController @RestController
@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
public class UserController { public class UserController {
@Reference(validation = "true") @Reference(validation = "true")
@Autowired // TODO dubbo 2.7.2 删除用于解决 bug
private UserService userService; private UserService userService;
@GetMapping("/info") @GetMapping("/info")

View File

@ -15,36 +15,31 @@
<groupId>cn.iocoder.mall</groupId> <groupId>cn.iocoder.mall</groupId>
<artifactId>common-framework</artifactId> <artifactId>common-framework</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.iocoder.mall</groupId> <groupId>cn.iocoder.mall</groupId>
<artifactId>user-service-api</artifactId> <artifactId>user-service-api</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId> <artifactId>spring-context</artifactId>
<version>5.1.5.RELEASE</version> <version>5.1.5.RELEASE</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
<version>5.1.5.RELEASE</version> <version>5.1.5.RELEASE</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
<version>5.1.5.RELEASE</version> <version>5.1.5.RELEASE</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId> <artifactId>dubbo</artifactId>
</dependency> </dependency>

View File

@ -3,11 +3,12 @@ package cn.iocoder.mall.user.sdk.interceptor;
import cn.iocoder.common.framework.util.HttpUtil; import cn.iocoder.common.framework.util.HttpUtil;
import cn.iocoder.mall.user.api.UserAccessLogService; import cn.iocoder.mall.user.api.UserAccessLogService;
import cn.iocoder.mall.user.api.dto.UserAccessLogAddDTO; import cn.iocoder.mall.user.api.dto.UserAccessLogAddDTO;
import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
@ -34,6 +35,7 @@ public class UserAccessLogInterceptor extends HandlerInterceptorAdapter {
private static final ThreadLocal<Integer> USER_ID = new ThreadLocal<>(); private static final ThreadLocal<Integer> USER_ID = new ThreadLocal<>();
@Reference @Reference
@Autowired(required = false)
private UserAccessLogService userAccessLogService; private UserAccessLogService userAccessLogService;
@Override @Override

View File

@ -8,7 +8,8 @@ import cn.iocoder.mall.user.api.bo.OAuth2AuthenticationBO;
import cn.iocoder.mall.user.sdk.annotation.PermitAll; import cn.iocoder.mall.user.sdk.annotation.PermitAll;
import cn.iocoder.mall.user.sdk.context.UserSecurityContext; import cn.iocoder.mall.user.sdk.context.UserSecurityContext;
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder; import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod; import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
@ -16,7 +17,6 @@ import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
/** /**
* 安全拦截器 * 安全拦截器
*/ */
@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletResponse;
public class UserSecurityInterceptor extends HandlerInterceptorAdapter { public class UserSecurityInterceptor extends HandlerInterceptorAdapter {
@Reference @Reference
@Autowired(required = false)
private OAuth2Service oauth2Service; private OAuth2Service oauth2Service;
@Override @Override

View File

@ -15,12 +15,10 @@
<artifactId>user-service-impl</artifactId> <artifactId>user-service-impl</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>cn.iocoder.mall</groupId> <groupId>cn.iocoder.mall</groupId>
<artifactId>user-service-api</artifactId> <artifactId>user-service-api</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -38,9 +36,21 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId> <artifactId>dubbo</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
</dependencies> </dependencies>

View File

@ -18,7 +18,7 @@ import java.util.Date;
* MobileCodeService 实现用户登陆时需要的验证码 * MobileCodeService 实现用户登陆时需要的验证码
*/ */
@Service @Service
@com.alibaba.dubbo.config.annotation.Service @org.apache.dubbo.config.annotation.Service
public class MobileCodeServiceImpl implements MobileCodeService { public class MobileCodeServiceImpl implements MobileCodeService {
/** /**

View File

@ -27,7 +27,7 @@ import java.util.UUID;
* OAuth2Service 实现用户授权相关的逻辑 * OAuth2Service 实现用户授权相关的逻辑
*/ */
@Service @Service
@com.alibaba.dubbo.config.annotation.Service @org.apache.dubbo.config.annotation.Service
public class OAuth2ServiceImpl implements OAuth2Service { public class OAuth2ServiceImpl implements OAuth2Service {
/** /**

View File

@ -13,7 +13,7 @@ import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class UserAccessLogServiceImpl implements UserAccessLogService { public class UserAccessLogServiceImpl implements UserAccessLogService {
/** /**

View File

@ -26,7 +26,7 @@ import java.util.List;
* @time 2019-04-06 13:26 * @time 2019-04-06 13:26
*/ */
@Service @Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true") @org.apache.dubbo.config.annotation.Service(validation = "true")
public class UserAddressServiceImpl implements UserAddressService { public class UserAddressServiceImpl implements UserAddressService {
@Autowired @Autowired

View File

@ -5,10 +5,6 @@ import cn.iocoder.common.framework.constant.SysErrorCodeEnum;
import cn.iocoder.common.framework.util.ServiceExceptionUtil; import cn.iocoder.common.framework.util.ServiceExceptionUtil;
import cn.iocoder.common.framework.util.ValidationUtil; import cn.iocoder.common.framework.util.ValidationUtil;
import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.user.biz.dao.UserMapper;
import cn.iocoder.mall.user.biz.dao.UserRegisterMapper;
import cn.iocoder.mall.user.biz.dataobject.UserDO;
import cn.iocoder.mall.user.biz.dataobject.UserRegisterDO;
import cn.iocoder.mall.user.api.UserService; import cn.iocoder.mall.user.api.UserService;
import cn.iocoder.mall.user.api.bo.UserBO; import cn.iocoder.mall.user.api.bo.UserBO;
import cn.iocoder.mall.user.api.bo.UserPageBO; import cn.iocoder.mall.user.api.bo.UserPageBO;
@ -17,7 +13,12 @@ import cn.iocoder.mall.user.api.constant.UserErrorCodeEnum;
import cn.iocoder.mall.user.api.dto.UserPageDTO; import cn.iocoder.mall.user.api.dto.UserPageDTO;
import cn.iocoder.mall.user.api.dto.UserUpdateDTO; import cn.iocoder.mall.user.api.dto.UserUpdateDTO;
import cn.iocoder.mall.user.biz.convert.UserConvert; import cn.iocoder.mall.user.biz.convert.UserConvert;
import cn.iocoder.mall.user.biz.dao.UserMapper;
import cn.iocoder.mall.user.biz.dao.UserRegisterMapper;
import cn.iocoder.mall.user.biz.dataobject.UserDO;
import cn.iocoder.mall.user.biz.dataobject.UserRegisterDO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
@ -25,8 +26,8 @@ import java.util.Date;
/** /**
* UserService 实现和用户信息相关的逻辑 * UserService 实现和用户信息相关的逻辑
*/ */
@org.springframework.stereotype.Service @Service
@com.alibaba.dubbo.config.annotation.Service @org.apache.dubbo.config.annotation.Service(validation = "true")
public class UserServiceImpl implements UserService { public class UserServiceImpl implements UserService {
@Autowired @Autowired