mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 20:55:46 +08:00
Merge branch 'chenjing' of https://gitlink.org.cn/KingChan/forgeplus into chenjing
This commit is contained in:
@@ -6,7 +6,7 @@ class Api::V1::Projects::Contributors::StatService < ApplicationService
|
||||
def initialize(project, params, token=nil)
|
||||
@project = project
|
||||
@branch = params[:branch]
|
||||
@pass_year = params[:pass_year]
|
||||
@pass_year = params[:pass_year] || 3
|
||||
@page = params[:page] || 1
|
||||
@limit = params[:limit] || 15
|
||||
@owner = project&.owner.login
|
||||
@@ -23,10 +23,10 @@ class Api::V1::Projects::Contributors::StatService < ApplicationService
|
||||
private
|
||||
def request_params
|
||||
param = {
|
||||
access_token: token
|
||||
access_token: token, page: page, limit: limit
|
||||
}
|
||||
param.merge!(branch: branch) if branch.present?
|
||||
param.merge!(pass_year: pass_year) if pass_year.present?
|
||||
param.merge!(pass_year: @pass_year)
|
||||
|
||||
param
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ class Gitea::Commit::DiffService < Gitea::ClientService
|
||||
end
|
||||
|
||||
def call
|
||||
response = get(url, params)
|
||||
response = get(url, params, true)
|
||||
render_result(response)
|
||||
end
|
||||
|
||||
|
||||
@@ -8,20 +8,17 @@ class Gitea::User::GetTokenService < Gitea::ClientService
|
||||
|
||||
def call
|
||||
params = {}
|
||||
url = "/users/#{username}".freeze
|
||||
params = params.merge(data: request_params)
|
||||
get(url, params)
|
||||
url = "/users/#{username}/tokens".freeze
|
||||
params = params.merge(sudo: username, page: 1, limit: 200, token: token)
|
||||
response = get(url, params)
|
||||
render_status(response)
|
||||
end
|
||||
|
||||
private
|
||||
# def token_params
|
||||
# {
|
||||
# username: username,
|
||||
# password: password
|
||||
# }
|
||||
# end
|
||||
|
||||
def request_params
|
||||
{ username: username }
|
||||
def token
|
||||
{
|
||||
username: GiteaService.gitea_config[:access_key_id],
|
||||
password: GiteaService.gitea_config[:access_key_secret]
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,7 +18,7 @@ class Projects::ForkService < ApplicationService
|
||||
:license_id, :ignore_id, {repository: [:identifier, :hidden]}]
|
||||
|
||||
result = Gitea::Repository::ForkService.new(@project.owner, @target_owner, @project.identifier, @organization, @new_identifier).call
|
||||
|
||||
return false if result['clone_url'].nil?
|
||||
clone_project.owner = @target_owner
|
||||
clone_project.forked_from_project_id = @project.id
|
||||
clone_project.gpid = result['id']
|
||||
|
||||
Reference in New Issue
Block a user