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