新增:最近提交列表message搜索
This commit is contained in:
		
							parent
							
								
									c88d0c2712
								
							
						
					
					
						commit
						fd6f904f7e
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue