aiteamutils 0.2.69__tar.gz → 0.2.71__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiteamutils
3
- Version: 0.2.69
3
+ Version: 0.2.71
4
4
  Summary: AI Team Utilities
5
5
  Project-URL: Homepage, https://github.com/yourusername/aiteamutils
6
6
  Project-URL: Issues, https://github.com/yourusername/aiteamutils/issues
@@ -0,0 +1,47 @@
1
+ #기본 라이브러리
2
+ from fastapi import Request
3
+ from typing import TypeVar, Generic, Type, Dict, Any, Union, List
4
+ from sqlalchemy.orm import DeclarativeBase
5
+ from sqlalchemy.ext.asyncio import AsyncSession
6
+ from datetime import datetime
7
+
8
+ #패키지 라이브러리
9
+ from .exceptions import ErrorCode, CustomException
10
+ from .base_repository import BaseRepository
11
+ from .database import (
12
+ process_response,
13
+ build_search_filters
14
+ )
15
+
16
+ ModelType = TypeVar("ModelType", bound=DeclarativeBase)
17
+
18
+ class BaseService(Generic[ModelType]):
19
+ ##################
20
+ # 1. 초기화 영역 #
21
+ ##################
22
+ def __init__(
23
+ self,
24
+ model: Type[ModelType],
25
+ repository: BaseRepository[ModelType],
26
+ db_session: AsyncSession,
27
+ additional_models: Dict[str, Type[DeclarativeBase]] = None,
28
+ ):
29
+ self.model = model
30
+ self.repository = repository
31
+ self.db_session = db_session
32
+ self.additional_models = additional_models or {},
33
+
34
+ async def list(
35
+ self,
36
+ skip: int = 0,
37
+ limit: int = 100,
38
+ filters: Dict[str, Any] | None =
39
+ except Exception as e:
40
+ raise CustomException(
41
+ ErrorCode.INTERNAL_ERROR,
42
+ detail=str(e),
43
+ source_function=f"{self.__class__.__name__}.list",
44
+ original_error=e
45
+ )
46
+
47
+
@@ -0,0 +1,2 @@
1
+ """버전 정보"""
2
+ __version__ = "0.2.71"
File without changes
@@ -1,2 +0,0 @@
1
- """버전 정보"""
2
- __version__ = "0.2.69"
File without changes
File without changes
File without changes
File without changes