|
@@ -5,18 +5,18 @@ from typing import List
|
|
|
from fastapi import APIRouter, Depends, HTTPException, Query
|
|
|
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 BluetoothCreate, IBeaconBase
|
|
|
+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]):
|
|
|
- valid_data = []
|
|
|
- logger.debug(valid_data)
|
|
|
info_list = [item.dict() for item in bluetooth_info]
|
|
|
logger.info(f'{user_id}: {info_list}')
|
|
|
- response = {'Result': 'success'}
|
|
|
+ sp_id = await get_space_location('Pj1101080259', bluetooth_info)
|
|
|
+ response = {'Result': sp_id}
|
|
|
|
|
|
return response
|