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