add: hub template
This commit is contained in:
24
hub/app/adapters/store_api_adapter.py
Normal file
24
hub/app/adapters/store_api_adapter.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import json
|
||||
import logging
|
||||
from typing import List
|
||||
|
||||
import pydantic_core
|
||||
import requests
|
||||
|
||||
from app.entities.processed_agent_data import ProcessedAgentData
|
||||
from app.interfaces.store_gateway import StoreGateway
|
||||
|
||||
|
||||
class StoreApiAdapter(StoreGateway):
|
||||
def __init__(self, api_base_url):
|
||||
self.api_base_url = api_base_url
|
||||
|
||||
def save_data(self, processed_agent_data_batch: List[ProcessedAgentData]):
|
||||
"""
|
||||
Save the processed road data to the Store API.
|
||||
Parameters:
|
||||
processed_agent_data_batch (dict): Processed road data to be saved.
|
||||
Returns:
|
||||
bool: True if the data is successfully saved, False otherwise.
|
||||
"""
|
||||
# Implement it
|
||||
Reference in New Issue
Block a user