推荐列表开发完成

This commit is contained in:
buerjun
2023-06-29 16:19:41 +08:00
parent f353116ce2
commit ae4382441a
4 changed files with 99 additions and 110 deletions

View File

@@ -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);
}
}