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 #10 from xhsun/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
xhsun authored Jun 15, 2017
2 parents e0411aa + ebbe74b commit 5809f17
Show file tree
Hide file tree
Showing 95 changed files with 4,562 additions and 1,551 deletions.
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,24 @@ So if you see anything I missed, please don't hesitate to create an issue to let

+ /v2/achievements

+ /v2/characters/<name>/core
+ /v2/achievements/*

+ /v2/characters/<name>/inventory
+ /v2/backstory/*

+ /v2/build

+ /v2/cats

+ /v2/characters

+ /v2/colors

+ /v2/commerce/prices

+ /v2/commerce/transactions

+ /v2/continents

+ /v2/currencies

+ /v2/dungeons
Expand All @@ -132,6 +140,10 @@ So if you see anything I missed, please don't hesitate to create an issue to let

+ /v2/outfits

+ /v2/professions

+ /v2/pvp/amulets

+ /v2/pvp/heroes

+ /v2/raids
Expand All @@ -140,14 +152,22 @@ So if you see anything I missed, please don't hesitate to create an issue to let

+ /v2/recipes/search

+ /v2/skills

+ /v2/skins

+ /v2/specializations

+ /v2/titles

+ /v2/tokeninfo

+ /v2/traits

+ /v2/worlds

+ /v2/wvw/abilities


## Download

Expand All @@ -157,7 +177,7 @@ Download latest [release](https://github.com/xhsun/gw2wrapper/releases) in Maven
<dependency>
<groupId>me.xhsun.gw2wrapper</groupId>
<artifactId>gw2wrapper</artifactId>
<version>0.4.1</version>
<version>0.6.2</version>
</dependency>
```

Expand All @@ -166,7 +186,7 @@ Or Gradle:
```groovy
dependencies {
...
compile 'me.xhsun.gw2wrapper:gw2wrapper:0.4.1'
compile 'me.xhsun.gw2wrapper:gw2wrapper:0.6.2'
...
}
```
Expand Down
4 changes: 2 additions & 2 deletions comm.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
currentVer=0.4.1
verDesc=Release All Account Endpoints
currentVer=0.6.2
verDesc=Release More Endpoints
groupID=me.xhsun.gw2wrapper
projectName=gw2wrapper
siteUrl=https://github.com/xhsun/gw2wrapper
Expand Down
757 changes: 748 additions & 9 deletions src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java

Large diffs are not rendered by default.

4 changes: 3 additions & 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,9 @@
* &#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
* @since 2017-02-06
*/
Expand Down
172 changes: 170 additions & 2 deletions src/main/java/me/xhsun/guildwars2wrapper/GuildWars2API.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,27 @@
import me.xhsun.guildwars2wrapper.model.*;
import me.xhsun.guildwars2wrapper.model.account.*;
import me.xhsun.guildwars2wrapper.model.achievements.Achievement;
import me.xhsun.guildwars2wrapper.model.character.CharacterInventory;
import me.xhsun.guildwars2wrapper.model.character.Core;
import me.xhsun.guildwars2wrapper.model.achievements.AchievementCategory;
import me.xhsun.guildwars2wrapper.model.achievements.AchievementGroup;
import me.xhsun.guildwars2wrapper.model.achievements.DailyAchievement;
import me.xhsun.guildwars2wrapper.model.backstory.BackStoryAnswer;
import me.xhsun.guildwars2wrapper.model.backstory.BackStoryQuestion;
import me.xhsun.guildwars2wrapper.model.character.Character;
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 @@ -102,16 +113,88 @@ interface GuildWars2API {
@GET("/v2/achievements")
Call<List<Achievement>> getAchievementInfo(@Query("ids") String ids);

@GET("/v2/achievements/categories")
Call<List<Integer>> getAllAchievementCategoryIDs();

@GET("/v2/achievements/categories")
Call<List<AchievementCategory>> getAchievementCategoryInfo(@Query("ids") String ids);

@GET("/v2/achievements/daily")
Call<DailyAchievement> getCurrentDailyAchievements();

@GET("/v2/achievements/daily/tomorrow")
Call<DailyAchievement> getNextDailyAchievements();

@GET("/v2/achievements/groups")
Call<List<String>> getAllAchievementGroupIDs();

@GET("/v2/achievements/groups")
Call<List<AchievementGroup>> getAchievementGroupInfo(@Query("ids") String ids);

//back story
@GET("/v2/backstory/answers")
Call<List<String>> getAllBackStoryAnswerIDs();

@GET("/v2/backstory/answers")
Call<List<BackStoryAnswer>> getBackStoryAnswerInfo(@Query("ids") String ids);

@GET("/v2/backstory/questions")
Call<List<Integer>> getAllBackStoryQuestionIDs();

@GET("/v2/backstory/questions")
Call<List<BackStoryQuestion>> getBackStoryQuestionInfo(@Query("ids") String ids);

//Current Game Build
@GET("/v2/build")
Call<GameBuild> getCurrentGameBuild();

//Cats
@GET("/v2/cats")
Call<List<Integer>> getAllCatIDs();

@GET("/v2/cats")
Call<List<Cat>> getCatInfo(@Query("ids") String ids);

//characters
@GET("/v2/characters")
Call<List<String>> getAllCharacterName(@Query("access_token") String token);

@GET("/v2/characters/{name}")
Call<Character> getCharacter(@Path("name") String name, @Query("access_token") String token);

@GET("/v2/characters/{name}/backstory")
Call<CharacterBackStory> getCharacterBackStory(@Path("name") String name, @Query("access_token") String token);

@GET("/v2/characters/{name}/core")
Call<Core> getCharacterCore(@Path("name") String name, @Query("access_token") String token);

@GET("/v2/characters/{name}/crafting")
Call<CraftingLevel> getCharacterCrafting(@Path("name") String name, @Query("access_token") String token);

@GET("/v2/characters/{name}/equipment")
Call<CharacterEquipment> getCharacterEquipment(@Path("name") String name, @Query("access_token") String token);

@GET("/v2/characters/{name}/heropoints")
Call<List<String>> getCharacterHeroPoints(@Path("name") String name, @Query("access_token") String token);

@GET("/v2/characters/{name}/inventory")
Call<CharacterInventory> getCharacterInventory(@Path("name") String name, @Query("access_token") String token);

@GET("/v2/characters/{name}/recipes")
Call<CharacterRecipes> getCharacterUnlockedRecipes(@Path("name") String name, @Query("access_token") String token);

@GET("/v2/characters/{name}/sab")
Call<CharacterSAB> getCharacterSAB(@Path("name") String name, @Query("access_token") String token);

@GET("/v2/characters/{name}/skills")
Call<CharacterSkills> getCharacterSkills(@Path("name") String name, @Query("access_token") String token);

@GET("/v2/characters/{name}/specializations")
Call<CharacterSpecialization> getCharacterSpecialization(@Path("name") String name, @Query("access_token") String token);

@GET("/v2/characters/{name}/training")
Call<CharacterTraining> getCharacterTraining(@Path("name") String name, @Query("access_token") String token);

//colors
@GET("/v2/colors")
Call<List<Integer>> getAllColorIDs();
Expand All @@ -129,6 +212,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 @@ -213,6 +339,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 @@ -241,24 +381,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 5809f17

Please sign in to comment.