基本完成了大部分内容的修复
This commit is contained in:
parent
91ac7ca65a
commit
ec8667eeea
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -141,14 +141,14 @@ class PromptService:
|
||||
try:
|
||||
with self.db_pool.get_connection() as conn:
|
||||
with conn.cursor(dictionary=True) as cursor:
|
||||
cursor.execute(
|
||||
"SELECT description FROM contentStyle WHERE styleName = %s",
|
||||
(styleName,)
|
||||
)
|
||||
result = cursor.fetchone()
|
||||
if result:
|
||||
logger.info(f"从数据库获取风格提示词: {styleName}")
|
||||
return result['description']
|
||||
cursor.execute(
|
||||
"SELECT description FROM contentStyle WHERE styleName = %s",
|
||||
(styleName,)
|
||||
)
|
||||
result = cursor.fetchone()
|
||||
if result:
|
||||
logger.info(f"从数据库获取风格提示词: {styleName}")
|
||||
return result['description']
|
||||
except Exception as e:
|
||||
logger.error(f"从数据库获取风格提示词失败: {e}")
|
||||
|
||||
@ -178,14 +178,14 @@ class PromptService:
|
||||
try:
|
||||
with self.db_pool.get_connection() as conn:
|
||||
with conn.cursor(dictionary=True) as cursor:
|
||||
cursor.execute(
|
||||
"SELECT description FROM targetAudience WHERE audienceName = %s",
|
||||
(audience_name,)
|
||||
)
|
||||
result = cursor.fetchone()
|
||||
if result:
|
||||
logger.info(f"从数据库获取受众提示词: {audience_name}")
|
||||
return result["description"]
|
||||
cursor.execute(
|
||||
"SELECT description FROM targetAudience WHERE audienceName = %s",
|
||||
(audience_name,)
|
||||
)
|
||||
result = cursor.fetchone()
|
||||
if result:
|
||||
logger.info(f"从数据库获取受众提示词: {audience_name}")
|
||||
return result["description"]
|
||||
except Exception as e:
|
||||
logger.error(f"从数据库获取受众提示词失败: {e}")
|
||||
|
||||
@ -233,7 +233,7 @@ class PromptService:
|
||||
try:
|
||||
with self.db_pool.get_connection() as conn:
|
||||
with conn.cursor(dictionary=True) as cursor:
|
||||
cursor.execute(
|
||||
cursor.execute(
|
||||
"SELECT description FROM scenicSpot WHERE name = %s",
|
||||
(spot_name,)
|
||||
)
|
||||
@ -276,7 +276,7 @@ class PromptService:
|
||||
try:
|
||||
with self.db_pool.get_connection() as conn:
|
||||
with conn.cursor(dictionary=True) as cursor:
|
||||
cursor.execute(
|
||||
cursor.execute(
|
||||
"SELECT detailedDescription FROM product WHERE productName = %s",
|
||||
(product_name,)
|
||||
)
|
||||
@ -390,8 +390,8 @@ class PromptService:
|
||||
try:
|
||||
with self.db_pool.get_connection() as conn:
|
||||
with conn.cursor(dictionary=True) as cursor:
|
||||
cursor.execute("SELECT styleName as name, description FROM contentStyle")
|
||||
results = cursor.fetchall()
|
||||
cursor.execute("SELECT styleName as name, description FROM contentStyle")
|
||||
results = cursor.fetchall()
|
||||
if results:
|
||||
logger.info(f"从数据库获取所有风格: {len(results)}个")
|
||||
return results
|
||||
@ -434,7 +434,7 @@ class PromptService:
|
||||
try:
|
||||
with self.db_pool.get_connection() as conn:
|
||||
with conn.cursor(dictionary=True) as cursor:
|
||||
cursor.execute("SELECT audienceName as name, description FROM targetAudience")
|
||||
cursor.execute("SELECT audienceName as name, description FROM targetAudience")
|
||||
results = cursor.fetchall()
|
||||
if results:
|
||||
logger.info(f"从数据库获取所有受众: {len(results)}个")
|
||||
@ -478,7 +478,7 @@ class PromptService:
|
||||
try:
|
||||
with self.db_pool.get_connection() as conn:
|
||||
with conn.cursor(dictionary=True) as cursor:
|
||||
cursor.execute("SELECT name as name, description FROM scenicSpot")
|
||||
cursor.execute("SELECT name as name, description FROM scenicSpot")
|
||||
results = cursor.fetchall()
|
||||
if results:
|
||||
logger.info(f"从数据库获取所有景区: {len(results)}个")
|
||||
@ -526,7 +526,7 @@ class PromptService:
|
||||
with conn.cursor() as cursor:
|
||||
|
||||
# 检查是否存在
|
||||
cursor.execute(
|
||||
cursor.execute(
|
||||
"SELECT COUNT(*) FROM contentStyle WHERE styleName = %s",
|
||||
(name,)
|
||||
)
|
||||
@ -590,7 +590,7 @@ class PromptService:
|
||||
with conn.cursor() as cursor:
|
||||
|
||||
# 检查是否存在
|
||||
cursor.execute(
|
||||
cursor.execute(
|
||||
"SELECT COUNT(*) FROM targetAudience WHERE audienceName = %s",
|
||||
(name,)
|
||||
)
|
||||
@ -635,3 +635,4 @@ class PromptService:
|
||||
except Exception as e:
|
||||
logger.error(f"受众保存到文件系统失败: {e}")
|
||||
return False
|
||||
|
||||
@ -1,13 +1,8 @@
|
||||
{
|
||||
"host": "localhost",
|
||||
"user": "root",
|
||||
<<<<<<< HEAD
|
||||
"password": "Kj#9mP2$",
|
||||
"database": "travel_content",
|
||||
=======
|
||||
"password": "mysql2025.",
|
||||
"database": "bangbang",
|
||||
>>>>>>> poster_update
|
||||
"port": 3306,
|
||||
"charset": "utf8mb4"
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user