1 Star 6 Fork 3

SDK For Gitee/gitee5j

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
docs
ActivityApi.md
AttachFile.md
Blame.md
Blob.md
Branch.md
BranchCommit.md
Code.md
CodeComment.md
CodeFile.md
CodeForks.md
CodeForksHistory.md
CollaboratorsUsernameBody.md
CommentBody.md
Commit.md
CommitContent.md
CommitParentsBasic.md
CommitStats.md
Compare.md
CompleteBranch.md
Content.md
ContentBasic.md
ContentsPathBody.md
ContentsPathBody1.md
ContentsPathBody2.md
Contributor.md
DiffFile.md
EmailsApi.md
EnterpriseBasic.md
EnterpriseMember.md
EnterpriseMembersBody.md
EnterpriseReposBody.md
EnterpriseWeekReportBody.md
EnterprisesApi.md
Event.md
GistIdCommentsBody.md
GistsApi.md
GistsBody.md
GistsIdBody.md
GitAction.md
GitCommit.md
GitDataApi.md
GitSha.md
GitUser.md
GitUserBasic.md
GiteeMetricData.md
GiteeMetrics.md
Group.md
GroupBasic.md
GroupDetail.md
GroupFollowers.md
GroupMember.md
Hook.md
HooksIdBody.md
Href.md
IdCommentBody.md
Issue.md
IssueState.md
IssueType.md
IssuesApi.md
IssuesNumberBody.md
IssuesNumberBody1.md
Label.md
LabelsApi.md
LabelsOriginalNameBody.md
Link.md
MarkdownBody.md
MembersUsernameBody.md
MembershipsUsernameBody.md
Milestone.md
MilestonesApi.md
MilestonesNumberBody.md
MiscellaneousApi.md
Namespace.md
NamespaceMini.md
Note.md
NotificationsMessagesBody.md
NotificationsMessagesBody1.md
NotificationsThreadsBody.md
NumberAssigneesBody.md
NumberAssigneesBody1.md
NumberCommentsBody.md
NumberCommentsBody1.md
NumberMergeBody.md
NumberReviewBody.md
NumberTestBody.md
NumberTestersBody.md
NumberTestersBody1.md
OperateLog.md
OrgReposBody.md
OrganizationsApi.md
OrgsOrgBody.md
OrgsOrgBody1.md
OwnerIssuesBody.md
OwnerRepoBody.md
OwnerRepoBody1.md
Patch.md
ProgramBasic.md
Project.md
ProjectBasic.md
ProjectLabel.md
ProjectMember.md
ProjectMemberPermission.md
ProjectMini.md
ProjectPermission.md
ProjectPushConfig.md
ProjectStargazers.md
ProjectTrafficData.md
ProjectTrafficDataDesc.md
ProjectTrafficDataSummary.md
ProjectWatchers.md
ProtectionRule.md
PullRequest.md
PullRequestBranch.md
PullRequestComments.md
PullRequestCommits.md
PullRequestFiles.md
PullRequestLinks.md
PullRequestsApi.md
PullsNumberBody.md
RefPullRequest.md
Release.md
ReleaseAsset.md
ReleaseIdAttachFilesBody.md
ReleasesIdBody.md
RepoBaiduStatisticKeyBody.md
RepoBranchesBody.md
RepoCommit.md
RepoCommitWithFiles.md
RepoCommitsBody.md
RepoForksBody.md
RepoHooksBody.md
RepoKeysBody.md
RepoLabelsBody.md
RepoMilestonesBody.md
RepoNotificationsBody.md
RepoPagesBody.md
RepoPullsBody.md
RepoPushConfigBody.md
RepoReleasesBody.md
RepoReviewerBody.md
RepoTagsBody.md
RepoTrafficdataBody.md
RepositoriesApi.md
SSHKey.md
SSHKeyBasic.md
SearchApi.md
SettingNewBody.md
ShaCommentsBody.md
Tag.md
TagCommit.md
Tree.md
TreeEntry.md
User.md
UserAssignee.md
UserBasic.md
UserBody.md
UserDetail.md
UserEmail.md
UserInfo.md
UserKeysBody.md
UserMessage.md
UserMessageList.md
UserMini.md
UserNotification.md
UserNotificationCount.md
UserNotificationList.md
UserNotificationNamespace.md
UserNotificationSubject.md
UserReposBody.md
UsersApi.md
UsersOrganizationBody.md
WebhooksApi.md
WeekReport.md
WeekReportIdBody.md
WildcardSettingBody.md
scripts
src
.gitignore
LICENSE
README.md
pom.xml
克隆/下载
GitDataApi.md 5.80 KB
一键复制 编辑 原始数据 按行查看 历史
likui 提交于 2年前 . rename group-id

