Projekt

Obecné

Profil

« Předchozí | Další » 

Revize d79d1369

Přidáno uživatelem David Friesecký před asi 4 roky(ů)

Re #8471 - Initialization of DAO implementation
- created data class according to DB tables (Certificate, PrivateKey)
- created abstract class for DB communication

Zobrazit rozdíly:

src/dao/repository.py
1
class IRepository:
2
    def create(self, sql: str, *args) -> bool:
3
        pass
4

  
5
    def read(self, sql: str, item_id: int = None):
6
        pass
7

  
8
    def update(self, sql: str, item_id: int, *args) -> bool:
9
        pass
10

  
11
    def delete(self, sql: str, item_id: int) -> bool:
12
        pass
src/db_objects/certificate.py
1
class Certificate:
2
    def __init__(self,
3
                 certificate_id: int,
4
                 common_name: str,
5
                 valid_from: str,
6
                 valid_to: str,
7
                 pem_data: str,
8
                 type_id: int,
9
                 private_key_id: int,
10
                 usage_id: int):
11
        self.certificate_id: int = certificate_id
12
        self.common_name: str = common_name
13
        self.valid_from: str = valid_from
14
        self.valid_to: str = valid_to
15
        self.pem_data: str = pem_data
16
        self.type_id: int = type_id
17
        self.private_key_id: int = private_key_id
18
        self.usage_id: int = usage_id
src/db_objects/private_key.py
1
class PrivateKey:
2
    def __init__(self,
3
                 private_key: str,
4
                 password: str):
5
        self.private_key = private_key
6
        self.password = password

Také k dispozici: Unified diff