『接口测试干货』| Newman+Postman接口自动化测试完整过程

news2024/10/6 1:35:20

『接口测试干货』| Newman+Postman接口自动化测试完整过程

  • 1 Newman简介
  • 2 如何安装Newman?
    • 2.1 安装NodeJs
    • 2.2 安装Newman
    • 2.2 解决Newman不是内部命令
  • 3 Newman使用
    • 3.1 Newman如何运行集合?
    • 3.2 如何查看帮助文档?
    • 3.3 环境变量设置
    • 3.4 关于全局变量
    • 3.5 数据源文件
    • 3.6 如何导出变量
  • 4 测试报告
    • 4.1 newman-reporter-html安装
    • 4.2 newman-reporter-html使用
    • 4.3 htmlextra安装
    • 4.4 htmlextra使用
  • 5 关于postman使用

1 Newman简介

  • NewmanPostman的一个扩展库(NodeJs库);
  • Newman+Postman可完成接口自动化测试工作;
  • Postman导出的JSON格式文件可通过Newman的命令行执行;
  • 因为Postman运行后只有概要结果,没有像其他自动化测试框架那么完美漂亮的测试报告样式,所以引入了Newman
  • Newman可快速完成集合的运行,构造自动化以及持续集成工作。

2 如何安装Newman?

2.1 安装NodeJs

  • 下载地址:NodeJs;
  • 下载后直接双击运行即可node-v20.10.0-x64.msi
    在这里插入图片描述

2.2 安装Newman

  • 直接命令行输入以下命令即可:
npm install -g newman
C:\Windows\System32>npm install -g newman
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 118 packages, and audited 119 packages in 15s

9 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm notice
npm notice New major version of npm available! 7.19.1 -> 10.2.4
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.2.4
npm notice Run npm install -g npm@10.2.4 to update!
  • 注意安装时要以管理员身份打开,不然会报错:
