perf: 优化菜单管理模块service层及异常处理

This commit is contained in:
insistence
2024-07-10 11:08:07 +08:00
parent 4a17ffbebe
commit 013ea25731
4 changed files with 129 additions and 96 deletions

View File

@@ -1,3 +1,6 @@
from config.constant import CommonConstant
class StringUtil:
"""
字符串工具类
@@ -29,3 +32,12 @@ class StringUtil:
:return: 校验结果
"""
return string is None or len(string) == 0
@classmethod
def is_http(cls, link: str):
"""
判断是否为http(s)://开头
:param link: 链接
:return: 是否为http(s)://开头
"""
return link.startswith(CommonConstant.HTTP) or link.startswith(CommonConstant.HTTPS)