HTTP工具类封装与http请求响应

news2024/9/23 11:14:34

一、前言

在Java web系统中经常需要与外部接口进行对接,比较多的方式就是是http的方式。在springboot中,我们可以直接使用封装的feign如:我们去请求微信的接口,定义一个client客户端,使用feign框架去请求就可以。但是也有很多系统没有使用feign的框架,那就需要使用http工具类了。

@FeignClient(name = "weixin", url = "https://api.weixin.qq.com/")
public interface WXCLient {

    /**
     * 获取微信token
     * @param appid
     * @param secret
     * @return
     */
    @GetMapping("cgi-bin/token")
    Map<String, Object> gettoken(@RequestParam("appid") String appid, 
    @RequestParam("secret") String secret, @RequestParam("grant_type") String grant_type);

    /**
     * 获取微信token
     *
     * @param appid
     * @param secret
     * @return
     */
    @GetMapping("cgi-bin/token")
    Map<String, Object> getQRtoken(@RequestParam("appid") String appid, @RequestParam("secret") String secret, @RequestParam("grant_type") String grant_type);

    
    /**
     * 小程序登录
     *
     * @param appid
     * @param secret
     * @param grant_type
     * @param jsCode
     * @return  map {"session_key": "", "openid": ""}
     */
    @GetMapping("sns/jscode2session")
    Map<String, Object> jscode2session(@RequestParam("appid") String appid, @RequestParam("secret") String secret, @RequestParam("grant_type") String grant_type, @RequestParam("js_code") String jsCode);
    /**
     * 根据access_token和code获取微信登录信息
     *
     * @param access_token
     * @param code
     * @return
     */
    @GetMapping("cgi-bin/user/getUserInfo")
    Map<String, Object> getuserinfo(@RequestParam("access_token") String access_token, @RequestParam("code") String code);


    /**
     * @param access_token
     * @param userId
     * @return
     */
    @GetMapping("cgi-bin/user/get")
    Map<String, Object> get(@RequestParam("access_token") String access_token, @RequestParam("userid") String userId);

    /**
     * 获取微信用户手机号
     *
     * @param bodyMap
     * @param accessToken
     * @return
     */
    @PostMapping("wxa/business/getuserphonenumber")
    Map<String, Object> getPhone(@RequestParam("access_token") String accessToken, @RequestBody Map<String, Object> bodyMap);

    /**
     * 创建特定路径的微信小程序二维码
     *
     * @param bodyMap {"path":"", "with": 430}
     * @param accessToken
     * @return 返回的图片 Buffer
     */
    @PostMapping("cgi-bin/wxaapp/createwxaqrcode")
    Response createwxaqrcode(@RequestParam("access_token") String accessToken, @RequestBody Map<String, Object> bodyMap);
    
    
    /**
     * 获取urlscheme
     * @param accessToken
     * @param bodyMap
     * @return
     */
    @PostMapping("wxa/generatescheme")
    Map<String, Object>  generatescheme(@RequestParam("access_token") String accessToken, @RequestBody Map<String, Object> bodyMap);

    
    /**
     * 通过短信链接跳转
     * 获取generate_urllink
     * @param accessToken
     * @param bodyMap
     * @return
     */
    @PostMapping("wxa/generate_urllink")
    Map<String, Object>  generateUrllink(@RequestParam("access_token") String accessToken, @RequestBody Map<String, Object> bodyMap);

    
    /**
     * 二维码
     *该接口用于获取小程序码,适用于需要的码数量极多的业务场景。通过该接口生成的小程序码,永久有效,数量暂无限制。
     * @param accessToken
     * @param bodyMap
     * @return
     */
    @PostMapping("wxa/getwxacodeunlimit")
    byte[] getwxacodeunlimit(@RequestParam("access_token") String accessToken, @RequestBody Map<String, Object> bodyMap);
    
    /**
	     * 二维码
	     *该接口用于获取小程序码,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制,详见获取小程序码。
     * @param accessToken
     * @param bodyMap
     * @return
     */
    @PostMapping("wxa/getwxacode")
    byte[] getwxacode(@RequestParam("access_token") String accessToken, @RequestBody Map<String, Object> bodyMap);

    

}

二、http工具类

