-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
798361f
commit ca070a6
Showing
16 changed files
with
252 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
rx-wecom-sdk/src/main/java/cn/felord/reactive/api/InternalFileManagerApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2023. felord.cn | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* Website: | ||
* https://felord.cn | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package cn.felord.reactive.api; | ||
|
||
import cn.felord.domain.wedrive.FileDownloadResponse; | ||
import cn.felord.domain.wedrive.FileId; | ||
import cn.felord.domain.wedrive.SelectedTicket; | ||
import io.reactivex.rxjava3.core.Single; | ||
import retrofit2.http.Body; | ||
import retrofit2.http.POST; | ||
|
||
/** | ||
* The type File manager api. | ||
* | ||
* @author dax | ||
* @since 2023 /3/17 15:02 | ||
*/ | ||
interface InternalFileManagerApi { | ||
|
||
/** | ||
* 下载文件(通过文件fileid) | ||
* | ||
* @param fileid the fileid | ||
* @return the file download response | ||
*/ | ||
@POST("wedrive/file_download") | ||
Single<FileDownloadResponse> getFileUrlByFileId(@Body FileId fileid); | ||
|
||
/** | ||
* 下载文件(微盘和文件选择器jsapi返回的selectedTicket) | ||
* <p> | ||
* 返回的下载链接和cookie值,通过下载链接带上{@code cookieName=cookieValue}Cookie请求头下载 | ||
* | ||
* @param selectedTicket the selected ticket | ||
* @return the file download response | ||
*/ | ||
@POST("wedrive/file_download") | ||
Single<FileDownloadResponse> getFileUrlBySelectedTicket(@Body SelectedTicket selectedTicket); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
wecom-objects/src/main/java/cn/felord/domain/wedrive/BufferSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2023. felord.cn | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* Website: | ||
* https://felord.cn | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package cn.felord.domain.wedrive; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import okhttp3.MediaType; | ||
import okio.BufferedSource; | ||
|
||
/** | ||
* @author dax | ||
* @since 2023/6/26 | ||
*/ | ||
@AllArgsConstructor | ||
@Getter | ||
public class BufferSource { | ||
private final MediaType contentType; | ||
private final long contentLength; | ||
private final BufferedSource source; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.