Skip to content

Commit 2d062bc

Browse files
committed
kebab case
1 parent a6cd5d3 commit 2d062bc

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

src/main/java/sg/edu/nus/iss/shopsmart_backend/controller/ApiController.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ private HttpHeaders createHeaders() {
4545
return headers;
4646
}
4747

48-
@GetMapping("/{apiKey}/**")
48+
@GetMapping("/{api-key}/**")
4949
public CompletableFuture<ResponseEntity<JsonNode>> handleGetRequest(
50-
@PathVariable String apiKey,
50+
@PathVariable(name = "api-key") String apiKey,
5151
HttpServletRequest request,
5252
HttpServletResponse response) {
5353
HttpHeaders headers = createHeaders();
@@ -64,9 +64,9 @@ public CompletableFuture<ResponseEntity<JsonNode>> handleGetRequest(
6464
});
6565
}
6666

67-
@PostMapping("/{apiKey}/**")
67+
@PostMapping("/{api-key}/**")
6868
public CompletableFuture<ResponseEntity<JsonNode>> handlePostRequest(
69-
@PathVariable String apiKey,
69+
@PathVariable(name = "api-key") String apiKey,
7070
@RequestBody JsonNode requestBody,
7171
HttpServletRequest request,
7272
HttpServletResponse response) {
@@ -84,9 +84,9 @@ public CompletableFuture<ResponseEntity<JsonNode>> handlePostRequest(
8484
});
8585
}
8686

87-
@PutMapping("/{apiKey}/**")
87+
@PutMapping("/{api-key}/**")
8888
public CompletableFuture<ResponseEntity<JsonNode>> handlePutRequest(
89-
@PathVariable String apiKey,
89+
@PathVariable(name = "api-key") String apiKey,
9090
@RequestBody JsonNode requestBody,
9191
HttpServletRequest request,
9292
HttpServletResponse response) {
@@ -104,9 +104,9 @@ public CompletableFuture<ResponseEntity<JsonNode>> handlePutRequest(
104104
});
105105
}
106106

107-
@PatchMapping("/{apiKey}/**")
107+
@PatchMapping("/{api-key}/**")
108108
public CompletableFuture<ResponseEntity<JsonNode>> handlePatchRequest(
109-
@PathVariable String apiKey,
109+
@PathVariable(name = "api-key") String apiKey,
110110
@RequestBody JsonNode requestBody,
111111
HttpServletRequest request,
112112
HttpServletResponse response) {
@@ -124,9 +124,9 @@ public CompletableFuture<ResponseEntity<JsonNode>> handlePatchRequest(
124124
});
125125
}
126126

127-
@DeleteMapping("/{apiKey}/**")
127+
@DeleteMapping("/{api-key}/**")
128128
public CompletableFuture<ResponseEntity<JsonNode>> handleDeleteRequest(
129-
@PathVariable String apiKey,
129+
@PathVariable(name = "api-key") String apiKey,
130130
HttpServletRequest request,
131131
HttpServletResponse response) {
132132
log.info("Handling DELETE request for API: {}", apiKey);

src/main/java/sg/edu/nus/iss/shopsmart_backend/controller/RedisController.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,35 @@ public RedisController(RedisService redisService) {
2727
this.redisService = redisService;
2828
}
2929

30-
@PostMapping("/ddo/{apiKey}")
31-
public ResponseEntity<String> insertDdoDataInRedis(@PathVariable String apiKey, @RequestBody DataDynamicObject requestBody) {
30+
@PostMapping("/ddo/{api-key}")
31+
public ResponseEntity<String> insertDdoDataInRedis(@PathVariable(name = "api-key") String apiKey, @RequestBody DataDynamicObject requestBody) {
3232
log.info("Inserting DDO data in Redis for API key: {}", apiKey);
3333
return ok(redisService.insertDdoDataInRedis(apiKey, requestBody));
3434
}
3535

36-
@GetMapping("/ddo/{apiKey}")
37-
public ResponseEntity<JsonNode> getDdoDataFromRedis(@PathVariable String apiKey) {
36+
@GetMapping("/ddo/{api-key}")
37+
public ResponseEntity<JsonNode> getDdoDataFromRedis(@PathVariable(name = "api-key") String apiKey) {
3838
log.info("Fetching DDO data from Redis for API key: {}", apiKey);
3939
return ok(redisService.getDdoDataFromRedis(apiKey));
4040
}
4141

42-
@PostMapping("/hash/{redisKey}")
43-
public ResponseEntity<String> insertHashEntry(@PathVariable String redisKey, @RequestBody Map<String, String> requestBody) {
42+
@PostMapping("/hash/{redis-key}")
43+
public ResponseEntity<String> insertHashEntry(@PathVariable(name = "redis-key") String redisKey, @RequestBody Map<String, String> requestBody) {
4444
log.info("Inserting hash entry in Redis for key: {}", redisKey);
4545
String hashKey = requestBody.get("hashKey");
4646
String value = requestBody.get("value");
4747
redisService.setHashValue(redisKey, hashKey, value);
4848
return ok("Success");
4949
}
5050

51-
@GetMapping("/hash/{redisKey}/{hashKey}")
52-
public ResponseEntity<String> getHashEntry(@PathVariable String redisKey, @PathVariable String hashKey) {
51+
@GetMapping("/hash/{redis-key}/{hash-key}")
52+
public ResponseEntity<String> getHashEntry(@PathVariable(name = "redis-key") String redisKey, @PathVariable(name = "hash-key") String hashKey) {
5353
log.info("Fetching hash entry from Redis for key: {} and hash key: {}", redisKey, hashKey);
5454
return ok(redisService.getHashValue(redisKey, hashKey));
5555
}
5656

57-
@GetMapping("/hash/{redisKey}")
58-
public ResponseEntity<JsonNode> getHashEntries(@PathVariable String redisKey) {
57+
@GetMapping("/hash/{redis-key}")
58+
public ResponseEntity<JsonNode> getHashEntries(@PathVariable(name = "redis-key") String redisKey) {
5959
log.info("Fetching all hash entries from Redis for key: {}", redisKey);
6060
return ok(redisService.getHashMap(redisKey));
6161
}

0 commit comments

Comments
 (0)