diff --git a/build.gradle b/build.gradle index 59bf1a2..af32cdf 100644 --- a/build.gradle +++ b/build.gradle @@ -47,5 +47,6 @@ dependencies { implementation("org.web3j:crypto:4.8.8-android") { exclude group: 'org.slf4j', module: 'slf4j-api' } - + compileOnly("org.projectlombok:lombok:1.18.26") + annotationProcessor("org.projectlombok:lombok:1.18.26") } \ No newline at end of file diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/CreateFileRequest.java b/src/main/java/com/github/zxbu/webdavteambition/model/CreateFileRequest.java index 430d898..de564bd 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/CreateFileRequest.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/CreateFileRequest.java @@ -1,49 +1,12 @@ package com.github.zxbu.webdavteambition.model; +import lombok.Data; + +@Data public class CreateFileRequest { private String check_name_mode = "refuse"; private String drive_id; private String name; private String parent_file_id; private String type; - - public String getCheck_name_mode() { - return check_name_mode; - } - - public void setCheck_name_mode(String check_name_mode) { - this.check_name_mode = check_name_mode; - } - - public String getDrive_id() { - return drive_id; - } - - public void setDrive_id(String drive_id) { - this.drive_id = drive_id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getParent_file_id() { - return parent_file_id; - } - - public void setParent_file_id(String parent_file_id) { - this.parent_file_id = parent_file_id; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/DownloadRequest.java b/src/main/java/com/github/zxbu/webdavteambition/model/DownloadRequest.java index 67c3429..cd02794 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/DownloadRequest.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/DownloadRequest.java @@ -1,31 +1,10 @@ package com.github.zxbu.webdavteambition.model; +import lombok.Data; + +@Data public class DownloadRequest { private String drive_id; private String file_id; private Integer expire_sec = 14400; - - public String getDrive_id() { - return drive_id; - } - - public void setDrive_id(String drive_id) { - this.drive_id = drive_id; - } - - public String getFile_id() { - return file_id; - } - - public void setFile_id(String file_id) { - this.file_id = file_id; - } - - public Integer getExpire_sec() { - return expire_sec; - } - - public void setExpire_sec(Integer expire_sec) { - this.expire_sec = expire_sec; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/FileGetRequest.java b/src/main/java/com/github/zxbu/webdavteambition/model/FileGetRequest.java index 4c13f1a..5beef35 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/FileGetRequest.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/FileGetRequest.java @@ -1,22 +1,9 @@ package com.github.zxbu.webdavteambition.model; +import lombok.Data; + +@Data public class FileGetRequest { private String drive_id; private String file_id; - - public String getDrive_id() { - return drive_id; - } - - public void setDrive_id(String drive_id) { - this.drive_id = drive_id; - } - - public String getFile_id() { - return file_id; - } - - public void setFile_id(String file_id) { - this.file_id = file_id; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/FileListRequest.java b/src/main/java/com/github/zxbu/webdavteambition/model/FileListRequest.java index 7779566..f55520b 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/FileListRequest.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/FileListRequest.java @@ -1,5 +1,8 @@ package com.github.zxbu.webdavteambition.model; +import lombok.Data; + +@Data public class FileListRequest extends Page{ private String drive_id; private Boolean all = false; @@ -8,60 +11,4 @@ public class FileListRequest extends Page{ private String image_url_process = "image/resize,w_1920/format,jpeg"; private String parent_file_id; private String video_thumbnail_process = "video/snapshot,t_0,f_jpg,ar_auto,w_300"; - - public String getDrive_id() { - return drive_id; - } - - public void setDrive_id(String drive_id) { - this.drive_id = drive_id; - } - - public Boolean getAll() { - return all; - } - - public void setAll(Boolean all) { - this.all = all; - } - - public String getFields() { - return fields; - } - - public void setFields(String fields) { - this.fields = fields; - } - - public String getImage_thumbnail_process() { - return image_thumbnail_process; - } - - public void setImage_thumbnail_process(String image_thumbnail_process) { - this.image_thumbnail_process = image_thumbnail_process; - } - - public String getImage_url_process() { - return image_url_process; - } - - public void setImage_url_process(String image_url_process) { - this.image_url_process = image_url_process; - } - - public String getParent_file_id() { - return parent_file_id; - } - - public void setParent_file_id(String parent_file_id) { - this.parent_file_id = parent_file_id; - } - - public String getVideo_thumbnail_process() { - return video_thumbnail_process; - } - - public void setVideo_thumbnail_process(String video_thumbnail_process) { - this.video_thumbnail_process = video_thumbnail_process; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/MoveRequest.java b/src/main/java/com/github/zxbu/webdavteambition/model/MoveRequest.java index 62182aa..b0fa724 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/MoveRequest.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/MoveRequest.java @@ -1,33 +1,10 @@ package com.github.zxbu.webdavteambition.model; -import java.util.List; +import lombok.Data; +@Data public class MoveRequest { private String drive_id; private String file_id; private String to_parent_file_id; - - public String getDrive_id() { - return drive_id; - } - - public void setDrive_id(String drive_id) { - this.drive_id = drive_id; - } - - public String getFile_id() { - return file_id; - } - - public void setFile_id(String file_id) { - this.file_id = file_id; - } - - public String getTo_parent_file_id() { - return to_parent_file_id; - } - - public void setTo_parent_file_id(String to_parent_file_id) { - this.to_parent_file_id = to_parent_file_id; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/MoveRequestId.java b/src/main/java/com/github/zxbu/webdavteambition/model/MoveRequestId.java index 7713c13..b05ef3a 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/MoveRequestId.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/MoveRequestId.java @@ -1,22 +1,9 @@ package com.github.zxbu.webdavteambition.model; +import lombok.Data; + +@Data public class MoveRequestId { private String ccpFileId; private String id; - - public String getCcpFileId() { - return ccpFileId; - } - - public void setCcpFileId(String ccpFileId) { - this.ccpFileId = ccpFileId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/Page.java b/src/main/java/com/github/zxbu/webdavteambition/model/Page.java index 1f67313..536b164 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/Page.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/Page.java @@ -1,40 +1,11 @@ package com.github.zxbu.webdavteambition.model; +import lombok.Data; + +@Data public class Page { private String marker; private int limit; private String order_by; private String order_direction; - - public String getMarker() { - return marker; - } - - public void setMarker(String marker) { - this.marker = marker; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - - public String getOrder_by() { - return order_by; - } - - public void setOrder_by(String order_by) { - this.order_by = order_by; - } - - public String getOrder_direction() { - return order_direction; - } - - public void setOrder_direction(String order_direction) { - this.order_direction = order_direction; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/PathInfo.java b/src/main/java/com/github/zxbu/webdavteambition/model/PathInfo.java index 9674229..4d9c4dc 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/PathInfo.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/PathInfo.java @@ -1,31 +1,10 @@ package com.github.zxbu.webdavteambition.model; +import lombok.Data; + +@Data public class PathInfo { private String path; private String parentPath; private String name; - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public String getParentPath() { - return parentPath; - } - - public void setParentPath(String parentPath) { - this.parentPath = parentPath; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/RefreshUploadUrlRequest.java b/src/main/java/com/github/zxbu/webdavteambition/model/RefreshUploadUrlRequest.java index c7f151f..d1d10fc 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/RefreshUploadUrlRequest.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/RefreshUploadUrlRequest.java @@ -1,42 +1,13 @@ package com.github.zxbu.webdavteambition.model; +import lombok.Data; + import java.util.List; +@Data public class RefreshUploadUrlRequest { private String drive_id; private List part_info_list; private String file_id; private String upload_id; - - public String getDrive_id() { - return drive_id; - } - - public void setDrive_id(String drive_id) { - this.drive_id = drive_id; - } - - public List getPart_info_list() { - return part_info_list; - } - - public void setPart_info_list(List part_info_list) { - this.part_info_list = part_info_list; - } - - public String getFile_id() { - return file_id; - } - - public void setFile_id(String file_id) { - this.file_id = file_id; - } - - public String getUpload_id() { - return upload_id; - } - - public void setUpload_id(String upload_id) { - this.upload_id = upload_id; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/RemoveRequest.java b/src/main/java/com/github/zxbu/webdavteambition/model/RemoveRequest.java index 4cf7785..c8d4065 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/RemoveRequest.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/RemoveRequest.java @@ -1,24 +1,9 @@ package com.github.zxbu.webdavteambition.model; -import java.util.List; +import lombok.Data; +@Data public class RemoveRequest { private String drive_id; private String file_id; - - public String getDrive_id() { - return drive_id; - } - - public void setDrive_id(String drive_id) { - this.drive_id = drive_id; - } - - public String getFile_id() { - return file_id; - } - - public void setFile_id(String file_id) { - this.file_id = file_id; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/RenameRequest.java b/src/main/java/com/github/zxbu/webdavteambition/model/RenameRequest.java index 75ba1f8..1613028 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/RenameRequest.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/RenameRequest.java @@ -1,41 +1,12 @@ package com.github.zxbu.webdavteambition.model; +import lombok.Data; + +@Data public class RenameRequest { //refuse auto_rename private String check_name_mode = "refuse"; private String drive_id; private String name; private String file_id; - - public String getCheck_name_mode() { - return check_name_mode; - } - - public void setCheck_name_mode(String check_name_mode) { - this.check_name_mode = check_name_mode; - } - - public String getDrive_id() { - return drive_id; - } - - public void setDrive_id(String drive_id) { - this.drive_id = drive_id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getFile_id() { - return file_id; - } - - public void setFile_id(String file_id) { - this.file_id = file_id; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/UploadFinalRequest.java b/src/main/java/com/github/zxbu/webdavteambition/model/UploadFinalRequest.java index 8e5064b..f6e09b8 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/UploadFinalRequest.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/UploadFinalRequest.java @@ -1,31 +1,10 @@ package com.github.zxbu.webdavteambition.model; +import lombok.Data; + +@Data public class UploadFinalRequest { private String drive_id; private String file_id; private String upload_id; - - public String getDrive_id() { - return drive_id; - } - - public void setDrive_id(String drive_id) { - this.drive_id = drive_id; - } - - public String getFile_id() { - return file_id; - } - - public void setFile_id(String file_id) { - this.file_id = file_id; - } - - public String getUpload_id() { - return upload_id; - } - - public void setUpload_id(String upload_id) { - this.upload_id = upload_id; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/UploadPreInfo.java b/src/main/java/com/github/zxbu/webdavteambition/model/UploadPreInfo.java index 6765e4e..f555e1b 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/UploadPreInfo.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/UploadPreInfo.java @@ -1,5 +1,8 @@ package com.github.zxbu.webdavteambition.model; +import lombok.Data; + +@Data public class UploadPreInfo { private String ccpParentId; private int chunkCount; @@ -8,60 +11,4 @@ public class UploadPreInfo { private String name; private int size; private String type; - - public int getChunkCount() { - return chunkCount; - } - - public void setChunkCount(int chunkCount) { - this.chunkCount = chunkCount; - } - - public String getContentType() { - return contentType; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } - - public String getDriveId() { - return driveId; - } - - public void setDriveId(String driveId) { - this.driveId = driveId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getSize() { - return size; - } - - public void setSize(int size) { - this.size = size; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getCcpParentId() { - return ccpParentId; - } - - public void setCcpParentId(String ccpParentId) { - this.ccpParentId = ccpParentId; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/UploadPreRequest.java b/src/main/java/com/github/zxbu/webdavteambition/model/UploadPreRequest.java index c569b2e..9762fc3 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/UploadPreRequest.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/UploadPreRequest.java @@ -1,7 +1,10 @@ package com.github.zxbu.webdavteambition.model; +import lombok.Data; + import java.util.List; +@Data public class UploadPreRequest { private String check_name_mode = "refuse"; private String content_hash; @@ -15,112 +18,9 @@ public class UploadPreRequest { private List part_info_list; private String type = "file"; - public String getCheck_name_mode() { - return check_name_mode; - } - - public void setCheck_name_mode(String check_name_mode) { - this.check_name_mode = check_name_mode; - } - - public String getContent_hash() { - return content_hash; - } - - public void setContent_hash(String content_hash) { - this.content_hash = content_hash; - } - - public String getContent_hash_name() { - return content_hash_name; - } - - public void setContent_hash_name(String content_hash_name) { - this.content_hash_name = content_hash_name; - } - - public String getDrive_id() { - return drive_id; - } - - public void setDrive_id(String drive_id) { - this.drive_id = drive_id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getParent_file_id() { - return parent_file_id; - } - - public void setParent_file_id(String parent_file_id) { - this.parent_file_id = parent_file_id; - } - - public String getProof_code() { - return proof_code; - } - - public void setProof_code(String proof_code) { - this.proof_code = proof_code; - } - - public String getProof_version() { - return proof_version; - } - - public void setProof_version(String proof_version) { - this.proof_version = proof_version; - } - - public Long getSize() { - return size; - } - - public void setSize(Long size) { - this.size = size; - } - - public List getPart_info_list() { - return part_info_list; - } - - public void setPart_info_list(List part_info_list) { - this.part_info_list = part_info_list; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - + @Data public static class PartInfo { private Integer part_number; private String upload_url; - - public Integer getPart_number() { - return part_number; - } - - public void setPart_number(Integer part_number) { - this.part_number = part_number; - } - - public String getUpload_url() { - return upload_url; - } - - public void setUpload_url(String upload_url) { - this.upload_url = upload_url; - } } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/result/CreateFileResult.java b/src/main/java/com/github/zxbu/webdavteambition/model/result/CreateFileResult.java index e424f5f..bfdc107 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/result/CreateFileResult.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/result/CreateFileResult.java @@ -1,40 +1,11 @@ package com.github.zxbu.webdavteambition.model.result; +import lombok.Data; + +@Data public class CreateFileResult { private String ccpFileId; private String nodeId; private String name; private String kind; - - public String getCcpFileId() { - return ccpFileId; - } - - public void setCcpFileId(String ccpFileId) { - this.ccpFileId = ccpFileId; - } - - public String getNodeId() { - return nodeId; - } - - public void setNodeId(String nodeId) { - this.nodeId = nodeId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getKind() { - return kind; - } - - public void setKind(String kind) { - this.kind = kind; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/result/TFile.java b/src/main/java/com/github/zxbu/webdavteambition/model/result/TFile.java index 246bc3a..e3cc61a 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/result/TFile.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/result/TFile.java @@ -1,8 +1,9 @@ package com.github.zxbu.webdavteambition.model.result; -import java.util.Date; -import java.util.Objects; +import lombok.Data; +import java.util.Date; +@Data public class TFile { private Date created_at; private String domain_id; @@ -20,132 +21,4 @@ public class TFile { private String url; private Long size; private String download_url; - - public Date getCreated_at() { - return created_at; - } - - public void setCreated_at(Date created_at) { - this.created_at = created_at; - } - - public String getDomain_id() { - return domain_id; - } - - public void setDomain_id(String domain_id) { - this.domain_id = domain_id; - } - - public String getDrive_id() { - return drive_id; - } - - public void setDrive_id(String drive_id) { - this.drive_id = drive_id; - } - - public String getEncrypt_mode() { - return encrypt_mode; - } - - public void setEncrypt_mode(String encrypt_mode) { - this.encrypt_mode = encrypt_mode; - } - - public String getFile_id() { - return file_id; - } - - public void setFile_id(String file_id) { - this.file_id = file_id; - } - - public Boolean getHidden() { - return hidden; - } - - public void setHidden(Boolean hidden) { - this.hidden = hidden; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getParent_file_id() { - return parent_file_id; - } - - public void setParent_file_id(String parent_file_id) { - this.parent_file_id = parent_file_id; - } - - public String getStarred() { - return starred; - } - - public void setStarred(String starred) { - this.starred = starred; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Date getUpdated_at() { - return updated_at; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public Long getSize() { - return size; - } - - public void setSize(Long size) { - this.size = size; - } - - public String getDownload_url() { - return download_url; - } - - public void setDownload_url(String download_url) { - this.download_url = download_url; - } - - public String getFile_name() { - return file_name; - } - - public void setFile_name(String file_name) { - this.file_name = file_name; - } - - public void setUpdated_at(Date updated_at) { - this.updated_at = updated_at; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/result/TFileListResult.java b/src/main/java/com/github/zxbu/webdavteambition/model/result/TFileListResult.java index 0973279..8550f2f 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/result/TFileListResult.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/result/TFileListResult.java @@ -1,24 +1,10 @@ package com.github.zxbu.webdavteambition.model.result; -import java.util.List; +import lombok.Data; +import java.util.List; +@Data public class TFileListResult { private List items; private String next_marker; - - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public String getNext_marker() { - return next_marker; - } - - public void setNext_marker(String next_marker) { - this.next_marker = next_marker; - } } diff --git a/src/main/java/com/github/zxbu/webdavteambition/model/result/UploadPreResult.java b/src/main/java/com/github/zxbu/webdavteambition/model/result/UploadPreResult.java index 957bba9..3e21ca0 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/model/result/UploadPreResult.java +++ b/src/main/java/com/github/zxbu/webdavteambition/model/result/UploadPreResult.java @@ -1,9 +1,10 @@ package com.github.zxbu.webdavteambition.model.result; import com.github.zxbu.webdavteambition.model.UploadPreRequest; +import lombok.Data; import java.util.List; - +@Data public class UploadPreResult { private String file_id; private String file_name; @@ -12,60 +13,4 @@ public class UploadPreResult { private String type; private String upload_id; private List part_info_list; - - public String getFile_id() { - return file_id; - } - - public void setFile_id(String file_id) { - this.file_id = file_id; - } - - public String getFile_name() { - return file_name; - } - - public void setFile_name(String file_name) { - this.file_name = file_name; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public Boolean getRapid_upload() { - return rapid_upload; - } - - public void setRapid_upload(Boolean rapid_upload) { - this.rapid_upload = rapid_upload; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getUpload_id() { - return upload_id; - } - - public void setUpload_id(String upload_id) { - this.upload_id = upload_id; - } - - public List getPart_info_list() { - return part_info_list; - } - - public void setPart_info_list(List part_info_list) { - this.part_info_list = part_info_list; - } }