科技

  • 酷派新机曝光 5000万像素4400mAh电池

    中关村在线消息:近日,酷派一款新机通过工信部认证,型号为CP05,可能是酷派COOL 21。搭载2.4GHz八核处理器,前置8MP,后置50MP三摄,6.58英寸2400*1080 LCD水滴屏,额定4400mAh电池,厚8.3mm,重193g,提供3.5mm耳机孔,支持存储卡扩展。

    科技 2021年11月18日
  • 小米生态再来造福厨房!米家APP控制的Five智能刀筷杀菌架实测

    Hello,大家好!不知道屏幕前的小伙伴们有没有注意过自己家里日常的筷笼或者刀架的实际现状呢?如果没有的话,现在去看看,相信你会回来感谢我的。因为像上述的两个地方都非常尴尬,就算在日常清洁过后,各种水滴的环绕也确实容易滋生细菌。最近小米生态链企业FIVE就再一次用新品的智能刀筷杀菌架来冲击我们的厨房了,本着体验后再发言的原则,下面就一起来和你们分享一下这款新品的实际使用感受吧!

    科技 2021年11月18日
  • 「开源分享」基于SpringBoot+Vue构建的数据可视化开发平台

    介绍基于SprigBoot+Vue构建的数据可视化开发平台,灵活的拖拽式布局、丰富的通用组件,帮助您快速的构建与迭代数据大屏页面。

    科技 2021年11月18日
  • 阿里突然出手!杀入网约车市场

    中国基金报记者 李智 硝烟四起的网约车领域又有巨头出手了。 11月17日晚间,大众交通公告称,大众出行拟增资扩股引入投资人阿里巴巴,阿里巴巴将分两期共计向大众出行投资4000万元,…

    科技 2021年11月18日
  • 阿里突然出手!杀入网约车市场

    中国基金报记者 李智 硝烟四起的网约车领域又有巨头出手了。 11月17日晚间,大众交通公告称,大众出行拟增资扩股引入投资人阿里巴巴,阿里巴巴将分两期共计向大众出行投资4000万元,…

    科技 2021年11月18日
  • 老罗吐槽苹果没文化 | 5000档旗舰新机,复古级配置,你会买吗?

    近日日本家电品牌巴慕达推出了自家的首款安卓手机——BalmudaPhone。

    2021年11月18日
  • 华为召开全场景智慧生活发布会,发布智能手表、折叠屏手机等新品

    11月17日晚,华为召开全场景智慧生活发布会,一次性发布了多款新品,其中包括HUAWEI WATCH GT3系列智能手表、HUAWEI WATCH GT Runner智能跑表、二合一笔记本HUAWEI MateBook E、HUAWEI VR Glass 6DoF游戏套装、HUAWEI Mate X2典藏版、HUAWEI FreeBuds Lipstick TWS耳机以及HUAWEI MateStation X一体机皓月银版本。

    科技 2021年11月18日
  • 华为watch GT3详细功能参数介绍,一款即将引起“内卷”的智能手表

    11月17日晚,华为如期举办全场景智能生活新品发布会,期间将会发布手表耳机等产品,距离发布会还有几个小时,跟随大尾一起提前了解一下其中的一款新品-华为 WATCH GT3智能手表。

    科技 2021年11月18日
  • Vivo S12 Pro真机地铁亮相 摩托罗拉随时可能截胡

    近日一张在地铁上拍到的疑似为Vivo S12 Pro工程样机的图片被曝光。图中显示Vivo S12 Pro机身呈青蓝色,采用了上曲面屏设计,刘海区域与之前的S10 Pro大致相同。

    科技 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日