Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions client/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
plugins {
id 'java'
}

dependencies {
implementation project(":utils")
implementation "com.squareup.okhttp3:okhttp:${rootProject.ext.okhttpVersion}"
testImplementation "com.squareup.okhttp3:mockwebserver:${rootProject.ext.okhttpVersion}"
implementation "com.google.code.gson:gson:${rootProject.ext.gsonVersion}"
implementation "org.jsoup:jsoup:${rootProject.ext.jsoupVersion}"
annotationProcessor "org.projectlombok:lombok:${rootProject.ext.lombokVersion}"
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

tasks.withType(Javadoc).configureEach {
failOnError = true
options.addStringOption('Xdoclint:all', '-quiet')
options.addBooleanOption('Xwerror', true)
}

tasks.named("build") {
dependsOn(javadoc)
}

test {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
* limitations under the License.
*/

package ru.funpay4j.client;
package ru.funpay4j.client.client;

import ru.funpay4j.client.request.SaveOfferRequest;
import ru.funpay4j.core.exceptions.FunPayApiException;
import ru.funpay4j.core.exceptions.InvalidCsrfTokenOrPHPSESSIDException;
import ru.funpay4j.core.exceptions.InvalidGoldenKeyException;
import ru.funpay4j.core.exceptions.offer.OfferAlreadyRaisedException;
import ru.funpay4j.client.exceptions.FunPayApiException;
import ru.funpay4j.client.exceptions.InvalidCsrfTokenOrPHPSESSIDException;
import ru.funpay4j.client.exceptions.InvalidGoldenKeyException;
import ru.funpay4j.client.exceptions.offer.OfferAlreadyRaisedException;

/**
* Interface for sending thematic requests to FunPay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@
* limitations under the License.
*/

package ru.funpay4j.client.okhttp;
package ru.funpay4j.client.client;

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import lombok.NonNull;
import okhttp3.*;
import ru.funpay4j.client.FunPayClient;
import ru.funpay4j.client.request.SaveOfferRequest;
import ru.funpay4j.core.exceptions.FunPayApiException;
import ru.funpay4j.core.exceptions.InvalidCsrfTokenOrPHPSESSIDException;
import ru.funpay4j.core.exceptions.InvalidGoldenKeyException;
import ru.funpay4j.core.exceptions.offer.OfferAlreadyRaisedException;
import ru.funpay4j.client.exceptions.FunPayApiException;
import ru.funpay4j.client.exceptions.InvalidCsrfTokenOrPHPSESSIDException;
import ru.funpay4j.client.exceptions.InvalidGoldenKeyException;
import ru.funpay4j.client.exceptions.offer.OfferAlreadyRaisedException;

import java.io.IOException;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package ru.funpay4j.core.exceptions;
package ru.funpay4j.client.exceptions;

/**
* Base class for exceptions related to FunPay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package ru.funpay4j.core.exceptions;
package ru.funpay4j.client.exceptions;

/**
* Base class for exception related to the fact that the csrf token or PHPSESSID is invalid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package ru.funpay4j.core.exceptions;
package ru.funpay4j.client.exceptions;

/**
* Base class for exception related to the fact that the goldenKey is invalid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package ru.funpay4j.core.exceptions.lot;
package ru.funpay4j.client.exceptions.lot;

/**
* Base class for exception related to the fact that the lot is not found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package ru.funpay4j.core.exceptions.offer;
package ru.funpay4j.client.exceptions.offer;

/**
* Base class for exception related to the fact that the offer already raised
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package ru.funpay4j.core.exceptions.offer;
package ru.funpay4j.client.exceptions.offer;

/**
* Base class for exception related to the fact that the offer is not found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package ru.funpay4j.core.exceptions.user;
package ru.funpay4j.client.exceptions.user;

/**
* Base class for exception related to the fact that the user is not found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package ru.funpay4j.core.objects;
package ru.funpay4j.client.objects;

import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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 ru.funpay4j.client.objects.game;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.util.List;

/**
* This object represents the parsed FunPay promo game
*
* @author panic08
* @since 1.0.6
*/
@Data
@AllArgsConstructor
@Builder
public class ParsedPromoGame {
private long lotId;

private String title;

private List<ParsedPromoGameCounter> promoGameCounters;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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 ru.funpay4j.client.objects.game;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

/**
* This object represents the parsed FunPay promo game counter
*
* @author panic08
* @since 1.0.6
*/
@Data
@AllArgsConstructor
@Builder
public class ParsedPromoGameCounter {
private long lotId;

private String title;
}
45 changes: 45 additions & 0 deletions client/src/main/java/ru/funpay4j/client/objects/lot/ParsedLot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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 ru.funpay4j.client.objects.lot;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import ru.funpay4j.client.objects.offer.ParsedPreviewOffer;

import java.util.List;

/**
* This object represents the parsed FunPay lot
*
* @author panic08
* @since 1.0.6
*/
@Data
@AllArgsConstructor
@Builder
public class ParsedLot {
private long id;

private long gameId;

private String title;

private String description;

private List<ParsedLotCounter> lotCounters;

private List<ParsedPreviewOffer> previewOffers;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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 ru.funpay4j.client.objects.lot;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

/**
* This object represents the parsed FunPay lot counter
*
* @author panic08
* @since 1.0.6
*/
@Data
@AllArgsConstructor
@Builder
public class ParsedLotCounter {
private long lotId;

private String param;

private int counter;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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 ru.funpay4j.client.objects.offer;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import ru.funpay4j.client.objects.user.ParsedPreviewSeller;

import java.util.List;
import java.util.Map;

/**
* This object represents the parsed FunPay offer
*
* @author panic08
* @since 1.0.6
*/
@Data
@AllArgsConstructor
@Builder
public class ParsedOffer {
private long id;

private String shortDescription;

private String detailedDescription;

private Map<String, String> parameters;

private double price;

private List<String> attachmentLinks;

private boolean isAutoDelivery;

private ParsedPreviewSeller seller;
}
Loading