Gerrit REST API简单介绍

news2024/11/24 11:35:40

Gerrit是一款开源免费的代码审查工具,如果其它平台想要获取gerrit数据,比如统计仓库代码提交数据等信息,可以使用Gerrit提供的REST API来获取,本文记录一些我使用到的Gerrit API。

目录

  • 准备工作
  • gerrit API
  • Gerrit REST API使用实例
    • 获取所有项目
    • 获取项目信息
    • 获取项目分支
    • 提交记录
    • Change Messages
    • 提交的详细信息
    • 获取评审信息
    • 读取用户信息
  • API数据返回限制

准备工作

Gerrit安装配置方法可参考代码评审平台Gerrit安装配置方法介绍。

REST API官方文档:https://gerrit-documentation.storage.googleapis.com/Documentation/3.8.0/rest-api.html

也可以点击gerrit平台的 DOCUMENTATION -> REST API 查看:

使用REST API读取数据需要用户名和密码,本文以admin用户为例,进入用户设置页面,找到HTTP Credentials,点击Generate new password,生成一个http认证密码。

我的用户名密码为:

admin
b0JoSt8KQHm5OhHhBsH+HN+GNVK9OPXrUzjGCXbxuw

gerrit API

gerrit主要包括以下8类API:

  • /access/:访问权限相关API
  • /accounts/:账户相关API
  • /changes/:更改相关API
  • /config/:配置相关API
  • /groups/:分组相关API
  • /plugins/:插件相关API
  • /projects/:仓库相关API
  • /Documentation/:文档相关API

下面仅介绍部分我使用到的接口,使用curl命令来测试。

Gerrit REST API使用实例

获取所有项目

/a/projects/

$ curl --user admin:b0JoSt8KQHm5OhHhBsH+HN+GNVK9OPXrUzjGCXbxuw http://172.23.23.31:8081/a/projects/
)]}'
{
  "All-Projects": {
    "id": "All-Projects",
    "state": "ACTIVE",
    "web_links": [
      {
        "name": "browse",
        "url": "/plugins/gitiles/All-Projects",
        "target": "_blank"
      }
    ]
  },
  "All-Users": {
    "id": "All-Users",
    "state": "ACTIVE",
    "web_links": [
      {
        "name": "browse",
        "url": "/plugins/gitiles/All-Users",
        "target": "_blank"
      }
    ]
  },
  "gerritDemo": {
    "id": "gerritDemo",
    "state": "ACTIVE",
    "web_links": [
      {
        "name": "browse",
        "url": "/plugins/gitiles/gerritDemo",
        "target": "_blank"
      }
    ]
  }
}

为了防止XSSI(XSSICross Site Script Inclusion)攻击,JSON响应数据前面包含了 )]}' 字符,在后续的数据处理中需要将其删除。

获取项目信息

/a/projects/gerritDemo

$ curl --user admin:b0JoSt8KQHm5OhHhBsH+HN+GNVK9OPXrUzjGCXbxuw http://172.23.23.31:8081/a/projects/gerritDemo
)]}'
{
  "id": "gerritDemo",
  "name": "gerritDemo",
  "parent": "All-Projects",
  "state": "ACTIVE",
  "web_links": [
    {
      "name": "browse",
      "url": "/plugins/gitiles/gerritDemo",
      "target": "_blank"
    }
  ],
  "labels": {
    "Verified": {
      "values": {
        " 0": "No score",
        "-1": "Fails",
        "+1": "Verified"
      },
      "default_value": 0
    },
    "Code-Review": {
      "values": {
        " 0": "No score",
        "-1": "I would prefer this is not submitted as is",
        "-2": "This shall not be submitted",
        "+1": "Looks good to me, but someone else must approve",
        "+2": "Looks good to me, approved"
      },
      "default_value": 0
    }
  }
}

获取项目分支

/a/projects/gerritDemo/branches/

curl --user admin:b0JoSt8KQHm5OhHhBsH+HN+GNVK9OPXrUzjGCXbxuw http://172.23.23.31:8081/a/projects/gerritDemo/branches/
)]}'
[
  {
    "ref": "HEAD",
    "revision": "master"
  },
  {
    "web_links": [
      {
        "name": "browse",
        "url": "/plugins/gitiles/gerritDemo/+/refs/meta/config",
        "target": "_blank"
      }
    ],
    "ref": "refs/meta/config",
    "revision": "8c739812c1813c52b47db8cb42aeffdacf84baaf"
  },
  {
    "web_links": [
      {
        "name": "browse",
        "url": "/plugins/gitiles/gerritDemo/+/refs/heads/master",
        "target": "_blank"
      }
    ],
    "ref": "refs/heads/master",
    "revision": "44438ca8f90741ef10e10a6574487975d2f82141"
  }
]

