修复了风格接口无法正确获取的问题

This commit is contained in:
jinye_huang 2025-07-11 15:34:55 +08:00
parent bebdba3c4b
commit 0653355c5e
2 changed files with 2 additions and 1 deletions

View File

@ -141,11 +141,12 @@ class PromptService:
with self.db_pool.get_connection() as conn: with self.db_pool.get_connection() as conn:
cursor = conn.cursor(dictionary=True) cursor = conn.cursor(dictionary=True)
cursor.execute( cursor.execute(
"SELECT description FROM contentStyle WHERE styleName = %s AND isDelete = 0", "SELECT description FROM contentStyle WHERE styleName = %s",
(style_name,) (style_name,)
) )
result = cursor.fetchone() result = cursor.fetchone()
if result: if result:
logger.info(f"从数据库获取风格提示词: {style_name}")
return result['description'] return result['description']
except Exception as e: except Exception as e:
logger.error(f"从数据库获取风格提示词失败: {e}") logger.error(f"从数据库获取风格提示词失败: {e}")