class Api::V1::Users::HomeTopSettingsController < Api::V1::BaseController

  before_action :load_observe_user
  before_action :check_auth_for_observe_user

  def create 
    @result = Api::V1::Users::HomeTopSettings::CreateService.call(@observe_user, home_top_setting_params)
    return render_error("置顶失败.") if @result.nil? 
    return render_ok
  end

  def cancel 
    @result = Api::V1::Users::HomeTopSettings::DeleteService.call(@observe_user, home_top_setting_params)
    return render_error("取消置顶失败.") if @result.nil? 
    return render_ok
  end

  private 
  def home_top_setting_params 
    params.permit(:top_type, :top_id)
  end

end