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

Commit

Permalink
Added new endpoint: v2/shop/br/combined
Browse files Browse the repository at this point in the history
  • Loading branch information
thoo0224 committed May 5, 2020
1 parent f102ea9 commit 265005d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/thoo/api/endpoints/ShopEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,12 @@ public FortniteResponse<BaseModel<BrShop>> getShop(Language language){
return HttpUtils.parse(service.shop(language.code));
}

public FortniteResponse<BaseModel<BrShop>> getShopCombined(){
return getShopCombined(defaultLanguage);
}

public FortniteResponse<BaseModel<BrShop>> getShopCombined(Language language){
return HttpUtils.parse(service.shop(language.code));
}

}
16 changes: 16 additions & 0 deletions src/main/java/com/thoo/api/model/BrShopCombined.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.thoo.api.model;

import org.jetbrains.annotations.Nullable;

import java.util.Date;

public class BrShopCombined {

public String hash;
public Date date;
public BrShopPage featured;
public BrShopPage daily;
@Nullable public BrShopEntry[] votes;
@Nullable public BrShopEntry[] voteWinners;

}
7 changes: 7 additions & 0 deletions src/main/java/com/thoo/api/services/ShopService.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.thoo.api.model.BaseModel;
import com.thoo.api.model.BrShop;
import com.thoo.api.model.BrShopCombined;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;
Expand All @@ -14,4 +15,10 @@ public interface ShopService {
@GET("/v2/shop/br")
Call<BaseModel<BrShop>> shop(@Query("language") String language);

@GET("/v2/shop/br/combined")
Call<BaseModel<BrShopCombined>> shopCombined();

@GET("/v2/shop/br/combined")
Call<BaseModel<BrShopCombined>> shopCombined(@Query("language") String language);

}
5 changes: 1 addition & 4 deletions src/main/java/example/Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ private void main() {
}

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

public static void main(String[] args) {
Expand Down

0 comments on commit 265005d

Please sign in to comment.