mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-25 02:32:57 +08:00
推荐列表开发完成
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package com.xboe.module.boecase.dao;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xboe.module.boecase.dto.CasePageVo;
|
||||
import com.xboe.module.boecase.entity.Cases;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -7,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
@@ -18,4 +22,15 @@ class CasesRecordDaoTest {
|
||||
@Autowired
|
||||
private CasesRecordDao casesRecordDao;
|
||||
|
||||
@Test
|
||||
void queryList() throws JsonProcessingException {
|
||||
PageRequest of = PageRequest.of(0, 10);
|
||||
String jsonStr = "{\"pageIndex\":1,\"pageSize\":10,\"orderField\":\"excellent\",\"majorType\":\"\",\"orgDomainDtos\":[],\"orderAsc\":false,\"excellent\":true,\"breCommend\":true,\"caseType\":\"\",\"authorName\":\"\",\"notInIds\":[],\"type\":\"recommend\",\"userId\":\"\",\"parent\":\"\",\"children\":[],\"name\":\"\",\"years\":[2023,2022,2020,2021]}";
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
|
||||
CasePageVo pageVo = mapper.readValue(jsonStr, CasePageVo.class);
|
||||
pageVo.setUserId("965341999643234304");
|
||||
Page<Cases> cases = casesRecordDao.queryList(of, pageVo);
|
||||
System.out.println(cases);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user