Fix RequestMapping annotations in http-service
Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -50,6 +50,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@@ -133,7 +134,7 @@ public class AccountService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/login")
|
@GetMapping("/login")
|
||||||
public OAuthResponse login(@RequestParam UUID uuid)
|
public OAuthResponse login(@RequestParam UUID uuid)
|
||||||
{
|
{
|
||||||
State state = new State();
|
State state = new State();
|
||||||
@@ -157,7 +158,7 @@ public class AccountService
|
|||||||
return lr;
|
return lr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/callback")
|
@GetMapping("/callback")
|
||||||
public Object callback(
|
public Object callback(
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
HttpServletResponse response,
|
HttpServletResponse response,
|
||||||
@@ -245,7 +246,7 @@ public class AccountService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/logout")
|
@GetMapping("/logout")
|
||||||
public void logout(HttpServletRequest request, HttpServletResponse response) throws IOException
|
public void logout(HttpServletRequest request, HttpServletResponse response) throws IOException
|
||||||
{
|
{
|
||||||
SessionEntry session = auth.handle(request, response);
|
SessionEntry session = auth.handle(request, response);
|
||||||
@@ -263,7 +264,7 @@ public class AccountService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/session-check")
|
@GetMapping("/session-check")
|
||||||
public void sessionCheck(HttpServletRequest request, HttpServletResponse response) throws IOException
|
public void sessionCheck(HttpServletRequest request, HttpServletResponse response) throws IOException
|
||||||
{
|
{
|
||||||
auth.handle(request, response);
|
auth.handle(request, response);
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ import net.runelite.http.service.cache.beans.IndexEntry;
|
|||||||
import net.runelite.http.service.util.exception.NotFoundException;
|
import net.runelite.http.service.util.exception.NotFoundException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
@@ -75,7 +76,7 @@ public class CacheController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CacheService cacheService;
|
private CacheService cacheService;
|
||||||
|
|
||||||
@RequestMapping("/")
|
@GetMapping("/")
|
||||||
public List<Cache> listCaches()
|
public List<Cache> listCaches()
|
||||||
{
|
{
|
||||||
return cacheService.listCaches().stream()
|
return cacheService.listCaches().stream()
|
||||||
@@ -83,7 +84,7 @@ public class CacheController
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("{cacheId}")
|
@GetMapping("{cacheId}")
|
||||||
public List<CacheIndex> listIndexes(@PathVariable int cacheId)
|
public List<CacheIndex> listIndexes(@PathVariable int cacheId)
|
||||||
{
|
{
|
||||||
CacheEntry cache = cacheService.findCache(cacheId);
|
CacheEntry cache = cacheService.findCache(cacheId);
|
||||||
@@ -99,7 +100,7 @@ public class CacheController
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("{cacheId}/{indexId}")
|
@GetMapping("{cacheId}/{indexId}")
|
||||||
public List<CacheArchive> listArchives(@PathVariable int cacheId,
|
public List<CacheArchive> listArchives(@PathVariable int cacheId,
|
||||||
@PathVariable int indexId)
|
@PathVariable int indexId)
|
||||||
{
|
{
|
||||||
@@ -122,7 +123,7 @@ public class CacheController
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("{cacheId}/{indexId}/{archiveId}")
|
@GetMapping("{cacheId}/{indexId}/{archiveId}")
|
||||||
public CacheArchive getCacheArchive(@PathVariable int cacheId,
|
public CacheArchive getCacheArchive(@PathVariable int cacheId,
|
||||||
@PathVariable int indexId,
|
@PathVariable int indexId,
|
||||||
@PathVariable int archiveId)
|
@PathVariable int archiveId)
|
||||||
@@ -149,7 +150,7 @@ public class CacheController
|
|||||||
archiveEntry.getNameHash(), archiveEntry.getRevision());
|
archiveEntry.getNameHash(), archiveEntry.getRevision());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("{cacheId}/{indexId}/{archiveId}/data")
|
@GetMapping("{cacheId}/{indexId}/{archiveId}/data")
|
||||||
public byte[] getArchiveData(
|
public byte[] getArchiveData(
|
||||||
@PathVariable int cacheId,
|
@PathVariable int cacheId,
|
||||||
@PathVariable int indexId,
|
@PathVariable int indexId,
|
||||||
@@ -200,7 +201,7 @@ public class CacheController
|
|||||||
return archiveEntry;
|
return archiveEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("item/{itemId}")
|
@GetMapping("item/{itemId}")
|
||||||
public ItemDefinition getItem(@PathVariable int itemId) throws IOException
|
public ItemDefinition getItem(@PathVariable int itemId) throws IOException
|
||||||
{
|
{
|
||||||
ArchiveEntry archiveEntry = findConfig(ConfigType.ITEM);
|
ArchiveEntry archiveEntry = findConfig(ConfigType.ITEM);
|
||||||
@@ -221,7 +222,7 @@ public class CacheController
|
|||||||
return itemdef;
|
return itemdef;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "item/{itemId}/image", produces = "image/png")
|
@GetMapping(path = "item/{itemId}/image", produces = "image/png")
|
||||||
public ResponseEntity<byte[]> getItemImage(
|
public ResponseEntity<byte[]> getItemImage(
|
||||||
@PathVariable int itemId,
|
@PathVariable int itemId,
|
||||||
@RequestParam(defaultValue = "1") int quantity,
|
@RequestParam(defaultValue = "1") int quantity,
|
||||||
@@ -313,7 +314,7 @@ public class CacheController
|
|||||||
return ResponseEntity.ok(bao.toByteArray());
|
return ResponseEntity.ok(bao.toByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("object/{objectId}")
|
@GetMapping("object/{objectId}")
|
||||||
public ObjectDefinition getObject(
|
public ObjectDefinition getObject(
|
||||||
@PathVariable int objectId
|
@PathVariable int objectId
|
||||||
) throws IOException
|
) throws IOException
|
||||||
@@ -336,7 +337,7 @@ public class CacheController
|
|||||||
return objectdef;
|
return objectdef;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("npc/{npcId}")
|
@GetMapping("npc/{npcId}")
|
||||||
public NpcDefinition getNpc(
|
public NpcDefinition getNpc(
|
||||||
@PathVariable int npcId
|
@PathVariable int npcId
|
||||||
) throws IOException
|
) throws IOException
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import net.runelite.http.api.config.Configuration;
|
|||||||
import net.runelite.http.service.account.AuthFilter;
|
import net.runelite.http.service.account.AuthFilter;
|
||||||
import net.runelite.http.service.account.beans.SessionEntry;
|
import net.runelite.http.service.account.beans.SessionEntry;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -52,7 +53,7 @@ public class ConfigController
|
|||||||
this.authFilter = authFilter;
|
this.authFilter = authFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping
|
@GetMapping
|
||||||
public Configuration get(HttpServletRequest request, HttpServletResponse response) throws IOException
|
public Configuration get(HttpServletRequest request, HttpServletResponse response) throws IOException
|
||||||
{
|
{
|
||||||
SessionEntry session = authFilter.handle(request, response);
|
SessionEntry session = authFilter.handle(request, response);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import static net.runelite.http.service.examine.ExamineType.OBJECT;
|
|||||||
import net.runelite.http.service.item.ItemEntry;
|
import net.runelite.http.service.item.ItemEntry;
|
||||||
import net.runelite.http.service.item.ItemService;
|
import net.runelite.http.service.item.ItemService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -50,19 +51,19 @@ public class ExamineController
|
|||||||
this.itemService = itemService;
|
this.itemService = itemService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/npc/{id}")
|
@GetMapping("/npc/{id}")
|
||||||
public String getNpc(@PathVariable int id)
|
public String getNpc(@PathVariable int id)
|
||||||
{
|
{
|
||||||
return examineService.get(NPC, id);
|
return examineService.get(NPC, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/object/{id}")
|
@GetMapping("/object/{id}")
|
||||||
public String getObject(@PathVariable int id)
|
public String getObject(@PathVariable int id)
|
||||||
{
|
{
|
||||||
return examineService.get(OBJECT, id);
|
return examineService.get(OBJECT, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/item/{id}")
|
@GetMapping("/item/{id}")
|
||||||
public String getItem(@PathVariable int id)
|
public String getItem(@PathVariable int id)
|
||||||
{
|
{
|
||||||
// Tradeable item examine info is available from the Jagex item API
|
// Tradeable item examine info is available from the Jagex item API
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.http.CacheControl;
|
import org.springframework.http.CacheControl;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@@ -95,7 +96,7 @@ public class FeedController
|
|||||||
feedResult = new FeedResult(items);
|
feedResult = new FeedResult(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping
|
@GetMapping
|
||||||
public ResponseEntity<FeedResult> getFeed()
|
public ResponseEntity<FeedResult> getFeed()
|
||||||
{
|
{
|
||||||
if (feedResult == null)
|
if (feedResult == null)
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import net.runelite.http.service.util.HiscoreEndpointEditor;
|
|||||||
import net.runelite.http.service.xp.XpTrackerService;
|
import net.runelite.http.service.xp.XpTrackerService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.InitBinder;
|
import org.springframework.web.bind.annotation.InitBinder;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -50,7 +51,7 @@ public class HiscoreController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private XpTrackerService xpTrackerService;
|
private XpTrackerService xpTrackerService;
|
||||||
|
|
||||||
@RequestMapping("/{endpoint}")
|
@GetMapping("/{endpoint}")
|
||||||
public HiscoreResult lookup(@PathVariable HiscoreEndpoint endpoint, @RequestParam String username) throws ExecutionException
|
public HiscoreResult lookup(@PathVariable HiscoreEndpoint endpoint, @RequestParam String username) throws ExecutionException
|
||||||
{
|
{
|
||||||
HiscoreResult result = hiscoreService.lookupUsername(username, endpoint);
|
HiscoreResult result = hiscoreService.lookupUsername(username, endpoint);
|
||||||
@@ -68,7 +69,7 @@ public class HiscoreController
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/{endpoint}/{skillName}")
|
@GetMapping("/{endpoint}/{skillName}")
|
||||||
public SingleHiscoreSkillResult singleSkillLookup(@PathVariable HiscoreEndpoint endpoint, @PathVariable String skillName, @RequestParam String username) throws ExecutionException
|
public SingleHiscoreSkillResult singleSkillLookup(@PathVariable HiscoreEndpoint endpoint, @PathVariable String skillName, @RequestParam String username) throws ExecutionException
|
||||||
{
|
{
|
||||||
HiscoreSkill skill = HiscoreSkill.valueOf(skillName.toUpperCase());
|
HiscoreSkill skill = HiscoreSkill.valueOf(skillName.toUpperCase());
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import net.runelite.http.api.item.SearchResult;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.CacheControl;
|
import org.springframework.http.CacheControl;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
@@ -78,7 +79,7 @@ public class ItemController
|
|||||||
.toArray(ItemPrice[]::new), 30, TimeUnit.MINUTES);
|
.toArray(ItemPrice[]::new), 30, TimeUnit.MINUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/{itemId}")
|
@GetMapping("/{itemId}")
|
||||||
public Item getItem(HttpServletResponse response, @PathVariable int itemId)
|
public Item getItem(HttpServletResponse response, @PathVariable int itemId)
|
||||||
{
|
{
|
||||||
ItemEntry item = itemService.getItem(itemId);
|
ItemEntry item = itemService.getItem(itemId);
|
||||||
@@ -91,7 +92,7 @@ public class ItemController
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "/{itemId}/icon", produces = "image/gif")
|
@GetMapping(path = "/{itemId}/icon", produces = "image/gif")
|
||||||
public ResponseEntity<byte[]> getIcon(@PathVariable int itemId)
|
public ResponseEntity<byte[]> getIcon(@PathVariable int itemId)
|
||||||
{
|
{
|
||||||
ItemEntry item = itemService.getItem(itemId);
|
ItemEntry item = itemService.getItem(itemId);
|
||||||
@@ -104,7 +105,7 @@ public class ItemController
|
|||||||
return ResponseEntity.notFound().build();
|
return ResponseEntity.notFound().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(path = "/{itemId}/icon/large", produces = "image/gif")
|
@GetMapping(path = "/{itemId}/icon/large", produces = "image/gif")
|
||||||
public ResponseEntity<byte[]> getIconLarge(HttpServletResponse response, @PathVariable int itemId)
|
public ResponseEntity<byte[]> getIconLarge(HttpServletResponse response, @PathVariable int itemId)
|
||||||
{
|
{
|
||||||
ItemEntry item = itemService.getItem(itemId);
|
ItemEntry item = itemService.getItem(itemId);
|
||||||
@@ -117,7 +118,7 @@ public class ItemController
|
|||||||
return ResponseEntity.notFound().build();
|
return ResponseEntity.notFound().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/{itemId}/price")
|
@GetMapping("/{itemId}/price")
|
||||||
public ResponseEntity<ItemPrice> itemPrice(
|
public ResponseEntity<ItemPrice> itemPrice(
|
||||||
@PathVariable int itemId,
|
@PathVariable int itemId,
|
||||||
@RequestParam(required = false) Instant time
|
@RequestParam(required = false) Instant time
|
||||||
@@ -179,7 +180,7 @@ public class ItemController
|
|||||||
.body(itemPrice);
|
.body(itemPrice);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/search")
|
@GetMapping("/search")
|
||||||
public SearchResult search(@RequestParam String query)
|
public SearchResult search(@RequestParam String query)
|
||||||
{
|
{
|
||||||
List<ItemEntry> result = itemService.search(query);
|
List<ItemEntry> result = itemService.search(query);
|
||||||
@@ -193,7 +194,7 @@ public class ItemController
|
|||||||
return searchResult;
|
return searchResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/price")
|
@GetMapping("/price")
|
||||||
public ItemPrice[] prices(@RequestParam("id") int[] itemIds)
|
public ItemPrice[] prices(@RequestParam("id") int[] itemIds)
|
||||||
{
|
{
|
||||||
if (itemIds.length > MAX_BATCH_LOOKUP)
|
if (itemIds.length > MAX_BATCH_LOOKUP)
|
||||||
@@ -216,7 +217,7 @@ public class ItemController
|
|||||||
.toArray(ItemPrice[]::new);
|
.toArray(ItemPrice[]::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/prices")
|
@GetMapping("/prices")
|
||||||
public ResponseEntity<ItemPrice[]> prices()
|
public ResponseEntity<ItemPrice[]> prices()
|
||||||
{
|
{
|
||||||
return ResponseEntity.ok()
|
return ResponseEntity.ok()
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import net.runelite.http.service.account.AuthFilter;
|
|||||||
import net.runelite.http.service.account.beans.SessionEntry;
|
import net.runelite.http.service.account.beans.SessionEntry;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
@@ -65,7 +66,7 @@ public class LootTrackerController
|
|||||||
response.setStatus(HttpStatusCodes.STATUS_CODE_OK);
|
response.setStatus(HttpStatusCodes.STATUS_CODE_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping
|
@GetMapping
|
||||||
public Collection<LootRecord> getLootRecords(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "count", defaultValue = "1024") int count, @RequestParam(value = "start", defaultValue = "0") int start) throws IOException
|
public Collection<LootRecord> getLootRecords(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "count", defaultValue = "1024") int count, @RequestParam(value = "start", defaultValue = "0") int start) throws IOException
|
||||||
{
|
{
|
||||||
SessionEntry e = auth.handle(request, response);
|
SessionEntry e = auth.handle(request, response);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.CacheControl;
|
import org.springframework.http.CacheControl;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@@ -45,7 +46,7 @@ public class OSBGrandExchangeController
|
|||||||
this.grandExchangeService = grandExchangeService;
|
this.grandExchangeService = grandExchangeService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping
|
@GetMapping
|
||||||
public ResponseEntity<GrandExchangeEntry> get(@RequestParam("itemId") int itemId) throws ExecutionException
|
public ResponseEntity<GrandExchangeEntry> get(@RequestParam("itemId") int itemId) throws ExecutionException
|
||||||
{
|
{
|
||||||
GrandExchangeEntry grandExchangeEntry = grandExchangeService.get(itemId);
|
GrandExchangeEntry grandExchangeEntry = grandExchangeService.get(itemId);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import java.io.IOException;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@@ -55,7 +56,7 @@ public class SpriteController
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@RequestMapping(produces = "image/png")
|
@GetMapping(produces = "image/png")
|
||||||
public ResponseEntity<byte[]> getSprite(
|
public ResponseEntity<byte[]> getSprite(
|
||||||
@RequestParam int spriteId,
|
@RequestParam int spriteId,
|
||||||
@RequestParam(defaultValue = "0") int frameId
|
@RequestParam(defaultValue = "0") int frameId
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.http.CacheControl;
|
import org.springframework.http.CacheControl;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ public class WorldController
|
|||||||
|
|
||||||
private WorldResult worldResult;
|
private WorldResult worldResult;
|
||||||
|
|
||||||
@RequestMapping
|
@GetMapping
|
||||||
public ResponseEntity<WorldResult> listWorlds() throws IOException
|
public ResponseEntity<WorldResult> listWorlds() throws IOException
|
||||||
{
|
{
|
||||||
return ResponseEntity.ok()
|
return ResponseEntity.ok()
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import java.time.Instant;
|
|||||||
import net.runelite.http.api.xp.XpData;
|
import net.runelite.http.api.xp.XpData;
|
||||||
import net.runelite.http.service.xp.beans.XpEntity;
|
import net.runelite.http.service.xp.beans.XpEntity;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@@ -39,13 +40,13 @@ public class XpTrackerController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private XpTrackerService xpTrackerService;
|
private XpTrackerService xpTrackerService;
|
||||||
|
|
||||||
@RequestMapping("/update")
|
@GetMapping("/update")
|
||||||
public void update(@RequestParam String username)
|
public void update(@RequestParam String username)
|
||||||
{
|
{
|
||||||
xpTrackerService.tryUpdate(username);
|
xpTrackerService.tryUpdate(username);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/get")
|
@GetMapping("/get")
|
||||||
public XpData get(@RequestParam String username, @RequestParam(required = false) Instant time)
|
public XpData get(@RequestParam String username, @RequestParam(required = false) Instant time)
|
||||||
{
|
{
|
||||||
if (time == null)
|
if (time == null)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import net.runelite.http.api.xtea.XteaKey;
|
|||||||
import net.runelite.http.api.xtea.XteaRequest;
|
import net.runelite.http.api.xtea.XteaRequest;
|
||||||
import net.runelite.http.service.util.exception.NotFoundException;
|
import net.runelite.http.service.util.exception.NotFoundException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -49,7 +50,7 @@ public class XteaController
|
|||||||
xteaService.submit(xteaRequest);
|
xteaService.submit(xteaRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping
|
@GetMapping
|
||||||
public List<XteaKey> get()
|
public List<XteaKey> get()
|
||||||
{
|
{
|
||||||
return xteaService.get().stream()
|
return xteaService.get().stream()
|
||||||
@@ -57,7 +58,7 @@ public class XteaController
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/{region}")
|
@GetMapping("/{region}")
|
||||||
public XteaKey getRegion(@PathVariable int region)
|
public XteaKey getRegion(@PathVariable int region)
|
||||||
{
|
{
|
||||||
XteaEntry xteaRegion = xteaService.getRegion(region);
|
XteaEntry xteaRegion = xteaService.getRegion(region);
|
||||||
|
|||||||
Reference in New Issue
Block a user