解决推荐案例报错问题2

This commit is contained in:
buerjun
2023-07-03 11:43:36 +08:00
parent a0135ecdd1
commit 78ebea470d
2 changed files with 44 additions and 90 deletions

View File

@@ -41,7 +41,7 @@ class CasesServiceImplTest {
@Test
void queryRecommendPageCasesV2() throws JsonProcessingException {
String jsonStr = "{\"pageIndex\":1,\"pageSize\":5,\"majorType\":\"\",\"orderAsc\":false,\"excellent\":false,\"orgDomainDtos\":[],\"caseType\":\"\",\"authorName\":\"\",\"notInIds\":[],\"type\":\"recommend\",\"userId\":\"\",\"parent\":\"\",\"children\":[],\"name\":\"\",\"years\":[2023]}\n";
String jsonStr = "{\"pageIndex\":1,\"pageSize\":5,\"majorType\":\"\",\"orderAsc\":false,\"excellent\":false,\"orgDomainDtos\":[],\"caseType\":\"\",\"authorName\":\"\",\"notInIds\":[],\"type\":\"recommend\",\"userId\":\"\",\"parent\":\"\",\"children\":[],\"name\":\"\",\"years\":[2023]}";
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
CasePageVo pageVo = mapper.readValue(jsonStr, CasePageVo.class);