ezKit 1.12.36__tar.gz → 1.12.37__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.
Files changed (30) hide show
  1. {ezkit-1.12.36/ezKit.egg-info → ezkit-1.12.37}/PKG-INFO +1 -1
  2. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/fastapix.py +17 -0
  3. {ezkit-1.12.36 → ezkit-1.12.37/ezKit.egg-info}/PKG-INFO +1 -1
  4. {ezkit-1.12.36 → ezkit-1.12.37}/setup.py +1 -1
  5. {ezkit-1.12.36 → ezkit-1.12.37}/LICENSE +0 -0
  6. {ezkit-1.12.36 → ezkit-1.12.37}/MANIFEST.in +0 -0
  7. {ezkit-1.12.36 → ezkit-1.12.37}/README.md +0 -0
  8. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/__init__.py +0 -0
  9. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/_file.py +0 -0
  10. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/bottle.py +0 -0
  11. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/bottle_extensions.py +0 -0
  12. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/cipher.py +0 -0
  13. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/database.py +0 -0
  14. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/dockerhub.py +0 -0
  15. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/errors.py +0 -0
  16. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/http.py +0 -0
  17. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/markdown_to_html.template +0 -0
  18. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/mongo.py +0 -0
  19. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/qywx.py +0 -0
  20. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/redis.py +0 -0
  21. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/sendemail.py +0 -0
  22. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/token.py +0 -0
  23. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/utils.py +0 -0
  24. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/xftp.py +0 -0
  25. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit/zabbix.py +0 -0
  26. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit.egg-info/SOURCES.txt +0 -0
  27. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit.egg-info/dependency_links.txt +0 -0
  28. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit.egg-info/requires.txt +0 -0
  29. {ezkit-1.12.36 → ezkit-1.12.37}/ezKit.egg-info/top_level.txt +0 -0
  30. {ezkit-1.12.36 → ezkit-1.12.37}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ezKit
3
- Version: 1.12.36
3
+ Version: 1.12.37
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -7,6 +7,7 @@ from typing import Any
7
7
 
8
8
  from fastapi import FastAPI, Request
9
9
  from fastapi.exceptions import RequestValidationError
10
+ from fastapi.middleware.cors import CORSMiddleware
10
11
  from fastapi.responses import JSONResponse
11
12
  from loguru import logger
12
13
  from pydantic import ValidationError
@@ -32,6 +33,19 @@ logger.add(
32
33
  )
33
34
 
34
35
 
36
+ # --------------------------------------------------------------------------------------------------
37
+
38
+
39
+ def CORS(app):
40
+ app.add_middleware(
41
+ CORSMiddleware,
42
+ allow_credentials=True,
43
+ allow_headers=["*"],
44
+ allow_methods=["*"],
45
+ allow_origins=["*"],
46
+ )
47
+
48
+
35
49
  def Response(code: int = 200, data: Any = None, message: str | None = None, status_code: int = 200):
36
50
  return JSONResponse(content={"code": code, "data": data, "message": message}, status_code=status_code)
37
51
 
@@ -62,6 +76,9 @@ def exceptions(app: FastAPI):
62
76
  return Response(code=500, data=None, message="Server Internal Error")
63
77
 
64
78
 
79
+ # --------------------------------------------------------------------------------------------------
80
+
81
+
65
82
  # 兼容 FastAPI/Uvicorn 的 logging(重要)
66
83
  class InterceptHandler(logging.Handler):
67
84
  """Intercept Handler"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ezKit
3
- Version: 1.12.36
3
+ Version: 1.12.37
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -4,7 +4,7 @@ from setuptools import find_packages, setup
4
4
 
5
5
  setup(
6
6
  name="ezKit",
7
- version="1.12.36",
7
+ version="1.12.37",
8
8
  author="septvean",
9
9
  author_email="septvean@gmail.com",
10
10
  description="Easy Kit",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes