fastgenerateapi 1.1.8__py2.py3-none-any.whl → 1.1.10__py2.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.
Files changed (36) hide show
  1. fastgenerateapi/__version__.py +1 -1
  2. fastgenerateapi/api_view/base_view.py +5 -2
  3. fastgenerateapi/api_view/create_view.py +4 -0
  4. fastgenerateapi/api_view/delete_filter_view.py +7 -2
  5. fastgenerateapi/api_view/delete_tree_view.py +8 -2
  6. fastgenerateapi/api_view/delete_view.py +8 -2
  7. fastgenerateapi/api_view/get_all_view.py +8 -4
  8. fastgenerateapi/api_view/get_one_view.py +5 -1
  9. fastgenerateapi/api_view/get_relation_view.py +3 -0
  10. fastgenerateapi/api_view/get_tree_view.py +3 -0
  11. fastgenerateapi/api_view/mixin/base_mixin.py +1 -1
  12. fastgenerateapi/api_view/switch_view.py +9 -3
  13. fastgenerateapi/api_view/update_relation_view.py +4 -0
  14. fastgenerateapi/api_view/update_view.py +4 -0
  15. fastgenerateapi/channel/connection_manager.py +30 -0
  16. fastgenerateapi/channel/consumer.py +25 -20
  17. fastgenerateapi/channel/websocket_view.py +60 -2
  18. fastgenerateapi/my_fields/enum_field.py +8 -6
  19. fastgenerateapi/schemas_factory/filter_schema_factory.py +5 -1
  20. fastgenerateapi/schemas_factory/get_all_schema_factory.py +6 -6
  21. fastgenerateapi/schemas_factory/response_factory.py +2 -2
  22. fastgenerateapi/settings/all_settings.py +78 -71
  23. fastgenerateapi/settings/app_settings.py +14 -5
  24. fastgenerateapi/settings/db_settings.py +21 -31
  25. fastgenerateapi/settings/file_settings.py +13 -7
  26. fastgenerateapi/settings/jwt_settings.py +13 -6
  27. fastgenerateapi/settings/otlp_settings.py +14 -7
  28. fastgenerateapi/settings/redis_settings.py +13 -6
  29. fastgenerateapi/settings/sms_settings.py +13 -6
  30. fastgenerateapi/settings/system_settings.py +8 -2
  31. fastgenerateapi/utils/snowflake.py +1 -1
  32. {fastgenerateapi-1.1.8.dist-info → fastgenerateapi-1.1.10.dist-info}/METADATA +1 -1
  33. {fastgenerateapi-1.1.8.dist-info → fastgenerateapi-1.1.10.dist-info}/RECORD +36 -35
  34. {fastgenerateapi-1.1.8.dist-info → fastgenerateapi-1.1.10.dist-info}/LICENSE +0 -0
  35. {fastgenerateapi-1.1.8.dist-info → fastgenerateapi-1.1.10.dist-info}/WHEEL +0 -0
  36. {fastgenerateapi-1.1.8.dist-info → fastgenerateapi-1.1.10.dist-info}/top_level.txt +0 -0
