httpclient工具类(支持泛型转换)

1、网上搜到的httpclient工具类的问题:

1.1、如下图我们都能够发现这种封装的问题:

  • 代码繁杂、充斥了很多重复性代码
  • 返回值单一,无法拿到对应的Java Bean对象及List对象集合
  • 实际场景中会对接大量第三方的OPEN API,下述方法的扩展性差

在这里插入图片描述

1.2、简洁调用方式演示

本文基于上述问题,通过设计模式、泛型、JSON工具类的方式进行了封装,得到了下述更方便、更简洁的http请求调用方式

Entity params = new Entity();
params.setUrl("/common/postJson");Map<String, Object> map = new HashMap<>();
map.put("userId", "13277887788");
map.put("companyId", "87037827534cf");
params.setParams(map);// 返回对象集合
List<AppEntity> appEntity = thirdHttpProcessorFactory.doGetReturnList(ThirdSystemEnum.ION, params, AppEntity.class);
// 返回String类型
String result = thirdHttpProcessorFactory.doGetReturnBean(ThirdSystemEnum.ION, params, String.class);
// 返回指定的对象
AppEntity appEntity = thirdHttpProcessorFactory.doGetReturnBean(ThirdSystemEnum.ION, params, AppEntity.class);

1.3、 目录结构

在这里插入图片描述

2、引入的maven仓库

 <dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>2.14.2</version>
</dependency>
<dependency><groupId>cn.hutool</groupId><artifactId>hutool-all</artifactId><version>5.7.16</version>
</dependency>
  • ThirdHttpProcessorFactory:存储不同三方平台的处理期
  • ThirdHttpProcessor:定义通用的接口
  • AbstractThirdHttpProcessor:定义公共的处理逻辑
  • IonHttpProcessor:定义各对接平台的差异性逻辑
  • AppEntity:返回值
  • Entity:入参
  • ThirdSystemEnum:定义三方平台的枚举

3、代码实现

3.1、获取不同第三方处理器的工厂ThirdHttpProcessorFactory

package com.ionrocking.platform.tripartite;import com.ionrocking.common.core.exception.ServiceException;
import com.ionrocking.platform.tripartite.entity.Entity;
import com.ionrocking.platform.tripartite.enums.ThirdSystemEnum;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.List;
import java.util.Map;/*** @author ke* Created by on  2023-10-27 15:23*/
@Component
@Accessors(chain = true)
public class ThirdHttpProcessorFactory {@Autowiredprivate List<ThirdHttpProcessor> thirdHttpProcessors;private Map<String, ThirdHttpProcessor> thirdHttpProcessorMap;@PostConstructpublic void init() {if (CollectionUtils.isEmpty(thirdHttpProcessors)) {return;}thirdHttpProcessorMap = new HashMap<>(8);for (ThirdHttpProcessor processor : thirdHttpProcessors) {thirdHttpProcessorMap.put(processor.getType().getCode(), processor);}}private ThirdHttpProcessor getThirdHttpProcessor(String type) {ThirdSystemEnum thirdSystemEnum = ThirdSystemEnum.getByCode(type);if (null == thirdSystemEnum) {throw new ServiceException("三方OpenApi尚未配置,无法进行请求");}return thirdHttpProcessorMap.get(type);}/*** http get请求** @param thirdSystemEnum 三方系统类型枚举* @param entity          参数* @param tClass          返回参数类型* @return T              返回数据对象* @throws Exception 业务执行异常*/public <T> T doGetReturnBean(ThirdSystemEnum thirdSystemEnum, Entity entity, Class<T> tClass) throws Exception {return getThirdHttpProcessor(thirdSystemEnum.getCode()).doGetReturnBean(entity, tClass);}/*** http post请求,入参支持application/x-www-form-urlencoded 请求** @param thirdSystemEnum 三方系统类型枚举* @param entity          参数* @param tClass          返回参数类型* @return T              返回数据对象* @throws Exception 业务执行异常*/public <T> T doPostReturnBean(ThirdSystemEnum thirdSystemEnum, Entity entity, Class<T> tClass) throws Exception {return getThirdHttpProcessor(thirdSystemEnum.getCode()).doPostReturnBean(entity, tClass);}/*** http post请求,入参支持application/json请求** @param thirdSystemEnum 三方系统类型枚举* @param entity          参数* @param tClass          返回参数类型* @return T              返回数据对象* @throws Exception 业务执行异常*/public <T> T doPostJsonReturnBean(ThirdSystemEnum thirdSystemEnum, Entity entity, Class<T> tClass) throws Exception {return getThirdHttpProcessor(thirdSystemEnum.getCode()).doPostJsonReturnBean(entity, tClass);}/*** http get请求** @param thirdSystemEnum 三方系统类型枚举* @param entity          参数* @param tClass          返回参数类型* @return List<T>        返回数据集合* @throws Exception 业务执行异常*/public <T> List<T> doGetReturnList(ThirdSystemEnum thirdSystemEnum, Entity entity, Class<T> tClass) throws Exception {return getThirdHttpProcessor(thirdSystemEnum.getCode()).doGetReturnList(entity, tClass);}/*** http post请求,入参支持application/x-www-form-urlencoded 请求** @param thirdSystemEnum 三方系统类型枚举* @param entity          参数* @param tClass          返回参数类型* @return List<T>        返回数据集合* @throws Exception 业务执行异常*/public <T> List<T> doPostReturnList(ThirdSystemEnum thirdSystemEnum, Entity entity, Class<T> tClass) throws Exception {return getThirdHttpProcessor(thirdSystemEnum.getCode()).doPostReturnList(entity, tClass);}/*** http post请求,入参支持application/json请求** @param thirdSystemEnum 三方系统类型枚举* @param entity          参数* @param tClass          返回参数类型* @return List<T>        返回数据集合* @throws Exception 业务执行异常*/public <T> List<T> doPostJsonReturnList(ThirdSystemEnum thirdSystemEnum, Entity entity, Class<T> tClass) throws Exception {return getThirdHttpProcessor(thirdSystemEnum.getCode()).doPostJsonReturnList(entity, tClass);}}

3.2、http请求处理的接口ThirdHttpProcessor

/*** Dans.com Inc.* Copyright (c) 2011-2020 All Rights Reserved*/
package com.ionrocking.platform.tripartite;import com.ionrocking.platform.tripartite.entity.Entity;
import com.ionrocking.platform.tripartite.enums.ThirdSystemEnum;import java.util.List;/*** 追踪事件处理器** @author ke* Created by on  2023-06-20 15:23*/
public interface ThirdHttpProcessor {/*** 业务执行** @param entity* @param tClass* @return T* @throws Exception 业务执行异常*/<T> T doGetReturnBean(Entity entity, Class<T> tClass) throws Exception;/*** 业务执行** @param entity* @param tClass* @return* @throws Exception 业务执行异常*/<T> T doPostReturnBean(Entity entity, Class<T> tClass) throws Exception;/*** 业务执行** @param entity* @param tClass* @return* @throws Exception 业务执行异常*/<T> T doPostJsonReturnBean(Entity entity, Class<T> tClass) throws Exception;/*** 业务执行** @param entity* @param tClass* @return T* @throws Exception 业务执行异常*/<T> List<T> doGetReturnList(Entity entity, Class<T> tClass) throws Exception;/*** 业务执行** @param entity* @param tClass* @return* @throws Exception 业务执行异常*/<T> List<T> doPostReturnList(Entity entity, Class<T> tClass) throws Exception;/*** 业务执行** @param entity* @param tClass* @return* @throws Exception 业务执行异常*/<T> List<T> doPostJsonReturnList(Entity entity, Class<T> tClass) throws Exception;/*** 获取事件类型** @return*/ThirdSystemEnum getType();
}

3.3、通用逻辑处理的抽象类AbstractThirdHttpProcessor

  • 如在通过http client发起HTTP请求时,除了请求头requestHeader、请求入参requestBody不同,其他逻辑都是一样的,则可以进行公共代码的抽取
  • 如果存在特殊的逻辑处理,则可以在子类中重写父类的方法
