use of com.github.lybgeek.swagger.dto.BookDTO in project springboot-learning by lyb-geek.
the class BookController method getBookById.
@PostMapping(value = "/get/{id}")
@ApiOperation(value = "查找书籍", notes = "根据书籍编号查找书籍")
@ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "书籍编号", dataType = "Long", required = true) })
public Result<BookDTO> getBookById(@PathVariable("id") Long id) {
Result<BookDTO> result = new Result<>();
BookDTO book = bookService.getBookById(id);
result.setData(book);
return result;
}
use of com.github.lybgeek.swagger.dto.BookDTO in project springboot-learning by lyb-geek.
the class BookServiceImpl method getBookById.
@Override
public BookDTO getBookById(Long id) {
Book dbBook = baseMapper.selectById(id);
BookDTO bookDTO = dozerMapper.map(dbBook, BookDTO.class);
return bookDTO;
}
Aggregations