diff --git a/http-service/src/main/java/net/runelite/http/service/account/AccountService.java b/http-service/src/main/java/net/runelite/http/service/account/AccountService.java index c78a25b9ff..cda996ea1e 100644 --- a/http-service/src/main/java/net/runelite/http/service/account/AccountService.java +++ b/http-service/src/main/java/net/runelite/http/service/account/AccountService.java @@ -50,6 +50,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -133,7 +134,7 @@ public class AccountService } } - @RequestMapping("/login") + @GetMapping("/login") public OAuthResponse login(@RequestParam UUID uuid) { State state = new State(); @@ -157,7 +158,7 @@ public class AccountService return lr; } - @RequestMapping("/callback") + @GetMapping("/callback") public Object callback( HttpServletRequest request, HttpServletResponse response, @@ -245,7 +246,7 @@ public class AccountService } } - @RequestMapping("/logout") + @GetMapping("/logout") public void logout(HttpServletRequest request, HttpServletResponse response) throws IOException { 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 { auth.handle(request, response); diff --git a/http-service/src/main/java/net/runelite/http/service/cache/CacheController.java b/http-service/src/main/java/net/runelite/http/service/cache/CacheController.java index 9e4c0ab0bb..f86f453412 100644 --- a/http-service/src/main/java/net/runelite/http/service/cache/CacheController.java +++ b/http-service/src/main/java/net/runelite/http/service/cache/CacheController.java @@ -62,6 +62,7 @@ import net.runelite.http.service.cache.beans.IndexEntry; import net.runelite.http.service.util.exception.NotFoundException; import org.springframework.beans.factory.annotation.Autowired; 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.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -75,7 +76,7 @@ public class CacheController @Autowired private CacheService cacheService; - @RequestMapping("/") + @GetMapping("/") public List listCaches() { return cacheService.listCaches().stream() @@ -83,7 +84,7 @@ public class CacheController .collect(Collectors.toList()); } - @RequestMapping("{cacheId}") + @GetMapping("{cacheId}") public List listIndexes(@PathVariable int cacheId) { CacheEntry cache = cacheService.findCache(cacheId); @@ -99,7 +100,7 @@ public class CacheController .collect(Collectors.toList()); } - @RequestMapping("{cacheId}/{indexId}") + @GetMapping("{cacheId}/{indexId}") public List listArchives(@PathVariable int cacheId, @PathVariable int indexId) { @@ -122,7 +123,7 @@ public class CacheController .collect(Collectors.toList()); } - @RequestMapping("{cacheId}/{indexId}/{archiveId}") + @GetMapping("{cacheId}/{indexId}/{archiveId}") public CacheArchive getCacheArchive(@PathVariable int cacheId, @PathVariable int indexId, @PathVariable int archiveId) @@ -149,7 +150,7 @@ public class CacheController archiveEntry.getNameHash(), archiveEntry.getRevision()); } - @RequestMapping("{cacheId}/{indexId}/{archiveId}/data") + @GetMapping("{cacheId}/{indexId}/{archiveId}/data") public byte[] getArchiveData( @PathVariable int cacheId, @PathVariable int indexId, @@ -200,7 +201,7 @@ public class CacheController return archiveEntry; } - @RequestMapping("item/{itemId}") + @GetMapping("item/{itemId}") public ItemDefinition getItem(@PathVariable int itemId) throws IOException { ArchiveEntry archiveEntry = findConfig(ConfigType.ITEM); @@ -221,7 +222,7 @@ public class CacheController return itemdef; } - @RequestMapping(path = "item/{itemId}/image", produces = "image/png") + @GetMapping(path = "item/{itemId}/image", produces = "image/png") public ResponseEntity getItemImage( @PathVariable int itemId, @RequestParam(defaultValue = "1") int quantity, @@ -313,7 +314,7 @@ public class CacheController return ResponseEntity.ok(bao.toByteArray()); } - @RequestMapping("object/{objectId}") + @GetMapping("object/{objectId}") public ObjectDefinition getObject( @PathVariable int objectId ) throws IOException @@ -336,7 +337,7 @@ public class CacheController return objectdef; } - @RequestMapping("npc/{npcId}") + @GetMapping("npc/{npcId}") public NpcDefinition getNpc( @PathVariable int npcId ) throws IOException diff --git a/http-service/src/main/java/net/runelite/http/service/config/ConfigController.java b/http-service/src/main/java/net/runelite/http/service/config/ConfigController.java index 966d49cda2..b14a03659c 100644 --- a/http-service/src/main/java/net/runelite/http/service/config/ConfigController.java +++ b/http-service/src/main/java/net/runelite/http/service/config/ConfigController.java @@ -31,6 +31,7 @@ import net.runelite.http.api.config.Configuration; import net.runelite.http.service.account.AuthFilter; import net.runelite.http.service.account.beans.SessionEntry; 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.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -52,7 +53,7 @@ public class ConfigController this.authFilter = authFilter; } - @RequestMapping + @GetMapping public Configuration get(HttpServletRequest request, HttpServletResponse response) throws IOException { SessionEntry session = authFilter.handle(request, response); diff --git a/http-service/src/main/java/net/runelite/http/service/examine/ExamineController.java b/http-service/src/main/java/net/runelite/http/service/examine/ExamineController.java index c689172e9b..b7e079497f 100644 --- a/http-service/src/main/java/net/runelite/http/service/examine/ExamineController.java +++ b/http-service/src/main/java/net/runelite/http/service/examine/ExamineController.java @@ -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.ItemService; 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.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -50,19 +51,19 @@ public class ExamineController this.itemService = itemService; } - @RequestMapping("/npc/{id}") + @GetMapping("/npc/{id}") public String getNpc(@PathVariable int id) { return examineService.get(NPC, id); } - @RequestMapping("/object/{id}") + @GetMapping("/object/{id}") public String getObject(@PathVariable int id) { return examineService.get(OBJECT, id); } - @RequestMapping("/item/{id}") + @GetMapping("/item/{id}") public String getItem(@PathVariable int id) { // Tradeable item examine info is available from the Jagex item API diff --git a/http-service/src/main/java/net/runelite/http/service/feed/FeedController.java b/http-service/src/main/java/net/runelite/http/service/feed/FeedController.java index fa641d3714..c679cd319f 100644 --- a/http-service/src/main/java/net/runelite/http/service/feed/FeedController.java +++ b/http-service/src/main/java/net/runelite/http/service/feed/FeedController.java @@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.CacheControl; import org.springframework.http.ResponseEntity; 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.RestController; @@ -95,7 +96,7 @@ public class FeedController feedResult = new FeedResult(items); } - @RequestMapping + @GetMapping public ResponseEntity getFeed() { if (feedResult == null) diff --git a/http-service/src/main/java/net/runelite/http/service/hiscore/HiscoreController.java b/http-service/src/main/java/net/runelite/http/service/hiscore/HiscoreController.java index d144b7db79..25a89e6a8d 100644 --- a/http-service/src/main/java/net/runelite/http/service/hiscore/HiscoreController.java +++ b/http-service/src/main/java/net/runelite/http/service/hiscore/HiscoreController.java @@ -34,6 +34,7 @@ import net.runelite.http.service.util.HiscoreEndpointEditor; import net.runelite.http.service.xp.XpTrackerService; import org.springframework.beans.factory.annotation.Autowired; 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.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -50,7 +51,7 @@ public class HiscoreController @Autowired private XpTrackerService xpTrackerService; - @RequestMapping("/{endpoint}") + @GetMapping("/{endpoint}") public HiscoreResult lookup(@PathVariable HiscoreEndpoint endpoint, @RequestParam String username) throws ExecutionException { HiscoreResult result = hiscoreService.lookupUsername(username, endpoint); @@ -68,7 +69,7 @@ public class HiscoreController return result; } - @RequestMapping("/{endpoint}/{skillName}") + @GetMapping("/{endpoint}/{skillName}") public SingleHiscoreSkillResult singleSkillLookup(@PathVariable HiscoreEndpoint endpoint, @PathVariable String skillName, @RequestParam String username) throws ExecutionException { HiscoreSkill skill = HiscoreSkill.valueOf(skillName.toUpperCase()); diff --git a/http-service/src/main/java/net/runelite/http/service/item/ItemController.java b/http-service/src/main/java/net/runelite/http/service/item/ItemController.java index 9c05889330..9d1ed5710e 100644 --- a/http-service/src/main/java/net/runelite/http/service/item/ItemController.java +++ b/http-service/src/main/java/net/runelite/http/service/item/ItemController.java @@ -40,6 +40,7 @@ import net.runelite.http.api.item.SearchResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.CacheControl; 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.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -78,7 +79,7 @@ public class ItemController .toArray(ItemPrice[]::new), 30, TimeUnit.MINUTES); } - @RequestMapping("/{itemId}") + @GetMapping("/{itemId}") public Item getItem(HttpServletResponse response, @PathVariable int itemId) { ItemEntry item = itemService.getItem(itemId); @@ -91,7 +92,7 @@ public class ItemController return null; } - @RequestMapping(path = "/{itemId}/icon", produces = "image/gif") + @GetMapping(path = "/{itemId}/icon", produces = "image/gif") public ResponseEntity getIcon(@PathVariable int itemId) { ItemEntry item = itemService.getItem(itemId); @@ -104,7 +105,7 @@ public class ItemController return ResponseEntity.notFound().build(); } - @RequestMapping(path = "/{itemId}/icon/large", produces = "image/gif") + @GetMapping(path = "/{itemId}/icon/large", produces = "image/gif") public ResponseEntity getIconLarge(HttpServletResponse response, @PathVariable int itemId) { ItemEntry item = itemService.getItem(itemId); @@ -117,7 +118,7 @@ public class ItemController return ResponseEntity.notFound().build(); } - @RequestMapping("/{itemId}/price") + @GetMapping("/{itemId}/price") public ResponseEntity itemPrice( @PathVariable int itemId, @RequestParam(required = false) Instant time @@ -179,7 +180,7 @@ public class ItemController .body(itemPrice); } - @RequestMapping("/search") + @GetMapping("/search") public SearchResult search(@RequestParam String query) { List result = itemService.search(query); @@ -193,7 +194,7 @@ public class ItemController return searchResult; } - @RequestMapping("/price") + @GetMapping("/price") public ItemPrice[] prices(@RequestParam("id") int[] itemIds) { if (itemIds.length > MAX_BATCH_LOOKUP) @@ -216,7 +217,7 @@ public class ItemController .toArray(ItemPrice[]::new); } - @RequestMapping("/prices") + @GetMapping("/prices") public ResponseEntity prices() { return ResponseEntity.ok() diff --git a/http-service/src/main/java/net/runelite/http/service/loottracker/LootTrackerController.java b/http-service/src/main/java/net/runelite/http/service/loottracker/LootTrackerController.java index d5a09f44d2..2c1bd77140 100644 --- a/http-service/src/main/java/net/runelite/http/service/loottracker/LootTrackerController.java +++ b/http-service/src/main/java/net/runelite/http/service/loottracker/LootTrackerController.java @@ -35,6 +35,7 @@ import net.runelite.http.service.account.AuthFilter; import net.runelite.http.service.account.beans.SessionEntry; import org.springframework.beans.factory.annotation.Autowired; 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.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -65,7 +66,7 @@ public class LootTrackerController response.setStatus(HttpStatusCodes.STATUS_CODE_OK); } - @RequestMapping + @GetMapping public Collection 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); diff --git a/http-service/src/main/java/net/runelite/http/service/osbuddy/OSBGrandExchangeController.java b/http-service/src/main/java/net/runelite/http/service/osbuddy/OSBGrandExchangeController.java index 847c415772..eaade27c12 100644 --- a/http-service/src/main/java/net/runelite/http/service/osbuddy/OSBGrandExchangeController.java +++ b/http-service/src/main/java/net/runelite/http/service/osbuddy/OSBGrandExchangeController.java @@ -29,6 +29,7 @@ import java.util.concurrent.TimeUnit; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.CacheControl; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -45,7 +46,7 @@ public class OSBGrandExchangeController this.grandExchangeService = grandExchangeService; } - @RequestMapping + @GetMapping public ResponseEntity get(@RequestParam("itemId") int itemId) throws ExecutionException { GrandExchangeEntry grandExchangeEntry = grandExchangeService.get(itemId); diff --git a/http-service/src/main/java/net/runelite/http/service/sprite/SpriteController.java b/http-service/src/main/java/net/runelite/http/service/sprite/SpriteController.java index 42b285761e..80d8f738ba 100644 --- a/http-service/src/main/java/net/runelite/http/service/sprite/SpriteController.java +++ b/http-service/src/main/java/net/runelite/http/service/sprite/SpriteController.java @@ -31,6 +31,7 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; import org.springframework.beans.factory.annotation.Autowired; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -55,7 +56,7 @@ public class SpriteController } }); - @RequestMapping(produces = "image/png") + @GetMapping(produces = "image/png") public ResponseEntity getSprite( @RequestParam int spriteId, @RequestParam(defaultValue = "0") int frameId diff --git a/http-service/src/main/java/net/runelite/http/service/worlds/WorldController.java b/http-service/src/main/java/net/runelite/http/service/worlds/WorldController.java index 7dba1bc1dd..51769e181c 100644 --- a/http-service/src/main/java/net/runelite/http/service/worlds/WorldController.java +++ b/http-service/src/main/java/net/runelite/http/service/worlds/WorldController.java @@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.CacheControl; import org.springframework.http.ResponseEntity; 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.RestController; @@ -45,7 +46,7 @@ public class WorldController private WorldResult worldResult; - @RequestMapping + @GetMapping public ResponseEntity listWorlds() throws IOException { return ResponseEntity.ok() diff --git a/http-service/src/main/java/net/runelite/http/service/xp/XpTrackerController.java b/http-service/src/main/java/net/runelite/http/service/xp/XpTrackerController.java index 9710faef20..d247d735a4 100644 --- a/http-service/src/main/java/net/runelite/http/service/xp/XpTrackerController.java +++ b/http-service/src/main/java/net/runelite/http/service/xp/XpTrackerController.java @@ -28,6 +28,7 @@ import java.time.Instant; import net.runelite.http.api.xp.XpData; import net.runelite.http.service.xp.beans.XpEntity; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -39,13 +40,13 @@ public class XpTrackerController @Autowired private XpTrackerService xpTrackerService; - @RequestMapping("/update") + @GetMapping("/update") public void update(@RequestParam String username) { xpTrackerService.tryUpdate(username); } - @RequestMapping("/get") + @GetMapping("/get") public XpData get(@RequestParam String username, @RequestParam(required = false) Instant time) { if (time == null) diff --git a/http-service/src/main/java/net/runelite/http/service/xtea/XteaController.java b/http-service/src/main/java/net/runelite/http/service/xtea/XteaController.java index 5f06429a80..3868acb8c6 100644 --- a/http-service/src/main/java/net/runelite/http/service/xtea/XteaController.java +++ b/http-service/src/main/java/net/runelite/http/service/xtea/XteaController.java @@ -30,6 +30,7 @@ import net.runelite.http.api.xtea.XteaKey; import net.runelite.http.api.xtea.XteaRequest; import net.runelite.http.service.util.exception.NotFoundException; 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.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -49,7 +50,7 @@ public class XteaController xteaService.submit(xteaRequest); } - @RequestMapping + @GetMapping public List get() { return xteaService.get().stream() @@ -57,7 +58,7 @@ public class XteaController .collect(Collectors.toList()); } - @RequestMapping("/{region}") + @GetMapping("/{region}") public XteaKey getRegion(@PathVariable int region) { XteaEntry xteaRegion = xteaService.getRegion(region);