mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-16 09:45:57 +08:00
新增:code_stats分页
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class Api::V1::Projects::CodeStats::ListService < ApplicationService
|
||||
|
||||
attr_reader :project, :ref, :owner, :repo, :token
|
||||
attr_reader :project, :ref, :owner, :repo, :token, :page, :limit
|
||||
attr_accessor :gitea_data
|
||||
|
||||
def initialize(project, params, token=nil)
|
||||
@@ -9,6 +9,8 @@ class Api::V1::Projects::CodeStats::ListService < ApplicationService
|
||||
@owner = project&.owner.login
|
||||
@repo = project&.identifier
|
||||
@token = token
|
||||
@page = params[:page]
|
||||
@limit = params[:limit]
|
||||
end
|
||||
|
||||
def call
|
||||
@@ -20,7 +22,9 @@ class Api::V1::Projects::CodeStats::ListService < ApplicationService
|
||||
private
|
||||
def request_params
|
||||
param = {
|
||||
access_token: token
|
||||
access_token: token,
|
||||
page: page,
|
||||
limit: limit
|
||||
}
|
||||
param.merge!(ref: ref) if ref.present?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user