package com.ruoyi.shop.util;
|
|
/**
|
* @ClassName WxUploadUtils
|
* @Description TODO
|
* @Author jqs
|
* @Date 2023/6/19 11:55
|
* @Version 1.0
|
*/
|
public class WxUploadUtils {
|
|
/*String filePath = "/your/home/hellokitty.png";
|
URI uri = new URI("https://api.mch.weixin.qq.com/v3/merchant/media/upload");
|
File file = new File(filePath);
|
|
|
FileInputStream ins1 = new FileInputStream(file)) {
|
String sha256 = DigestUtils.sha256Hex(ins1);
|
try (InputStream ins2 = new FileInputStream(file)) {
|
HttpPost request = new WechatPayUploadHttpPost.Builder(uri)
|
.withImage(file.getName(), sha256, ins2)
|
.build();
|
CloseableHttpResponse response1 = httpClient.execute(request);
|
}
|
}*/
|
}
|