jiangqs
2023-06-19 cd8d65c1e5378bddded25cad300f34024ba136ba
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
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);
        }
    }*/
}