internal 1.0.56__py3-none-any.whl → 1.0.58__py3-none-any.whl

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.

@@ -1,8 +1,10 @@
1
+ from fastapi import status
1
2
  from fastapi import HTTPException
2
3
 
3
4
 
4
5
  class InternalBaseException(HTTPException):
5
- def __init__(self, status_code: int = None, code: str = "ok", message: str = "success", **kwargs):
6
+ def __init__(self, status_code: int = status.HTTP_500_INTERNAL_SERVER_ERROR, code: str = "internal_server_error",
7
+ message: str = "Internal server error", **kwargs):
6
8
  detail = {
7
9
  "code": code,
8
10
  "message": message,
internal/model/operate.py CHANGED
@@ -36,11 +36,17 @@ class Operate(BaseModel):
36
36
  diff[2] = list(diff[2])
37
37
 
38
38
  if diff[0] == 'change':
39
- diff_result['change'][diff[1]] = {'orig': diff[2][0], 'new': diff[2][1]}
39
+ temp_key = diff[1]
40
+ if type(diff[1]) == list:
41
+ temp_key = "_".join([str(temp_x) for temp_x in list(diff[1])])
42
+ diff_result['change'][temp_key] = {'orig': diff[2][0], 'new': diff[2][1]}
40
43
 
41
44
  if diff[0] == 'add' or diff[0] == 'remove':
42
45
  for j in range(0, len(diff[2])):
43
- diff_result[diff[0]][diff[2][j][0]] = diff[2][j][1]
46
+ if str(diff[2][j][0]).isdigit():
47
+ diff_result[diff[0]][f"{diff[1]}_{diff[2][j][0]}"] = diff[2][j][1]
48
+ else:
49
+ diff_result[diff[0]][diff[2][j][0]] = diff[2][j][1]
44
50
 
45
51
  final_diff_result = cls.split_keys(diff_result)
46
52
  return Operate(**final_diff_result)
@@ -60,6 +66,7 @@ class Operate(BaseModel):
60
66
  def split_keys(cls, diff_result: Dict):
61
67
  result = {}
62
68
  for key, value in diff_result.items():
69
+ key = str(key)
63
70
  if '.' in key:
64
71
  parts = key.split('.')
65
72
  current_level = result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: internal
3
- Version: 1.0.56
3
+ Version: 1.0.58
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -11,7 +11,7 @@ internal/common_enum/order_type.py,sha256=XwAl5JaZgFLahBQhBKG4VuMJ39Si9KZEhcSS0-
11
11
  internal/const.py,sha256=U1S9r7bjtHgad2oYQoHO19s8D4V0WDUG-L-haV4UaIw,1025
12
12
  internal/database.py,sha256=1u53JnFJ0jvP7H4HPY2faA2ABdPQ8SlsZigYmQAPktI,2470
13
13
  internal/exception/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- internal/exception/base_exception.py,sha256=U0ZXx1FOXydAnQQImznkeAdsKVC_YaukPWvJdWqEBfg,363
14
+ internal/exception/base_exception.py,sha256=8ctp525A3up9mZrHCq_-Jj0hWr_4NfZsXGg1e4ftVuQ,473
15
15
  internal/exception/internal_exception.py,sha256=rBi70sDFwoYc2NSnxXQ9LY6r2TnxA7ILC64xjpg5h4c,2296
16
16
  internal/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  internal/ext/amazon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -26,8 +26,8 @@ internal/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
26
26
  internal/middleware/log_request.py,sha256=bXAxmvvsYDhObXzfUw4ZNreKAWOo8ee_vpb6Xin5ztc,854
27
27
  internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  internal/model/base_model.py,sha256=NS_GZvw_IqU1aZPHPpyQs6A741O34ybmzVzBPm9nGWU,3014
29
- internal/model/operate.py,sha256=YZ-sgCx10ln93haJrgU18oeOvINoy5EnOPw1G3-2c4s,2828
29
+ internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
30
30
  internal/utils.py,sha256=CXYZs4rDDe33Zac27YeknBE4uQN437ys1YAbW3Xeyow,1517
31
- internal-1.0.56.dist-info/METADATA,sha256=1XdQ13QC2bdwAXhkn9nivO5iSBMe8hMhOutDrxivjwc,625
32
- internal-1.0.56.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
33
- internal-1.0.56.dist-info/RECORD,,
31
+ internal-1.0.58.dist-info/METADATA,sha256=rS0yrVwtoPcfWMFuZCSh6ICYsnvpY4_RBKVjUCuSX-E,625
32
+ internal-1.0.58.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
33
+ internal-1.0.58.dist-info/RECORD,,