全高python统一处理底层框架封装包
Project description
底层封装工具类
异常处理
自定义异常信息 catchException.py
# 业务异常类封装
class BusinessException(Exception):
def __init__(self, data: str,msg: str):
self.data = data
self.code = StatusCode.BUSINESSEXEC
self.msg = msg
# 异常封装类
class SysException(Exception):
def __init__(self, data: str,msg: str):
self.data = data
self.code = StatusCode.SYSEXEC
self.msg = msg
需要异常处理的接口上,添加exec_catch_func装饰器即可。
返回值信息统一封装
returnInfo.py 每个需要统一返回值的接口上,添加return_info_func装饰器即可。 return_info_func 中封装了异常处理,异常日志记录,操作日志记录等
字典统一处理
dictOpr.py 字典统一处理类,支持内存缓存,提供字典查询,清除缓存接口,未来可以支持redis缓存。
获取用户信息
operUserInfo.py 提供接口从redis中获取当前用户信息
时间转换工具
dateTool.py 时间转换工具
系统工具
sysTool.py 操作系统参数的函数封装
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file qg_common_sdk-1.2.1-py3-none-any.whl
.
File metadata
- Download URL: qg_common_sdk-1.2.1-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afb471ea975a99ba4678c85216f99b5f47e1862f9bc23783dabc1dadc8cab0a0 |
|
MD5 | 30e85ad1e6c5cfc3f9262f0c0e148230 |
|
BLAKE2b-256 | 16c713e8197fe07765f8513ca6a22ea933250f6a91b6253ab455f9281e97d8df |