package com.ionrocking.platform.tripartite;import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ionrocking.common.core.exception.ServiceException;
import com.ionrocking.platform.config.SysNacosConfig;
import com.ionrocking.platform.tripartite.entity.Entity;
import com.ionrocking.platform.tripartite.entity.IonResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;/*** @author ke* @Date 2023/10/27*/
@Slf4j
@Component
public abstract class AbstractThirdHttpProcessor implements ThirdHttpProcessor {@Overridepublic <T> List<T> doGetReturnList(Entity entity, Class<T> tClass) throws Exception {// 构造请求头Map<String, String> requestHead = constructRequestHead(entity);// 构造请求数据Map<String, Object> requestBody = constructRequestBody(entity);String result = HttpUtil.createGet(sysNacosConfig.getIonRequestUrl() + entity.getUrl()).addHeaders(requestHead).form(requestBody).execute().body();return toList(result, tClass);}@Overridepublic <T> List<T> doPostReturnList(Entity entity, Class<T> tClass) throws Exception {// 构造请求头Map<String, String> requestHead = constructRequestHead(entity);// 构造请求数据Map<String, Object> requestBody = constructRequestBody(entity);String result = HttpUtil.createPost(sysNacosConfig.getIonRequestUrl() + entity.getUrl()).addHeaders(requestHead).form(requestBody).execute().body();return toList(result, tClass);}@Overridepublic <T> List<T> doPostJsonReturnList(Entity entity, Class<T> tClass) throws Exception {// 构造请求头Map<String, String> requestHead = constructRequestHead(entity);// 构造请求数据Map<String, Object> requestBody = constructRequestBody(entity);String result = HttpUtil.createPost(sysNacosConfig.getIonRequestUrl() + entity.getUrl()).addHeaders(requestHead).body(JSONUtil.toJsonStr(requestBody)).execute().body();return toList(result, tClass);}public <T> T toBean(String result, Class<T> tClass) throws Exception {ObjectMapper objectMapper = new ObjectMapper();IonResponse<Object> response = JSONUtil.toBean(result, IonResponse.class);if (CODE != response.getCode()) {throw new ServiceException(response.getMsg());}if (null == response.getData()) {return null;}return objectMapper.readValue(response.getData().toString(), tClass);}public <T> List<T> toList(String result, Class<T> tClass) throws JsonProcessingException {List<T> data = new ArrayList<>();IonResponse<List<Object>> response = JSONUtil.toBean(result, IonResponse.class);if (CODE != response.getCode()) {throw new ServiceException(response.getMsg());}if (CollUtil.isEmpty(response.getData())) {return null;}for (Object o : response.getData()) {ObjectMapper objectMapper = new ObjectMapper();data.add(objectMapper.readValue(o.toString(), tClass));}return data;}@Resourceprotected SysNacosConfig sysNacosConfig;protected static final int CODE = 200;@Overridepublic <T> T doGetReturnBean(Entity entity, Class<T> tClass) throws Exception {// 构造请求头Map<String, String> requestHead = constructRequestHead(entity);// 构造请求数据Map<String, Object> requestBody = constructRequestBody(entity);String result = HttpUtil.createGet(sysNacosConfig.getIonRequestUrl() + entity.getUrl()).addHeaders(requestHead).form(requestBody).execute().body();return toBean(result, tClass);}/*** 执行** @return*/@Overridepublic <T> T doPostReturnBean(Entity entity, Class<T> tClass) throws Exception {// 构造请求头Map<String, String> requestHead = constructRequestHead(entity);// 构造请求数据Map<String, Object> requestBody = constructRequestBody(entity);String result = HttpUtil.createPost(sysNacosConfig.getIonRequestUrl() + entity.getUrl()).addHeaders(requestHead).form(requestBody).execute().body();return toBean(result, tClass);}@Overridepublic <T> T doPostJsonReturnBean(Entity entity, Class<T> tClass) throws Exception {// 构造请求头Map<String, String> requestHead = constructRequestHead(entity);// 构造请求数据Map<String, Object> requestBody = constructRequestBody(entity);String result = HttpUtil.createPost(sysNacosConfig.getIonRequestUrl() + entity.getUrl()).addHeaders(requestHead).body(JSONUtil.toJsonStr(requestBody)).execute().body();return toBean(result, tClass);}/*** 构造请求头** @param entity* @return*/public abstract Map<String, String> constructRequestHead(Entity entity);/*** 构造请求体** @param entity* @return*/public Map<String, Object> constructRequestBody(Entity entity) {if (CharSequenceUtil.isBlank(entity.getUrl())) {throw new ServiceException("请求路径不能为空");}if (null == entity) {return null;}return entity.getParams();}}

3.4、第三方非通用逻辑处理类IonHttpProcessor

