YqMerchantConfigDTOConvert.java
4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package cn.com.glsx.dj.smartcarlife.convert;
import cn.com.glsx.dj.smartcarlife.dto.YqMerchantConfigDTO;
import cn.com.glsx.dj.smartcarlife.dto.YqMerchantConfigUpdatePartnerMerchantReqDTO;
import cn.com.glsx.dj.smartcarlife.request.smartcarlife.YqMerchantConfigSearchRequest;
import cn.com.glsx.dj.smartcarlife.request.smartcarlife.YqMerchantConfigUpdatePartnerMerchantRequest;
import cn.com.glsx.dj.smartcarlife.request.smartcarlife.YqMerchantConfigUpdateRequest;
import cn.com.glsx.dj.smartcarlife.request.smartcarlife.serviceMerchant.ServiceMerchantRelateQrcodeRequest;
import cn.com.glsx.dj.smartcarlife.response.smartcarlife.YqMerchantConfigDetailResponse;
import cn.com.glsx.dj.smartcarlife.response.smartcarlife.YqMerchantConfigPageResponse;
import cn.com.glsx.dj.smartcarlife.response.smartcarlife.YqMerchantConfigUpdateResponse;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
@Mapper
public interface YqMerchantConfigDTOConvert {
YqMerchantConfigDTOConvert INSTANCE = Mappers.getMapper(YqMerchantConfigDTOConvert.class);
@Mappings({
@Mapping(source = "yqMerchantId",target = "merchantId"),
@Mapping(target = "supportPayType", expression = "java(cn.com.glsx.dj.smartcarlife.convert.helper.YqMerchantConfigDTOConvertHelper.getSupportPayType(sourceEntity.getSupportPayTypes()))"),
@Mapping(source = "businessModel",target = "businessModel")
})
YqMerchantConfigDTO fromYqMerchantConfigUpdateRequest(YqMerchantConfigUpdateRequest sourceEntity);
/**
* 转换更新主服务商请求
*
* @param sourceEntity ROP请求
* @return 更新主服务商请求DTO
*/
YqMerchantConfigUpdatePartnerMerchantReqDTO fromYqMerchantConfigUpdatePartnerMerchantRequest(
YqMerchantConfigUpdatePartnerMerchantRequest sourceEntity);
@Mappings({
@Mapping(source = "merchantId",target = "yqMerchantId"),
@Mapping(target = "supportPayTypes", expression = "java(cn.com.glsx.dj.smartcarlife.convert.helper.YqMerchantConfigDTOConvertHelper.getSupportPayTypes(sourceEntity.getSupportPayType()))")
})
YqMerchantConfigUpdateResponse toYqMerchantConfigUpdateResponse(YqMerchantConfigDTO sourceEntity);
@Mappings({
@Mapping(source = "merchantId",target = "yqMerchantId"),
@Mapping(source = "workWechatQrcode",target = "workWechatQrcode"),
@Mapping(target = "supportPayTypes", expression = "java(cn.com.glsx.dj.smartcarlife.convert.helper.YqMerchantConfigDTOConvertHelper.getSupportPayTypes(sourceEntity.getSupportPayType()))"),
@Mapping(source = "qrcodeType", target = "qrcodeType"),
@Mapping(target = "loginControlList", expression = "java(cn.com.glsx.dj.smartcarlife.convert.helper.YqMerchantConfigDTOConvertHelper.getloginControlList(sourceEntity.getLoginControl()))")
})
YqMerchantConfigDetailResponse toYqMerchantConfigDetailResponse(YqMerchantConfigDTO sourceEntity);
@Mappings({
@Mapping(source = "merchantId",target = "yqMerchantId"),
@Mapping(source = "yqMerchant.merchantName",target = "yqMerchantName"),
@Mapping(source = "yqMerchant.accountName",target = "accountName"),
@Mapping(source = "yqMerchant.merchantType",target = "merchantType"),
@Mapping(source = "yqMerchant.paymentChannelId",target = "paymentChannelId"),
@Mapping(target = "supportPayTypes", expression = "java(cn.com.glsx.dj.smartcarlife.convert.helper.YqMerchantConfigDTOConvertHelper.getSupportPayTypes(sourceEntity.getSupportPayType()))")
})
YqMerchantConfigPageResponse toYqMerchantConfigPageResponse(YqMerchantConfigDTO sourceEntity);
@Mappings({
@Mapping(source = "yqMerchantId",target = "merchantId"),
@Mapping(source = "yqMerchantName",target = "merchantName")
})
YqMerchantConfigDTO fromYqMerchantConfigSearchRequest(YqMerchantConfigSearchRequest sourceEntity);
@Mappings({
@Mapping(source = "yqMerchantId",target = "merchantId"),
@Mapping(source = "imgUrl",target = "workWechatQrcode"),
@Mapping(source = "qrcodeType", target = "qrcodeType")
})
YqMerchantConfigDTO fromYqMerchantConfigServiceMerchantRelateQrcodeRequest(ServiceMerchantRelateQrcodeRequest sourceEntity);
}