use of com.github.lybgeek.spilt.dto.BookDTO in project springboot-learning by lyb-geek.
the class BookController method upadteBook.
@PostMapping(value = "/update")
public Result<BookDTO> upadteBook(BookDTO bookDTO) {
Result<BookDTO> result = new Result<>();
if (bookDTO.getId() == null) {
result.setStatus(Result.fail);
result.setMessage("id不能为空");
return result;
}
BookDTO book = bookService.editBook(bookDTO);
result.setData(book);
return result;
}
use of com.github.lybgeek.spilt.dto.BookDTO in project springboot-learning by lyb-geek.
the class SplitTableApplicationTest method testAddBook.
@Test
public void testAddBook() {
for (int i = 1; i <= 10; i++) {
BookDTO bookDTO = BookDTO.builder().bookName("docker从入门到精通(第" + i + ")版").author("张三" + i).description("docker从入门到精通(第" + i + ")版,热门系列").price(BigDecimal.valueOf(i * 10)).stock(i).build();
bookDTO = bookService.addBook(bookDTO);
System.out.println(bookDTO);
}
}
Aggregations