forked from chroe/gitlink-cli
2.1 KiB
2.1 KiB
gitlink-search 参考手册
本文档定义搜索相关命令的 API 字段映射。
一、search +repos 返回字段
{
"ok": true,
"data": {
"projects": [
{
"id": 1513956,
"identifier": "gitlink-cli",
"name": "gitlink-cli",
"description": "GitLink CLI - GitLink 平台命令行工具",
"author": {
"login": "Gitlink",
"name": "GitLink",
"type": "Organization"
},
"language": { "id": 19, "name": "Go" },
"forked_count": 31,
"praises_count": 5,
"visits": 2155,
"is_public": true,
"time_ago": "12小时前",
"platform": "forge",
"open_devops": false
}
]
}
}
| 字段 | 类型 | 说明 |
|---|---|---|
id |
int | 项目全局 ID(用于 Raw API) |
identifier |
string | 仓库标识(即 repo 名) |
name |
string | 仓库名 |
description |
string | 项目描述 |
author.login |
string | 所有者 login |
author.type |
string | "User" 或 "Organization" |
language.name |
string | 主要编程语言 |
forked_count |
int | Fork 数 |
praises_count |
int | Star/点赞数 |
visits |
int | 访问量 |
is_public |
bool | 是否公开 |
time_ago |
string | 最后更新时间(相对) |
二、search +users 返回字段
{
"ok": true,
"data": {
"total_count": 1,
"users": [
{
"user_id": 149027,
"login": "chroe",
"username": "chroe",
"image_url": "system/lets/letter_avatars/2/C/142_140_188/120.png",
"profile_completed": false
}
]
},
"meta": {
"total_count": 1
}
}
| 字段 | 类型 | 说明 |
|---|---|---|
user_id |
int | 用户全局 ID |
login |
string | 登录名 |
username |
string | 显示名 |
profile_completed |
bool | 是否完善个人资料 |
三、参数说明
| 参数 | 命令 | 必填 | 说明 |
|---|---|---|---|
--keyword / -k |
+repos, +users | 是 | 搜索关键词 |
--limit |
+repos | 否 | 返回数量限制 |