  • 比如此处对接的xx公司需要进行access_token获取及验证,然后将access_token放在请求头中
package com.ionrocking.platform.tripartite.impl;import cn.hutool.core.lang.TypeReference;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.ionrocking.platform.tripartite.AbstractThirdHttpProcessor;
import com.ionrocking.platform.tripartite.entity.Entity;
import com.ionrocking.platform.tripartite.entity.IonResponse;
import com.ionrocking.platform.tripartite.enums.ThirdSystemEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;import java.util.HashMap;
import java.util.Map;/*** @author ke* @Date 2023/10/27*/
@Slf4j
@Component
public class IonHttpProcessor extends AbstractThirdHttpProcessor {private String accessTokenUrl = "/token/getAccessToken";private static final String ACCESS_TOKEN_KEY = "access_token";@Overridepublic Map<String, String> constructRequestHead(Entity entity) {Map<String, String> header = new HashMap<>(2);Map<String, Object> params = new HashMap<>(4);params.put("appId", sysNacosConfig.getIonRequestAppId());params.put("appSecret", sysNacosConfig.getIonRequestAppSecret());String result = HttpUtil.get(sysNacosConfig.getIonRequestUrl() + accessTokenUrl, params);if (CharSequenceUtil.isEmpty(result)) {return null;}TypeReference<IonResponse<Map<String, Object>>> typeRef = new TypeReference<IonResponse<Map<String, Object>>>() {};IonResponse<Map<String, Object>> response = JSONUtil.toBean(result, typeRef, false);if (CODE == response.getCode() && null != response.getData()) {if (response.getData().containsKey(ACCESS_TOKEN_KEY)) {header.put(ACCESS_TOKEN_KEY, response.getData().get(ACCESS_TOKEN_KEY).toString());}}return header;}@Overridepublic ThirdSystemEnum getType() {return ThirdSystemEnum.ION;}
}

3.5、枚举类ThirdSystemEnum

  • 区分不同的平台,根据枚举获取不同的实现类
package com.ionrocking.platform.tripartite.enums;import org.apache.commons.lang3.StringUtils;/*** @author ke* @Date 2023/10/27*/
public enum ThirdSystemEnum {/*** XX科技公司*/ION("ion", "xx科技");private final String code;private final String name;public String getName() {return this.name;}public String getCode() {return this.code;}ThirdSystemEnum(String code, String name) {this.code = code;this.name = name;}public static ThirdSystemEnum getByCode(String code) {if (StringUtils.isEmpty(code)) {return null;}for (ThirdSystemEnum codeEnum : values()) {if (code.equals(codeEnum.getCode())) {return codeEnum;}}return null;}
}

3.6、第三方返回格式对象IonResponse

package com.ionrocking.platform.tripartite.entity;import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;import java.io.Serializable;/*** @author ke* @Date 2023/10/27*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class IonResponse<T> implements Serializable {private static final long serialVersionUID = -8741972144218822267L;private int code;/*** 消息*/private String msg;/*** 数据*/private T data;/*** 总记录数*/private long total;
}

3.7、处理器入参对象Entity

  • 此处定义请求的URL和请求的参数
package com.ionrocking.platform.tripartite.entity;import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;import java.io.Serializable;
import java.util.Map;/*** @author ke* @Date 2023/10/27*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Entity implements Serializable {private static final long serialVersionUID = -6083780287057302816L;private String url;/*** 参数*/private Map<String, Object> params;
}

