From 6eaeadb11d56dc4d72ec24a6fde3a1487233334f Mon Sep 17 00:00:00 2001 From: lensferno Date: Fri, 31 Mar 2023 16:40:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BE=E4=B9=A6=E9=A6=86?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E7=9A=84=E4=B8=80=E4=BA=9B=E6=99=BA=E9=9A=9C?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../linghang/mywust/core/api/LibraryUrls.java | 2 +- .../library/LibraryRequestFactory.java | 2 +- .../service/library/LibraryApiService.java | 22 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/mywust-core/src/main/java/cn/linghang/mywust/core/api/LibraryUrls.java b/mywust-core/src/main/java/cn/linghang/mywust/core/api/LibraryUrls.java index 8c4bbc9..79a562c 100644 --- a/mywust-core/src/main/java/cn/linghang/mywust/core/api/LibraryUrls.java +++ b/mywust-core/src/main/java/cn/linghang/mywust/core/api/LibraryUrls.java @@ -13,7 +13,7 @@ public class LibraryUrls { public static final String LIBRARY_LOAN_HISTORY_API = "https://libsys.wust.edu.cn/meta-local/opac/users/loan_hists?page=1&pageSize=100"; public static final String LIBRARY_OVERDUE_SOON_API = "https://libsys.wust.edu.cn/meta-local/opac/users/overdue_soon"; - public static final String LIBRARY_BOOK_INFO_API = "https://libsys.wust.edu.cn/meta-local/opac/bibs/%s/holdings"; + public static final String LIBRARY_BOOK_INFO_API = "https://libsys.wust.edu.cn/meta-local/opac/bibs/%s/infos"; public static final String LIBRARY_BOOK_COVER_IMAGE_API = "https://libsys.wust.edu.cn/meta-local/opac/search/extend/"; diff --git a/mywust-core/src/main/java/cn/linghang/mywust/core/request/factory/library/LibraryRequestFactory.java b/mywust-core/src/main/java/cn/linghang/mywust/core/request/factory/library/LibraryRequestFactory.java index 46ca438..223302d 100644 --- a/mywust-core/src/main/java/cn/linghang/mywust/core/request/factory/library/LibraryRequestFactory.java +++ b/mywust-core/src/main/java/cn/linghang/mywust/core/request/factory/library/LibraryRequestFactory.java @@ -25,7 +25,7 @@ public class LibraryRequestFactory extends RequestFactory { } public static HttpRequest bookSearchRequest(String keyword, int page, int pageSize) { - return bookSearchRequest(new SearchRequest(keyword, page, pageSize)); + return bookSearchRequest(new SearchRequest(keyword, pageSize, page)); } public static HttpRequest bookSearchRequest(SearchRequest request) { diff --git a/mywust-core/src/main/java/cn/linghang/mywust/core/request/service/library/LibraryApiService.java b/mywust-core/src/main/java/cn/linghang/mywust/core/request/service/library/LibraryApiService.java index cd56803..7803ffb 100644 --- a/mywust-core/src/main/java/cn/linghang/mywust/core/request/service/library/LibraryApiService.java +++ b/mywust-core/src/main/java/cn/linghang/mywust/core/request/service/library/LibraryApiService.java @@ -21,46 +21,46 @@ public class LibraryApiService extends LibraryApiServiceBase { HttpResponse response = requester.post(request); checkResponse(response); - return request.getStringData(); + return response.getStringBody(); } public String getBookDetail(String bookId) throws ApiException, IOException { HttpRequest request = LibraryRequestFactory.bookInfoRequest(bookId); - HttpResponse response = requester.post(request); + HttpResponse response = requester.get(request); checkResponse(response); - return request.getStringData(); + return response.getStringBody(); } public String getBookCoverImageUrl(String isbn) throws ApiException, IOException { HttpRequest request = LibraryRequestFactory.bookCoverImageUrlRequest(isbn); - HttpResponse response = requester.post(request); + HttpResponse response = requester.get(request); checkResponse(response); - return request.getStringData(); + return response.getStringBody(); } public String getOverdueSoon(String cookie) throws ApiException, IOException { HttpRequest request = LibraryRequestFactory.overdueSoonRequest(cookie); - HttpResponse response = requester.post(request); + HttpResponse response = requester.get(request); checkResponse(response); - return request.getStringData(); + return response.getStringBody(); } public String getCurrentLoan(String cookie) throws ApiException, IOException { HttpRequest request = LibraryRequestFactory.currentLoanRequest(cookie); - HttpResponse response = requester.post(request); + HttpResponse response = requester.get(request); checkResponse(response); - return request.getStringData(); + return response.getStringBody(); } public String getLoanHistory(String cookie) throws ApiException, IOException { HttpRequest request = LibraryRequestFactory.loanHistoryRequest(cookie); - HttpResponse response = requester.post(request); + HttpResponse response = requester.get(request); checkResponse(response); - return request.getStringData(); + return response.getStringBody(); } } \ No newline at end of file