| | |
| | | @Resource |
| | | EntMapper entMapper; |
| | | |
| | | @Value("${qylweb.url}") |
| | | String url; |
| | | @Value("${qylweb.host}") |
| | | String host; |
| | | |
| | | @Value("${qylweb.user}") |
| | | String user; |
| | |
| | | |
| | | private final static String getEntBaseInfo = "%s/yqfwg/api/project/getEntBaseInfoForOtherSysListPage?ctoken=%s&buildDate_startdate=%s&buildDate_enddate=%s&qylabel=%s&showCount=%d¤tPage=%d"; |
| | | |
| | | public String getToken() { |
| | | try { |
| | | String url = String.format(generateToken, host); |
| | | |
| | | Map<String, String> map = new HashMap<>(2); |
| | | map.put("userName", user); |
| | | map.put("passWord", pwd); |
| | | |
| | | return null; |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * post请求(Rest) |
| | | */ |
| | |
| | | /** |
| | | * delete请求(Rest) |
| | | */ |
| | | public Object deleteForRest(String url, Map<String, Object> map) { |
| | | public <T> T deleteForRest(String url, Map<String, T> map, Class<T> clazz) { |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | | |
| | | HttpEntity<?> entity = new HttpEntity<>(map, headers); |
| | | |
| | | RestTemplate rest = RestHelper.getRestTemplate(); |
| | | ResponseEntity<Object> rs = rest.exchange(url, HttpMethod.DELETE, entity, Object.class); |
| | | ResponseEntity<T> rs = rest.exchange(url, HttpMethod.DELETE, entity, clazz); |
| | | |
| | | return rs.getBody(); |
| | | } |