1
0
mirror of synced 2025-12-28 22:31:14 +08:00

🆕 #2651【企业微信】新增微盘文件管理接口

This commit is contained in:
0katekate0
2022-05-19 14:06:39 +08:00
committed by GitHub
parent 5da9fb30aa
commit a6d4b6e6ab
8 changed files with 393 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
package me.chanjar.weixin.cp.api;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
@@ -47,6 +48,33 @@ public class WxCpOaWeDriveServiceTest {
String fileId = "s.ww45d3e188865aca30.652091685u4h_f.652344507ysDL";
String fileId2 = "s.ww45d3e188865aca30.652091685u4h_f.652696024TU4P";
/**
* 删除文件
*/
ArrayList<String> fileIds = Lists.newArrayList();
fileIds.add(fileId);
WxCpBaseResp fileDelete = cpService.getOaWeDriveService().fileDelete(uId, fileIds);
log.info("删除文件数据为:{}", fileDelete.toJson());
/**
* 文件信息
*/
WxCpFileInfo fileInfo = cpService.getOaWeDriveService().fileInfo(uId, fileId);
log.info("fileInfo数据为{}", fileInfo.toJson());
/**
* 移动文件
*/
WxCpFileMoveRequest fileMoveRequest = new WxCpFileMoveRequest();
fileMoveRequest.setUserId(uId);
fileMoveRequest.setFatherId(spId);
fileMoveRequest.setReplace(true);
fileMoveRequest.setFileId(new String[]{fileId});
WxCpFileMove fileMove = cpService.getOaWeDriveService().fileMove(fileMoveRequest);
log.info("fileMove数据为{}", fileMove.toJson());
/**
* 新建文件/微文档
*/