提交记录

changes: /a/changes/

过滤条件:project:gerritDemo status:open branch:master

REST API:

curl --user admin:b0JoSt8KQHm5OhHhBsH+HN+GNVK9OPXrUzjGCXbxuw http://172.23.23.31:8081/a/changes/?q=status:open+project:gerritDemo+branch:master

返回:

curl --user admin:b0JoSt8KQHm5OhHhBsH+HN+GNVK9OPXrUzjGCXbxuw http://172.23.23.31:8081/a/changes/?q=status:open+project:gerritDemo+branch:master
)]}'
[
  {
    "id": "gerritDemo~master~Ia461fa2b266a749a8e195bb668938cc5c4f8a2dd",
    "project": "gerritDemo",
    "branch": "master",
    "topic": "test",
    "attention_set": {
      "1000001": {
        "account": {
          "_account_id": 1000001
        },
        "last_update": "2023-07-04 13:30:26.000000000",
        "reason": "<GERRIT_ACCOUNT_1000000> replied on the change",
        "reason_account": {
          "_account_id": 1000000
        }
      }
    },
    "removed_from_attention_set": {},
    "hashtags": [],
    "change_id": "Ia461fa2b266a749a8e195bb668938cc5c4f8a2dd",
    "subject": "gerrit提交测试",
    "status": "NEW",
    "created": "2023-07-03 13:00:34.000000000",
    "updated": "2023-07-04 13:32:30.000000000",
    "submit_type": "MERGE_IF_NECESSARY",
    "insertions": 1,
    "deletions": 0,
    "total_comment_count": 1,
    "unresolved_comment_count": 0,
    "has_review_started": true,
    "meta_rev_id": "f0c2f1952432d62db1f6b8d23d83e4399facab25",
    "_number": 1,
    "owner": {
      "_account_id": 1000000
    },
    "requirements": [],
    "submit_records": [
      {
        "rule_name": "gerrit~DefaultSubmitRule",
        "status": "NOT_READY",
        "labels": [
          {
            "label": "Code-Review",
            "status": "NEED"
          },
          {
            "label": "Verified",
            "status": "NEED"
          }
        ]
      }
    ]
  }
]

Change Messages

通过change ID读取提交的详细信息:a/changes/gerritDemo~master~Ia461fa2b266a749a8e195bb668938cc5c4f8a2dd/messages,包含评分及评论内容。

$ curl --user admin:b0JoSt8KQHm5OhHhBsH+HN+GNVK9OPXrUzjGCXbxuw http://172.23.23.31:8081/a/changes/gerritDemo~master~Ia461fa2b266a749a8e195bb668938cc5c4f8a2dd/messages
)]}'
[
  {
    "id": "0556a0aff79e94456565d656c7eabf31c5bd07fb",
    "tag": "autogenerated:gerrit:newPatchSet",
    "author": {
      "_account_id": 1000000,
      "name": "admin",
      "email": "123456789@163.com",
      "username": "admin"
    },
    "real_author": {
      "_account_id": 1000000,
      "name": "admin",
      "email": "123456789@163.com",
      "username": "admin"
    },
    "date": "2023-07-03 13:00:34.000000000",
    "message": "Uploaded patch set 1.",
    "accounts_in_message": [],
    "_revision_number": 1
  },
  {
    "id": "28d364b0bd5018a556b1a0bd41c6fb0dd1d1c739",
    "author": {
      "_account_id": 1000000,
      "name": "admin",
      "email": "123456789@163.com",
      "username": "admin"
    },
    "real_author": {
      "_account_id": 1000000,
      "name": "admin",
      "email": "123456789@163.com",
      "username": "admin"
    },
    "date": "2023-07-03 13:42:19.000000000",
    "message": "Patch Set 1: Verified+1 Code-Review+1\n\n(1 comment)",
    "accounts_in_message": [],
    "_revision_number": 1
  },
 ................................
]

提交的详细信息

a/changes/UGW_main~dev_ugw6.0_main_for_AX2Pro~Ifc3ec88e7f6648a834a743c465dd7cce1c268789/detail:某次提交的详细信息,比messages更详细,包括评审人、评审等信息。

