|
|
@@ -0,0 +1,28 @@
|
|
|
+package top.haijunit.train.controller;
|
|
|
+
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import top.haijunit.train.domain.entity.StationEntity;
|
|
|
+import top.haijunit.train.domain.repository.StationRepository;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author zhanghaijun
|
|
|
+ * @date 2024/1/7 00:41
|
|
|
+ * @description 车站请求处理
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/station")
|
|
|
+@RequiredArgsConstructor
|
|
|
+public class StationController {
|
|
|
+
|
|
|
+ private final StationRepository stationRepository;
|
|
|
+
|
|
|
+ @GetMapping("/list")
|
|
|
+ public List<StationEntity> getStationList() {
|
|
|
+ return stationRepository.findAll();
|
|
|
+ }
|
|
|
+}
|