Skip to content
This repository was archived by the owner on Apr 9, 2024. It is now read-only.

Commit 265005d

Browse files
committed
Added new endpoint: v2/shop/br/combined
1 parent f102ea9 commit 265005d

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

src/main/java/com/thoo/api/endpoints/ShopEndpoint.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,12 @@ public FortniteResponse<BaseModel<BrShop>> getShop(Language language){
2121
return HttpUtils.parse(service.shop(language.code));
2222
}
2323

24+
public FortniteResponse<BaseModel<BrShop>> getShopCombined(){
25+
return getShopCombined(defaultLanguage);
26+
}
27+
28+
public FortniteResponse<BaseModel<BrShop>> getShopCombined(Language language){
29+
return HttpUtils.parse(service.shop(language.code));
30+
}
31+
2432
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.thoo.api.model;
2+
3+
import org.jetbrains.annotations.Nullable;
4+
5+
import java.util.Date;
6+
7+
public class BrShopCombined {
8+
9+
public String hash;
10+
public Date date;
11+
public BrShopPage featured;
12+
public BrShopPage daily;
13+
@Nullable public BrShopEntry[] votes;
14+
@Nullable public BrShopEntry[] voteWinners;
15+
16+
}

src/main/java/com/thoo/api/services/ShopService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.thoo.api.model.BaseModel;
44
import com.thoo.api.model.BrShop;
5+
import com.thoo.api.model.BrShopCombined;
56
import retrofit2.Call;
67
import retrofit2.http.GET;
78
import retrofit2.http.Query;
@@ -14,4 +15,10 @@ public interface ShopService {
1415
@GET("/v2/shop/br")
1516
Call<BaseModel<BrShop>> shop(@Query("language") String language);
1617

18+
@GET("/v2/shop/br/combined")
19+
Call<BaseModel<BrShopCombined>> shopCombined();
20+
21+
@GET("/v2/shop/br/combined")
22+
Call<BaseModel<BrShopCombined>> shopCombined(@Query("language") String language);
23+
1724
}

src/main/java/example/Example.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ private void main() {
1414
}
1515

1616
private void init() {
17-
this.api = new FortniteAPIBuilder().setKey("f58b42bd605c0c1c9067d0352bc75cf52a84e62c").setDefaultLanguage(Language.AR).build();
18-
this.api.getAESEndpoint().getAES().ifSuccessful(model -> {
19-
System.out.println(HttpUtils.gson.toJson(model.data));
20-
});
17+
this.api = new FortniteAPIBuilder().setKey("").setDefaultLanguage(Language.AR).build();
2118
}
2219

2320
public static void main(String[] args) {

0 commit comments

Comments
 (0)