C:\Users\Administrator>npm install -g newman
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path C:\Program Files\nodejs\node_cache\_cacache\tmp\9c4058f4
npm ERR! errno EPERM
npm ERR! FetchError: Invalid response body while trying to fetch https://registry.npmjs.org/newman: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\9c4058f4'
npm ERR!     at C:\Program Files\nodejs\nod_global\node_modules\npm\node_modules\minipass-fetch\lib\body.js:162:15
npm ERR!     at async [nodeFromEdge] (C:\Program Files\nodejs\nod_global\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:936:19)
npm ERR!     at async [buildDepStep] (C:\Program Files\nodejs\nod_global\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:882:11)
npm ERR!     at async Arborist.buildIdealTree (C:\Program Files\nodejs\nod_global\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:218:7)
npm ERR!     at async Arborist.reify (C:\Program Files\nodejs\nod_global\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:134:5)
npm ERR!     at async Install.install (C:\Program Files\nodejs\nod_
  • 验证Newman是否安装成功:
'newman' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
  • 问题排查:我们已经安装了node.js了,也已经安装了newman,其他都ok了。但还是不行查看node版本也是好的;
    在这里插入图片描述

2.2 解决Newman不是内部命令

  • 根据上边的提示,我们已经做好了很多工作,但是还是不行;
  • 这里需要配置node.js的一些环境变;
  • node.js的安装目录下新建两个文件夹如下node_globalnode_cache
    在这里插入图片描述
  • 打开系统环境变量,新增NODE_PATH变量:
NODE_PATH
D:\nodejs\node_modules

在这里插入图片描述

  • 在系统环境变量的path新增:%NODE_PATH%
    在这里插入图片描述
  • 打开用户环境变量,修改path中的npm路径为:D:\nodejs\node_global
    在这里插入图片描述
    在这里插入图片描述
  • 重启电脑、重启电脑、重启电脑(重要的事情说三遍)。
  • 验证newman是否安装成功:
newman -h
newman --version

在这里插入图片描述

3 Newman使用

3.1 Newman如何运行集合?

  • postman中将脚本导出,集合-右键-三个点-【Export】:
    在这里插入图片描述
  • 导出为JSON格式文件即可:
    在这里插入图片描述
  • 我们导出的文件为:test.postman_collection.json
  • 直接命令行执行以下命令运行脚本:
newman run test.postman_collection.json
  • 运行结果如下:
C:\Users\Administrator\Desktop>newman run test.postman_collection.json
newman

test

→ zentao
  POST http://127.0.0.1/zentao/api.php/v1/tokens [201 Created, 1.29kB, 1997ms]
  √  状态码为201

┌─────────────────────────┬─────────────────────┬─────────────────────┐
│                         │            executed │              failed │
├─────────────────────────┼─────────────────────┼─────────────────────┤
│              iterations │                   10 │
├─────────────────────────┼─────────────────────┼─────────────────────┤
│                requests │                   10 │
├─────────────────────────┼─────────────────────┼─────────────────────┤
│            test-scripts │                   10 │
├─────────────────────────┼─────────────────────┼─────────────────────┤
│      prerequest-scripts │                   00 │
├─────────────────────────┼─────────────────────┼─────────────────────┤
│              assertions │                   10 │
├─────────────────────────┴─────────────────────┴─────────────────────┤
│ total run duration: 2.1s                                            │
├─────────────────────────────────────────────────────────────────────┤
│ total data received: 44B (approx)                                   │
├─────────────────────────────────────────────────────────────────────┤
│ average response time: 1997ms [min: 1997ms, max: 1997ms, s.d.: 0µs] │
└─────────────────────────────────────────────────────────────────────┘

在这里插入图片描述

3.2 如何查看帮助文档?

  • 使用以下命令即可:
newman -h
或
newman --help
C:\Users\Administrator\Desktop>newman -h
Usage: newman [options] [command]

Options:
  -v, --version               output the version number
  -h, --help                  display help for command

Commands:
  run [options] <collection>  Initiate a Postman Collection run from a given URL or path

To get available options for a command:
  newman <command> -h

C:\Users\Administrator\Desktop>newman --help
Usage: newman [options] [command]

Options:
  -v, --version               output the version number
  -h, --help                  display help for command

Commands:
  run [options] <collection>  Initiate a Postman Collection run from a given URL or path

To get available options for a command:
  newman <command> -h

3.3 环境变量设置

  • 脚本文件和环境变量是两个文件;
  • 所以运行脚本的时候如果有环境变量,那么直接加-e--environment即可:
newman run 脚本文件 -e 环境变量文件

3.4 关于全局变量

  • 这个和环境变量类似,如果有全局变量,使用-g--globals即可;
newman run 脚本文件 -g 全局变量文件

3.5 数据源文件

  • Postman中可以设置迭代次数和数据源文件,而在Newman中使用的话,需要加-d--iteration-data参数指定数据源的路径:
newman run 脚本文件 -g 全局变量文件 -d 数据源文件
  • 迭代次数通过-n--iteration-count来确定。

3.6 如何导出变量

  • 直接在命令行加如下参数即可:
--export-environment
--export-globals
--export-collection

4 测试报告

  • Newman支持CLI、JSON、HTML、JUNIT等等;
  • 本文主要说下HTML格式的报告使用。

4.1 newman-reporter-html安装

  • newman-reporter-html插件安装:
npm install -g newman-reporter-html

在这里插入图片描述

4.2 newman-reporter-html使用

  • 使用方法:
命令说明
-r,json,junit表示指定生成HTML、JSON、XML格式形式的测试报告
--reporter-json-export xxx.json生成JSON格式的测试报告
--reporter-junit-export xxx.xml生成XML格式的测试报告
--reporter-html-export xxx.html生成HTML格式的测试报告
  • 生成的测试报告默认保存到当前目录下,如果报告名称为目录名,则保存到指定目录下;
  • 比如HTML报告:
newman run test.postman_collection.json \
-r html --reporter-html-export html_report.html

在这里插入图片描述

  • 比如XML格式报告:
newman run test.postman_collection.json \
-r junit --reporter-junit-export xml_report.xml

在这里插入图片描述

  • 比如JSON格式报告:
newman run test.postman_collection.json \
-r json --reporter-json-export json_report.json
{
  "collection": {
    "_": {
      "postman_id": "a1ee2193-7e02-4c50-892f-1e4d706a1132"
    },
    "item": [
      {
        "id": "393ea4b7-bfcf-4e3e-853d-e05a263435bf",
        "name": "zentao",
        "request": {
          "description": {
            "content": "禅道系统接口测试",
            "type": "text/plain"
          },
          "url": {
            "protocol": "http",
            "path": [
              "zentao",
              "api.php",
              "v1",
              "tokens"
            ],
            "host": [
              "127",
              "0",
              "0",
              "1"
            ],
            "query": [],
            "variable": []
          },
          "method": "POST",
          "body": {
            "mode": "raw",
            "raw": "{\"account\": \"admin\", \"password\": \"ZenTao123456\"}",
            "options": {
              "raw": {
                "language": "json"
              }
            }
          }
        },
        "response": [],
        "event": [
          {
            "listen": "test",
            "script": {
              "id": "63fb0da7-27ef-4569-87c6-81697169acf5",
              "type": "text/javascript",
              "exec": [
                "pm.test(\r",
                "    \"状态码为201\",function(){\r",
                "        pm.response.to.have.status(201);\r",
                "    }\r",
                ");"
              ],
              "_lastExecutionId": "9d83ab07-5d8c-4170-bb4f-898dbd965e57"
            }
          }
        ]
      }
    ],
    "event": [],
    "variable": [],
    "info": {
      "_postman_id": "a1ee2193-7e02-4c50-892f-1e4d706a1132",
      "name": "test",
      "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    }
  },
  "environment": {
    "id": "a4b8954c-a10e-4b54-80d0-bb003c56953e",
    "values": []
  },
  "globals": {
    "id": "a084d77b-cbf5-4498-9770-200d6e0a4168",
    "values": []
  },
  "run": {
    "stats": {
      "iterations": {
        "total": 1,
        "pending": 0,
        "failed": 0
      },
      "items": {
        "total": 1,
        "pending": 0,
        "failed": 0
      },
      "scripts": {
        "total": 1,
        "pending": 0,
        "failed": 0
      },
      "prerequests": {
        "total": 1,
        "pending": 0,
        "failed": 0
      },
      "requests": {
        "total": 1,
        "pending": 0,
        "failed": 0
      },
      "tests": {
        "total": 1,
        "pending": 0,
        "failed": 0
      },
      "assertions": {
        "total": 1,
        "pending": 0,
        "failed": 0
      },
      "testScripts": {
        "total": 1,
        "pending": 0,
        "failed": 0
      },
      "prerequestScripts": {
        "total": 0,
        "pending": 0,
        "failed": 0
      }
    },
    "timings": {
      "responseAverage": 154,
      "responseMin": 154,
      "responseMax": 154,
      "responseSd": 0,
      "dnsAverage": 0,
      "dnsMin": 0,
      "dnsMax": 0,
      "dnsSd": 0,
      "firstByteAverage": 0,
      "firstByteMin": 0,
      "firstByteMax": 0,
      "firstByteSd": 0,
      "started": 1700804595902,
      "completed": 1700804596169
    },
    "executions": [
      {
        "cursor": {
          "position": 0,
          "iteration": 0,
          "length": 1,
          "cycles": 1,
          "empty": false,
          "eof": false,
          "bof": true,
          "cr": false,
          "ref": "1d6d4e14-53d2-4ab6-8e78-87c67bad8bc9",
          "httpRequestId": "b5949fe3-d241-4020-a10c-b4adcbef9bb1"
        },
        "item": {
          "id": "393ea4b7-bfcf-4e3e-853d-e05a263435bf",
          "name": "zentao",
          "request": {
            "description": {
              "content": "禅道系统接口测试",
              "type": "text/plain"
            },
            "url": {
              "protocol": "http",
              "path": [
                "zentao",
                "api.php",
                "v1",
                "tokens"
              ],
              "host": [
                "127",
                "0",
                "0",
                "1"
              ],
              "query": [],
              "variable": []
            },
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\"account\": \"admin\", \"password\": \"ZenTao123456\"}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "id": "63fb0da7-27ef-4569-87c6-81697169acf5",
                "type": "text/javascript",
                "exec": [
                  "pm.test(\r",
                  "    \"状态码为201\",function(){\r",
                  "        pm.response.to.have.status(201);\r",
                  "    }\r",
                  ");"
                ],
                "_lastExecutionId": "9d83ab07-5d8c-4170-bb4f-898dbd965e57"
              }
            }
          ]
        },
        "request": {
          "description": {
            "content": "禅道系统接口测试",
            "type": "text/plain"
          },
          "url": {
            "protocol": "http",
            "path": [
              "zentao",
              "api.php",
              "v1",
              "tokens"
            ],
            "host": [
              "127",
              "0",
              "0",
              "1"
            ],
            "query": [],
            "variable": []
          },
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json",
              "system": true
            },
            {
              "key": "User-Agent",
              "value": "PostmanRuntime/7.33.0",
              "system": true
            },
            {
              "key": "Accept",
              "value": "*/*",
              "system": true
            },
            {
              "key": "Cache-Control",
              "value": "no-cache",
              "system": true
            },
            {
              "key": "Postman-Token",
              "value": "4dd31771-a07b-42e8-b78a-ac244c4dca6c",
              "system": true
            },
            {
              "key": "Host",
              "value": "127.0.0.1",
              "system": true
            },
            {
              "key": "Accept-Encoding",
              "value": "gzip, deflate, br",
              "system": true
            },
            {
              "key": "Connection",
              "value": "keep-alive",
              "system": true
            },
            {
              "key": "Content-Length",
              "value": "48",
              "system": true
            }
          ],
          "method": "POST",
          "body": {
            "mode": "raw",
            "raw": "{\"account\": \"admin\", \"password\": \"ZenTao123456\"}",
            "options": {
              "raw": {
                "language": "json"
              }
            }
          }
        },
        "response": {
          "id": "2a26af66-ad21-42d2-8b7a-b89cd7339a47",
          "status": "Created",
          "code": 201,
          "header": [
            {
              "key": "Date",
              "value": "Fri, 24 Nov 2023 05:43:16 GMT"
            },
            {
              "key": "Server",
              "value": "Apache"
            },
            {
              "key": "Set-Cookie",
              "value": "zentaosid=9f0dab6ebbe1e65c99a8abb3c351d89a; path=/zentao/; HttpOnly"
            },
            {
              "key": "Set-Cookie",
              "value": "lang=zh-cn; expires=Sun, 24-Dec-2023 05:43:16 GMT; Max-Age=2592000; path=/zentao/"
            },
            {
              "key": "Set-Cookie",
              "value": "device=desktop; expires=Sun, 24-Dec-2023 05:43:16 GMT; Max-Age=2592000; path=/zentao/; HttpOnly"
            },
            {
              "key": "Set-Cookie",
              "value": "theme=default; expires=Sun, 24-Dec-2023 05:43:16 GMT; Max-Age=2592000; path=/zentao/"
            },
            {
              "key": "Expires",
              "value": "Thu, 19 Nov 1981 08:52:00 GMT"
            },
            {
              "key": "Cache-Control",
              "value": "private"
            },
            {
              "key": "Pragma",
              "value": "no-cache"
            },
            {
              "key": "X-Content-Type-Options",
              "value": "nosniff"
            },
            {
              "key": "X-XSS-Protection",
              "value": "1; mode=block"
            },
            {
              "key": "Strict-Transport-Security",
              "value": "max-age=3600; includeSubDomains"
            },
            {
              "key": "Referrer-Policy",
              "value": "no-referrer-when-downgrade"
            },
            {
              "key": "X-Permitted-Cross-Domain-Policies",
              "value": "master-only"
            },
            {
              "key": "X-Download-Options",
              "value": "noopen"
            },
            {
              "key": "Content-Security-Policy",
              "value": "form-action 'self';connect-src 'self';"
            },
            {
              "key": "X-Frame-Options",
              "value": "SAMEORIGIN"
            },
            {
              "key": "Access-Control-Allow-Origin",
              "value": "*"
            },
            {
              "key": "Access-Control-Allow-Credentials",
              "value": "true"
            },
            {
              "key": "Access-Control-Allow-Headers",
              "value": "Origin,X-Requested-With,Content-Type,Accept,Authorization,Token,Referer,User-Agent"
            },
            {
              "key": "Access-Control-Allow-Methods",
              "value": "GET,POST,PUT,DELETE,OPTIONS,PATCH"
            },
            {
              "key": "Content-Length",
              "value": "44"
            },
            {
              "key": "Keep-Alive",
              "value": "timeout=10, max=100"
            },
            {
              "key": "Connection",
              "value": "Keep-Alive"
            },
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "stream": {
            "type": "Buffer",
            "data": [
              123,
              34,
              116,
              111,
              107,
              101,
              110,
              34,
              58,
              34,
              57,
              102,
              48,
              100,
              97,
              98,
              54,
              101,
              98,
              98,
              101,
              49,
              101,
              54,
              53,
              99,
              57,
              57,
              97,
              56,
              97,
              98,
              98,
              51,
              99,
              51,
              53,
              49,
              100,
              56,
              57,
              97,
              34,
              125
            ]
          },
          "cookie": [],
          "responseTime": 154,
          "responseSize": 44
        },
        "id": "393ea4b7-bfcf-4e3e-853d-e05a263435bf",
        "assertions": [
          {
            "assertion": "状态码为201",
            "skipped": false
          }
        ]
      }
    ],
    "transfers": {
      "responseTotal": 44
    },
    "failures": [],
    "error": null
  }
}
  • 以下是生成的几个报告:
    在这里插入图片描述