$ curl --user admin:b0JoSt8KQHm5OhHhBsH+HN+GNVK9OPXrUzjGCXbxuw http://172.23.23.31:8081/a/changes/gerritDemo~master~Ia461fa2b266a749a8e195bb668938cc5c4f8a2dd/detail
)]}'
{
  "id": "gerritDemo~master~Ia461fa2b266a749a8e195bb668938cc5c4f8a2dd",
  "project": "gerritDemo",
  "branch": "master",
  "topic": "test",
  "attention_set": {
    "1000001": {
      "account": {
        "_account_id": 1000001,
        "name": "gerrit",
        "email": "987654321@qq.com",
        "username": "gerrit"
      },
      "last_update": "2023-07-04 13:30:26.000000000",
      "reason": "<GERRIT_ACCOUNT_1000000> replied on the change",
      "reason_account": {
        "_account_id": 1000000,
        "name": "admin",
        "email": "123456789@163.com",
        "username": "admin"
      }
    }
  },
  "removed_from_attention_set": {},
  "hashtags": [],
  "change_id": "Ia461fa2b266a749a8e195bb668938cc5c4f8a2dd",
  "subject": "gerrit提交测试",
  "status": "NEW",
  "created": "2023-07-03 13:00:34.000000000",
  "updated": "2023-07-04 13:32:30.000000000",
  "submit_type": "MERGE_IF_NECESSARY",
  "insertions": 1,
  "deletions": 0,
  "total_comment_count": 1,
  "unresolved_comment_count": 0,
  "has_review_started": true,
  "meta_rev_id": "f0c2f1952432d62db1f6b8d23d83e4399facab25",
  "_number": 1,
  "owner": {
    "_account_id": 1000000,
    "name": "admin",
    "email": "123456789@163.com",
    "username": "admin"
  },
  "labels": {
    "Code-Review": {
      "all": [
        {
          "value": 0,
          "permitted_voting_range": {
            "min": -1,
            "max": 1
          },
          "_account_id": 1000001,
          "name": "gerrit",
          "email": "987654321@qq.com",
          "username": "gerrit"
        },
        {
          "value": 0,
          "date": "2023-07-04 13:30:26.000000000",
          "permitted_voting_range": {
            "min": -2,
            "max": 2
          },
          "_account_id": 1000000,
          "name": "admin",
          "email": "123456789@163.com",
          "username": "admin"
        }
      ],
      "values": {
        "-2": "This shall not be submitted",
        "-1": "I would prefer this is not submitted as is",
        " 0": "No score",
        "+1": "Looks good to me, but someone else must approve",
        "+2": "Looks good to me, approved"
      },
      "description": "",
      "default_value": 0
    },
    "Verified": {
      "all": [
        {
          "_account_id": 1000001,
          "name": "gerrit",
          "email": "987654321@qq.com",
          "username": "gerrit"
        },
        {
          "value": 0,
          "date": "2023-07-04 13:30:26.000000000",
          "permitted_voting_range": {
            "min": -1,
            "max": 1
          },
          "_account_id": 1000000,
          "name": "admin",
          "email": "123456789@163.com",
          "username": "admin"
        }
      ],
      "values": {
        "-1": "Fails",
        " 0": "No score",
        "+1": "Verified"
      },
      "description": "",
      "default_value": 0
    }
  },
  "permitted_labels": {
    "Code-Review": [
      "-2",
      "-1",
      " 0",
      "+1",
      "+2"
    ],
    "Verified": [
      "-1",
      " 0",
      "+1"
    ]
  },
  "removable_reviewers": [
    {
      "_account_id": 1000001,
      "name": "gerrit",
      "email": "987654321@qq.com",
      "username": "gerrit"
    },
    {
      "_account_id": 1000000,
      "name": "admin",
      "email": "123456789@163.com",
      "username": "admin"
    }
  ],
  "reviewers": {
    "REVIEWER": [
      {
        "_account_id": 1000000,
        "name": "admin",
        "email": "123456789@163.com",
        "username": "admin"
      },
      {
        "_account_id": 1000001,
        "name": "gerrit",
        "email": "987654321@qq.com",
        "username": "gerrit"
      }
    ]
  },
  "pending_reviewers": {},
  "reviewer_updates": [
    {
      "updated": "2023-07-04 13:30:26.000000000",
      "updated_by": {
        "_account_id": 1000000,
        "name": "admin",
        "email": "123456789@163.com",
        "username": "admin"
      },
      "reviewer": {
        "_account_id": 1000001,
        "name": "gerrit",
        "email": "987654321@qq.com",
        "username": "gerrit"
      },
      "state": "REVIEWER"
    }
  ],
  "messages": [
    {
      "id": "0556a0aff79e94456565d656c7eabf31c5bd07fb",
      "tag": "autogenerated:gerrit:newPatchSet",
      "author": {
        "_account_id": 1000000,
        "name": "admin",
        "email": "123456789@163.com",
        "username": "admin"
      },
      "real_author": {
        "_account_id": 1000000,
        "name": "admin",
        "email": "123456789@163.com",
        "username": "admin"
      },
      "date": "2023-07-03 13:00:34.000000000",
      "message": "Uploaded patch set 1.",
      "accounts_in_message": [],
      "_revision_number": 1
    },
    {
      "id": "28d364b0bd5018a556b1a0bd41c6fb0dd1d1c739",
      "author": {
        "_account_id": 1000000,
        "name": "admin",
        "email": "123456789@163.com",
        "username": "admin"
      },
      "real_author": {
        "_account_id": 1000000,
        "name": "admin",
        "email": "123456789@163.com",
        "username": "admin"
      },
      "date": "2023-07-03 13:42:19.000000000",
      "message": "Patch Set 1: Verified+1 Code-Review+1\n\n(1 comment)",
      "accounts_in_message": [],
      "_revision_number": 1
    },
    {
      "id": "8a4eb8d2a7fd3bc7481e6365b3afff3b7d2f54f7",
      "author": {
        "_account_id": 1000000,
        "name": "admin",
        "email": "123456789@163.com",
        "username": "admin"
      },
      "real_author": {
        "_account_id": 1000000,
        "name": "admin",
        "email": "123456789@163.com",
        "username": "admin"
      },
      "date": "2023-07-03 13:42:47.000000000",
      "message": "Patch Set 1: Code-Review+2",
      "accounts_in_message": [],
      "_revision_number": 1
    },
 ..........................
  ],
  "requirements": [],
  "submit_records": [
    {
      "rule_name": "gerrit~DefaultSubmitRule",
      "status": "NOT_READY",
      "labels": [
        {
          "label": "Code-Review",
          "status": "NEED"
        },
        {
          "label": "Verified",
          "status": "NEED"
        }
      ]
    }
  ]
}

