mirror of
https://gitee.com/dromara/dax-pay
synced 2026-08-12 15:35:38 +08:00
refactor(payment): 精简 MapStruct 冗余 @Mapping,依赖内置 Long→String
移除 PayRouteSceneConfigConvert 中手工 expression,由 MapStruct 自动做 strategyId 类型转换。
This commit is contained in:
@@ -3,16 +3,15 @@ package cn.daxpay.open.payment.merchant.convert.route.scene;
|
||||
import cn.daxpay.open.payment.merchant.entity.route.scene.PayRouteSceneConfig;
|
||||
import cn.daxpay.open.payment.merchant.result.route.scene.PayRouteSceneConfigResult;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/// # 支付通道路由场景模式配置转换
|
||||
///
|
||||
/// strategyId: 实体 Long → Result String,MapStruct 内置 null 安全数值转字符串
|
||||
@Mapper
|
||||
public interface PayRouteSceneConfigConvert {
|
||||
|
||||
PayRouteSceneConfigConvert CONVERT = Mappers.getMapper(PayRouteSceneConfigConvert.class);
|
||||
|
||||
@Mapping(target = "strategyId", expression = "java(entity.getStrategyId() == null ? null : String.valueOf(entity.getStrategyId()))")
|
||||
PayRouteSceneConfigResult toResult(PayRouteSceneConfig entity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user