mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 03:46:50 +08:00
最佳案例
This commit is contained in:
@@ -11,8 +11,7 @@ import java.util.List;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
import javafx.util.Builder;
|
|
||||||
import org.apache.lucene.util.QueryBuilder;
|
|
||||||
import org.springframework.dao.DataAccessException;
|
import org.springframework.dao.DataAccessException;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.jdbc.core.PreparedStatementCallback;
|
import org.springframework.jdbc.core.PreparedStatementCallback;
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
package com.xboe.module.boecase.service.impl;
|
package com.xboe.module.boecase.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.ListUtil;
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.json.JSON;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.xboe.common.PageList;
|
import com.xboe.common.PageList;
|
||||||
import com.xboe.module.boecase.dto.CasePageVo;
|
import com.xboe.module.boecase.dto.CasePageVo;
|
||||||
import com.xboe.module.boecase.entity.Cases;
|
import com.xboe.module.boecase.entity.Cases;
|
||||||
@@ -20,13 +25,33 @@ class CasesServiceImplTest {
|
|||||||
private ICasesService casesService;
|
private ICasesService casesService;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void queryPageCasesV2() {
|
void queryPageCasesV2() throws JsonProcessingException {
|
||||||
CasePageVo pageVo = new CasePageVo();
|
String jsonStr = "{\n" +
|
||||||
// pageVo.setYears(ListUtil.toList(2023));
|
"\t\"pageIndex\": 1,\n" +
|
||||||
pageVo.setPageIndex(1);
|
"\t\"pageSize\": 10,\n" +
|
||||||
pageVo.setPageSize(10);
|
"\t\"isTop\": false,\n" +
|
||||||
pageVo.setUserId("199");
|
"\t\"orderField\": \"excellent\",\n" +
|
||||||
pageVo.setExcellent(Boolean.TRUE);
|
"\t\"majorType\": \"\",\n" +
|
||||||
|
"\t\"orgDomainDtos\": [],\n" +
|
||||||
|
"\t\"orderAsc\": false,\n" +
|
||||||
|
"\t\"excellent\": true,\n" +
|
||||||
|
"\t\"years\": [2023],\n" +
|
||||||
|
"\t\"breCommend\": true,\n" +
|
||||||
|
"\t\"caseType\": \"\",\n" +
|
||||||
|
"\t\"authorName\": \"\",\n" +
|
||||||
|
"\t\"notInIds\": [],\n" +
|
||||||
|
"\t\"type\": \"recommend\",\n" +
|
||||||
|
"\t\"userId\": \"\",\n" +
|
||||||
|
"\t\"parent\": \"\",\n" +
|
||||||
|
"\t\"children\": [],\n" +
|
||||||
|
"\t\"name\": \"\",\n" +
|
||||||
|
"\t\"firstId\": \"\",\n" +
|
||||||
|
"\t\"secondId\": \"\",\n" +
|
||||||
|
"\t\"threeId\": \"\"\n" +
|
||||||
|
"}";
|
||||||
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
|
||||||
|
CasePageVo pageVo = mapper.readValue(jsonStr, CasePageVo.class);
|
||||||
PageList<Cases> casesV2 = casesService.queryPageCasesV2(pageVo);
|
PageList<Cases> casesV2 = casesService.queryPageCasesV2(pageVo);
|
||||||
System.out.println(casesV2);
|
System.out.println(casesV2);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user