123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- package cn.cslg.pas.controller.outApi;
- import cn.cslg.pas.common.core.base.Constants;
- import cn.cslg.pas.common.dto.*;
- import cn.cslg.pas.common.dto.business.SelectClaimDTO;
- import cn.cslg.pas.common.model.cronModel.Records;
- import cn.cslg.pas.common.model.pythonModel.GetPatentSimilarScoreDTO;
- import cn.cslg.pas.common.model.pythonModel.GetPatentSimilarScoreVO;
- import cn.cslg.pas.common.utils.Response;
- import cn.cslg.pas.common.vo.QueryExternalFamilyVO;
- import cn.cslg.pas.common.vo.business.PatentNoVO;
- import cn.cslg.pas.domain.es.Text;
- import cn.cslg.pas.service.common.PatentStarApiService;
- import cn.cslg.pas.service.common.PythonApiService;
- import io.swagger.v3.oas.annotations.Operation;
- import io.swagger.v3.oas.annotations.tags.Tag;
- import lombok.RequiredArgsConstructor;
- import org.springframework.context.annotation.Lazy;
- import org.springframework.web.bind.annotation.*;
- import java.io.IOException;
- import java.text.ParseException;
- import java.util.List;
- import java.util.Map;
- @Tag(name = "专利之星接口服务类")
- @RestController
- @RequestMapping(Constants.API_XiaoSHI + "/patentStar")
- @RequiredArgsConstructor(onConstructor_ = {@Lazy})
- public class PatentStarController {
- private final PatentStarApiService patentStarApiService;
- private final PythonApiService pythonApiService;
- @PostMapping("/select")
- @Operation(summary = "一般检索接口")
- public Response select(@RequestBody PatentStarListDTO patentStarListDto) throws IOException {
- Records records = null;
- try {
- records = patentStarApiService.patentStarSearchLocal(patentStarListDto);
- } catch (Exception e) {
- return Response.error(e.getMessage());
- }
- return Response.success(records);
- }
- @GetMapping("/getCnBib")
- @Operation(summary = "获得中国专利著录")
- public String getCnBib(String appNo) {
- return patentStarApiService.getCnBibApi(appNo);
- }
- @GetMapping("/getPicture")
- @Operation(summary = "获得中国专利摘要附图")
- public String getPicture(String appNo) {
- return patentStarApiService.getPictureApi(appNo);
- }
- @GetMapping("/getWGPicture")
- @Operation(summary = "获得中国专利外观图")
- public String getWGPicture(String appNo) throws IOException {
- return patentStarApiService.getWGPictureApi(appNo);
- }
- @GetMapping("/getCnLegal")
- @Operation(summary = "获得中国专利法律状态")
- public String getCnLegal(String appNo) {
- return patentStarApiService.getCnLegalApi(appNo);
- }
- @GetMapping("/getCnPdf")
- @Operation(summary = "获得中国专利pdf全文")
- public String getCnPdf(String appNo) throws IOException {
- String picUrl = patentStarApiService.getCnPdfApi(appNo);
- return picUrl;
- }
- @GetMapping("/getCnFullXml")
- @Operation(summary = "获得中国专利全文文本")
- public String getCnFullXml(String appNo) throws IOException {
- return patentStarApiService.getCnFullXmlApi(appNo);
- }
- @GetMapping("/getEnPdf")
- @Operation(summary = "获得世界专利pdf")
- public String getEnPdf(String patentNo) throws IOException {
- return patentStarApiService.getEnPdfApi(patentNo);
- }
- @GetMapping("/getENBib")
- @Operation(summary = "获得世界专利著录信息")
- public String getENBib(String patentNo) throws IOException {
- String result = patentStarApiService.getENBibApi(patentNo);
- return result;
- }
- @GetMapping("/getFamilyByPubNo")
- @Operation(summary = "获得同族专利")
- public String getFamilyByPubNo(String patentNo) {
- return patentStarApiService.getFamilyByPubNoApi(patentNo);
- }
- @GetMapping("/getCitedNumByPubNo")
- @Operation(summary = "获得被引用次数")
- public String getCitedNumByPubNo(String patentNo) throws IOException {
- return patentStarApiService.getCitedNumByPubNoApi(patentNo);
- }
- @Operation(summary = "根据原始申请号查询外部权利要求")
- @GetMapping("/queryExternalClaim")
- public Response queryExternalClaim(String appNo) throws Exception {
- SelectClaimDTO dto = patentStarApiService.queryExternalClaim(appNo);
- return Response.success(dto);
- }
- @Operation(summary = "查询外部专利详情")
- @PostMapping("/queryExternalDetail")
- public Response queryExternalDetail(@RequestBody QueryExternalFamilyVO vo) throws Exception {
- PatentColumnDTO dto = null;
- try {
- dto = patentStarApiService.queryExternalDetail(vo);
- } catch (IOException e) {
- return Response.error(e.getMessage());
- }
- return Response.success(dto);
- }
- @Operation(summary = "查询外部专利同族专利")
- @PostMapping("/queryExternalFamily")
- public Response queryExternalFamily(@RequestBody QueryExternalFamilyVO vo) throws IOException {
- Records records = patentStarApiService.queryExternalFamily(vo);
- return Response.success(records);
- }
- @GetMapping("/getCnFullText")
- @Operation(summary = "获得中国专利说明书全文文本")
- public Response getCnFullText(String appNo) throws IOException {
- List<Text> fullText = patentStarApiService.getCnFullText(appNo);
- return Response.success(fullText);
- }
- @GetMapping("/getExternalTextPdf")
- @Operation(summary = "获得中国专利pdf全文")
- public Response getExternalTextPdf(String appNo,String rowApplicationNo,String publicNo,String grantNo ) throws IOException {
- List<InnerPatentPdfDTO> pdfDTOS = patentStarApiService.getExternalTextPdf(appNo,rowApplicationNo,publicNo,grantNo);
- return Response.success(pdfDTOS);
- }
- @GetMapping("/getExternalFigure")
- @Operation(summary = "外部获得附图")
- public Response getExternalFigure(String appNo) throws IOException {
- List<String> figures = patentStarApiService.getExternalFigure(appNo);
- return Response.success(figures);
- }
- @GetMapping("/getPictureGuid")
- @Operation(summary = "外部获取摘要附图")
- public Response getPictureGuid(String appNo) throws IOException {
- String pictureGuid = patentStarApiService.getPictureGuid(appNo);
- return Response.success(pictureGuid);
- }
- @GetMapping("/getLegalStatus")
- @Operation(summary = "外部获取法律状态")
- public Response getLegalStatus(String appNo) throws ParseException {
- ExternalLegalInfoDTO infoDTO = patentStarApiService.getLegalStatus(appNo);
- return Response.success(infoDTO);
- }
- @PostMapping("/getPatentSimilarMess")
- @Operation(summary = "获取专利相似度信息")
- public Response getLegalStatus(@RequestBody GetPatentSimilarScoreDTO getPatentSimilarScoreDTO) throws ParseException {
- GetPatentSimilarScoreVO getPatentSimilarScoreVO= pythonApiService.getPatentSimilarMess(getPatentSimilarScoreDTO);
- return Response.success(getPatentSimilarScoreVO);
- }
- @GetMapping("/queryPatentDetailByPatentNo")
- @Operation(summary = "用于窍笔根据号码获取专利检索详情数据")
- public Response queryPatentDetailByPatentNo(String patentNo) throws IOException {
- PatentInfoDTO infoDTO = patentStarApiService.queryPatentDetailByPatentNo(patentNo);
- return Response.success(infoDTO);
- }
- }
|