mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
🆕 #2665【企业微信】增加微盘文件权限相关接口
This commit is contained in:
@@ -249,6 +249,36 @@ public interface WxCpOaWeDriveService {
|
||||
*/
|
||||
WxCpBaseResp fileAclDel(@NonNull WxCpFileAclDelRequest request) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 分享设置
|
||||
* 该接口用于文件的分享设置。
|
||||
* <p>
|
||||
* 请求方式:POST(HTTPS)
|
||||
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_setting?access_token=ACCESS_TOKEN
|
||||
*
|
||||
* @param userId
|
||||
* @param fileId
|
||||
* @param authScope
|
||||
* @param auth
|
||||
* @return
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
WxCpBaseResp fileSetting(@NonNull String userId, @NonNull String fileId, @NonNull Integer authScope, Integer auth) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取分享链接
|
||||
* 该接口用于获取文件的分享链接。
|
||||
* <p>
|
||||
* 请求方式:POST(HTTPS)
|
||||
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_share?access_token=ACCESS_TOKEN
|
||||
*
|
||||
* @param userId
|
||||
* @param fileId
|
||||
* @return
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
WxCpFileShare fileShare(@NonNull String userId, @NonNull String fileId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 文件信息
|
||||
* 该接口用于获取指定文件的信息。
|
||||
|
||||
@@ -167,6 +167,30 @@ public class WxCpOaWeDriveServiceImpl implements WxCpOaWeDriveService {
|
||||
return WxCpBaseResp.fromJson(responseContent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxCpBaseResp fileSetting(@NonNull String userId, @NonNull String fileId, @NonNull Integer authScope, Integer auth) throws WxErrorException {
|
||||
String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(FILE_SETTING);
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("userid", userId);
|
||||
jsonObject.addProperty("fileid", fileId);
|
||||
jsonObject.addProperty("auth_scope", authScope);
|
||||
if (auth != null) {
|
||||
jsonObject.addProperty("auth", auth);
|
||||
}
|
||||
String responseContent = this.cpService.post(apiUrl, jsonObject.toString());
|
||||
return WxCpBaseResp.fromJson(responseContent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxCpFileShare fileShare(@NonNull String userId, @NonNull String fileId) throws WxErrorException {
|
||||
String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(FILE_SHARE);
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("userid", userId);
|
||||
jsonObject.addProperty("fileid", fileId);
|
||||
String responseContent = this.cpService.post(apiUrl, jsonObject.toString());
|
||||
return WxCpFileShare.fromJson(responseContent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxCpFileInfo fileInfo(@NonNull String userId, @NonNull String fileId) throws WxErrorException {
|
||||
String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(FILE_INFO);
|
||||
|
||||
Reference in New Issue
Block a user