public class HttpUtils {
    private static Log logger = LogFactory.getLog(HttpUtils.class);

    public static String doGet(String url, Map<String, String> param) {

        // 创建Httpclient对象
        CloseableHttpClient httpclient = HttpClients.createDefault();

        String resultString = "";
        CloseableHttpResponse response = null;
        try {
            // 创建uri
            URIBuilder builder = new URIBuilder(url);
            if (param != null) {
                for (String key : param.keySet()) {
                    builder.addParameter(key, param.get(key));
                }
            }
            URI uri = builder.build();

            // 创建http GET请求
            HttpGet httpGet = new HttpGet(uri);

            // 执行请求
            response = httpclient.execute(httpGet);
            // 判断返回状态是否为200
            if (response.getStatusLine().getStatusCode() == 200) {
                resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (response != null) {
                    response.close();
                }
                httpclient.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return resultString;
    }

    public static String doGet(String url) {
        return doGet(url, null);
    }

    public static String doPost(String url, Map<String, String> param) {
        // 创建Httpclient对象
        CloseableHttpClient httpClient = HttpClients.createDefault();
        CloseableHttpResponse response = null;
        String resultString = "";
        try {
            RequestConfig requestConfig = RequestConfig.custom().setConnectionRequestTimeout(3000)
                    .setSocketTimeout(3000).setConnectTimeout(3000).build();
            // 创建Http Post请求
            HttpPost httpPost = new HttpPost(url);
            httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
            httpPost.setConfig(requestConfig);

            // 创建参数列表
            if (param != null) {
                List<NameValuePair> paramList = new ArrayList<>();
                for (String key : param.keySet()) {
                    paramList.add(new BasicNameValuePair(key, (String) param.get(key)));
                }
                // 模拟表单
                UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList, "utf-8");
                httpPost.setEntity(entity);
            }
            // 执行http请求
            response = httpClient.execute(httpPost);
            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (response != null) {
                    response.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return resultString;
    }

    public static String doPost(String url, Map<String, String> param, Map<String, String> headerParam) {
        // 创建Httpclient对象
        CloseableHttpClient httpClient = HttpClients.createDefault();
        CloseableHttpResponse response = null;
        String resultString = "";
        try {
            RequestConfig requestConfig = RequestConfig.custom().setConnectionRequestTimeout(10000)
                    .setSocketTimeout(10000).setConnectTimeout(10000).build();
            // 创建Http Post请求
            HttpPost httpPost = new HttpPost(url);
            httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
            httpPost.setConfig(requestConfig);
            if (headerParam != null) {
                for (Map.Entry<String, String> entry : headerParam.entrySet()) {
                    httpPost.setHeader(entry.getKey(), entry.getValue());
                }
            }

            // 创建参数列表
            if (param != null) {
                List<NameValuePair> paramList = new ArrayList<>();
                for (String key : param.keySet()) {
                    paramList.add(new BasicNameValuePair(key, (String) param.get(key)));
                }
                // 模拟表单
                UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList, "utf-8");
                httpPost.setEntity(entity);
            }
            // 执行http请求
            response = httpClient.execute(httpPost);
            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("请求异常", e);
        } finally {
            try {
                if (response != null) {
                    response.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return resultString;
    }

    public static String doPostJson(String url, Map<String, String> param) {
        // 创建Httpclient对象
        CloseableHttpClient httpClient = HttpClients.createDefault();
        CloseableHttpResponse response = null;
        String resultString = "";
        try {
            // 创建Http Post请求
            HttpPost httpPost = new HttpPost(url);
            httpPost.addHeader("Content-Type", "application/json");
            String jsonStr = JSONUtility.objectToJson(param);
            logger.info("post json parm:" + jsonStr);
            // 创建参数列表
            httpPost.setEntity(new StringEntity(jsonStr, "UTF-8"));
            // 执行http请求
            response = httpClient.execute(httpPost);
            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (response != null) {
                    response.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return resultString;
    }

    public static String doPost(String url) {
        return doPost(url, null);
    }

    public static String jsonPostHttps(String url, JSONObject params, int connectTimeout) {
        String responseContent = null;
        HttpPost httpPost = new HttpPost(url);
        CloseableHttpClient httpClient = HttpClients.createDefault();
        try {
            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(connectTimeout)
                    .setConnectTimeout(connectTimeout).setConnectionRequestTimeout(connectTimeout).build();
            httpPost.setHeader("Content-type", "application/x-www-form-urlencoded");
            httpPost.setEntity(new StringEntity(params.toString(), Consts.UTF_8));
            httpPost.setConfig(requestConfig);
            CloseableHttpResponse response = httpClient.execute(httpPost);

            try {
                // 执行POST请求
                HttpEntity entity = response.getEntity(); // 获取响应实体
                try {
                    if (null != entity) {
                        responseContent = EntityUtils.toString(entity, Consts.UTF_8);
                    }
                } finally {
                    if (entity != null) {
                        entity.getContent().close();
                    }
                }
            } finally {
                if (response != null) {
                    response.close();
                }
            }
        } catch (ClientProtocolException e) {
        } catch (IOException e) {
        } finally {
            httpPost.releaseConnection();
        }
        return responseContent;
    }

    public static String doPostJson(String url, String json) {
        // 创建Httpclient对象
        CloseableHttpClient httpClient = HttpClients.createDefault();
        CloseableHttpResponse response = null;
        String resultString = "";
        try {
            // 创建Http Post请求
            HttpPost httpPost = new HttpPost(url);
            httpPost.setHeader("Content-Type", "application/json");
            // 创建请求内容
            StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON);
            httpPost.setEntity(entity);
            // 执行http请求
            response = httpClient.execute(httpPost);
            resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                response.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return resultString;
    }

    public static String doPostJson(String url, String json, Map<String, String> headerParam) {
        // 创建Httpclient对象
        CloseableHttpClient httpClient = HttpClients.createDefault();
        CloseableHttpResponse response = null;
        String resultString = "";
        try {
            // 创建Http Post请求
            HttpPost httpPost = new HttpPost(url);
            httpPost.setHeader("Content-Type", "application/json");
            if (headerParam != null) {
                for (Map.Entry<String, String> entry : headerParam.entrySet()) {
                    httpPost.setHeader(entry.getKey(), entry.getValue());
                }
            }
            // 创建请求内容
            StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON);
            httpPost.setEntity(entity);
            // 执行http请求
            response = httpClient.execute(httpPost);
            resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                response.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return resultString;
    }

    public static String doPostStream(String url, Map<String, String> param, Map<String, InputStream> streamMap) {
        // MultipartEntityBuilder;
        // 创建Httpclient对象
        CloseableHttpClient httpClient = HttpClients.createDefault();
        CloseableHttpResponse response = null;
        String resultString = "";
        try {
            // 创建Http Post请求
            HttpPost httpPost = new HttpPost(url);
            // 创建参数列表
            MultipartEntityBuilder meBuilder = MultipartEntityBuilder.create();
            if (param != null) {
                for (String key : param.keySet()) {
                    meBuilder.addPart(key, new StringBody((String) param.get(key), ContentType.APPLICATION_JSON));
                }
            }
            if (streamMap != null) {
                for (String key : streamMap.keySet()) {
                    InputStreamBody inputStreamBody = new InputStreamBody(streamMap.get(key), key);
                    meBuilder.addPart(key, inputStreamBody);
                }
            }
            HttpEntity entity = meBuilder.build();
            httpPost.setEntity(entity);
            // 执行http请求
            response = httpClient.execute(httpPost);
            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                response.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return resultString;
    }

    public static String doPost(String url, Map<String, String> param, int connectTimeout) {
        // 创建Httpclient对象
        CloseableHttpClient httpClient = HttpClients.createDefault();

        CloseableHttpResponse response = null;
        String resultString = "";
        try {
            RequestConfig requestConfig = RequestConfig.custom().setConnectionRequestTimeout(connectTimeout)
                    .setSocketTimeout(connectTimeout).setConnectTimeout(connectTimeout).build();
            // 创建Http Post请求
            HttpPost httpPost = new HttpPost(url);
            httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
            httpPost.setConfig(requestConfig);

            // 创建参数列表
            if (param != null) {
                List<NameValuePair> paramList = new ArrayList<>();
                for (String key : param.keySet()) {
                    paramList.add(new BasicNameValuePair(key, (String) param.get(key)));
                }
                // 模拟表单
                UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList, "utf-8");
                httpPost.setEntity(entity);
            }
            // 执行http请求
            response = httpClient.execute(httpPost);
            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (response != null) {
                    response.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return resultString;
    }

    public static String doPost(String url, String param, String contentType, int connectTimeout) {
        // 创建Httpclient对象
        CloseableHttpClient httpClient = HttpClients.createDefault();

        CloseableHttpResponse response = null;
        String resultString = "";
        try {
            RequestConfig requestConfig = RequestConfig.custom().setConnectionRequestTimeout(connectTimeout)
                    .setSocketTimeout(connectTimeout).setConnectTimeout(connectTimeout).build();
            // 创建Http Post请求
            HttpPost httpPost = new HttpPost(url);
            httpPost.setHeader("Content-Type", contentType);
            httpPost.setConfig(requestConfig);

            // 创建参数列表
            if (param != null) {
//                List<NameValuePair> paramList = new ArrayList<>();
//                for (String key : param.keySet()) {
//                    paramList.add(new BasicNameValuePair("key", (String) param.get(key)));
//                }
//                // 模拟表单
//                UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList, "utf-8");
                httpPost.setEntity(new StringEntity(param, Consts.UTF_8));
            }
            // 执行http请求
            response = httpClient.execute(httpPost);
            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (response != null) {
                    response.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return resultString;
    }

三、http请求数据和响应数据详解

HTTP请求数据

HTTP请求通常由四部分组成:请求行、请求头部、空行和请求体(如果有的话)。

  1. 请求行

    • 请求方法:如GET、POST、PUT、DELETE等。它告诉服务器你想要执行的操作类型。
    • URL:请求的资源的路径。
    • HTTP协议版本:客户端使用的HTTP协议版本,通常是HTTP/1.1。
  2. 请求头部:包含一系列键值对,提供了关于请求和客户端的额外信息。例如:

    • Host:请求的目标主机。
    • User-Agent:发送请求的客户端的类型和版本。
    • Accept:客户端可以处理的内容类型。
    • Content-Type:请求体的媒体类型(如果有的话)。
    • Content-Length:请求体的长度(如果有的话)。
  3. 空行:请求头部之后是一个空行,用于分隔请求头部和请求体。

  4. 请求体:包含发送给服务器的数据,通常用于POST和PUT请求。

HTTP响应数据

HTTP响应也由四部分组成:状态行、响应头部、空行和响应体。

  1. 状态行

    • HTTP协议版本:服务器使用的HTTP协议版本。
    • 状态码:一个三位数,表示请求的处理结果,如200表示成功,404表示未找到资源等。
    • 状态消息:对状态码的简短描述。
  2. 响应头部:与请求头部类似,包含一系列键值对,提供了关于响应和服务器的额外信息。例如:

    • Content-Type:响应体的媒体类型。
    • Content-Length:响应体的长度。
    • Date:响应生成的日期和时间。
    • Server:服务器软件的名称和版本。
  3. 空行:响应头部之后是一个空行,用于分隔响应头部和响应体。

  4. 响应体:包含服务器返回给客户端的数据,通常是HTML、JSON或其他类型的内容。

四、TCP的三次握手

HTTP通常建立在TCP之上,因此,当我们在谈论网络请求时,实际上在底层是通过TCP来建立和维护连接的。

以下是TCP三次握手的简要概述:

  1. SYN(同步)阶段
    • 客户端向服务器发送一个SYN包,并等待服务器确认。SYN包中包含客户端的初始序列号。
  2. SYN-ACK(同步-应答)阶段
    • 服务器收到SYN包后,向客户端发送一个SYN-ACK包作为应答。这个包中包含对客户端SYN包的确认信息(ACK)以及服务器自己的初始序列号。
  3. ACK(应答)阶段
    • 客户端收到SYN-ACK包后,再向服务器发送一个ACK包,此包包含对服务器SYN-ACK包的确认信息。

完成这三次握手后,TCP连接就建立起来了,之后客户端和服务器就可以开始传输数据了。

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

全志A33编译踩坑!

领导给了个新sdk。然后开编。 编译的标准流程是这样 cd lichee ./build.sh config 这还得了&#xff0c;每次都选很烦&#xff08;虽然只需要选一次&#xff09;&#xff0c;于是新写法是这样 ./build.sh -p sun8iw5p1_android -k linux-3.4 -b evb 果断提示 ERROR: inv…

[深度学习]yolov8+streamlit搭建精美界面GUI网页设计源码实现三

【设计思路介绍】 为了使用YOLOv8和Streamlit搭建一个精美的界面GUI网页&#xff0c;你需要遵循几个关键步骤。以下是一个简化的流程&#xff0c;帮助你设计并实现这一目标&#xff1a; 1. 环境准备 安装YOLOv8 YOLOv8是一个先进的实时目标检测模型。你需要先下载并安装YOL…

Excel双击单元格后弹窗输入日期

Step1. 在VBE界面新建一个窗体(Userform1),在窗体的工具箱的空白处右键,选中添加附件,勾选Calendar control 8.0,即可完成日历的添加。 PS:遗憾的是, Office 64 位没有官方的日期选择器控件。唯一的解决方案是使用Excel 的第三方日历。 参考链接:How to insert calen…

2024最新最全Selenium自动化测试面试题!

1、什么是自动化测试、自动化测试的优势是什么&#xff1f; 通过工具或脚本代替手工测试执行过程的测试都叫自动化测试。 自动化测试的优势&#xff1a; 1、减少回归测试成本 2、减少兼容性测试成本 3、提高测试反馈速度 4、提高测试覆盖率 5、让测试工程师做更有意义的…

vue echarts 记录一个带tab切换的echarts页面 切换的时候如果有一个tab里的echarts没有数据 该如何清空echarts图的数据的问题

<template><div class"app-container"><el-form :model"queryParams" ref"queryForm" size"small" v-show"showSearch" label-width"85px"><el-form-item label"园所名称" prop&q…

Matlab从入门到精通课程

教程介绍 MATLAB是美国MathWorks公司出品的商业数学软件&#xff0c;用于数据分析、无线通信、深度学习、图像处理与计算机视觉、信号处理、量化金融与风险管理、机器人&#xff0c;控制系统等领域。 学习地址 链接&#xff1a;https://pan.baidu.com/s/1PxGarBwQusMzwPVqcE…

动态内存管理一一常见错误与习题练习

目录 前言 一、常见错误 1、对NULL指针的解引用操作 2、 对动态开辟空间的越界访问 3、对非动态开辟内存使用free释放 4、使用free释放一块动态开辟内存的一部分 5、对同一块动态内存多次释放 6、动态开辟内存忘记释放&#xff08;内存泄漏&#xff09; 二、习题练习…

一篇文章带你搞定接单的多种渠道,赶紧码住!!!

相信大家也看到了不少人通过网络接单实现年入30W&#xff0c;彻底财富自由&#xff01;咱看了&#xff0c;真的很难不心痒痒&#xff0c;想加入其中&#xff0c;大干一场&#xff01;毕竟搞钱嘛&#xff01;才是王道。但是呢&#xff0c;也有很多人心向往之&#xff0c;奈何不知…

STM32在使用CAN通信时需要注意哪些配置和设置?

STM32微控制器在使用CAN通信时&#xff0c;需要进行一系列的配置和设置以确保通信的可靠性和有效性。以下是一些关键的配置和设置注意事项&#xff1a; 1. 选择合适的CAN外设 STM32系列微控制器通常包含一个或多个CAN外设。首先需要确定使用哪个CAN外设&#xff0c;并了解其特…

资管账户/资管分仓/期货资管账户和专户的区别?

资管账户是什么意思? 资管账户又叫做子账户、伞型账户、分仓账户&#xff0c;它是将一个母账户分成多个子账户&#xff0c;子账户可以由多个投资者独立控制&#xff0c;使得多个投资者可以通过子账户来进行投资。资管账户常见于股票配资&#xff0c;先由出资方提供母账户&…

01-CSS基础(选择器)

一、css基本语法 1、CSS概述 CSS 指层叠样式表 (Cascading Style Sheets)样式定义如何显示 HTML 元素样式通常存储在样式表中把样式添加到 HTML 4.0 中&#xff0c;是为了解决内容与表现分离的问题外部样式表可以极大提高工作效率外部样式表通常存储在 CSS 文件中多个样式定义可…

大数据毕业设计Python+Spark知识图谱高考志愿推荐系统 高考数据分析 高考可视化 高考大数据 计算机毕业设计 机器学习 深度学习 人工智能 高考预测

意义 高考是中国的大学招生的学术资格考试&#xff0c;在目前看来&#xff0c;高考的考试类型有两种&#xff0c;一种是文理分科&#xff0c;另一种是新高考模式。传统的文理分科是将学生分成两个类型&#xff0c;一种是文科&#xff0c;除了语数外三门课以外需要学习政史地&am…

[BT]BUUCTF刷题第4天(3.22)

第4天&#xff08;共3题&#xff09; Web [极客大挑战 2019]Upload 这是文件上传的题目&#xff0c;有一篇比较详细的有关文件上传的绕过方法文件上传漏洞详解&#xff08;CTF篇&#xff09; 首先直接上传带一句话木马的php文件&#xff0c;发现被拦截&#xff0c;提示不是图…

vue3+threejs新手从零开发卡牌游戏(十三):上场手牌添加攻击力文字

在utils/common.ts下新建渲染场上手牌文字方法&#xff1a; // 渲染场上手牌文字 const renderSiteCardText (mesh: any, font: any) > {return new Promise((resolve, reject) > {let pos mesh.positionconst geometry new TextGeometry( ATK ${mesh.userData._ATK}…

✮✮✮宁波CE认证,CE认证,CE产品检测✮✮✮

✮✮✮&#x1f308;宁波CE认证&#xff0c;&#x1f308;CE认证&#xff0c;&#x1f308;CE产品检测&#x1f308;✮✮✮ ❀热点&#xff1a;&#x1f618;CE认证什么意思 ❀优势&#xff1a;&#x1f61c;CE认证的目的 ✎&#x1f352;CE认证定义和目的 ✎&#x1f350;CE认…

u盘文件删不掉怎么办?u盘文件删不掉解决方法

u盘是我们经常使用的工具之一,一般用来拷贝文件。但是,使用u盘的时候,难免会遇到一些问题,例如u盘文件删除不了。有很多小伙伴都不直到如何解决,那么下面一起来看看u盘文件删不掉怎么办吧。 u盘文件删不掉解决方法一: 可能是u盘中病毒了导致u盘文件无法删除,出现这个问题…

Java后端项目性能优化实战-群发通知

背景 公司群发通知模块性能存在问题&#xff0c;我进行全面的系统调优&#xff0c;系统处理能力大幅提升。 原发送流程 优化后的发送流程 优化的点 说明&#xff1a;以下问题基本都是压测过程遇到的&#xff0c;有些问题普通的功能测试暴露不了。优化目标&#xff1a;保证高…

芯课堂 | 华芯微特图形上位机快速上手指南

01.工具准备 1、硬件&#xff1a;SWMDM-QFP100-34SVEA3驱屏板TFT屏800x480&#xff08;触摸IC-GT911&#xff09;Jlink&#xff1b; 2、PC端&#xff1a;上位机keil。 02.实验现象 通过屏幕上的按钮控制uart发送。 03.创建文件工程 1、可以通过论坛 https://bbs.synwit.cn 获取…

具有徊滞特性的欠压锁定功能的B3842/43/44是专为脱线和Dc-Dc开关电源应用设计的

B3842/43/44是专为脱线和Dc-Dc开关电源应用设计的恒频电流型Pwd控制器内部包含温度补偿精密基准、供精密占空比调节用的可调振荡器、高增益混放大器、电流传感比较器和适合作功率MOST驱动用的大电流推挽输出颇以及单周期徊滞式限流欠压锁定、死区可调、单脉冲计数拴锁等保护电路…

网页设计必备技能:如何用CSS盒子模型打造完美布局?

在网络设计的世界里&#xff0c;盒子模型是构建网页布局的基石&#xff0c;只有理解了盒子模型&#xff0c;我们才能更好的进行网页布局。 HTML中的每一个元素都可以看成是一个盒子&#xff0c;拥有盒子一样的外形和平面空间&#xff0c;它不可见、不直观&#xff0c;但无处不在…