CONTROLLER變更

This commit is contained in:
2025-05-14 14:17:03 +09:00
parent 057a066404
commit 31639a6e98
14 changed files with 33 additions and 31 deletions

View File

@ -3,13 +3,15 @@ package co.jp.app.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import co.jp.app.entity.PetEntity;
import co.jp.app.service.PetService;
@Controller
@RestController
public class PetController {
@ -17,8 +19,9 @@ public class PetController {
private PetService service;
@GetMapping("/api/dogs/pet")
public String getListByEntities(@RequestParam List<Integer> id) {
service.getPetByID(id);
return "pet";
public ResponseEntity<?> getListByEntities(@RequestParam List<Integer> id) {
List<PetEntity> list = service.getPetByID(id);
return ResponseEntity.ok(list);
}
}