获取评审信息

评审人:/a/changes/gerritDemo~master~Ia461fa2b266a749a8e195bb668938cc5c4f8a2dd/reviewers

$  curl --user admin:b0JoSt8KQHm5OhHhBsH+HN+GNVK9OPXrUzjGCXbxuw http://172.23.23.31:8081/a/changes/gerritDemo~master~Ia461fa2b266a749a8e195bb668938cc5c4f8a2dd/reviewers
)]}'
[
  {
    "approvals": {
      "Code-Review": " 0"
    },
    "_account_id": 1000001,
    "name": "gerrit",
    "email": "987654321@qq.com",
    "username": "gerrit"
  },
  {
    "approvals": {
      "Code-Review": " 0",
      "Verified": " 0"
    },
    "_account_id": 1000000,
    "name": "admin",
    "email": "123456789@163.com",
    "username": "admin"
  }
]
  
$ curl --user admin:b0JoSt8KQHm5OhHhBsH+HN+GNVK9OPXrUzjGCXbxuw http://172.23.23.31:8081/a/changes/gerritDemo~master~Ia461fa2b266a749a8e195bb668938cc5c4f8a2dd/reviewers/987654321@qq.com
)]}'
[
  {
    "approvals": {
      "Code-Review": " 0"
    },
    "_account_id": 1000001,
    "name": "gerrit",
    "email": "987654321@qq.com",
    "username": "gerrit"
  }
]

读取用户信息

/accounts/1000001

$curl --user admin:b0JoSt8KQHm5OhHhBsH+HN+GNVK9OPXrUzjGCXbxuw http://172.23.23.31:8081/accounts/1000001
)]}'
{
  "_account_id": 1000001,
  "name": "gerrit",
  "email": "987654321@qq.com",
  "username": "gerrit"
}

API数据返回限制

Gerrit REST API限制了一次请求最多返回500条记录,如果当前请求接口数据大于500条,在最后一条记录会有一个名称为_more_changes 的字段,值为true

