Skip to content

Commit

Permalink
Merge branch 'main' into create-bookCreate
Browse files Browse the repository at this point in the history
  • Loading branch information
tfer2442 committed Feb 3, 2023
2 parents 2f6fa79 + 9c90f7e commit 38205d6
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ public class BookInfoController {
BookInfoService bookInfoService;
@GetMapping("")
@ResponseBody
public List<BookInfo> returnBookInfoAll(){
return bookInfoService.findAll();
public Object returnBookInfoAll(@RequestParam(value="bookInfoId", required=false) Long id){
if(id==null)
return bookInfoService.findAll();
else
return bookInfoService.findOne(id);
}

@GetMapping("/{bookName}")
@ResponseBody
public List<BookInfo> returnBookInfo(@PathVariable("bookName") String name){
return bookInfoService.findByBookNameContaining(name);
}
@GetMapping("")
@ResponseBody
public BookInfo returnBookInfoById(@RequestParam(value="bookInfoId") Long id){
return bookInfoService.findOne(id);
}

@GetMapping("/random/{count}")
@ResponseBody
Expand Down

0 comments on commit 38205d6

Please sign in to comment.