Skip to main content

底层封装工具类

异常处理

自定义异常信息 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 操作系统参数的函数封装

Metadata

Release files for qg-common-sdk 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for qg-common-sdk 1.2.1
File Interpreter ABI Platform Actions
qg_common_sdk-1.2.1-py3-none-any.whl Python 3 none any Details for qg_common_sdk-1.2.1-py3-none-any.whl

Release files / qg_common_sdk-1.2.1-py3-none-any.whl

Download URL qg_common_sdk-1.2.1-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
afb471ea975a99ba4678c85216f99b5f47e1862f9bc23783dabc1dadc8cab0a0
BLAKE2b-256 checksum
How to use checksums
16c713e8197fe07765f8513ca6a22ea933250f6a91b6253ab455f9281e97d8df
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for qg-common-sdk 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page