升级 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 数据库 | 暂未引入,等压测后,部分模块 |
| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 暂未引入,等压测后,部分模块 |
| [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 |
| [SkyWalking](http://skywalking.apache.org/) | 分布式应用追踪系统 | 6.0.0 |
| [Zookeeper](http://zookeeper.apache.org/) | 分布式系统协调 | 3.4.9 作为注册中心 |

View File

@ -39,20 +39,6 @@
<scope>test</scope>
</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>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>

View File

@ -1,9 +1,12 @@
package cn.iocoder.mall.admin.application.config;
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.AdminSecurityInterceptor;
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.Import;
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/");
}
// TODO 芋艿允许跨域
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedHeaders("*")
.allowedMethods("*")
.allowedOrigins("*");
@Bean
public FilterRegistrationBean<CorsFilter> corsFilter() {
FilterRegistrationBean<CorsFilter> registrationBean = new FilterRegistrationBean<>();
registrationBean.setFilter(new CorsFilter());
registrationBean.addUrlPatterns("/*");
return registrationBean;
}
}

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.AdminVO;
import cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api;
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.web.bind.annotation.*;
import java.util.*;
@ -33,11 +33,11 @@ import java.util.stream.Collectors;
@Api("管理员模块")
public class AdminController {
@Reference(validation = "true")
@Reference(validation = "true", lazy = true)
private ResourceService resourceService;
@Reference(validation = "true")
@Reference(validation = "true", lazy = true)
private AdminService adminService;
@Reference(validation = "true")
@Reference(validation = "true", lazy = true)
private RoleService roleService;
// =========== 当前管理员相关的资源 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.DataDictVO;
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.Multimaps;
import io.swagger.annotations.Api;
@ -26,7 +26,7 @@ import java.util.List;
@Api("数据字典模块")
public class DataDictController {
@Reference(validation = "true")
@Reference(validation = "true", lazy = true)
private DataDictService dataDictService;
@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.application.convert.PassportConvert;
import cn.iocoder.mall.admin.application.vo.PassportLoginVO;
import com.alibaba.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api;
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.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
@Api("Admin Passport 模块")
public class PassportController {
@Reference
@Reference(validation = "true", lazy = true)
private OAuth2Service oauth2Service;
@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.ResourceVO;
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.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -28,7 +28,7 @@ import java.util.stream.Collectors;
@Api("资源模块")
public class ResourceController {
@Reference(validation = "true")
@Reference(validation = "true", lazy = true)
private ResourceService resourceService;
@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.RoleVO;
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.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@ -29,9 +29,9 @@ import java.util.stream.Collectors;
@RequestMapping("admins/role")
public class RoleController {
@Reference(validation = "true")
@Reference(validation = "true", lazy = true)
private RoleService roleService;
@Reference(validation = "true")
@Reference(validation = "true", lazy = true)
private ResourceService resourceService;
@GetMapping("/page")

View File

@ -17,19 +17,16 @@
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.5.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.5.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>2.6.5</version>
</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.mall.admin.api.AdminAccessLogService;
import cn.iocoder.mall.admin.api.dto.AdminAccessLogAddDTO;
import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@ -32,7 +32,7 @@ public class AdminAccessLogInterceptor extends HandlerInterceptorAdapter {
*/
private static final ThreadLocal<Integer> ADMIN_ID = new ThreadLocal<>();
@Reference
@Reference(lazy = true) // TODO 芋艿初始化时会存在 spring boot 启动时服务无法引用的情况先暂时这么解决
private AdminAccessLogService adminAccessLogService;
@Override
@ -44,6 +44,9 @@ public class AdminAccessLogInterceptor extends HandlerInterceptorAdapter {
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
if (adminAccessLogService == null) {
throw new IllegalStateException("AdminAccessLogService 服务未引入成功");
}
AdminAccessLogAddDTO accessLog = new AdminAccessLogAddDTO();
try {
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.sdk.context.AdminSecurityContext;
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.web.servlet.handler.HandlerInterceptorAdapter;
@ -22,7 +22,7 @@ import java.util.Set;
@Component
public class AdminSecurityInterceptor extends HandlerInterceptorAdapter {
@Reference
@Reference(lazy = true) // TODO 芋艿初始化时会存在 spring boot 启动时服务无法引用的情况先暂时这么解决
private OAuth2Service oauth2Service;
@Override

View File

@ -3,6 +3,7 @@ package cn.iocoder.mall.admin.api.bo;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
@ -10,7 +11,7 @@ import java.util.Date;
*/
@Data
@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.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
@ -10,7 +11,7 @@ import java.util.List;
*/
@Data
@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.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
@ -10,7 +11,7 @@ import java.util.Date;
*/
@Data
@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.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
@ -10,7 +11,7 @@ import java.util.Date;
*/
@Data
@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.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
@ -10,7 +11,7 @@ import java.util.List;
*/
@Data
@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 javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
@ -12,7 +13,7 @@ import java.util.Date;
*/
@Data
@Accessors(chain = true)
public class AdminAccessLogAddDTO {
public class AdminAccessLogAddDTO implements Serializable {
/**
* 管理员编号 -

View File

@ -29,9 +29,21 @@
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
</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>
<groupId>org.mybatis.spring.boot</groupId>

View File

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

View File

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

View File

@ -24,7 +24,7 @@ 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 DataDictServiceImpl implements DataDictService {
@Autowired

View File

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

View File

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

View File

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

View File

@ -21,6 +21,7 @@ public class ExceptionUtil {
// 原因是
// 1. Dubbo 动态代理 Wrapper 会将抛出的异常包装成 InvocationTargetException 异常
// 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) {
Throwable undeclaredThrowable = e.getUndeclaredThrowable();
if (undeclaredThrowable instanceof InvocationTargetException) {
@ -33,12 +34,13 @@ public class ExceptionUtil {
return null;
}
@Deprecated // https://github.com/apache/incubator-dubbo/issues/3386 Dubbo 2.6.5 会触发该问题 2.7.1 版本已经解决
public static ConstraintViolationException getConstraintViolationException(UndeclaredThrowableException e) {
Throwable undeclaredThrowable = e.getUndeclaredThrowable();
if (undeclaredThrowable instanceof InvocationTargetException) {
InvocationTargetException invocationTargetException = (InvocationTargetException) undeclaredThrowable;
Throwable targetException = invocationTargetException.getTargetException();
if (targetException != null && targetException instanceof ConstraintViolationException) {
if (targetException instanceof ConstraintViolationException) {
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.vo.UsersOrderConfirmCreateVO;
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.ApiOperation;
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.OrderErrorCodeEnum;
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.ApiOperation;
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.application.convert.OrderReturnConvert;
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 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.user.sdk.annotation.PermitAll;
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 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.PromotionActivityBO;
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.stereotype.Service;
import org.springframework.util.Assert;
@ -33,7 +33,7 @@ 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 CartServiceImpl implements CartService {
@Reference(validation = "true")

View File

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

View File

@ -1,7 +1,6 @@
package cn.iocoder.mall.order.biz.service;
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.vo.CommonResult;
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.biz.convert.OrderReturnConvert;
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.OrderReturnMapper;
import cn.iocoder.mall.order.biz.dataobject.OrderDO;
import cn.iocoder.mall.order.biz.dataobject.OrderItemDO;
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.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -35,7 +33,7 @@ import java.util.UUID;
* @time 2019-03-30 15:35
*/
@Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true")
@org.apache.dubbo.config.annotation.Service(validation = "true")
public class OrderReturnServiceImpl implements OrderReturnService {
@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.user.api.UserAddressService;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -39,7 +39,7 @@ import java.util.stream.Collectors;
* @time 2019-03-16 15:08
*/
@Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true")
@org.apache.dubbo.config.annotation.Service(validation = "true")
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.dto.PayTransactionSubmitDTO;
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.LoggerFactory;
import org.springframework.http.MediaType;

View File

@ -1,7 +1,7 @@
import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.alibaba.dubbo.rpc.service.GenericService;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ReferenceConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.rpc.service.GenericService;
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.PayTransactionDO;
import cn.iocoder.mall.pay.biz.dataobject.PayTransactionExtensionDO;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.fastjson.JSON;
import org.apache.fastjson.JSONObject;
import com.google.common.collect.ImmutableMap;
import com.pingplusplus.Pingpp;
import com.pingplusplus.exception.*;

View File

@ -1,9 +1,9 @@
package cn.iocoder.mall.pay.biz.component;
import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.alibaba.dubbo.rpc.service.GenericService;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ReferenceConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.rpc.service.GenericService;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
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.dataobject.PayNotifyLogDO;
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.springframework.beans.factory.annotation.Autowired;
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.dao.PayRefundMapper;
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.core.RocketMQListener;
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.dao.PayTransactionMapper;
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.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;

View File

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

View File

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

32
pom.xml
View File

@ -28,11 +28,13 @@
<properties>
<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>
<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>
<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>
<mybatis-spring-boot-starter.version>2.0.0</mybatis-spring-boot-starter.version>
<xxl-job.version>2.0.1</xxl-job.version>
@ -47,15 +49,26 @@
<dependencyManagement>
<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>
<groupId>com.alibaba</groupId>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>${com.alibab.dubbo.version}</version>
<version>${dubbo.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.boot</groupId>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>${dubbo-spring-boot-starter.version}</version>
<version>${dubbo.version}</version>
</dependency>
<dependency>
@ -86,6 +99,11 @@
<artifactId>curator-framework</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>

View File

@ -64,14 +64,9 @@
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.boot</groupId>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<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.AdminsProductAttrVO;
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.ApiImplicitParam;
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.vo.admins.AdminsProductCategoryTreeNodeVO;
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.ApiImplicitParam;
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.vo.admins.AdminsProductSpuDetailVO;
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.ObjectMapper;
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.vo.users.UsersProductCategoryVO;
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.ApiImplicitParam;
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.UsersProductSpuPageVO;
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.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;

View File

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

View File

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

View File

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

View File

@ -31,7 +31,7 @@ import java.util.*;
import java.util.stream.Collectors;
@Service // 实际上不用添加添加的原因是必须 Spring 报错提示
@com.alibaba.dubbo.config.annotation.Service(validation = "true")
@org.apache.dubbo.config.annotation.Service(validation = "true")
public class ProductSpuServiceImpl implements ProductSpuService {
@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.vo.admins.AdminsBannerPageVO;
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.ApiImplicitParam;
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.vo.admins.AdminsCouponTemplatePageVO;
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.ApiImplicitParam;
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.vo.admins.AdminsProductRecommendPageVO;
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.ApiImplicitParam;
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.vo.users.UsersBannerVO;
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.ApiOperation;
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.user.sdk.annotation.PermitAll;
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.ApiImplicitParam;
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.vo.users.UsersProductRecommendVO;
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.Multimap;
import io.swagger.annotations.Api;

View File

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

View File

@ -24,7 +24,7 @@ import java.util.*;
import java.util.stream.Collectors;
@Service // 实际上不用添加添加的原因是必须 Spring 报错提示
@com.alibaba.dubbo.config.annotation.Service(validation = "true")
@org.apache.dubbo.config.annotation.Service(validation = "true")
public class CouponServiceImpl implements CouponService {
@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.dao.ProductRecommendMapper;
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.stereotype.Service;
@ -24,7 +24,7 @@ import java.util.Date;
import java.util.List;
@Service // 实际上不用添加添加的原因是必须 Spring 报错提示
@com.alibaba.dubbo.config.annotation.Service(validation = "true")
@org.apache.dubbo.config.annotation.Service(validation = "true")
public class ProductRecommendServiceImpl implements ProductRecommendService {
@Reference(validation = "true")

View File

@ -18,7 +18,7 @@ import java.util.Iterator;
import java.util.List;
@Service // 实际上不用添加添加的原因是必须 Spring 报错提示
@com.alibaba.dubbo.config.annotation.Service(validation = "true")
@org.apache.dubbo.config.annotation.Service(validation = "true")
public class PromotionActivityServiceImpl implements PromotionActivityService {
@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.dto.ProductConditionDTO;
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 org.springframework.web.bind.annotation.GetMapping;
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.dao.ProductRepository;
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.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilders;
@ -37,7 +37,7 @@ import java.util.Map;
import java.util.stream.Collectors;
@Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true")
@org.apache.dubbo.config.annotation.Service(validation = "true")
public class ProductSearchServiceImpl implements ProductSearchService {
private static final Integer REBUILD_FETCH_PER_SIZE = 100;

View File

@ -36,15 +36,15 @@
<artifactId>common-framework</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>user-sdk</artifactId>
<artifactId>admin-sdk</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>admin-sdk</artifactId>
<artifactId>user-sdk</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
@ -58,20 +58,6 @@
<scope>test</scope>
</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>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
@ -80,13 +66,6 @@
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>admin-sdk</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -1,17 +1,18 @@
package cn.iocoder.mall.user.application.controller.admins;
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.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.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.*;
@RestController
@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
public class AdminsUserController {
@Reference(validation = "true")
@Autowired // TODO dubbo 2.7.2 删除用于解决 bug
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.bo.OAuth2AccessTokenBO;
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.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -24,11 +25,14 @@ import org.springframework.web.bind.annotation.RestController;
@Api("Passport 模块")
public class PassportController {
@Reference
@Reference(validation = "true")
@Autowired // TODO dubbo 2.7.2 删除用于解决 bug
private OAuth2Service oauth2Service;
@Reference
@Reference(validation = "true")
@Autowired // TODO dubbo 2.7.2 删除用于解决 bug
private UserService userService;
@Reference
@Reference(validation = "true")
@Autowired // TODO dubbo 2.7.2 删除用于解决 bug
private MobileCodeService mobileCodeService;
// TODO 功能手机密码登陆

View File

@ -1,16 +1,17 @@
package cn.iocoder.mall.user.application.controller.users;
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.dto.UserAddressAddDTO;
import cn.iocoder.mall.user.api.dto.UserAddressUpdateDTO;
import cn.iocoder.mall.user.application.convert.UserAddressConvert;
import cn.iocoder.mall.user.application.po.UserAddressAddPO;
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.api.UserAddressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -25,10 +26,11 @@ import java.util.List;
*/
@RestController
@RequestMapping("users/address")
@Api(description = "用户地址API")
@Api(value = "用户地址API")
public class UserAddressController {
@Autowired
@Reference(validation = "true")
@Autowired // TODO dubbo 2.7.2 删除用于解决 bug
private UserAddressService userAddressService;
@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.application.vo.users.UsersUserVO;
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.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
public class UserController {
@Reference(validation = "true")
@Autowired // TODO dubbo 2.7.2 删除用于解决 bug
private UserService userService;
@GetMapping("/info")

View File

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

View File

@ -3,11 +3,12 @@ package cn.iocoder.mall.user.sdk.interceptor;
import cn.iocoder.common.framework.util.HttpUtil;
import cn.iocoder.mall.user.api.UserAccessLogService;
import cn.iocoder.mall.user.api.dto.UserAccessLogAddDTO;
import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Component;
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<>();
@Reference
@Autowired(required = false)
private UserAccessLogService userAccessLogService;
@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.context.UserSecurityContext;
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.web.method.HandlerMethod;
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.HttpServletResponse;
/**
* 安全拦截器
*/
@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletResponse;
public class UserSecurityInterceptor extends HandlerInterceptorAdapter {
@Reference
@Autowired(required = false)
private OAuth2Service oauth2Service;
@Override

View File

@ -15,12 +15,10 @@
<artifactId>user-service-impl</artifactId>
<dependencies>
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>user-service-api</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
@ -38,9 +36,21 @@
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
</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>

View File

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

View File

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

View File

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

View File

@ -26,7 +26,7 @@ import java.util.List;
* @time 2019-04-06 13:26
*/
@Service
@com.alibaba.dubbo.config.annotation.Service(validation = "true")
@org.apache.dubbo.config.annotation.Service(validation = "true")
public class UserAddressServiceImpl implements UserAddressService {
@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.ValidationUtil;
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.bo.UserBO;
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.UserUpdateDTO;
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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
@ -25,8 +26,8 @@ import java.util.Date;
/**
* UserService 实现和用户信息相关的逻辑
*/
@org.springframework.stereotype.Service
@com.alibaba.dubbo.config.annotation.Service
@Service
@org.apache.dubbo.config.annotation.Service(validation = "true")
public class UserServiceImpl implements UserService {
@Autowired