3.8、第三方接口返回值对象AppEntity

package com.ionrocking.platform.tripartite.entity;import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;import javax.validation.constraints.NotBlank;/*** @author ke* @Date 2023/10/26*/@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class AppEntity {private long id;private String appId;@NotBlank(message = "应用名称不能为空")private String appName;private String appSecret;private String accessToken;private Integer isFlag;
}

3.9、Nacos配置

  • Nacos中一般存放一些第三方的请求域名、鉴权的appId、appSecret等
tripartite-platform:ion:request:url: http://localhost:8080/api/appId: YodeqWwpappSecret: 87037827534cf848a570fae3c93a2469fa0262935af531dddfe7a52ae7f98f41
package com.ionrocking.platform.config;import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;/*** nacos配置信息* @author ke* @Date 2023/9/20*/
@Component
public class SysNacosConfig {@Value("${upload.path}")private String uploadPath;@Value("${tripartite-platform.ion.request.url}")private String ionRequestUrl;@Value("${tripartite-platform.ion.request.appId}")private String ionRequestAppId;@Value("${tripartite-platform.ion.request.appSecret}")private String ionRequestAppSecret;public String getUploadPath() {return uploadPath;}public String getIonRequestUrl() {return ionRequestUrl;}public String getIonRequestAppId() {return ionRequestAppId;}public String getIonRequestAppSecret() {return ionRequestAppSecret;}
}

测试

