|
@@ -9,6 +9,7 @@ import cn.nosum.wx.cp.config.WxCpConfiguration;
|
|
|
import cn.nosum.wx.cp.entity.message.WxCpMessage;
|
|
|
import cn.nosum.wx.cp.entity.message.WxCpMessageSendResult;
|
|
|
import lombok.SneakyThrows;
|
|
|
+import org.apache.commons.io.IOUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -16,6 +17,8 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import java.io.*;
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
+import static org.apache.commons.io.FileUtils.openOutputStream;
|
|
|
+
|
|
|
/**
|
|
|
* 企业微信消息推送.
|
|
|
*
|
|
@@ -43,9 +46,8 @@ public class MessageController {
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/download")
|
|
|
- public void download(Integer appId,String mediaId) throws WxErrorException, FileNotFoundException {
|
|
|
+ public void download(Integer appId,String mediaId) throws WxErrorException, IOException {
|
|
|
OutputStream download = WxCpConfiguration.getCpService(appId).getMediaService().download(mediaId);
|
|
|
- File src = new File("/Users/huanghuijie/Downloads/Snipaste_2021-08-30_22-59-43.png");
|
|
|
- FileOutputStream fileOutputStream = new FileOutputStream(src);
|
|
|
+ return;
|
|
|
}
|
|
|
}
|