...............
{
      "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501",
      "project": "demo",
      "branch": "master",
      "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501",
      "subject": "Another change",
      "status": "NEW",
      "created": "2012-07-17 07:18:30.884000000",
      "updated": "2012-07-17 07:18:30.885000000",
      "mergeable": true,
      "insertions": 12,
      "deletions": 18,
      "_number": 1757,
      "owner": {
        "name": "John Doe"
      },
      "_more_changes": true
  }
  ]

可以使用 S 参数来读取更多记录:

http://172.16.30.72:8080/a/changes/?q=project:UGW_main+branch:dev_ugw6.0_main&S=0
http://172.16.30.72:8080/a/changes/?q=project:UGW_main+branch:dev_ugw6.0_main&S=500
http://172.16.30.72:8080/a/changes/?q=project:UGW_main+branch:dev_ugw6.0_main&S=1000

参考文档:

  1. 官网:https://www.gerritcodereview.com/
  2. 接口说明文档:https://gerrit-documentation.storage.googleapis.com/Documentation/3.8.0/rest-api.html
--THE END--

相关阅读:

  1. 代码评审平台Gerrit安装配置方法介绍

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

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

相关文章

一例.bat脚本打包样本的分析

样本的基本信息 hosts.exe MD5: 72ddf833fa206326e15c2c97679d323e SHA1: ad148ff4b7f77831b469be8bb19d32d029c23b50banish.exe MD5: 4a43ea617017d5de7d93eb2380634eee SHA1: b0af5aa27cd0e49955f1ab2d18d69f7bc8fd4d21分析过程 查壳 脱掉upx壳&#xff0c;用IDA打开&…

【文件 part 6 - 格式化读写文件函数 随机读写】

