mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-05 05:07:46 +08:00
🎨 优化部分代码
This commit is contained in:
parent
060576148b
commit
7bf811aa57
@ -1,11 +1,16 @@
|
||||
package me.chanjar.weixin.common.util.fs;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Base64;
|
||||
|
||||
import static org.apache.commons.io.FileUtils.openOutputStream;
|
||||
|
||||
public class FileUtils {
|
||||
|
||||
/**
|
||||
@ -20,10 +25,16 @@ public class FileUtils {
|
||||
File resultFile = File.createTempFile(name, '.' + ext, tmpDirFile);
|
||||
|
||||
resultFile.deleteOnExit();
|
||||
org.apache.commons.io.FileUtils.copyToFile(inputStream, resultFile);
|
||||
copyToFile(inputStream, resultFile);
|
||||
return resultFile;
|
||||
}
|
||||
|
||||
private static void copyToFile(final InputStream source, final File destination) throws IOException {
|
||||
try (InputStream in = source; OutputStream out = openOutputStream(destination)) {
|
||||
IOUtils.copy(in, out);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建临时文件.
|
||||
*
|
||||
|
@ -18,10 +18,10 @@ public class ContentValue implements Serializable {
|
||||
private String text;
|
||||
|
||||
@SerializedName("new_number")
|
||||
private Double newNumber;
|
||||
private String newNumber;
|
||||
|
||||
@SerializedName("new_money")
|
||||
private Double newMoney;
|
||||
private String newMoney;
|
||||
|
||||
private ContentValue.Date date;
|
||||
|
||||
@ -43,7 +43,7 @@ public class ContentValue implements Serializable {
|
||||
private String type;
|
||||
|
||||
@SerializedName("s_timestamp")
|
||||
private Double timestamp;
|
||||
private String timestamp;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
@ -14,6 +14,7 @@ import java.util.List;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class ApplymentsStatusResult implements Serializable {
|
||||
private static final long serialVersionUID = 1488464536143984732L;
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:申请状态
|
||||
|
@ -17,6 +17,7 @@ import java.util.List;
|
||||
@NoArgsConstructor
|
||||
public class CombineTransactionsNotifyResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4710926828683593250L;
|
||||
/**
|
||||
* 源数据
|
||||
*/
|
||||
|
@ -16,6 +16,7 @@ import java.util.List;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class CombineTransactionsRequest implements Serializable {
|
||||
private static final long serialVersionUID = -1242741645939606441L;
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:合单商户appid
|
||||
|
@ -12,7 +12,7 @@ import java.io.Serializable;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class NotifyResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 341873114458149365L;
|
||||
@SerializedName(value = "id")
|
||||
private String id;
|
||||
|
||||
|
@ -16,7 +16,7 @@ import java.util.List;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class PartnerTransactionsNotifyResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6602962275015706689L;
|
||||
/**
|
||||
* 源数据
|
||||
*/
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class PartnerTransactionsRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1550405819444680465L;
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:服务商公众号ID
|
||||
|
@ -12,7 +12,7 @@ import java.io.Serializable;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SignatureHeader implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6958015499416059949L;
|
||||
/**
|
||||
* 时间戳
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@ import java.security.PrivateKey;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class TransactionsResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1760592667519950149L;
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:预支付交易会话标识 (APP支付、JSAPI支付 会返回)
|
||||
|
@ -9,12 +9,22 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum TradeTypeEnum {
|
||||
|
||||
APP("/v3/combine-transactions/app","/v3/pay/partner/transactions/app"),
|
||||
JSAPI("/v3/combine-transactions/jsapi","/v3/pay/partner/transactions/jsapi"),
|
||||
NATIVE("/v3/combine-transactions/native","/v3/pay/partner/transactions/native"),
|
||||
MWEB("/v3/combine-transactions/h5","/v3/pay/partner/transactions/h5")
|
||||
;
|
||||
/**
|
||||
* APP
|
||||
*/
|
||||
APP("/v3/combine-transactions/app", "/v3/pay/partner/transactions/app"),
|
||||
/**
|
||||
* JSAPI
|
||||
*/
|
||||
JSAPI("/v3/combine-transactions/jsapi", "/v3/pay/partner/transactions/jsapi"),
|
||||
/**
|
||||
* NATIVE
|
||||
*/
|
||||
NATIVE("/v3/combine-transactions/native", "/v3/pay/partner/transactions/native"),
|
||||
/**
|
||||
* MWEB
|
||||
*/
|
||||
MWEB("/v3/combine-transactions/h5", "/v3/pay/partner/transactions/h5");
|
||||
|
||||
/**
|
||||
* 合单url
|
||||
|
Loading…
Reference in New Issue
Block a user