mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	支付的 code review
This commit is contained in:
		| @@ -12,6 +12,7 @@ import javax.validation.constraints.NotNull; | ||||
| @Data | ||||
| public class PayMerchantBaseVO { | ||||
|  | ||||
|     // TODO @aquan:no 应该不允许修改。啊哈哈,我的原型没画对 | ||||
|     @ApiModelProperty(value = "商户号") | ||||
|     private String no; | ||||
|  | ||||
|   | ||||
| @@ -9,7 +9,6 @@ import cn.iocoder.yudao.adminserver.modules.pay.convert.merchant.PayMerchantConv | ||||
| import cn.iocoder.yudao.adminserver.modules.pay.dal.mysql.merchant.PayMerchantMapper; | ||||
| import cn.iocoder.yudao.adminserver.modules.pay.service.merchant.PayMerchantService; | ||||
| import cn.iocoder.yudao.coreservice.modules.pay.dal.dataobject.merchant.PayMerchantDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import com.google.common.annotations.VisibleForTesting; | ||||
| import org.springframework.stereotype.Service; | ||||
| @@ -20,7 +19,7 @@ import java.time.LocalDateTime; | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
|  | ||||
| import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.*; | ||||
| import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.MERCHANT_NOT_EXISTS; | ||||
| import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||||
| /** | ||||
|  * 支付商户信息 Service 实现类 | ||||
| @@ -39,6 +38,7 @@ public class PayMerchantServiceImpl implements PayMerchantService { | ||||
|         // 插入 | ||||
|         PayMerchantDO merchant = PayMerchantConvert.INSTANCE.convert(createReqVO); | ||||
|         // 根据 年月日时分秒毫秒 生成时间戳 | ||||
|         // TODO @aquan:生成 no 可以单独一个小方法 | ||||
|         String merchantNo = "M" + DateUtil.format(LocalDateTime.now(),"yyyyMMddHHmmssSSS"); | ||||
|         merchant.setNo(merchantNo); | ||||
|         merchantMapper.insert(merchant); | ||||
|   | ||||
| @@ -28,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.*; | ||||
| /** | ||||
| * {@link PayMerchantServiceImpl} 的单元测试类 | ||||
| * | ||||
| * @author 芋艿 | ||||
| * @author 芋艿 // TODO @aquan:修改成自己的。。。 | ||||
| */ | ||||
| @Import(PayMerchantServiceImpl.class) | ||||
| public class PayMerchantServiceTest extends BaseDbUnitTest { | ||||
| @@ -51,6 +51,7 @@ public class PayMerchantServiceTest extends BaseDbUnitTest { | ||||
|         assertNotNull(merchantId); | ||||
|         // 校验记录的属性是否正确 | ||||
|         PayMerchantDO merchant = merchantMapper.selectById(merchantId); | ||||
|         // TODO @aquan:需要判断 no 非空 | ||||
|         assertPojoEquals(reqVO, merchant,"no"); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV