internal 1.0.106__tar.gz → 1.0.108__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of internal might be problematic. Click here for more details.

Files changed (41) hide show
  1. {internal-1.0.106 → internal-1.0.108}/PKG-INFO +1 -1
  2. {internal-1.0.106 → internal-1.0.108}/pyproject.toml +1 -1
  3. {internal-1.0.106 → internal-1.0.108}/src/internal/base_factory.py +3 -0
  4. internal-1.0.108/src/internal/log_config.py +32 -0
  5. internal-1.0.106/src/internal/common_enum/event_trigger_type.py +0 -34
  6. internal-1.0.106/src/internal/common_enum/feature.py +0 -6
  7. internal-1.0.106/src/internal/common_enum/notify_type.py +0 -10
  8. {internal-1.0.106 → internal-1.0.108}/README.md +0 -0
  9. {internal-1.0.106 → internal-1.0.108}/src/internal/__init__.py +0 -0
  10. {internal-1.0.106 → internal-1.0.108}/src/internal/base_config.py +0 -0
  11. {internal-1.0.106 → internal-1.0.108}/src/internal/cache_redis.py +0 -0
  12. {internal-1.0.106 → internal-1.0.108}/src/internal/common_enum/__init__.py +0 -0
  13. {internal-1.0.106 → internal-1.0.108}/src/internal/common_enum/contact_type.py +0 -0
  14. {internal-1.0.106 → internal-1.0.108}/src/internal/common_enum/description_type.py +0 -0
  15. {internal-1.0.106 → internal-1.0.108}/src/internal/common_enum/device_code.py +0 -0
  16. {internal-1.0.106 → internal-1.0.108}/src/internal/common_enum/event_code.py +0 -0
  17. {internal-1.0.106 → internal-1.0.108}/src/internal/common_enum/lpr_direction.py +0 -0
  18. {internal-1.0.106 → internal-1.0.108}/src/internal/common_enum/operator_type.py +0 -0
  19. {internal-1.0.106 → internal-1.0.108}/src/internal/common_enum/order_type.py +0 -0
  20. {internal-1.0.106 → internal-1.0.108}/src/internal/const.py +0 -0
  21. {internal-1.0.106 → internal-1.0.108}/src/internal/database.py +0 -0
  22. {internal-1.0.106 → internal-1.0.108}/src/internal/exception/__init__.py +0 -0
  23. {internal-1.0.106 → internal-1.0.108}/src/internal/exception/app_exception.py +0 -0
  24. {internal-1.0.106 → internal-1.0.108}/src/internal/exception/base_exception.py +0 -0
  25. {internal-1.0.106 → internal-1.0.108}/src/internal/exception/internal_exception.py +0 -0
  26. {internal-1.0.106 → internal-1.0.108}/src/internal/ext/__init__.py +0 -0
  27. {internal-1.0.106 → internal-1.0.108}/src/internal/ext/amazon/__init__.py +0 -0
  28. {internal-1.0.106 → internal-1.0.108}/src/internal/ext/amazon/aws/__init__.py +0 -0
  29. {internal-1.0.106 → internal-1.0.108}/src/internal/ext/amazon/aws/const.py +0 -0
  30. {internal-1.0.106 → internal-1.0.108}/src/internal/http/__init__.py +0 -0
  31. {internal-1.0.106 → internal-1.0.108}/src/internal/http/requests.py +0 -0
  32. {internal-1.0.106 → internal-1.0.108}/src/internal/http/responses.py +0 -0
  33. {internal-1.0.106 → internal-1.0.108}/src/internal/interface/__init__.py +0 -0
  34. {internal-1.0.106 → internal-1.0.108}/src/internal/interface/base_interface.py +0 -0
  35. {internal-1.0.106 → internal-1.0.108}/src/internal/middleware/__init__.py +0 -0
  36. {internal-1.0.106 → internal-1.0.108}/src/internal/middleware/log_request.py +0 -0
  37. {internal-1.0.106 → internal-1.0.108}/src/internal/model/__init__.py +0 -0
  38. {internal-1.0.106 → internal-1.0.108}/src/internal/model/base_model.py +0 -0
  39. {internal-1.0.106 → internal-1.0.108}/src/internal/model/operate.py +0 -0
  40. {internal-1.0.106 → internal-1.0.108}/src/internal/utils.py +0 -0
  41. {internal-1.0.106 → internal-1.0.108}/src/internal/validator_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: internal
3
- Version: 1.0.106
3
+ Version: 1.0.108
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "internal"
3
- version = "1.0.106"
3
+ version = "1.0.108"
4
4
  description = ""
5
5
  authors = [{ name = "Ray", email = "ray@cruisys.com" }]
6
6
  readme = "README.md"
@@ -1,4 +1,5 @@
1
1
  import logging
2
+ import logging.config
2
3
  import logging.handlers
3
4
  import os
4
5
  import traceback
@@ -21,6 +22,7 @@ from .exception.internal_exception import BadGatewayException, GatewayTimeoutExc
21
22
  from .ext.amazon import aws
22
23
  from .http.requests import async_request
23
24
  from .http.responses import async_response
25
+ from .log_config import LOGGING
24
26
  from .middleware.log_request import LogRequestMiddleware
25
27
  from .utils import update_dict_with_cast
26
28
 
@@ -231,6 +233,7 @@ class BaseFactory(metaclass=ABCMeta):
231
233
 
232
234
  #
233
235
  def __setup_logger(self, app, logger_name, level=logging.INFO):
236
+ logging.config.dictConfig(LOGGING)
234
237
  logger = logging.getLogger(logger_name)
235
238
  logger.setLevel(level)
236
239
 
@@ -0,0 +1,32 @@
1
+ LOGGING = {
2
+ 'version': 1,
3
+ 'disable_existing_loggers': False,
4
+ 'filters': {
5
+ 'correlation_id': {
6
+ '()': 'asgi_correlation_id.CorrelationIdFilter',
7
+ 'uuid_length': 32,
8
+ 'default_value': '-',
9
+ },
10
+ },
11
+ 'formatters': {
12
+ 'web': {
13
+ 'class': 'logging.Formatter',
14
+ 'datefmt': '%H:%M:%S',
15
+ 'format': '%(levelname)s ... [%(correlation_id)s] %(name)s %(message)s',
16
+ },
17
+ },
18
+ 'handlers': {
19
+ 'web': {
20
+ 'class': 'logging.StreamHandler',
21
+ 'filters': ['correlation_id'],
22
+ 'formatter': 'web',
23
+ },
24
+ },
25
+ 'loggers': {
26
+ 'my_project': {
27
+ 'handlers': ['web'],
28
+ 'level': 'DEBUG',
29
+ 'propagate': True,
30
+ },
31
+ },
32
+ }
@@ -1,34 +0,0 @@
1
- from enum import Enum
2
-
3
-
4
- # 待廢
5
- class EventTriggerTypeEnum(str, Enum):
6
- MANUAL_CANCEL_SERVICE_TICKET = "manual_cancel_service_ticket"
7
- MANUAL_TRACING_START_SERVICE_TICKET = "manual_tracking_start_service_ticket"
8
- MANUAL_TRACING_STOP_SERVICE_TICKET = "manual_tracking_stop_service_ticket"
9
- MANUAL_CREATE_SERVICE_TICKET = "manual_create_service_ticket"
10
- MANUAL_IMPORT_RESERVATION_SMWS = "manual_import_reservation_smws"
11
- MANUAL_MODIFY_USER_SERVICE_TICKET = "manual_modify_user_service_ticket"
12
- MANUAL_MODIFY_ESTIMATED_ARRIVAL_TIME_SERVICE_TICKET = "manual_modify_estimated_arrival_time_service_ticket"
13
- MANUAL_MODIFY_ESTIMATED_DELIVERY_TIME_SERVICE_TICKET = "manual_modify_estimated_delivery_time_service_ticket"
14
- MANUAL_DELETE_ESTIMATED_DELIVERY_TIME_SERVICE_TICKET = "manual_delete_estimated_delivery_time_service_ticket"
15
- MANUAL_BOOKING_MESSAGE_SERVICE_TICKET = "manual_booking_message_service_ticket"
16
- MANUAL_DELIVERY_MESSAGE_SERVICE_TICKET = "manual_delivery_message_service_ticket"
17
-
18
- NOSHOW_SERVICE_TICKET_AUTO_CANCEL = "noshow_service_ticket_auto_cancel"
19
- IMPORT_RESERVATION_CONFLICT_AUTO_CANCEL = "import_reservation_conflict_auto_cancel"
20
- BOOKING_REMINDING_SERVICE_TICKET = "booking_reminding_service_ticket"
21
- TODAY_REPAIR_WORKING_SERVICE_TICKET_AUTO_CLOSED = "today_repair_working_service_ticket_auto_closed"
22
-
23
- LPNR_IN_ESTABLISHED = "lpnr_in_established"
24
- LPNR_IN_RECEPTION = "lpnr_in_reception"
25
- LPNR_IN_WORKING = "lpnr_in_working"
26
- LPNR_IN_NO_SERVICE_TICKET = "lpnr_in_no_service_ticket"
27
- LPNR_OUT = "lpnr_out"
28
- LPNR_OUT_GENERAL = "lpnr_out_general"
29
- LPNR_OUT_NO_SERVE = "lpnr_out_no_serve"
30
- LPNR_IN_POSITION = "lpnr_in_position"
31
- LPNR_OUT_POSITION = "lpnr_out_position"
32
-
33
- LPR_STATE = "lpr_state"
34
- LPR = "lpr"
@@ -1,6 +0,0 @@
1
- from enum import Enum
2
-
3
- # 討論是否廢
4
- class FeatureEnum(str, Enum):
5
- IMPORT = 'import'
6
- QUERY = 'query'
@@ -1,10 +0,0 @@
1
- from enum import Enum
2
-
3
-
4
- # 討論是否廢
5
- class NotifyTypeEnum(str, Enum):
6
- APP = "app"
7
- LINE = "line"
8
- SMS = "sms"
9
- NOTIFICATION = "notification"
10
- WEBSOCKET = "websocket"
File without changes