Skip to content

Commit 81a6502

Browse files
committed
Share the responsibility of the module client
1 parent 6ee858e commit 81a6502

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+857
-130
lines changed

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
}
44

55
dependencies {
6+
implementation project(":utils")
67
implementation "com.squareup.okhttp3:okhttp:${rootProject.ext.okhttpVersion}"
78
testImplementation "com.squareup.okhttp3:mockwebserver:${rootProject.ext.okhttpVersion}"
89
implementation "com.google.code.gson:gson:${rootProject.ext.gsonVersion}"

core/src/main/java/ru/funpay4j/client/FunPayClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
package ru.funpay4j.client;
1616

1717
import ru.funpay4j.client.request.SaveOfferRequest;
18-
import ru.funpay4j.core.exceptions.FunPayApiException;
19-
import ru.funpay4j.core.exceptions.InvalidCsrfTokenOrPHPSESSIDException;
20-
import ru.funpay4j.core.exceptions.InvalidGoldenKeyException;
21-
import ru.funpay4j.core.exceptions.offer.OfferAlreadyRaisedException;
18+
import ru.funpay4j.client.exceptions.FunPayApiException;
19+
import ru.funpay4j.client.exceptions.InvalidCsrfTokenOrPHPSESSIDException;
20+
import ru.funpay4j.client.exceptions.InvalidGoldenKeyException;
21+
import ru.funpay4j.client.exceptions.offer.OfferAlreadyRaisedException;
2222

2323
/**
2424
* Interface for sending thematic requests to FunPay

core/src/main/java/ru/funpay4j/client/FunPayParser.java

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414

1515
package ru.funpay4j.client;
1616

17-
import ru.funpay4j.core.exceptions.FunPayApiException;
18-
import ru.funpay4j.core.exceptions.offer.OfferNotFoundException;
19-
import ru.funpay4j.core.exceptions.lot.LotNotFoundException;
20-
import ru.funpay4j.core.exceptions.user.UserNotFoundException;
21-
import ru.funpay4j.core.objects.CsrfTokenAndPHPSESSID;
17+
import ru.funpay4j.client.exceptions.FunPayApiException;
18+
import ru.funpay4j.client.exceptions.offer.OfferNotFoundException;
19+
import ru.funpay4j.client.exceptions.lot.LotNotFoundException;
20+
import ru.funpay4j.client.exceptions.user.UserNotFoundException;
21+
import ru.funpay4j.client.objects.CsrfTokenAndPHPSESSID;
22+
import ru.funpay4j.client.objects.game.ParsedPromoGame;
23+
import ru.funpay4j.client.objects.lot.ParsedLot;
24+
import ru.funpay4j.client.objects.offer.ParsedOffer;
25+
import ru.funpay4j.client.objects.user.ParsedSellerReview;
26+
import ru.funpay4j.client.objects.user.ParsedUser;
2227
import ru.funpay4j.core.objects.game.PromoGame;
2328
import ru.funpay4j.core.objects.lot.Lot;
2429
import ru.funpay4j.core.objects.offer.Offer;
@@ -42,7 +47,7 @@ public interface FunPayParser {
4247
* @throws FunPayApiException if the other api-related exception
4348
* @throws LotNotFoundException if the lot with id does not found
4449
*/
45-
Lot parseLot(long lotId) throws FunPayApiException, LotNotFoundException;
50+
ParsedLot parseLot(long lotId) throws FunPayApiException, LotNotFoundException;
4651

4752
/**
4853
* Parse promo games
@@ -51,7 +56,7 @@ public interface FunPayParser {
5156
* @return promo games
5257
* @throws FunPayApiException if the other api-related exception
5358
*/
54-
List<PromoGame> parsePromoGames(String query) throws FunPayApiException;
59+
List<ParsedPromoGame> parsePromoGames(String query) throws FunPayApiException;
5560

5661
/**
5762
* Parse offer
@@ -61,7 +66,7 @@ public interface FunPayParser {
6166
* @throws FunPayApiException if the other api-related exception
6267
* @throws OfferNotFoundException if the offer with id does not found
6368
*/
64-
Offer parseOffer(long offerId) throws FunPayApiException, OfferNotFoundException;
69+
ParsedOffer parseOffer(long offerId) throws FunPayApiException, OfferNotFoundException;
6570

6671
/**
6772
* Parse user
@@ -71,7 +76,7 @@ public interface FunPayParser {
7176
* @throws FunPayApiException if the other api-related exception
7277
* @throws UserNotFoundException if the user with id does not found
7378
*/
74-
User parseUser(long userId) throws FunPayApiException, UserNotFoundException;
79+
ParsedUser parseUser(long userId) throws FunPayApiException, UserNotFoundException;
7580

7681
/**
7782
* Parse user authorized
@@ -82,7 +87,7 @@ public interface FunPayParser {
8287
* @throws FunPayApiException if the other api-related exception
8388
* @throws UserNotFoundException if the user with id does not found
8489
*/
85-
User parseUser(String goldenKey, long userId) throws FunPayApiException, UserNotFoundException;
90+
ParsedUser parseUser(String goldenKey, long userId) throws FunPayApiException, UserNotFoundException;
8691

8792
/**
8893
* Parse seller reviews
@@ -93,7 +98,7 @@ public interface FunPayParser {
9398
* @throws FunPayApiException if the other api-related exception
9499
* @throws UserNotFoundException if the user with id does not found/seller
95100
*/
96-
List<SellerReview> parseSellerReviews(long userId, int pages) throws FunPayApiException, UserNotFoundException;
101+
List<ParsedSellerReview> parseSellerReviews(long userId, int pages) throws FunPayApiException, UserNotFoundException;
97102

98103
/**
99104
* Parse seller reviews authorized
@@ -105,7 +110,7 @@ public interface FunPayParser {
105110
* @throws FunPayApiException if the other api-related exception
106111
* @throws UserNotFoundException if the user with id does not found/seller
107112
*/
108-
List<SellerReview> parseSellerReviews(String goldenKey, long userId, int pages) throws FunPayApiException, UserNotFoundException;
113+
List<ParsedSellerReview> parseSellerReviews(String goldenKey, long userId, int pages) throws FunPayApiException, UserNotFoundException;
109114

110115
/**
111116
* Parse seller reviews with stars filter
@@ -117,7 +122,7 @@ public interface FunPayParser {
117122
* @throws FunPayApiException if the other api-related exception
118123
* @throws UserNotFoundException if the user with id does not found/seller
119124
*/
120-
List<SellerReview> parseSellerReviews(long userId, int pages, int starsFilter) throws FunPayApiException, UserNotFoundException;
125+
List<ParsedSellerReview> parseSellerReviews(long userId, int pages, int starsFilter) throws FunPayApiException, UserNotFoundException;
121126

122127
/**
123128
* Parse seller reviews with stars filter authorized
@@ -130,7 +135,7 @@ public interface FunPayParser {
130135
* @throws FunPayApiException if the other api-related exception
131136
* @throws UserNotFoundException if the user with id does not found/seller
132137
*/
133-
List<SellerReview> parseSellerReviews(String goldenKey, long userId, int pages, int starsFilter) throws FunPayApiException, UserNotFoundException;
138+
List<ParsedSellerReview> parseSellerReviews(String goldenKey, long userId, int pages, int starsFilter) throws FunPayApiException, UserNotFoundException;
134139

135140
/**
136141
* Parse csrf-token and PHPSESSID

core/src/main/java/ru/funpay4j/core/exceptions/FunPayApiException.java renamed to core/src/main/java/ru/funpay4j/client/exceptions/FunPayApiException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package ru.funpay4j.core.exceptions;
15+
package ru.funpay4j.client.exceptions;
1616

1717
/**
1818
* Base class for exceptions related to FunPay

core/src/main/java/ru/funpay4j/core/exceptions/InvalidCsrfTokenOrPHPSESSIDException.java renamed to core/src/main/java/ru/funpay4j/client/exceptions/InvalidCsrfTokenOrPHPSESSIDException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package ru.funpay4j.core.exceptions;
15+
package ru.funpay4j.client.exceptions;
1616

1717
/**
1818
* Base class for exception related to the fact that the csrf token or PHPSESSID is invalid

core/src/main/java/ru/funpay4j/core/exceptions/InvalidGoldenKeyException.java renamed to core/src/main/java/ru/funpay4j/client/exceptions/InvalidGoldenKeyException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package ru.funpay4j.core.exceptions;
15+
package ru.funpay4j.client.exceptions;
1616

1717
/**
1818
* Base class for exception related to the fact that the goldenKey is invalid

core/src/main/java/ru/funpay4j/core/exceptions/lot/LotNotFoundException.java renamed to core/src/main/java/ru/funpay4j/client/exceptions/lot/LotNotFoundException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package ru.funpay4j.core.exceptions.lot;
15+
package ru.funpay4j.client.exceptions.lot;
1616

1717
/**
1818
* Base class for exception related to the fact that the lot is not found

core/src/main/java/ru/funpay4j/core/exceptions/offer/OfferAlreadyRaisedException.java renamed to core/src/main/java/ru/funpay4j/client/exceptions/offer/OfferAlreadyRaisedException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package ru.funpay4j.core.exceptions.offer;
15+
package ru.funpay4j.client.exceptions.offer;
1616

1717
/**
1818
* Base class for exception related to the fact that the offer already raised

core/src/main/java/ru/funpay4j/core/exceptions/offer/OfferNotFoundException.java renamed to core/src/main/java/ru/funpay4j/client/exceptions/offer/OfferNotFoundException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package ru.funpay4j.core.exceptions.offer;
15+
package ru.funpay4j.client.exceptions.offer;
1616

1717
/**
1818
* Base class for exception related to the fact that the offer is not found

0 commit comments

Comments
 (0)