|
|
@@ -0,0 +1,88 @@
|
|
|
+package cn.cslg.pas.controller;
|
|
|
+
|
|
|
+import cn.cslg.pas.common.core.base.Constants;
|
|
|
+import cn.cslg.pas.common.model.dto.CniprFrontDTO;
|
|
|
+import cn.cslg.pas.common.model.dto.CniprSf1V1DTO;
|
|
|
+import cn.cslg.pas.common.utils.Response;
|
|
|
+import cn.cslg.pas.service.CniprService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.io.IOException;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 对接Cnipr平台的controller层
|
|
|
+ *
|
|
|
+ * @Author xiexiang
|
|
|
+ * @Date 2023/4/17
|
|
|
+ */
|
|
|
+@Tag(name = "Cnipr平台")
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RequestMapping(Constants.API_VERSION_V2 + "/Cnipr")
|
|
|
+public class CniprController {
|
|
|
+ private final CniprService cniprService;
|
|
|
+
|
|
|
+ @Operation(summary = "测试Cnipr检索")
|
|
|
+ @GetMapping("/test")
|
|
|
+ public String testCnipr() throws IOException {
|
|
|
+ String res = cniprService.getAccessTokenAndOpenId();
|
|
|
+ return Response.success(res);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "测试Cnipr sf1v1检索")
|
|
|
+ @PostMapping("/search")
|
|
|
+ public String SearchCnipr(@RequestBody CniprSf1V1DTO cniprSf1V1DTO) throws IOException {
|
|
|
+ String res = cniprService.searchSf1V1(cniprSf1V1DTO);
|
|
|
+ return Response.success(res);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "测试数据装载")
|
|
|
+ @PostMapping("/to")
|
|
|
+ public String CniprToXiaoShi(@RequestBody CniprFrontDTO cniprFrontDTO) throws IOException {
|
|
|
+ CniprFrontDTO cniprFrontDTO1 = cniprService.CniprToXiaoShi(cniprFrontDTO);
|
|
|
+ return Response.success(cniprFrontDTO1);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "测试pi11")
|
|
|
+ @GetMapping("/pi11")
|
|
|
+ public String CniprPi11(String pid) throws IOException {
|
|
|
+ String res = cniprService.GetPicturePdf(pid);
|
|
|
+ return Response.success(res);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "测试pi12")
|
|
|
+ @GetMapping("/pi12")
|
|
|
+ public String CniprPi12(String pid) throws IOException {
|
|
|
+ String res = cniprService.GetAbsPicture(pid);
|
|
|
+ return Response.success(res);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "测试pi13")
|
|
|
+ @GetMapping("/pi13")
|
|
|
+ public String CniprPi13(String pid,String target) throws IOException {
|
|
|
+ String res = cniprService.GetPatentInstructionText(pid,target);
|
|
|
+ return Response.success(res);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "测试pi14")
|
|
|
+ @GetMapping("/pi14")
|
|
|
+ public String CniprPi14(String pid,String target) throws IOException {
|
|
|
+ String res = cniprService.GetPatentAppPicture(pid,target);
|
|
|
+ return Response.success(res);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "测试pi16")
|
|
|
+ @GetMapping("/pi16")
|
|
|
+ public String CniprPi16(String pid,String resource_name) throws IOException {
|
|
|
+ String res = cniprService.GetPatentIllustration(pid,resource_name);
|
|
|
+ return Response.success(res);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|