Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #8 from xhsun/feat/all_referenced_endpoint
Browse files Browse the repository at this point in the history
Feat/all referenced endpoint
  • Loading branch information
xhsun authored Jun 15, 2017
2 parents 39806d6 + 439a175 commit 3d57d1d
Show file tree
Hide file tree
Showing 45 changed files with 2,350 additions and 61 deletions.
408 changes: 407 additions & 1 deletion src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/java/me/xhsun/guildwars2wrapper/GuildWars2.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* &#32;1) use methods provided by {@link SynchronousRequest} to get data synchronously<br/>
* &#32;2) use methods provided by {@link AsynchronousRequest} to get/process data asynchronously
* TODO chatLinkToItemID
* TODO language selection, default english
* TODO language selection(en - english, de - german, es - spanish, fr - french), default english
* TODO method to resolve back story question using answer id
* TODO coins to gold/sliver/copper
* @author xhsun
Expand Down
93 changes: 93 additions & 0 deletions src/main/java/me/xhsun/guildwars2wrapper/GuildWars2API.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@
import me.xhsun.guildwars2wrapper.model.character.*;
import me.xhsun.guildwars2wrapper.model.commerce.Prices;
import me.xhsun.guildwars2wrapper.model.commerce.Transaction;
import me.xhsun.guildwars2wrapper.model.continent.Continent;
import me.xhsun.guildwars2wrapper.model.continent.ContinentFloor;
import me.xhsun.guildwars2wrapper.model.continent.ContinentMap;
import me.xhsun.guildwars2wrapper.model.continent.ContinentRegion;
import me.xhsun.guildwars2wrapper.model.guild.Upgrade;
import me.xhsun.guildwars2wrapper.model.pvp.Amulet;
import me.xhsun.guildwars2wrapper.model.pvp.Hero;
import me.xhsun.guildwars2wrapper.model.unlockable.Finisher;
import me.xhsun.guildwars2wrapper.model.unlockable.Glider;
import me.xhsun.guildwars2wrapper.model.unlockable.MailCarrier;
import me.xhsun.guildwars2wrapper.model.unlockable.Outfit;
import me.xhsun.guildwars2wrapper.model.wvw.Ability;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
Expand Down Expand Up @@ -142,6 +148,8 @@ interface GuildWars2API {
@GET("/v2/build")
Call<GameBuild> getCurrentGameBuild();

//TODO /v2/cats

//characters
@GET("/v2/characters")
Call<List<String>> getAllCharacterName(@Query("access_token") String token);
Expand Down Expand Up @@ -199,6 +207,49 @@ interface GuildWars2API {
@GET("/v2/commerce/prices")
Call<List<Prices>> getPrices(@Query("ids") String ids);

//continents
@GET("/v2/continents")
Call<List<Integer>> getAllContinentIDs();

@GET("/v2/continents")
Call<List<Continent>> getContinentInfo(@Query("ids") String ids);

@GET("/v2/continents/{continentId}/floors")
Call<List<Integer>> getAllContinentFloorIDs(@Path("continentId") String continent);

@GET("/v2/continents/{continentId}/floors")
Call<List<ContinentFloor>> getContinentFloorInfo(@Path("continentId") String continent, @Query("ids") String ids);

@GET("/v2/continents/{continentId}/floors/{floorId}/regions")
Call<List<Integer>> getAllContinentRegionIDs(@Path("continentId") String continent, @Path("floorId") String floor);

@GET("/v2/continents/{continentId}/floors/{floorId}/regions")
Call<List<ContinentRegion>> getContinentRegionInfo(@Path("continentId") String continent, @Path("floorId") String floor, @Query("ids") String ids);

@GET("/v2/continents/{continentId}/floors/{floorId}/regions/{regionId}/maps")
Call<List<Integer>> getAllContinentMapIDs(@Path("continentId") String continent, @Path("floorId") String floor, @Path("regionId") String region);

@GET("/v2/continents/{continentId}/floors/{floorId}/regions/{regionId}/maps")
Call<List<ContinentMap>> getContinentMapInfo(@Path("continentId") String continent, @Path("floorId") String floor, @Path("regionId") String region, @Query("ids") String ids);

@GET("/v2/continents/{continentId}/floors/{floorId}/regions/{regionId}/maps/{mapId}/sectors")
Call<List<Integer>> getAllContinentSectorIDs(@Path("continentId") String continent, @Path("floorId") String floor, @Path("regionId") String region, @Path("mapId") String map);

@GET("/v2/continents/{continentId}/floors/{floorId}/regions/{regionId}/maps/{mapId}/sectors")
Call<List<ContinentMap.Sector>> getContinentSectorInfo(@Path("continentId") String continent, @Path("floorId") String floor, @Path("regionId") String region, @Path("mapId") String map, @Query("ids") String ids);

@GET("/v2/continents/{continentId}/floors/{floorId}/regions/{regionId}/maps/{mapId}/pois")
Call<List<Integer>> getAllContinentPOIIDs(@Path("continentId") String continent, @Path("floorId") String floor, @Path("regionId") String region, @Path("mapId") String map);

@GET("/v2/continents/{continentId}/floors/{floorId}/regions/{regionId}/maps/{mapId}/pois")
Call<List<ContinentMap.PoI>> getContinentPOIInfo(@Path("continentId") String continent, @Path("floorId") String floor, @Path("regionId") String region, @Path("mapId") String map, @Query("ids") String ids);

@GET("/v2/continents/{continentId}/floors/{floorId}/regions/{regionId}/maps/{mapId}/tasks")
Call<List<Integer>> getAllContinentTaskIDs(@Path("continentId") String continent, @Path("floorId") String floor, @Path("regionId") String region, @Path("mapId") String map);

@GET("/v2/continents/{continentId}/floors/{floorId}/regions/{regionId}/maps/{mapId}/tasks")
Call<List<ContinentMap.Task>> getContinentTaskInfo(@Path("continentId") String continent, @Path("floorId") String floor, @Path("regionId") String region, @Path("mapId") String map, @Query("ids") String ids);

//currencies
@GET("/v2/currencies")
Call<List<Integer>> getAllCurrencies();
Expand Down Expand Up @@ -283,6 +334,20 @@ interface GuildWars2API {
@GET("/v2/outfits")
Call<List<Outfit>> getOutfitInfo(@Query("ids") String ids);

//Professions
@GET("/v2/professions")
Call<List<String>> getAllProfessionIDs();

@GET("/v2/professions")
Call<List<Profession>> getProfessionInfo(@Query("ids") String ids);

//PvP Amulets
@GET("/v2/pvp/amulets")
Call<List<Integer>> getAllPvPAmuletIDs();

@GET("/v2/pvp/amulets")
Call<List<Amulet>> getPvPAmuletInfo(@Query("ids") String ids);

//PvP Heroes
@GET("/v2/pvp/heroes")
Call<List<String>> getAllPvPHeroIDs();
Expand Down Expand Up @@ -311,24 +376,52 @@ interface GuildWars2API {
@GET("/v2/recipes/search")
Call<List<Integer>> searchOutputRecipes(@Query("output") String id);

//Skills
@GET("/v2/skills")
Call<List<Integer>> getAllSkillIDs();

@GET("/v2/skills")
Call<List<Skill>> getSkillInfo(@Query("ids") String ids);

//skins
@GET("/v2/skins")
Call<List<Integer>> getAllSkinIDs();

@GET("/v2/skins")
Call<List<Skin>> getSkinInfo(@Query("ids") String ids);

//Specializations
@GET("/v2/specializations")
Call<List<Integer>> getAllSpecializationIDs();

@GET("/v2/specializations")
Call<List<Specialization>> getSpecializationInfo(@Query("ids") String ids);

//Titles
@GET("/v2/titles")
Call<List<Integer>> getAllTitleIDs();

@GET("/v2/titles")
Call<List<Title>> getTitleInfo(@Query("ids") String ids);

//Traits
@GET("/v2/traits")
Call<List<Integer>> getAllTraitIDs();

@GET("/v2/traits")
Call<List<Trait>> getTraitInfo(@Query("ids") String ids);

//worlds
@GET("/v2/worlds")
Call<List<Integer>> getAllWorldsIDs();

@GET("/v2/worlds")
Call<List<World>> getWorldsInfo(@Query("ids") String ids);

//WvW Abilities
@GET("/v2/wvw/abilities")
Call<List<Integer>> getAllWvWAbilityIDs();

@GET("/v2/wvw/abilities")
Call<List<Ability>> getWvWAbilityInfo(@Query("ids") String ids);
}
1 change: 0 additions & 1 deletion src/main/java/me/xhsun/guildwars2wrapper/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ void isParamValid(ParamChecker... items) throws GuildWars2Exception {
throw new GuildWars2Exception(ErrorCode.ID, "List of id cannot be empty");
}
}

}
}

Expand Down
Loading

0 comments on commit 3d57d1d

Please sign in to comment.