@RestController
@RequestMapping("/test")
public class Test {@Resourceprivate SysNacosConfig sysNacosConfig;@Resourceprivate ThirdHttpProcessorFactory thirdHttpProcessorFactory;@ResponseBody@RequestMapping(value = "/get")public AjaxResult get() throws Exception extends BaseController  {Entity params = new Entity();params.setUrl("/common/get");String result = thirdHttpProcessorFactory.doGetReturnBean(ThirdSystemEnum.ION, params, String.class);return AjaxResult.success(result);}@ResponseBody@RequestMapping(value = "/list")public AjaxResult list() throws Exception {Entity params = new Entity();params.setUrl("/common/list");List<AppEntity> appEntity = thirdHttpProcessorFactory.doGetReturnList(ThirdSystemEnum.ION, params, AppEntity.class);return AjaxResult.success(appEntity);}@ResponseBody@RequestMapping(value = "/postJson")public AjaxResult postJson() throws Exception {Entity params = new Entity();params.setUrl("/common/postJson");Map<String, Object> map = new HashMap<>();map.put("appId", "YodeqWwp");map.put("appSecret", "87037827534cf848a570fae3c93a2469fa0262935af531dddfe7a52ae7f98f41");params.setParams(map);List<AppEntity> list = thirdHttpProcessorFactory.doPostJsonReturnList(ThirdSystemEnum.ION, params, AppEntity.class);return AjaxResult.success(list);}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/162216.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【电路笔记】-谐波

谐波 文章目录 谐波1、概述2、频谱分析3、已知信号4、未知信号5、总结 周期性信号并不总是完美的正弦模式&#xff0c;例如我们之前有关 正弦波的文章之一中介绍的那样。 有时&#xff0c;信号确实可以是简单正弦波的叠加&#xff0c;它们被称为复杂波形。 在本文中&#xff0…

HR的油猴脚本:前程无忧简历关键词统计

介绍 近年来&#xff0c;求职市场变得愈加竞争激烈&#xff0c;雇主和招聘人员需要花费大量的时间来筛选简历&#xff0c;以找到合适的候选人。这个Tampermonkey脚本“HR帮手”为前程无忧&#xff08;51job&#xff09;的HR提供了一种强大的工具&#xff0c;帮助他们快速筛选简…

60V、低 IQ、双通道LTC3892MPUH-2、LTC3892HUH-2、LTC3892IUH-2、LTC3892IUH两相同步降压型 DC/DC 控制器

概述&#xff1a; LTC3892 / LTC3892-2 是一款高性能、双通道降压型 DC/DC 开关稳压控制器&#xff0c;用于驱动全 N 沟道同步功率 MOSFET 级。通过使两个控制器输出级异相运作&#xff0c;可较大限度地降低功率损耗和噪声。 栅极驱动电压可设置在 5V 至 10V 的范围内&…

22款奔驰GLE450加装原厂360全景影像 打破死角

360全景影像影像系统提升行车时的便利&#xff0c;不管是新手或是老司机都将是一个不错的配置&#xff0c;无论是在倒车&#xff0c;挪车以及拐弯转角的时候都能及时关注车辆所处的环境状况&#xff0c;避免盲区事故发生&#xff0c;提升行车出入安全性。 360全景影像包含&…

ActiveMq学习⑨__基于zookeeper和LevelDB搭建ActiveMQ集群

引入消息中间件后如何保证其高可用&#xff1f; 基于zookeeper和LevelDB搭建ActiveMQ集群。集群仅提供主备方式的高可用集群功能&#xff0c;避免单点故障。 http://activemq.apache.org/masterslave LevelDB&#xff0c;5.6版本之后推出了LecelDB的持久化引擎&#xff0c;它使…

mysql迁移data目录(Linux-Centos)

随着时间的推移&#xff0c;mysql的数据量越越大&#xff0c;使用yum默认安装的目录为系统盘 /var/lib/mysql&#xff0c;现重新挂载了一个硬盘&#xff0c;需要做数据目录的迁移到 /mnt/data/。以解决占用系统盘过高情况。 1.强烈建议这种操作。镜像一个一样的Centos系统&…

【文生图】Stable Diffusion XL 1.0模型Full Fine-tuning指南(U-Net全参微调)

文章目录 前言重要教程链接以海报生成微调为例总体流程数据获取POSTER-TEXTAutoPosterCGL-DatasetPKU PosterLayoutPosterT80KMovie & TV Series & Anime Posters 数据清洗与标注模型训练模型评估生成图片样例宠物包商品海报护肤精华商品海报 一些TipsMata&#xff1a;…

以太网知识

/ 【读书笔记】C3 The Ethernet System 以太网知识01 Media Independent Interface &#xff08;MII) 媒体独立接口 CHAPTER 2 IEEE Ethernet Standards 以太网标准- 以太网的历史背景 基础知识——以太网&#xff08;Ethernet &#xff09; 以太网数据帧格式&#xff08;结…

selenium元素定位 —— 提高篇 xpath定位元素

XPath 最初是用来在 XML 文档中定位 DOM 节点的语言&#xff0c;由于 HTML 也可以算作 XML 的一种实现&#xff0c;所以 Selenium 也可以利用 XPath 这一强大的语言来定位 Web 元素。xpath的强大在于它可以通过父节点或者兄弟节点&#xff0c;根据html元素的前后关联性定位到元…

Flink源码解析八之任务调度和负载均衡

源码概览 jobmanager scheduler:这部分与 Flink 的任务调度有关。 CoLocationConstraint:这是一个约束类,用于确保某些算子的不同子任务在同一个 TaskManager 上运行。这通常用于状态共享或算子链的情况。CoLocationGroup & CoLocationGroupImpl:这些与 CoLocationCon…

飞桨平台搭建PP-YOLOE模型

一、创建项目 此博客仅是运行PP-YOLOE源码&#xff0c;这里以变压器渗漏数据集为例COCO数据集太大了&#xff0c;跑不动&#xff0c;V100训练预估计得7天左右&#xff0c;即便是A100也得4天半&#xff0c;变压器渗漏油数据集跑一个小时左右&#xff0c;还可以接受&#xff0c;…

网络安全应急响应工具(系统痕迹采集)-FireKylin

文章目录 网络安全应急响应工具(系统痕迹采集)-FireKylin1.FireKylin介绍【v1.4.0】 2021-12-20【v1.0.1】 2021-08-09 2.客户端界面Agent支持的操作系统FireKylinAgent界面使用方式比较传统方式与FireKylin比较无法可达目标的场景应用对比 3.使用教程设置语言Agent配置&#x…