|
@@ -7,6 +7,7 @@ import com.ygj.yuemum.service.admin.TrainService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
@@ -22,6 +23,11 @@ public class TrainController {
|
|
|
return jso;
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/getAllTrains")
|
|
|
+ public List<Train> getAllTrains() {
|
|
|
+ return trainService.getAllTrains();
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/addTrain")
|
|
|
public int add(@ModelAttribute Train train) {
|
|
|
return trainService.addTrain(train);
|