Search in sources :

Example 11 with BookDTO

use of com.github.lybgeek.redis.dto.BookDTO in project springboot-learning by lyb-geek.

the class RedisApplicationTest method testPageBook.

@Test
public void testPageBook() {
    PageQuery pageQuery = new PageQuery<>().setPageNo(1).setPageSize(5);
    BookDTO bookDTO = new BookDTO();
    bookDTO.setAuthor("张三");
    // bookDTO.setBookName("图解Http");
    // bookDTO.setId(4L);
    pageQuery.setQueryParams(bookDTO);
    PageResult<BookDTO> pageResult = bookService.pageBook(pageQuery);
    if (pageResult != null) {
        pageResult.getList().forEach(book -> System.out.println(book));
    }
}
Also used : PageQuery(com.github.lybgeek.common.model.PageQuery) BookDTO(com.github.lybgeek.redis.dto.BookDTO) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

BookDTO (com.github.lybgeek.redis.dto.BookDTO)11 Test (org.junit.Test)6 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)6 Book (com.github.lybgeek.redis.model.Book)3 PageResult (com.github.lybgeek.common.model.PageResult)2 Result (com.github.lybgeek.common.model.Result)2 Cacheable (org.springframework.cache.annotation.Cacheable)2 BindingResult (org.springframework.validation.BindingResult)2 PostMapping (org.springframework.web.bind.annotation.PostMapping)2 IPage (com.baomidou.mybatisplus.core.metadata.IPage)1 Page (com.baomidou.mybatisplus.extension.plugins.pagination.Page)1 BizException (com.github.lybgeek.common.exception.BizException)1 PageQuery (com.github.lybgeek.common.model.PageQuery)1 RedisCache (com.github.lybgeek.redis.annotation.RedisCache)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 Transactional (org.springframework.transaction.annotation.Transactional)1