zero 1 рік тому
батько
коміт
00ece3de2f

+ 3 - 2
src/main/java/cn/cslg/pas/controller/outApi/PatentStarController.java

@@ -2,6 +2,7 @@ package cn.cslg.pas.controller.outApi;
 
 import cn.cslg.pas.common.core.base.Constants;
 import cn.cslg.pas.common.dto.PatentStarListDTO;
+import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.service.common.PatentStarApiService;
 import io.swagger.v3.oas.annotations.Operation;
@@ -24,8 +25,8 @@ public class PatentStarController {
     @PostMapping("/select")
     @Operation(summary = "一般检索接口")
     public Response select(@RequestBody PatentStarListDTO patentStarListDto) throws IOException {
-        Map<String, Object> map = patentStarApiService.patentStarSearchLocal(patentStarListDto);
-        return Response.success(map);
+        Records records = patentStarApiService.patentStarSearchLocal(patentStarListDto);
+        return Response.success(records);
     }
 
     @GetMapping("/getCnBib")

+ 3 - 5
src/main/java/cn/cslg/pas/service/common/PatentStarApiService.java

@@ -194,7 +194,7 @@ public class PatentStarApiService {
 //        });
 //    }
 
-    public Map<String, Object> patentStarSearchLocal(PatentStarListDTO patentStarListDTO) throws IOException {
+    public Records patentStarSearchLocal(PatentStarListDTO patentStarListDTO) throws IOException {
         RetrieveRecord retrieveRecord = new RetrieveRecord();
         retrieveRecord.setConditions(patentStarListDTO.getCurrentQuery());
 
@@ -224,15 +224,13 @@ public class PatentStarApiService {
 //        else {
 //            retrieveRecord.updateById();
 //        }
-        map.put("retrieveRecordId", retrieveRecord.getId());
         Records records = new Records();
+        records.setRetrieveRecordId(retrieveRecord.getId());
         records.setCurrent((Long) map.get("current"));
         records.setSize((Long) map.get("size"));
         records.setData(map.get("records"));
         records.setTotal((Long) map.get("total"));
-        map.put("records", records);
-        return map;
-
+        return records;
     }
 
 

+ 3 - 2
src/test/java/cn/cslg/pas/service/PatentStarServiceTests.java

@@ -2,6 +2,7 @@ package cn.cslg.pas.service;
 
 import cn.cslg.pas.common.core.IgnoreDTDEntityResolver;
 import cn.cslg.pas.common.dto.PatentStarListDTO;
+import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.utils.FormatUtil;
 import cn.cslg.pas.common.utils.RedisUtil;
 import cn.cslg.pas.common.utils.StringUtils;
@@ -52,8 +53,8 @@ public class PatentStarServiceTests {
         patentStarListDTO.setPageNum(1);
         patentStarListDTO.setRowCount(10);
         patentStarListDTO.setOrderByType("DESC");
-        Map<String, Object> map = patentStarApiService.patentStarSearchLocal(patentStarListDTO);
-        System.out.println(map);
+        Records records = patentStarApiService.patentStarSearchLocal(patentStarListDTO);
+        System.out.println(records);
     }
 
     @Test