mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-24 05:35:46 +08:00
add: project branch_slice
This commit is contained in:
22
app/services/gitea/repository/branches/list_slice_service.rb
Normal file
22
app/services/gitea/repository/branches/list_slice_service.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
class Gitea::Repository::Branches::ListSliceService < Gitea::ClientService
|
||||
attr_reader :user, :repo
|
||||
|
||||
def initialize(user, repo)
|
||||
@user = user
|
||||
@repo = repo
|
||||
end
|
||||
|
||||
def call
|
||||
response = get(url, params)
|
||||
render_200_response(response)
|
||||
end
|
||||
|
||||
private
|
||||
def params
|
||||
Hash.new.merge(token: user.gitea_token)
|
||||
end
|
||||
|
||||
def url
|
||||
"/repos/#{user.login}/#{repo}/branches/branches_slice".freeze
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user