Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kebab case #10

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ private HttpHeaders createHeaders() {
return headers;
}

@GetMapping("/{apiKey}/**")
@GetMapping("/{api-key}/**")
public CompletableFuture<ResponseEntity<JsonNode>> handleGetRequest(
@PathVariable String apiKey,
@PathVariable(name = "api-key") String apiKey,
HttpServletRequest request,
HttpServletResponse response) {
HttpHeaders headers = createHeaders();
Expand All @@ -64,9 +64,9 @@ public CompletableFuture<ResponseEntity<JsonNode>> handleGetRequest(
});
}

@PostMapping("/{apiKey}/**")
@PostMapping("/{api-key}/**")
public CompletableFuture<ResponseEntity<JsonNode>> handlePostRequest(
@PathVariable String apiKey,
@PathVariable(name = "api-key") String apiKey,
@RequestBody JsonNode requestBody,
HttpServletRequest request,
HttpServletResponse response) {
Expand All @@ -84,9 +84,9 @@ public CompletableFuture<ResponseEntity<JsonNode>> handlePostRequest(
});
}

@PutMapping("/{apiKey}/**")
@PutMapping("/{api-key}/**")
public CompletableFuture<ResponseEntity<JsonNode>> handlePutRequest(
@PathVariable String apiKey,
@PathVariable(name = "api-key") String apiKey,
@RequestBody JsonNode requestBody,
HttpServletRequest request,
HttpServletResponse response) {
Expand All @@ -104,9 +104,9 @@ public CompletableFuture<ResponseEntity<JsonNode>> handlePutRequest(
});
}

@PatchMapping("/{apiKey}/**")
@PatchMapping("/{api-key}/**")
public CompletableFuture<ResponseEntity<JsonNode>> handlePatchRequest(
@PathVariable String apiKey,
@PathVariable(name = "api-key") String apiKey,
@RequestBody JsonNode requestBody,
HttpServletRequest request,
HttpServletResponse response) {
Expand All @@ -124,9 +124,9 @@ public CompletableFuture<ResponseEntity<JsonNode>> handlePatchRequest(
});
}

@DeleteMapping("/{apiKey}/**")
@DeleteMapping("/{api-key}/**")
public CompletableFuture<ResponseEntity<JsonNode>> handleDeleteRequest(
@PathVariable String apiKey,
@PathVariable(name = "api-key") String apiKey,
HttpServletRequest request,
HttpServletResponse response) {
log.info("Handling DELETE request for API: {}", apiKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,35 @@ public RedisController(RedisService redisService) {
this.redisService = redisService;
}

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

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

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

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

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