4.3 htmlextra安装

  • htmlextra主要实现比较高级的测试报告,需要进行安装:
npm install -g newman-reporter-htmlextra

在这里插入图片描述

4.4 htmlextra使用

  • 使用方法和newman-reporter-html基本一样;
  • 使用命令方法:
newman run test.postman_collection.json -r \
htmlextra --reporter-html-export html_report.html
  • 执行命令后会在当前目录或者指定目录生成一个newman文件夹,文件夹中保存着生成的文报告信息;
  • 测试报告样式如下:
    在这里插入图片描述

5 关于postman使用

  • 这个之前的文章已经介绍了,直接去浏览即可,这里不再赘述;
  • 大概思路就是使用postman生成接口数据,导出来后使用Newman运行和生成测试报告。

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

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

相关文章

MyBatisPlus总结

MyBatis-Plus时Mybatis的Best Partner MyBatis-Plus (opens new window)&#xff08;简称 MP&#xff09;是一个 MyBatis (opens new window)的增强工具&#xff0c;在 MyBatis 的基础上只做增强不做改变&#xff0c;为简化开发、提高效率而生。 特性 无侵入损耗小强大的 CR…

第21章 JUC并发编程

通过本章的学习可以学到&#xff1a;掌握java.util.concurrent(JUC)开发框架的核心接口与使用特点,掌握TimeUnit类的作用&#xff0c;并且可以使用此类实现日期时间数据转换&#xff0c;掌握多线程原子操作类的实现以及与volatile关键字的应用&#xff0c;理解ThreadFactory类的…

