| | |
| | | return null; |
| | | } |
| | | |
| | | public static BaseResponse sendSmsByHk(Map<String,Object> param,String url){ |
| | | log.info("【海康发送短信】================开始===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | TypeReference typeReference = |
| | | new TypeReference<BaseResponse>(){}; |
| | | String res = HttpsUtil.postJson(url, JSONObject.toJSONString(param)); |
| | | BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康发送短信"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康发送短信】================失败====:\n"+ e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public static BaseResponse sendSms(Map<String,Object> param){ |
| | | log.info("【发送短信信息】================开始===="+ JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.sendSms(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference<BaseResponse>(){}; |
| | | BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"发送短信信息"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【发送短信信息】================失败====:\n"+ e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | private static void logResult(BaseResponse res,String name) { |
| | | if(StringUtils.equals(res.getCode(),HKConstants.RESPONSE_SUCCEE)){ |
| | | log.info("【"+name+"】================成功====\n"+res); |