GitDataApi

All URIs are relative to https://gitee.com/api/v5

Method HTTP request Description
getReposOwnerRepoGitBlobsSha GET /repos/{owner}/{repo}/git/blobs/{sha} 获取文件Blob
getReposOwnerRepoGitGiteeMetrics GET /repos/{owner}/{repo}/git/gitee_metrics 获取 Gitee 指数
getReposOwnerRepoGitTreesSha GET /repos/{owner}/{repo}/git/trees/{sha} 获取目录Tree

getReposOwnerRepoGitBlobsSha

Blob getReposOwnerRepoGitBlobsSha(owner, repo, sha)

获取文件Blob

获取文件Blob

Example

// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.GitDataApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");

GitDataApi apiInstance = new GitDataApi();
String owner = "owner_example"; // String | 仓库所属空间地址(企业、组织或个人的地址path)
String repo = "repo_example"; // String | 仓库路径(path)
String sha = "sha_example"; // String | 文件的 Blob SHA,可通过 [获取仓库具体路径下的内容] API 获取
try {
    Blob result = apiInstance.getReposOwnerRepoGitBlobsSha(owner, repo, sha);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GitDataApi#getReposOwnerRepoGitBlobsSha");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
owner String 仓库所属空间地址(企业、组织或个人的地址path)
repo String 仓库路径(path)
sha String 文件的 Blob SHA,可通过 [获取仓库具体路径下的内容] API 获取

Return type

Blob

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getReposOwnerRepoGitGiteeMetrics

GiteeMetrics getReposOwnerRepoGitGiteeMetrics(owner, repo)

获取 Gitee 指数

获取 Gitee 指数

Example

// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.GitDataApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");

GitDataApi apiInstance = new GitDataApi();
String owner = "owner_example"; // String | 仓库所属空间地址(企业、组织或个人的地址path)
String repo = "repo_example"; // String | 仓库路径(path)
try {
    GiteeMetrics result = apiInstance.getReposOwnerRepoGitGiteeMetrics(owner, repo);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GitDataApi#getReposOwnerRepoGitGiteeMetrics");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
owner String 仓库所属空间地址(企业、组织或个人的地址path)
repo String 仓库路径(path)

Return type

GiteeMetrics

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getReposOwnerRepoGitTreesSha

Tree getReposOwnerRepoGitTreesSha(owner, repo, sha, recursive)

获取目录Tree

获取目录Tree

Example

// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.GitDataApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");

GitDataApi apiInstance = new GitDataApi();
String owner = "owner_example"; // String | 仓库所属空间地址(企业、组织或个人的地址path)
String repo = "repo_example"; // String | 仓库路径(path)
String sha = "sha_example"; // String | 可以是分支名(如master)、Commit或者目录Tree的SHA值
Integer recursive = 56; // Integer | 赋值为1递归获取目录
try {
    Tree result = apiInstance.getReposOwnerRepoGitTreesSha(owner, repo, sha, recursive);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GitDataApi#getReposOwnerRepoGitTreesSha");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
owner String 仓库所属空间地址(企业、组织或个人的地址path)
repo String 仓库路径(path)
sha String 可以是分支名(如master)、Commit或者目录Tree的SHA值
recursive Integer 赋值为1递归获取目录 [optional]

Return type

Tree

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/sdk/gitee5j.git
git@gitee.com:sdk/gitee5j.git
sdk
gitee5j
gitee5j
main

搜索帮助