PLC通过RS232转PROFINET与电子分析天平秤通讯案例

本案例是通过用兴达易控的XD-PNR200型RS232转Profinet网关连接电子分析天平秤与PLC通讯的配置案例&#xff0c;用到设备为西门子S7-1200PLC&#xff0c;RS232转Profinet网关&#xff0c;电子分析天平秤。 打开博图&#xff0c;添加PLC&#xff1b;本案例使用的是1200PLC。 添加…

leetcode 343.整数拆分 198.打家劫舍(动态规划)

OJ链接 &#xff1a;leetcode 343.整数拆分 代码&#xff1a; class Solution {public int integerBreak(int n) {int[] dp new int[n1];//每个n&#xff0c;拆分多个整数乘积的最大值dp [0] 0;dp [1] 1; for(int i 2 ; i<n; i){for(int j 0 ; j < i; j){dp[i] Ma…

云原生系列Go语言篇-编写测试Part 1

本文来自正在规划的​​Go语言&云原生自我提升系列​​&#xff0c;欢迎关注后续文章。 2000年以来&#xff0c;自动化测试的广泛应用可能比任何其他软件工程技术都更能提高代码质量。Go是一种专注于提高软件质量的语言和生态系统&#xff0c;很自然的在其标准库中包含了测…

欲更新浏览器的Mac用户请注意,AMOS又出一招新“骗术”

