2024-03-15 18:27:31 -04:00
|
|
|
class Api::V1::PointsController < ApplicationController
|
|
|
|
|
skip_forgery_protection
|
|
|
|
|
|
|
|
|
|
def create
|
2024-04-02 11:37:38 -04:00
|
|
|
PointCreatingJob.perform_later(point_params)
|
2024-03-15 18:27:31 -04:00
|
|
|
|
2024-04-02 11:37:38 -04:00
|
|
|
render json: {}, status: :ok
|
2024-03-15 18:27:31 -04:00
|
|
|
end
|
|
|
|
|
|
2024-03-23 08:36:09 -04:00
|
|
|
def destroy
|
|
|
|
|
@point = Point.find(params[:id])
|
|
|
|
|
@point.destroy
|
|
|
|
|
|
|
|
|
|
head :no_content
|
|
|
|
|
end
|
|
|
|
|
|
2024-03-15 18:27:31 -04:00
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def point_params
|
|
|
|
|
params.permit(
|
|
|
|
|
:lat, :lon, :bs, :batt, :p, :alt, :acc, :vac, :vel, :conn, :SSID, :BSSID, :m, :tid, :tst,
|
|
|
|
|
:topic, :_type, :cog, :t, inrids: [], inregions: [], point: {}
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
end
|