9 changed files with 89 additions and 19 deletions
Unified View
Diff Options
-
5dating-agency-mall-server/pom.xml
-
7dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/paymentchannelorder/user/PaymentChannelOrderUserCommandController.java
-
13dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/paymentchannelorder/user/assembler/ThirdPartyFieldAssembler.java
-
10dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/paymentchannelorder/user/request/PrePayThirdPartyDto.java
-
27dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/paymentchannelorder/user/request/ThirdPartyField.java
-
13dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/paymentchannelorder/user/request/ThirdPartyFieldDto.java
-
8dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/paymentchannelorder/PaymentChannelOrderApplicationService.java
-
4dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/paymentchannelorder/processor/IChannelPayService.java
-
21dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/paymentchannelorder/processor/wechat/WeChatPayProcessor.java
@ -0,0 +1,13 @@ |
|||||
|
package com.qniao.dam.api.command.paymentchannelorder.user.assembler; |
||||
|
|
||||
|
import com.qniao.dam.api.command.paymentchannelorder.user.request.ThirdPartyField; |
||||
|
import com.qniao.dam.api.command.paymentchannelorder.user.request.ThirdPartyFieldDto; |
||||
|
import com.qniao.framework.utils.TypeConvertUtils; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public abstract class ThirdPartyFieldAssembler { |
||||
|
public static List<ThirdPartyField> from(List<ThirdPartyFieldDto> source) { |
||||
|
return TypeConvertUtils.convert(source, ThirdPartyField.class); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
package com.qniao.dam.api.command.paymentchannelorder.user.request; |
||||
|
|
||||
|
import cn.hutool.core.text.StrFormatter; |
||||
|
import com.qniao.framework.exception.BizException; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Objects; |
||||
|
|
||||
|
@Data |
||||
|
public class ThirdPartyField { |
||||
|
|
||||
|
private String key; |
||||
|
|
||||
|
private String value; |
||||
|
|
||||
|
public static ThirdPartyField findFieldByKey(String specifiedKey, List<ThirdPartyField> fieldList) { |
||||
|
return fieldList.stream().filter(f -> Objects.equals(f.getKey(), specifiedKey)).findFirst().orElseThrow(() -> new BizException(StrFormatter.format("认证字段[{}]不存在", specifiedKey))); |
||||
|
} |
||||
|
|
||||
|
public static String findFiledValueByKey(String specifiedKey, List<ThirdPartyField> fieldList) { |
||||
|
return findFieldByKey(specifiedKey, fieldList).getValue(); |
||||
|
} |
||||
|
|
||||
|
public static final String JS_CODE = "jsCode"; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.qniao.dam.api.command.paymentchannelorder.user.request; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
@Data |
||||
|
public class ThirdPartyFieldDto { |
||||
|
@NotNull(message = "关键字不能为空") |
||||
|
private String key; |
||||
|
|
||||
|
private String value; |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save