update fake_data_control
This commit is contained in:
parent
700cc47662
commit
1ad16560d3
|
@ -40,12 +40,7 @@ class MysqlDB:
|
|||
try:
|
||||
with self.conn.cursor() as cursor:
|
||||
cursor.execute(sql)
|
||||
if state == QueryState.ALL:
|
||||
data = cursor.fetchall()
|
||||
elif state == QueryState.ONE:
|
||||
data = cursor.fetchone()
|
||||
else:
|
||||
raise ValueError(f"无效的查询状态: {state}")
|
||||
data = cursor.fetchall() if state == QueryState.ALL else cursor.fetchone() if state == QueryState.ONE else ...
|
||||
return data
|
||||
except Exception as err:
|
||||
logger.error(f"查询失败: {err}")
|
||||
|
|
|
@ -23,10 +23,8 @@ class Execute:
|
|||
"""
|
||||
:return: 返回除内置方法外类中的所有其他方法
|
||||
"""
|
||||
func_list = {}
|
||||
all_method = inspect.getmembers(self, inspect.ismethod)
|
||||
for name in all_method:
|
||||
func_list[name[0]] = name[0] if not str(name[0]).startswith('__') else ...
|
||||
func_list = {name: (name if not str(name).startswith('__') else '...') for name, method in all_methods}
|
||||
return func_list
|
||||
|
||||
def random_int(self):
|
||||
|
|
Loading…
Reference in New Issue