近日&#xff0c;Malwarebytes发现有一种专门针对Mac操作系统&#xff08;OS&#xff09;的数据窃取程序正通过伪造的网页浏览器更新程序进行分发。Malwarebytes称这与其通常的技术、战术和程序大不相同&#xff0c;该恶意软件可以模仿 Safari 和谷歌 Chrome 浏览器。 网络安全…

Linux上自动挂载windows下的网络共享文件夹

比如我们想在ubuntu上挂载一个windows的共享文件夹&#xff0c;我们可以用如下方式实现。 首先我们将windows下的文件夹右键选择【属性】&#xff0c;然后选择【共享】。 选择需要共享的用户&#xff0c;然后设置权限级别。 点击共享&#xff0c;然后点击完成。 这样我们在wi…

Python武器库开发-前端篇之Html基础语法(二十九)

前端篇之Html基础语法(二十九) HTML 元素 HTML元素指的是HTML文档中的标签和内容。标签用于定义元素的类型&#xff0c;而内容则是元素所包含的内容。HTML元素由开始标签和结束标签组成&#xff0c;也可以是自闭合标签。 例如&#xff0c;下面是一个叫做<p>的HTML元素…

配电室智慧运维监控系统

配电室智能运维监控系统是一个综合性的管理系统&#xff0c;专门针对配电室的运维工作进行设计。依托电易云-智慧电力物联网&#xff0c;它融合了先进的监测技术、自动化技术、数据分析技术等&#xff0c;对配电室进行全方位、实时的智能化监控和管理&#xff0c;以提升配电室运…

