智己汽车 IM,im智己汽车官网

文章长度:0太短了,请勿浪费资源

内容来源网络,如有侵权,联系删除,本文地址:https://www.230890.com/zhan/139897.html

(0)

相关推荐

  • 爷青结,QQ秀正式下线?腾讯紧急回应

    机哥那天掰掰手指数了数,QQ宠物、漂流瓶、腾讯微博……

    科技 2021年11月10日
  • 新能源汽车时代来临!盘点广州车展将亮相的3款合资新能源汽车

    不管你们承认与否,当下汽车新能源化已成为“箭在弦上不得不发”的事实。虽然很多人在现实生活中依旧嚷嚷着不买新能源汽车,但实际上身体却很诚实,所以对于这种现象我们想说:新能源汽车时代其实已经悄悄地来临了。11月19日,一年一度的广州车展就将要正式开幕了,对于咱们消费者们来说,此次车展有哪些新车值得一看呢?在新能源汽车时代已来临的当下,各大汽车厂商们又都拿出来了怎样的车型呢?下面我们就从合资品牌在此次广州车展上即将推出的新能源汽车开始说起。

    科技 2021年11月18日
  • 钉钉报警接入代码

    @Service@Slf4jpublic class DingTalkUtil { @Value("${dingTalk.robot.url}") private String robotUrl; @Value("${dingTalk.robot.me}") private String me; // 钉钉密钥 @Value("${dingTalk.robot.secret}") private String secret; @Value("${dingTalk.enabled}") private Boolean enabled; private OkHttpClient okHttpClient; private static final ObjectMapper objectMapper = new ObjectMapper(); private static final MediaType jsonMediaType = MediaType.parse("application/json"); @PostConstruct public void init() { ExecutorService executorService = new ThreadPoolExecutor( 1, 5, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<>(100), ThreadFactoryBuilder.create().setNamePrefix("dingTalk-").build(), new ThreadPoolExecutor.CallerRunsPolicy() ); Dispatcher dispatcher = new Dispatcher(executorService); dispatcher.setMaxRequests(5); dispatcher.setMaxRequestsPerHost(5); okHttpClient = new OkHttpClient.Builder() .readTimeout(Duration.ofSeconds(1)) .connectTimeout(Duration.ofSeconds(1)) .callTimeout(Duration.ofSeconds(1)) .writeTimeout(Duration.ofSeconds(1)) .dispatcher(dispatcher) .build(); } /** * 异步发送钉钉机器人文本消息. */ public void sendTextMessage(String content) { doSendTextMessage(content, textMessage -> { }); } /** * 异步发送文本消息并@自己. */ public void sendTextMessageWithAtMe(String content) { doSendTextMessage(content, textMessage -> textMessage.getAt().getAtMobiles().add(me)); } /** * 异步发送文本消息并@所有人. */ public void sendTextMessageWithAtAll(String content) { doSendTextMessage(content, textMessage -> textMessage.getAt().setAtAll(true)); } private void doSendTextMessage(String content, Consumer<TextMessage> messageConfigurator) { if (!enabled) { return; } if (StringUtils.isBlank(content)) { throw new IllegalArgumentException("文本消息内容不能为空"); } TextMessage textMessage = new TextMessage(); textMessage.setText(new TextMessage.Content(content)); messageConfigurator.accept(textMessage); long timestamp = System.currentTimeMillis(); String sign = sign(timestamp); try { Request request = new Request.Builder() .url((robotUrl + "×tamp=" + timestamp + "&sign=" + sign)) .post(RequestBody.create(objectMapper.writeValueAsString(textMessage), jsonMediaType)) .build(); Call call = okHttpClient.newCall(request); call.enqueue(new Callback() { @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { log.error("发送钉钉消息失败, 请求: {}.", call, e); } @Override public void onResponse(@NotNull Call call, @NotNull Response response) { ResponseBody responseBody = response.body(); log.debug("钉钉发送成功, call: {}, resp: {}.", call.request().body(), responseBody); if (responseBody != null) responseBody.close(); } }); } catch (JsonProcessingException e) { throw ExceptionUtil.wrapRuntime(e); } } private String sign(long timestamp) { final String seed = (timestamp + "\n" + secret); try { Mac mac = Mac.getInstance("HmacSHA256"); mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256")); byte[] result = mac.doFinal(seed.getBytes(StandardCharsets.UTF_8)); return URLEncoder.encode(Base64.getEncoder().encodeToString(result), StandardCharsets.UTF_8.displayName()); } catch (NoSuchAlgorithmException | InvalidKeyException | UnsupportedEncodingException e) { throw ExceptionUtil.wrapRuntime(e); } } @Getter private static class TextMessage { private final String msgtype = "text"; @Setter private Content text; private final At at = new At(); @Data @AllArgsConstructor private static class Content { private String content; } private static class At { @Setter private boolean isAtAll = false; @Getter private final List<String> atMobiles = new LinkedList<>(); // 不能删除,否则会导致生成的json字段名是atAll, 导致@所有人不生效 public boolean getIsAtAll() { return isAtAll; } } }}

    科技 2021年11月18日
  • 预算3000元近期哪款手机最值得买 这四款性能超耐打媲美当家旗舰机

    现在越来越多的人在选择手机的时候都会选择一款性能超耐打的手机,毕竟一款手机要陪伴我们相当长的时间,所以么,选择手机的时候肯定会特别的注重性能、性能强意味着我们平时不管用手机干什么都非常的迅速,当然,续航、快充、颜值、拍照等等都我们来说也非常的重要,当然价格也不能太高了,毕竟大部分的人都没有太高的预算,今天我就给大家推荐四款3000元近期最值得买的手机,款款都性能超耐打而且媲美当家旗舰机,让我们不再多花一分钱,你会选择哪一款呢?

    科技 2021年11月24日