Skip to content
This repository has been archived by the owner on Jan 25, 2025. It is now read-only.

Commit

Permalink
dofus3
Browse files Browse the repository at this point in the history
  • Loading branch information
stelzo committed Dec 2, 2024
1 parent 6e191c9 commit 5d6f457
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/docker-java-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: Docker

on:
push:
# Publish `main` as Docker `latest` image.
branches:
- main

# Publish `v1.2.3` tags as releases.
tags:
- v*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
@RequestScoped
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/dofus2")
@Path("/dofus3")
public class OfferingResourceV2 {

private OfferingRepository offeringRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ItemObjectDTO get(String url, String language) {
Integer ankamaId = Integer.parseInt(split[split.length - 1].trim());
String ankamaEnGeneral = "https://www.dofus.com/en/mmorpg/encyclopedia";
ApiClient defaultClient = Configuration.getDefaultApiClient();
String game = "dofus2";
String game = "dofus3";

if (url.contains("resources")) {
ResourcesApi resourcesApi = new ResourcesApi(defaultClient);
Expand Down Expand Up @@ -103,7 +103,7 @@ public ItemDTOV2 getV2(String url, String language) {
String[] split = url.split("/");
Integer ankamaId = Integer.parseInt(split[split.length - 1].trim());
ApiClient defaultClient = Configuration.getDefaultApiClient();
String game = "dofus2";
String game = "dofus3";

if (url.contains("resources")) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ private boolean offeringChanged(CreateOfferingDTO newOffering, Offering persiste
return true;
}

if (!newOffering.itemPicture.equals(persistentOffering.getItem().getPictureUrl())) {
return true;
}

return false;
}

Expand Down Expand Up @@ -179,7 +183,8 @@ public void persist(CreateOfferingDTO offeringDTO, String language, boolean recr
GameApi apiInstance = new GameApi(defaultClient);

try {
List<ItemsListEntryTyped> items = apiInstance.getItemsAllSearch(language, "dofus2",
// TODO disallow quest item subtypes using "-quest" filter
List<ItemsListEntryTyped> items = apiInstance.getItemsAllSearch(language, "dofus3",
offeringDTO.item,
null, null, null, null);

Expand All @@ -191,7 +196,7 @@ public void persist(CreateOfferingDTO offeringDTO, String language, boolean recr
}

ItemsListEntryTyped item = items.get(i);
resUrl = defaultClient.getBasePath() + "/dofus2/" + offeringDTO.language + "/items/" + item.getItemSubtype()
resUrl = defaultClient.getBasePath() + "/dofus3/v1/" + offeringDTO.language + "/items/" + item.getItemSubtype()
+ "/"
+ Integer.toString(item.getAnkamaId());
offeringDTO.itemPicture = item.getImageUrls().getSd() == null ? item.getImageUrls().getIcon()
Expand Down

0 comments on commit 5d6f457

Please sign in to comment.