mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-13 08:15:55 +08:00
新增:发布人和状态接口
This commit is contained in:
@@ -20,10 +20,19 @@ class Api::V1::BaseController < ApplicationController
|
||||
# User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token
|
||||
# end
|
||||
# end
|
||||
|
||||
def kaminary_select_paginate(relation)
|
||||
limit = params[:limit] || params[:per_page]
|
||||
limit = (limit.to_i.zero? || limit.to_i > 100) ? 100 : limit.to_i
|
||||
page = params[:page].to_i.zero? ? 1 : params[:page].to_i
|
||||
|
||||
relation.page(page).per(limit)
|
||||
end
|
||||
|
||||
def limit
|
||||
params.fetch(:limit, 15)
|
||||
end
|
||||
|
||||
def page
|
||||
params.fetch(:page, 1)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user