CONTROLLER變更
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user