From 6fb44f4051509f66cc887d18469e2947e3702c11 Mon Sep 17 00:00:00 2001 From: guang <guang@guang.com> Date: 星期二, 01 八月 2023 15:13:20 +0800 Subject: [PATCH] 增加企业微盘操作工具类 --- src/main/java/com/hx/mp/util/CorpMpSpaceUtil.java | 14 ++++++++++++++ src/main/java/com/hx/api/CorpMpSpaceApi.java | 14 ++++++++++++++ 2 files changed, 28 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/hx/api/CorpMpSpaceApi.java b/src/main/java/com/hx/api/CorpMpSpaceApi.java index 470671d..fa97f08 100644 --- a/src/main/java/com/hx/api/CorpMpSpaceApi.java +++ b/src/main/java/com/hx/api/CorpMpSpaceApi.java @@ -179,4 +179,18 @@ } ) JSONObject fileDelete(@DataVariable("accessToken") String accessToken, @JSONBody String param); + + /** + * 鑾峰彇涓嬭浇璺緞 + * @param accessToken + * @param param + * @return + */ + @Post( + url = "https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_download?access_token=${accessToken}", + headers = { + "Content-Type: application/json" + } + ) + JSONObject getDownloadUrl(@DataVariable("accessToken") String accessToken, @JSONBody String param); } diff --git a/src/main/java/com/hx/mp/util/CorpMpSpaceUtil.java b/src/main/java/com/hx/mp/util/CorpMpSpaceUtil.java index eda8dd9..22bb5c9 100644 --- a/src/main/java/com/hx/mp/util/CorpMpSpaceUtil.java +++ b/src/main/java/com/hx/mp/util/CorpMpSpaceUtil.java @@ -221,4 +221,18 @@ return corpMpSpaceApi.fileUploadFinish(accessToken, param.toJSONString()); } + + /** + * 鑾峰彇涓嬭浇璺緞 + * @param corpMpSpaceApi + * @param accessToken + * @param fileId + * @return + */ + public static JSONObject getDownloadUrl(CorpMpSpaceApi corpMpSpaceApi, String accessToken, String fileId){ + JSONObject param = new JSONObject(); + param.put("fileid", fileId); + + return corpMpSpaceApi.getDownloadUrl(accessToken, param.toJSONString()); + } } -- Gitblit v1.8.0