虚拟化原理

目录 什么是虚拟化广义虚拟化狭义虚拟化 虚拟化指令集敏感指令集虚拟化指令集的工作模式监视器对敏感指令的处理过程&#xff1a; 虚拟化类型全虚拟化类虚拟化硬件辅助虚拟化 虚拟化架构裸金属架构宿主机模式架构 什么是虚拟化 虚拟化就是通过模仿下层原有的功能模块创造接口来…

shrio----(1)基础

文章目录 前言 一、Shrio1、什么是shiro2、为什么使用shrio 二、主要类2.1、Subject2.2、SecurityManager2.3、Realms 三、认证授权3.1、认证(Authentication)3.2、授权&#xff08;authorization&#xff09;四、入门示例参考文章 前言 简单入门介绍 一、Shrio http://shir…

配置mvn打包参数,不同环境使用不同的配置文件

方法一&#xff1a; 首先在/resource目录下创建各自环境的配置 要在不同的环境中使用不同的配置文件进行Maven打包&#xff0c;可以使用Maven的profiles特性和资源过滤功能。下面是配置Maven打包参数的步骤&#xff1a; 在项目的pom.xml文件中&#xff0c;添加profiles配置…

前端实现菜单快速检索的功能

前端CSS <style type"text/css">.btn-box {color: #fff;width: auto;border-radius: 25px;min-width: 40px;height: 40px;margin: 9px;line-height: 40px;display: inline-block;position: relative;overflow: hidden;background-image: linear-gradient(315de…

MySQL-03-索引

索引是提高MySQL查询性能的一个重要途径&#xff0c;但过多的索引可能会导致过高的磁盘使用率以及过高的内存占用&#xff0c;从而影响应用程序的整体性能。应当尽量避免事后才想起添加索引&#xff0c;因为事后可能需要监控大量的SQL才能定位到问题所在&#xff0c;而且添加索…

NX二次开发UF_CSYS_create_csys 函数介绍

文章作者&#xff1a;里海 来源网站&#xff1a;https://blog.csdn.net/WangPaiFeiXingYuan UF_CSYS_create_csys Defined in: uf_csys.h int UF_CSYS_create_csys(const double csys_origin [ 3 ] , tag_t matrix_id, tag_t * csys_id ) overview 概述 Creates a CSYS. 创…

单片机串口通用收发代码

本篇博客大部分是自己收集和整理&#xff0c;借鉴了很多大佬的图片和知识点整理&#xff0c;如有侵权请联系我删除。本博客内容原创&#xff0c;创作不易&#xff0c;转载请注明 串口接收最后应有一定的协议&#xff0c;如发送一帧数据应该有头标志或尾标志&#xff0c;也可两个…

Unity阻止射线穿透UI的方法之一

if(UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject()) return; 作者&#xff1a;StormerZ https://www.bilibili.com/read/cv27797873/ 出处&#xff1a;bilibili

名酒新周期,西凤复兴的“四个自信”

执笔 | 文 清 编辑 | 萧 萧 11月18日&#xff0c;四大名酒之一、凤香品类龙头企业的西凤酒&#xff0c;携全系列产品亮相AIIC酒业创新展暨中国名酒成就展。 在当日下午举行的“筑梦新征程”2023中国名酒纪念大会暨《大师》影像志上线仪式上&#xff0c;陕西西凤酒股份有限…

uni微信小程序 map 添加padding

问题背景&#xff1a; 规划驾车线路的时候&#xff0c;使用uni的include-points指定可视范围的时候&#xff0c;会很极限。导致marker不能完全显示。 解决方法 给地图显示范围添加padding (推荐) <mapid"myMap":markers"markers":polyline"pol…

【Rxjava详解】(四)线程切换

lift()变换原理 这些变换虽然功能各有不同&#xff0c;但实质上都是针对事件序列的处理和再发送。而在RxJava的内部&#xff0c;它们是基于同一个基础的变换方法&#xff1a;lift()。 首先看一下lift() 的内部实现&#xff08;仅显示了部分主要逻辑代码): public <R> …