格式化读写文件函数 /* 函数调用: */ fprintf ( 文件指针&#xff0c;格式字符串&#xff0c;输出表列&#xff09;&#xff1b; fscanf ( 文件指针&#xff0c;格式字符串&#xff0c;输入表列&#xff09;&#xff1b;/** 函数功能:* 从磁盘文件中读入或输出字符* fprint…

用 ChatGPT 制作中英双语字幕

用 ChatGPT 制作中英双语字幕 0. 背景1. 使用剪映生成英文字幕2. 使用 ChatGPT 的制作中英双语字幕 0. 背景 最近在学习 AI 相关的知识&#xff0c;有很多视频是英文的。 为了提高学习效率&#xff0c;我考虑将这些视频加上中英双语字幕。 效果展示如下&#xff0c; 1. 使用…

如何用logrotate管理每日增长的日志

这篇文章主要介绍了如何用logrotate管理每日增长的日志问题&#xff0c;具有很好的参考价值&#xff0c;希望对大家有所帮助。如有错误或未考虑完全的地方&#xff0c;望不吝赐教&#xff01; logrotate简介 logrotate is designed to ease administration of systems that gen…

数据结构--二叉树的存储结构

数据结构–二叉树的存储结构 二叉树的顺序存储 #define MaxSize 100 struct TreeNode {ElemType value;bool isEmpty; }; TreeNode tree[MaxSize];初始化 void init() {for (int i 0; i < MaxSize; i)tree[i].isEmpty true; }几个重要常考的基本操作: i的左孩子: 2 i 2…

骨传导蓝牙耳机哪个好,推荐几款造诣不错的骨传导耳机

欢迎来到骨传导耳机的奇妙世界&#xff01;这种别具一格的耳机&#xff0c;也被亲切地称为“不入耳式”耳机。它采用了一种神奇的技术&#xff0c;通过颅骨、骨迷路、内耳淋巴液和听神经之间的信号传导&#xff0c;保护我们的听力。不仅如此&#xff0c;这款耳机的开放式设计&a…

Spring七大组件

一、Spring七大组件 1.核心容器(Spring core) Spring-core相当于一个创建并管理bean的容器&#xff1a; 创建&#xff1a;底层使用反射技术创建bean的实例&#xff1b;管理&#xff1a;容器中的每个bean&#xff0c;spring容器默认按照单例模式管理&#xff1b;设计&#xff1…

0501逻辑存储结构和架构-InnoDB引擎-MySQL-数据库

文章目录 1 逻辑结构1.1 表空间1.2 段1.3 区1.4 页1.5 行 2 架构2.1 内存架构2.1.1 Buffer Pool2.1.2 change bufer2.1.3 自适应哈希2.1.4 log buffer 2.2 磁盘架构2.2.1 System Tablespace2.2.2 File-Per-Table Tablespace2.2.3 General Tablespaces2.2.4 Undo Tablespaces2.2…

NC30 缺失的第一个正整数

import java.util.*;public class Solution {/*** 代码中的类名、方法名、参数名已经指定&#xff0c;请勿修改&#xff0c;直接返回方法规定的值即可*** param nums int整型一维数组* return int整型*/public int minNumberDisappeared (int[] nums) {// write code hereHashM…

CCF-CSP真题《202303-3 LDAP》思路+python,c++满分题解

想查看其他题的真题及题解的同学可以前往查看&#xff1a;CCF-CSP真题附题解大全 试题编号&#xff1a;202303-3试题名称&#xff1a;LDAP时间限制&#xff1a;12.0s内存限制&#xff1a;1.0GB问题描述&#xff1a; 题目背景 西西艾弗岛运营公司是一家负责维护和运营岛上基础设…

Android Studio实现内容丰富的安卓电影购票系统

如需源码可以添加q-------3290510686&#xff0c;也有演示视频演示具体功能&#xff0c;源码不免费&#xff0c;尊重创作&#xff0c;尊重劳动。 项目编号043 1.开发环境 android stuido jdk1.8 eclipse mysql tomcat 2.功能介绍 安卓端&#xff1a; 1.注册登录 2.查看电影列表…

datagrip 无法断句

使用datagrip 的时候出现了几个sql 执行会无法断开语句的情况可以在这里设置: When caret outside statement execute:

PADS Layout软件中焊盘各层的释义是什么呢

对于PADS软件而言&#xff0c;焊盘的组成由下面几种组成。 焊盘&#xff1a;包括规则焊盘以及通孔焊盘。 热焊盘&#xff1a;热风盘&#xff0c;也叫花焊盘&#xff0c;在负片中有效&#xff0c;设计用于在负片中焊盘与敷铜的接连方式&#xff0c;防止焊接时散热太快&#xf…

Windows远程连接linux中mysql数据库

我没有mysql并且没有把mysql配置到环境变量中&#xff0c;所以现在我要下载mysql 一.下载mysql Mysql官网下载地址&#xff1a;https://downloads.mysql.com/archives/installer 二.安装mysql 1. 选择设置类型 双击运行mysql-installer-community-8.0.26.msi&#xff0c;这…

网络安全 | 商用密码产品介绍

关注wx&#xff1a; CodingTechWork 密码产品概述 密码 使用特定变换对数据等信息进行加密保护、安全认证的技术、产品和服务。 密码技术 实现密码的加密保护和安全认证等功能的技术&#xff0c;主要包含密码算法、密钥管理和密码协议等。 密码划分 核心密码普通密码商用…

ai绘画图片网站哪个好?这几个好用的ai绘画图片网站分享给你

近期我的朋友公司给它安排了一项艰巨的任务&#xff0c;公司给了他一堆图片&#xff0c;然后要求他根据这些图片生成一些风格类似却又独具特色的优质图片&#xff0c;这可难倒他了&#xff0c;他在机缘巧合的情况下得知了有ai绘画图片生成图片的技术&#xff0c;但它不知道怎么…

Rust 第三天---内存管理与所有权

前面介绍了环境配置以及基础语法,掌握之后已经可以开始用Rust编写一些简单的程序了,今天就要来介绍一下Rust核心的功能—内存管理与所有权 1. 关于内存管理 无论什么高级语言必须考虑到的一点就是编写程序时对于内存的管理问题,更简单一点解释,利用编程语言能快速高效的分配内…

C语言究竟是一门怎样的语言?

对于大部分程序员&#xff0c;C语言是学习编程的第一门语言&#xff0c;很少有不了解C的程序员。 C语言除了能让你了解编程的相关概念&#xff0c;带你走进编程的大门&#xff0c;还能让你明白程序的运行原理&#xff0c;比如&#xff0c;计算机的各个部件是如何交互的&#xf…

40、使用elementUI分别实现前端,后端表格分页

说明&#xff1a;前端单独做的表格分页—用于解决数据过多页面渲染压力&#xff0c;如果是服务器响应数据过慢&#xff0c;使用第二种分页方法–后端分页。以下为分页效果 一、前端分页 1、创建表格 <el-table:key"new Date().getTime()":data"tableData.s…

Linux samba服务器配置教程

此教程适用于Centos 和 Ubuntu&#xff0c;其它Linux系统一般大概率配置命令相同&#xff01; 一、关闭防火墙 1. Centos 查看防火墙状态&#xff1a;systemctl status firewalld.service 关闭防火墙&#xff1a;systemctl stop firewalld.service 永久关闭防火墙&#xff…