diff --git a/build.gradle.kts b/build.gradle.kts index d8f4d13..382dfe6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { java { toolchain { - languageVersion = JavaLanguageVersion.of(25) + languageVersion = JavaLanguageVersion.of(21) } } @@ -94,3 +94,7 @@ tasks.named("compileJava") { tasks.withType { useJUnitPlatform() } + +java.sourceSets["main"].java { + srcDirs("model", "src/main/smithy") +} diff --git a/src/main/java/com/shopping/inandout/routeservice/controller/RouteController.java b/src/main/java/com/shopping/inandout/routeservice/controller/RouteController.java new file mode 100644 index 0000000..5302386 --- /dev/null +++ b/src/main/java/com/shopping/inandout/routeservice/controller/RouteController.java @@ -0,0 +1,38 @@ +package com.shopping.inandout.routeservice.controller; + +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/api/stores/{storeId}/routes") +public class RouteController { + + private final RouteService routeService; + + public RouteController(RouteService routeService) { + this.routeService = routeService; + } + + @PostMapping + public RouteSummary createRoute( + @PathVariable String storeId, + @RequestBody CreateRouteInput request) { + + return routeService.createRoute(storeId, request); + } + + @GetMapping("/{routeId}") + public RouteSummary getRoute( + @PathVariable String storeId, + @PathVariable String routeId) { + + return routeService.getRoute(storeId, routeId); + } + + @DeleteMapping("/{routeId}") + public RouteSummary deleteRoute( + @PathVariable String storeId, + @PathVariable String routeId) { + + return routeService.deleteRoute(storeId, routeId); + } +} \ No newline at end of file