- demo 项目,修改 rpc 层,出参为 dto

This commit is contained in:
YunaiV
2019-09-26 01:19:42 +08:00
parent 2c7e1a97df
commit 9cadb9afd7
10 changed files with 21 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
package cn.iocoder.mall.demo.rpc.convert;
import cn.iocoder.mall.demo.business.bo.product.DemoProductBO;
import cn.iocoder.mall.demo.rpc.vo.DemoProductVO;
import cn.iocoder.mall.demo.rpc.dto.DemoProductDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
@@ -12,6 +12,6 @@ public interface DemoProductConvert {
DemoProductConvert INSTANCE = Mappers.getMapper(DemoProductConvert.class);
@Mappings({})
DemoProductVO convert(DemoProductBO object);
DemoProductDTO convert(DemoProductBO object);
}

View File

@@ -1,7 +1,7 @@
package cn.iocoder.mall.demo.rpc.convert;
import cn.iocoder.mall.demo.business.bo.user.DemoUserBO;
import cn.iocoder.mall.demo.rpc.vo.DemoUserVO;
import cn.iocoder.mall.demo.rpc.dto.DemoUserDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
@@ -12,6 +12,6 @@ public interface DemoUserConvert {
DemoUserConvert INSTANCE = Mappers.getMapper(DemoUserConvert.class);
@Mappings({})
DemoUserVO convert(DemoUserBO object);
DemoUserDTO convert(DemoUserBO object);
}

View File

@@ -4,7 +4,7 @@ import cn.iocoder.mall.demo.business.api.DemoProductService;
import cn.iocoder.mall.demo.business.bo.product.DemoProductBO;
import cn.iocoder.mall.demo.rpc.api.DemoProductRpcService;
import cn.iocoder.mall.demo.rpc.convert.DemoProductConvert;
import cn.iocoder.mall.demo.rpc.vo.DemoProductVO;
import cn.iocoder.mall.demo.rpc.dto.DemoProductDTO;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
@@ -15,7 +15,7 @@ public class DemoProductRpcServiceImpl implements DemoProductRpcService {
private DemoProductService productService;
@Override
public DemoProductVO get(Integer id) {
public DemoProductDTO get(Integer id) {
DemoProductBO product = productService.get(id);
return DemoProductConvert.INSTANCE.convert(product);
}

View File

@@ -4,7 +4,7 @@ import cn.iocoder.mall.demo.business.api.DemoUserService;
import cn.iocoder.mall.demo.business.bo.user.DemoUserBO;
import cn.iocoder.mall.demo.rpc.api.DemoUserRpcService;
import cn.iocoder.mall.demo.rpc.convert.DemoUserConvert;
import cn.iocoder.mall.demo.rpc.vo.DemoUserVO;
import cn.iocoder.mall.demo.rpc.dto.DemoUserDTO;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
@@ -15,7 +15,7 @@ public class DemoUserRpcServiceImpl implements DemoUserRpcService {
private DemoUserService demoUserService;
@Override
public DemoUserVO get(Integer id) {
public DemoUserDTO get(Integer id) {
DemoUserBO userBO = demoUserService.get(id);
return DemoUserConvert.INSTANCE.convert(userBO);
}