mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-16 17:55:56 +08:00
新增:openkylin_sign 签署协议
This commit is contained in:
23
app/controllers/api/v1/users/openkylin_sign_controller.rb
Normal file
23
app/controllers/api/v1/users/openkylin_sign_controller.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
class Api::V1::Users::OpenkylinSignController < Api::V1::BaseController
|
||||
|
||||
before_action :load_observe_user
|
||||
|
||||
def competitions
|
||||
@competition_ids = EduSetting.get("openkylin_sign_competitions").split(",") rescue []
|
||||
render :json => {data: @competition_ids}
|
||||
end
|
||||
|
||||
def create
|
||||
@object_result = Api::V1::Users::OpenkylinSign::CreateService.call(@observe_user, create_params)
|
||||
if @result_object
|
||||
return render_ok
|
||||
else
|
||||
return render_error('签署失败!')
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def create_params
|
||||
params.permit(:login, :email, :nickname, :phone, :address)
|
||||
end
|
||||
end
|
||||
@@ -1,7 +1,7 @@
|
||||
class Api::V1::UsersController < Api::V1::BaseController
|
||||
|
||||
before_action :load_observe_user, except: [:check_user_id]
|
||||
before_action :check_auth_for_observe_user, except: [:check_user_id]
|
||||
before_action :load_observe_user, except: [:check_user_id, :check_user_login]
|
||||
before_action :check_auth_for_observe_user, except: [:check_user_id, :check_user_login]
|
||||
|
||||
def check_user_id
|
||||
return tip_exception(-1, "用户ID不存在") unless params[:user_id].present? && User.exists?(id: params[:user_id])
|
||||
|
||||
Reference in New Issue
Block a user