@@ -81,22 +81,22 @@ def get_all_schema_factory(
81
81
  return schema
82
82
 
83
83
 
84
- def get_list_schema_factory(schema_cls: Type[T] = None) -> Type[T]:
84
+ def get_list_schema_factory(schema_cls: Type[T] = None, name: str = "") -> Type[T]:
85
85
  if schema_cls:
86
86
  fields = {
87
87
  settings.app_settings.LIST_RESPONSE_FIELD: (Optional[List[schema_cls]], FieldInfo(default=[], description="数据返回")),
88
88
  }
89
- name = schema_cls.__name__ + "GetListSchema"
89
+ name = schema_cls.__name__ + name + "GetListSchema"
90
90
  else:
91
91
  fields = {
92
92
  settings.app_settings.LIST_RESPONSE_FIELD: (Optional[List], FieldInfo(default=[], description="数据返回")),
93
93
  }
94
- name = "GetListSchema" + str(time.time())
94
+ name = name + "GetListSchema"
95
95
  schema: Type[T] = create_model(name, **fields, __config__=model_config)
96
96
  return schema
97
97
 
98
98
 
99
- def get_page_schema_factory(schema_cls: Type[T] = None) -> Type[T]:
99
+ def get_page_schema_factory(schema_cls: Type[T] = None, name: str = "") -> Type[T]:
100
100
  fields = {
101
101
  settings.app_settings.CURRENT_PAGE_FIELD: (Optional[int], FieldInfo(default=1, description="当前页")),
102
102
  settings.app_settings.PAGE_SIZE_FIELD: (Optional[int], FieldInfo(default=settings.app_settings.DEFAULT_PAGE_SIZE, description="每页数量")),
@@ -104,10 +104,10 @@ def get_page_schema_factory(schema_cls: Type[T] = None) -> Type[T]:
104
104
  }
105
105
  if schema_cls:
106
106
  fields.update({settings.app_settings.LIST_RESPONSE_FIELD: (Optional[List[schema_cls]], FieldInfo(default=[], description="数据返回"))})
107
- name = schema_cls.__name__ + "GetPageSchema"
107
+ name = schema_cls.__name__ + name + "GetPageSchema"
108
108
  else:
109
109
  fields.update({settings.app_settings.LIST_RESPONSE_FIELD: (Optional[List], FieldInfo(default=[], description="数据返回"))})
110
- name = "GetPageSchema" + str(time.time())
110
+ name = name + "GetPageSchema"
111
111
  schema: Type[T] = create_model(name, **fields, __config__=model_config)
112
112
  return schema
113
113
 
@@ -33,9 +33,9 @@ def response_factory(schema_cls: Union[Type[T], BaseModel, None] = None, name: s
33
33
  )
34
34
 
35
35
  try:
36
- name = schema_cls.__name__ + name + "Response" + str(time.time())
36
+ name = schema_cls.__name__ + name + "Response"
37
37
  except:
38
- name = "CommonResponse"
38
+ name = name + "CommonResponse"
39
39
  schema: Type[T] = create_model(name, **fields, __config__=model_config)
40
40
 
41
41
  return schema
@@ -1,5 +1,10 @@
1
+ from functools import lru_cache
2
+ from pathlib import Path
3
+ from typing import Union
1
4
 
5
+ import yaml
2
6
  from pydantic import BaseModel
7
+ from pydantic.fields import FieldInfo
3
8
 
4
9
  from fastgenerateapi.settings.redis_settings import RedisSettings
5
10
  from fastgenerateapi.settings.app_settings import AppSettings
@@ -14,78 +19,80 @@ class SettingsModel(BaseModel):
14
19
  # 缓存配置
15
20
  redis_settings: RedisSettings = RedisSettings()
16
21
 
17
- # pydantic v2 不支持 ModelField, v.type_
18
- # @classmethod
19
- # def generate_file(cls, path='./.env'):
20
- # """
21
- # 生成配置文件
22
- # .env 会增加前缀
23
- # .yaml 忽略前缀
24
- # :param path: 可选 .env / application.yaml
25
- # :return:
26
- # """
27
- # content = ''
28
- # setting_models = cls.__fields__.copy()
29
- # if path.__contains__('.env'):
30
- # for k, v in setting_models.items():
31
- # if issubclass(type(v), ModelField):
32
- # sub_setting_class = v.type_
33
- # content += f"[{sub_setting_class.__name__}]\n"
34
- # fields = sub_setting_class.__fields__.copy()
35
- # for k, v in fields.items():
36
- # field_name = f'{sub_setting_class.Config.env_prefix}{k}'
37
- # if v.field_info.description is None:
38
- # content += f"{field_name}={v.default}\n"
39
- # else:
40
- # content += f"# {v.field_info.description}\n{field_name}={v.default}\n"
41
- # content += "\n"
42
- # elif path.__contains__('.yaml'):
43
- # for k, v in setting_models.items():
44
- # if issubclass(type(v), ModelField):
45
- # sub_setting_class = v.type_
46
- # content += f"{sub_setting_class.__name__}:\n"
47
- # fields = sub_setting_class.__fields__.copy()
48
- # for k, v in fields.items():
49
- # content += f" {k}: {v.default}"
50
- # if v.field_info.description is None:
51
- # content += f"\n"
52
- # else:
53
- # content += f" # {v.field_info.description}\n"
54
- # content += "\n"
55
- # with open(file=path, mode='w', encoding='utf-8') as f:
56
- # f.writelines(content)
57
- #
58
- # @classmethod
59
- # @lru_cache
60
- # def get_global_settings(cls, path: Union[types.Path, str, None] = '.env'):
61
- # """
62
- # get global settings and set into cache
63
- # :param path: 可选 .env / application.yaml
64
- # :return:
65
- # """
66
- # setting_models = cls.__fields__.copy()
67
- #
68
- # setting_dict = {}
69
- # if str(path).__contains__('.env'):
70
- # for k, v in setting_models.items():
71
- # if issubclass(type(v), ModelField):
72
- # sub_setting_class = v.type_
73
- # setting_dict[k] = sub_setting_class(_env_file=str(path))
74
- # elif str(path).__contains__('.yaml'):
75
- # with open(path, 'r', encoding='utf-8') as file:
76
- # data_dict = yaml.safe_load(file)
77
- # for k, v in setting_models.items():
78
- # if issubclass(type(v), ModelField):
79
- # sub_setting_class = v.type_
80
- # setting_dict[k] = sub_setting_class(**data_dict.get(sub_setting_class.__name__, {}))
81
- #
82
- # setting_data = cls(**setting_dict)
83
- # global settings
84
- # settings.app_settings = setting_data.app_settings
85
- # settings.system_settings = setting_data.system_settings
86
- # settings.redis_settings = setting_data.redis_settings
87
- # return setting_data
22
+ @classmethod
23
+ def generate_file(cls, path='./.env'):
24
+ """
25
+ 生成配置文件
26
+ .env 会增加前缀
27
+ .yaml 忽略前缀
28
+ :param path: 可选 .env / application.yaml
29
+ :return:
30
+ """
31
+ content = ''
32
+ setting_models = cls.model_fields.copy()
33
+ if path.__contains__('.env'):
34
+ for k, v in setting_models.items():
35
+ if isinstance(v, FieldInfo):
36
+ content += f"[{v.annotation.__name__}]\n"
37
+ env_prefix = v.annotation.model_config.get("env_prefix", "")
38
+ fields = v.annotation.model_fields.copy()
39
+ for k, v in fields.items():
40
+ field_name = f'{env_prefix}{k}'
41
+ if v.description is None:
42
+ content += f"{field_name}={v.default}\n"
43
+ else:
44
+ content += f"# {v.description}\n{field_name}={v.default}\n"
45
+ content += "\n"
46
+ elif path.__contains__('.yaml'):
47
+ for k, v in setting_models.items():
48
+ if isinstance(v, FieldInfo):
49
+ content += f"[{v.annotation.__name__}]\n"
50
+ env_prefix = v.annotation.model_config.get("env_prefix", "")
51
+ fields = v.annotation.model_fields.copy()
52
+ for k, v in fields.items():
53
+ field_name = f'{env_prefix}{k}'
54
+ content += f" {field_name}: {v.default}"
55
+ if v.description is None:
56
+ content += f"\n"
57
+ else:
58
+ content += f" # {v.description}\n"
59
+ content += "\n"
60
+ with open(file=path, mode='w', encoding='utf-8') as f:
61
+ f.writelines(content)
62
+
63
+ @classmethod
64
+ @lru_cache
65
+ def get_global_settings(cls, path: Union[Path, str, None] = '.env'):
66
+ """
67
+ get global settings and set into cache
68
+ :param path: 可选 .env / application.yaml
69
+ :return:
70
+ """
71
+ setting_models = cls.model_fields.copy()
72
+
73
+ setting_dict = {}
74
+ if str(path).__contains__('.env'):
75
+ for k, v in setting_models.items():
76
+ if isinstance(v, FieldInfo):
77
+ setting_dict[k] = v.annotation(_env_file=str(path))
78
+ elif str(path).__contains__('.yaml'):
79
+ with open(path, 'r', encoding='utf-8') as file:
80
+ data_dict = yaml.safe_load(file)
81
+ for k, v in setting_models.items():
82
+ if isinstance(v, FieldInfo):
83
+ setting_dict[k] = v.annotation(**data_dict.get(v.annotation.__name__, {}))
84
+
85
+ setting_data = cls(**setting_dict)
86
+ global settings
87
+ settings.app_settings = setting_data.app_settings
88
+ settings.system_settings = setting_data.system_settings
89
+ settings.redis_settings = setting_data.redis_settings
90
+ return setting_data
88
91
 
89
92
 
90
93
  settings = SettingsModel()
91
94
 
95
+
96
+ if __name__ == '__main__':
97
+ settings.generate_file()
98
+
@@ -1,6 +1,8 @@
1
1
  from typing import Optional
2
2
 
3
3
  from pydantic import Field
4
+ from pydantic_settings import SettingsConfigDict
5
+
4
6
  from fastgenerateapi.pydantic_utils.base_settings import BaseSettings
5
7
 
6
8
 
@@ -79,11 +81,18 @@ class AppSettings(BaseSettings):
79
81
  FILTER_UNDERLINE_WHETHER_DOUBLE_TO_SINGLE: Optional[bool] = Field(default=True, description="筛选是否双下划线转单下划线")
80
82
  SCHEMAS_UNDERLINE_WHETHER_DOUBLE_TO_SINGLE: Optional[bool] = Field(default=True, description="序列化字段是否双下划线转单下划线")
81
83
 
82
- class Config:
83
- env_prefix = "APP_"
84
- env_file = "./.env"
85
- case_sensitive = True
86
- extra = 'allow'
84
+ model_config = SettingsConfigDict(
85
+ env_prefix="APP_",
86
+ env_file=".env",
87
+ case_sensitive=True,
88
+ extra='ignore'
89
+ )
90
+
91
+ # class Config:
92
+ # env_prefix = "APP_"
93
+ # env_file = "./.env"
94
+ # case_sensitive = True
95
+ # extra = 'allow'
87
96
 
88
97
 
89
98
 
@@ -1,7 +1,7 @@
1
1
  from typing import Optional
2
2
 
3
3
  from pydantic import Field
4
- from pydantic_settings import BaseSettings
4
+ from pydantic_settings import BaseSettings, SettingsConfigDict
5
5
 
6
6
 
7
7
  class DBSettings(BaseSettings):
@@ -9,22 +9,28 @@ class DBSettings(BaseSettings):
9
9
  Database Settings
10
10
  """
11
11
 
12
- TYPE: Optional[str] = Field(default='mysql', description="数据库类型")
13
- HOST: Optional[str] = Field(default='127.0.0.1', description="数据库域名")
14
- PORT: Optional[str] = Field(default='3306', description="数据库端口")
15
- DATABASE: Optional[str] = Field(default='admin', description="数据库名")
16
- USERNAME: Optional[str] = Field(default='root', description="数据库用户名")
17
- PASSWORD: Optional[str] = Field(default='', description="数据库密码")
12
+ DB_TYPE: Optional[str] = Field(default='mysql', description="数据库类型")
13
+ DB_HOST: Optional[str] = Field(default='127.0.0.1', description="数据库域名")
14
+ DB_PORT: Optional[str] = Field(default='3306', description="数据库端口")
15
+ DB_DATABASE: Optional[str] = Field(default='admin', description="数据库名")
16
+ DB_USERNAME: Optional[str] = Field(default='root', description="数据库用户名")
17
+ DB_PASSWORD: Optional[str] = Field(default='', description="数据库密码")
18
18
 
19
19
  @property
20
20
  def dsn(self):
21
- return f"{self.TYPE.lower()}://{self.USERNAME}:{self.PASSWORD}@{self.HOST}:{self.PORT}/{self.DATABASE}"
21
+ return f"{self.DB_TYPE.lower()}://{self.DB_USERNAME}:{self.DB_PASSWORD}@{self.DB_HOST}:{self.DB_PORT}/{self.DB_DATABASE}"
22
22
 
23
- class Config:
24
- env_prefix = 'DB_'
25
- env_file = "./.env"
26
- case_sensitive = True
27
- extra = 'allow'
23
+ model_config = SettingsConfigDict(
24
+ env_file=".env",
25
+ case_sensitive=True,
26
+ extra='ignore'
27
+ )
28
+
29
+ # class Config:
30
+ # env_prefix = ''
31
+ # env_file = "./.env"
32
+ # case_sensitive = True
33
+ # extra = 'allow'
28
34
 
29
35
 
30
36
  class PostgresqlSettings(DBSettings):
@@ -33,36 +39,20 @@ class PostgresqlSettings(DBSettings):
33
39
  """
34
40
  TYPE: Optional[str] = Field(default='postgres', description="数据库类型")
35
41
 
36
- class Config:
37
- env_prefix = 'Postgresql_'
38
- env_file = "./.env"
39
- case_sensitive = True
40
- extra = 'allow'
41
-
42
42
 
43
43
  class MySQLSettings(DBSettings):
44
44
  """
45
45
  MySQL Settings
46
46
  """
47
-
48
- class Config:
49
- env_prefix = 'MYSQL_'
50
- env_file = "./.env"
51
- case_sensitive = True
52
- extra = 'allow'
47
+ ...
53
48
 
54
49
 
55
50
  class LocalSettings(DBSettings):
56
51
  """
57
- MySQL Settings
52
+ Local Settings
58
53
  """
59
54
  TYPE: str = Field(..., description="数据库类型")
60
55
 
61
- class Config:
62
- env_prefix = 'LOCAL_'
63
- env_file = "./.env"
64
- case_sensitive = True
65
- extra = 'allow'
66
56
 
67
57
 
68
58
 
@@ -1,10 +1,10 @@
1
1
  from typing import Optional
2
2
 
3
3
  from pydantic import Field
4
- from pydantic_settings import BaseSettings
4
+ from pydantic_settings import BaseSettings, SettingsConfigDict
5
5
 
6
6
 
7
- class FileServerSettings(BaseSettings):
7
+ class FileSettings(BaseSettings):
8
8
  """
9
9
  文件配置
10
10
  """
@@ -12,11 +12,17 @@ class FileServerSettings(BaseSettings):
12
12
  FILE_URL: Optional[str] = Field(default='/static/', description="文件路径前缀", title="file url prefix")
13
13
  FILE_ROOT: Optional[str] = Field(default='static', description="文件储存路径", title="file storage path")
14
14
 
15
- class Config:
16
- env_prefix = 'FileServer_'
17
- env_file = "./.env"
18
- case_sensitive = True
19
- extra = 'allow'
15
+ model_config = SettingsConfigDict(
16
+ env_file=".env",
17
+ case_sensitive=True,
18
+ extra='ignore'
19
+ )
20
+
21
+ # class Config:
22
+ # env_prefix = 'FILESERVER_'
23
+ # env_file = "./.env"
24
+ # case_sensitive = True
25
+ # extra = 'allow'
20
26
 
21
27
 
22
28
 
@@ -1,7 +1,7 @@
1
1
  from typing import Optional
2
2
 
3
3
  from pydantic import Field
4
- from pydantic_settings import BaseSettings
4
+ from pydantic_settings import BaseSettings, SettingsConfigDict
5
5
 
6
6
 
7
7
  class JWTSettings(BaseSettings):
@@ -13,11 +13,18 @@ class JWTSettings(BaseSettings):
13
13
  ACCESS_TOKEN_EXPIRE_MINUTES: Optional[int] = Field(default=30, description="过期时间 (分钟)", title="JWT Access Token")
14
14
  REFRESH_TOKEN_EXPIRE_MINUTES: Optional[int] = Field(default=60, description="过期时间(分钟)", title="JWT Refresh Token")
15
15
 
16
- class Config:
17
- env_prefix = 'JWT_'
18
- env_file = "./.env"
19
- case_sensitive = True
20
- extra = 'allow'
16
+ model_config = SettingsConfigDict(
17
+ env_prefix="JWT_",
18
+ env_file=".env",
19
+ case_sensitive=True,
20
+ extra='ignore'
21
+ )
22
+
23
+ # class Config:
24
+ # env_prefix = 'JWT_'
25
+ # env_file = "./.env"
26
+ # case_sensitive = True
27
+ # extra = 'allow'
21
28
 
22
29
 
23
30
 
@@ -15,14 +15,14 @@ from opentelemetry.sdk.trace import TracerProvider
15
15
  from opentelemetry.sdk.trace.export import BatchSpanProcessor
16
16
 
17
17
  from pydantic import Field
18
- from pydantic_settings import BaseSettings
18
+ from pydantic_settings import BaseSettings, SettingsConfigDict
19
19
 
20
20
 
21
21
  class OpenTelemetrySettings(BaseSettings):
22
22
  """
23
23
  跟踪和指标配置
24
24
  """
25
- ENDPOINT: Optional[str] = Field(default=None, description="访问接口", example="http://127.0.0.1")
25
+ ENDPOINT: Optional[str] = Field(default=None, description="访问接口", examples=["http://127.0.0.1"])
26
26
  AUTHORIZATION: Optional[str] = Field(default=None, description="认证字符串")
27
27
 
28
28
  def setup_open_telemetry(self, app: FastAPI, service_name: str):
@@ -62,8 +62,15 @@ class OpenTelemetrySettings(BaseSettings):
62
62
  TortoiseORMInstrumentor().instrument(tracer_provider=tracer_provider)
63
63
  HTTPXClientInstrumentor().instrument(tracer_provider=tracer_provider)
64
64
 
65
- class Config:
66
- env_prefix = 'OTLP_'
67
- env_file = "./.env"
68
- case_sensitive = True
69
- extra = 'allow'
65
+ model_config = SettingsConfigDict(
66
+ env_prefix="OTLP_",
67
+ env_file=".env",
68
+ case_sensitive=True,
69
+ extra='ignore'
70
+ )
71
+
72
+ # class Config:
73
+ # env_prefix = 'OTLP_'
74
+ # env_file = "./.env"
75
+ # case_sensitive = True
76
+ # extra = 'allow'
@@ -1,7 +1,7 @@
1
1
  from typing import Optional
2
2
 
3
3
  from pydantic import Field
4
- from pydantic_settings import BaseSettings
4
+ from pydantic_settings import BaseSettings, SettingsConfigDict
5
5
 
6
6
 
7
7
  class RedisSettings(BaseSettings):
@@ -9,8 +9,15 @@ class RedisSettings(BaseSettings):
9
9
  PORT: Optional[int] = Field(default=6379, description="映射端口")
10
10
  PASSWORD: Optional[str] = Field(default="", description="密码")
11
11
 
12
- class Config:
13
- env_prefix = 'REDIS_'
14
- env_file = "./.env"
15
- case_sensitive = True
16
- extra = 'allow'
12
+ model_config = SettingsConfigDict(
13
+ env_prefix="REDIS_",
14
+ env_file=".env",
15
+ case_sensitive=True,
16
+ extra='ignore'
17
+ )
18
+
19
+ # class Config:
20
+ # env_prefix = 'REDIS_'
21
+ # env_file = "./.env"
22
+ # case_sensitive = True
23
+ # extra = 'allow'
@@ -1,7 +1,7 @@
1
1
  from typing import Optional
2
2
 
3
3
  from pydantic import Field
4
- from pydantic_settings import BaseSettings
4
+ from pydantic_settings import BaseSettings, SettingsConfigDict
5
5
 
6
6
 
7
7
  class SmsSettings(BaseSettings):
@@ -15,11 +15,18 @@ class SmsSettings(BaseSettings):
15
15
  CHECK_CODE_RESEND_TIME: Optional[int] = Field(default=1, description="验证码重新发送时间", title="check code resend time (minute)")
16
16
  DEFAULT_CODE: Optional[int] = Field(default="654123", description="默认验证码", title="sms default code")
17
17
 
18
- class Config:
19
- env_prefix = 'Sms_'
20
- env_file = "./.env"
21
- case_sensitive = True
22
- extra = 'allow'
18
+ model_config = SettingsConfigDict(
19
+ env_prefix="SMS_",
20
+ env_file=".env",
21
+ case_sensitive=True,
22
+ extra='ignore'
23
+ )
24
+
25
+ # class Config:
26
+ # env_prefix = 'SMS_'
27
+ # env_file = "./.env"
28
+ # case_sensitive = True
29
+ # extra = 'allow'
23
30
 
24
31
 
25
32
 
@@ -22,9 +22,15 @@ class SystemSettings(BaseSettings):
22
22
  DATACENTER_ID: Optional[int] = Field(default='1', description="机器ID")
23
23
 
24
24
  class Config:
25
- env_prefix = ''
25
+ env_prefix = 'SYSTEM_'
26
26
  env_file = "./.env"
27
27
  case_sensitive = True
28
- extra = 'allow'
28
+ extra = 'ignore'
29
+
30
+ # class Config:
31
+ # env_prefix = 'SYSTEM_'
32
+ # env_file = "./.env"
33
+ # case_sensitive = True
34
+ # extra = 'allow'
29
35
 
30
36
 
@@ -125,7 +125,7 @@ class IdWorker(object):
125
125
 
126
126
  new_id = ((timestamp - TWEPOCH) << TIMESTAMP_LEFT_SHIFT) | (self.datacenter_id << DATACENTER_ID_SHIFT) | \
127
127
  (self.worker_id << WOKER_ID_SHIFT) | self.sequence
128
- return new_id
128
+ return str(new_id)
129
129
 
130
130
  def _til_next_millis(self, last_timestamp):
131
131
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastgenerateapi
3
- Version: 1.1.8
3
+ Version: 1.1.10
4
4
  Summary: FastAPIView Class View
5
5
  Author: ShiLiang
6
6
  Author-email: 2509144896@qq.com