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)
    Rails.logger.info "OpenkylinSignController=====#{@object_result}"
    if @object_result
      return render_ok
    else
      return render_error('签署失败!') 
    end
  end 

  private 
  def create_params 
    params.permit(:login, :email, :nickname, :phone, :address)
  end
end