add: some lose api

This commit is contained in:
viletyy 2022-06-21 17:31:01 +08:00
parent 6978f97dbd
commit 41c2538e9c
4 changed files with 31 additions and 0 deletions

View File

@ -7,6 +7,7 @@ require_relative 'api/organization'
require_relative 'api/notification'
require_relative 'api/miscellaneous'
require_relative 'api/admin'
require_relative 'api/activity'
require_relative 'api/client'
require_relative 'api/config'
require_relative 'api/exception'

17
lib/gitea/api/activity.rb Normal file
View File

@ -0,0 +1,17 @@
module Gitea
module Api
module Activity
def get_activity(opt={})
@http.get("/activity", opt)
end
def get_activity_develop(opt={})
@http.get("/activity/develop", opt)
end
def get_activity_project(opt={})
@http.get("/activity/project", opt)
end
end # Activity
end # Api
end # Gitea

View File

@ -44,6 +44,7 @@ module Gitea
include Gitea::Api::Notification
include Gitea::Api::Miscellaneous
include Gitea::Api::Admin
include Gitea::Api::Activity
end
end # User
end # Gitea

View File

@ -29,6 +29,10 @@ module Gitea
@http.get("/repos/#{owner}/#{repo}/assignees", opt)
end
def get_repos_branch_name_set_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/branch_name_set", opt)
end
def get_repos_branch_protections_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/branch_protections", opt)
end
@ -61,6 +65,10 @@ module Gitea
@http.post("/repos/#{owner}/#{repo}/branches", opt)
end
def get_repos_branches_branches_slice_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/branches/branches_slice", opt)
end
def get_repos_branches_by_owner_repo_branch(owner, repo, branch, opt = {})
@http.get("/repos/#{owner}/#{repo}/branches/#{branch}", opt)
end
@ -93,6 +101,10 @@ module Gitea
@http.get("/repos/#{owner}/#{repo}/commits/#{ref}/statuses", opt)
end
def get_repos_commits_slice_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/commits_slice", opt)
end
def get_repos_contents_by_owner_repo(owner, repo, opt = {})
@http.get("/repos/#{owner}/#{repo}/contents", opt)
end