ecology_maven/com/api/aiyh_pcn/patentWall/controller/PatentWallController.java

61 lines
1.9 KiB
Java
Raw Normal View History

2021-11-25 21:46:05 +08:00
package com.api.aiyh_pcn.patentWall.controller;
import aiyh.utils.ApiResult;
import aiyh.utils.Util;
import com.api.aiyh_pcn.patentWall.dto.FilterWhere;
2021-11-25 21:46:05 +08:00
import com.api.aiyh_pcn.patentWall.service.PatentWallService;
import com.api.aiyh_pcn.patentWall.vo.PatentVO;
import com.api.aiyh_pcn.patentWall.vo.SearchInputVO;
2021-11-25 21:46:05 +08:00
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
2021-11-25 21:46:05 +08:00
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
2021-11-25 21:46:05 +08:00
import java.util.List;
import java.util.Map;
/**
* @author EBU7-dev1-ayh
* @create 2021/11/25 0025 15:18
*
*/
@Path("/patten/")
public class PatentWallController {
private final PatentWallService patentWallService = new PatentWallService();
@Path("/getSearchList/{prefix}")
@GET
@Produces(MediaType.APPLICATION_JSON)
public String getPatentList(@Context HttpServletRequest request, @Context HttpServletResponse response,
@PathParam("prefix") String prefix){
User user = HrmUserVarify.getUser(request, response);
int languageId = user.getLanguage();
List<SearchInputVO> result = patentWallService.getSearchList(prefix,languageId);
return ApiResult.success(result);
}
@Path("/getList/{prefix}")
2021-11-25 21:46:05 +08:00
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public String getPatentList(@RequestBody List<FilterWhere> filterWheres, @PathParam("prefix") String prefix){
List<PatentVO> result = patentWallService.getList(filterWheres,prefix);
2021-11-25 21:46:05 +08:00
return ApiResult.success(result);
}
@Path("/clearConf")
@GET
@Produces(MediaType.APPLICATION_JSON)
2021-11-25 21:46:05 +08:00
public String clearPatentWallConf(){
patentWallService.clearPatentWallConf();
patentWallService.clearPatentWallSerachConf();
2021-11-25 21:46:05 +08:00
return ApiResult.success("清除配置缓存成功!");
}
}