-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #332 from weni-ai/feature/refactoring-in-dashboard…
…-rooms-info-endpoint Feature/refactoring in dashboard rooms info endpoint
- Loading branch information
Showing
7 changed files
with
383 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import List | ||
|
||
from .dto import Filters, RoomData | ||
|
||
|
||
class RoomsDataRepository(ABC): | ||
@abstractmethod | ||
def get_cache_key(self, filters: Filters) -> str: | ||
pass | ||
|
||
@abstractmethod | ||
def get_rooms_data(self, filters: Filters) -> List["RoomData"]: | ||
pass | ||
|
||
|
||
class CacheRepository(ABC): | ||
@abstractmethod | ||
def get(self, key: str, default=None): | ||
"""Obtém dados do cache com base na chave.""" | ||
pass | ||
|
||
@abstractmethod | ||
def set(self, key: str, data): | ||
"""Define dados no cache com uma chave associada.""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.