mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
新增:最近提交列表message搜索
This commit is contained in:
@@ -11,6 +11,6 @@ class Api::V1::Projects::CommitsController < Api::V1::BaseController
|
||||
end
|
||||
|
||||
def recent
|
||||
@result_object = Api::V1::Projects::Commits::RecentService.call(@project, {page: page, limit: limit}, current_user&.gitea_token)
|
||||
@result_object = Api::V1::Projects::Commits::RecentService.call(@project, {keyword: params[:keyword], page: page, limit: limit}, current_user&.gitea_token)
|
||||
end
|
||||
end
|
||||
@@ -1,12 +1,13 @@
|
||||
class Api::V1::Projects::Commits::RecentService < ApplicationService
|
||||
|
||||
attr_reader :project, :page, :limit, :owner, :repo, :token
|
||||
attr_reader :project, :page, :limit, :keyword, :owner, :repo, :token
|
||||
attr_accessor :gitea_data
|
||||
|
||||
def initialize(project, params, token=nil)
|
||||
@project = project
|
||||
@page = params[:page] || 1
|
||||
@limit = params[:limit] || 15
|
||||
@keyword = params[:keyword]
|
||||
@owner = project&.owner&.login
|
||||
@repo = project&.identifier
|
||||
@token = token
|
||||
@@ -25,6 +26,7 @@ class Api::V1::Projects::Commits::RecentService < ApplicationService
|
||||
page: page,
|
||||
limit: limit
|
||||
}
|
||||
param.merge!(keyword: keyword) if keyword.present?
|
||||
|
||||
param
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user