# -*- coding: utf-8 -*- from fastapi import APIRouter from loguru import logger from app.controllers.location.ble.space import get_space_location from app.models.domain.bluetooth import BluetoothUserResponse from app.schemas.bluetooth import IBeaconBase router = APIRouter() @router.post("/user/{user_id}", response_model=BluetoothUserResponse) async def create_bluetooth_info(user_id: str, bluetooth_info: list[IBeaconBase]): info_list = [item.dict() for item in bluetooth_info] logger.info(f"{user_id}: {info_list}") sp_id = await get_space_location("Pj1101080259", bluetooth_info) response = {"Result": sp_id} return response