增加了细节
parent
8f332145cb
commit
cc1b02f3c8
|
|
@ -8,23 +8,23 @@ import mysql.connector
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.get("/tags/")
|
@router.get("/tags")
|
||||||
def get_all_tags():
|
def get_user_tags(current_user: dict = Depends(get_current_user)):
|
||||||
"""_summary_
|
"""_summary_
|
||||||
获取所有标签
|
获取当前用户创建的所有标签
|
||||||
"""
|
"""
|
||||||
query = "SELECT id, name, color FROM tags ORDER BY name"
|
query = "SELECT id, name, color FROM tags WHERE creator_id = %s ORDER BY name"
|
||||||
try:
|
try:
|
||||||
with get_db_connection() as connection:
|
with get_db_connection() as connection:
|
||||||
with connection.cursor(dictionary=True) as cursor:
|
with connection.cursor(dictionary=True) as cursor:
|
||||||
cursor.execute(query)
|
cursor.execute(query, (current_user["user_id"],))
|
||||||
tags = cursor.fetchall()
|
tags = cursor.fetchall()
|
||||||
return create_api_response(code="200", message="获取标签列表成功", data=tags)
|
return create_api_response(code="200", message="获取标签列表成功", data=tags)
|
||||||
except mysql.connector.Error as err:
|
except mysql.connector.Error as err:
|
||||||
print(f"Error: {err}")
|
print(f"Error: {err}")
|
||||||
return create_api_response(code="500", message="获取标签失败")
|
return create_api_response(code="500", message="获取标签失败")
|
||||||
|
|
||||||
@router.post("/tags/")
|
@router.post("/tags")
|
||||||
def create_tag(tag_in: Tag, current_user: dict = Depends(get_current_user)):
|
def create_tag(tag_in: Tag, current_user: dict = Depends(get_current_user)):
|
||||||
"""_summary_
|
"""_summary_
|
||||||
创建一个新标签,并记录创建者
|
创建一个新标签,并记录创建者
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,10 @@ VOICEPRINT_DIR.mkdir(exist_ok=True)
|
||||||
|
|
||||||
# 数据库配置
|
# 数据库配置
|
||||||
DATABASE_CONFIG = {
|
DATABASE_CONFIG = {
|
||||||
'host': os.getenv('DB_HOST', '10.100.51.161'),
|
'host': os.getenv('DB_HOST', 'localhost'),
|
||||||
'user': os.getenv('DB_USER', 'root'),
|
'user': os.getenv('DB_USER', 'root'),
|
||||||
'password': os.getenv('DB_PASSWORD', 'sagacity'),
|
'password': os.getenv('DB_PASSWORD', 'sagacity'),
|
||||||
'database': os.getenv('DB_NAME', 'imeeting_dev'),
|
'database': os.getenv('DB_NAME', 'imeeting'),
|
||||||
'port': int(os.getenv('DB_PORT', '3306')),
|
'port': int(os.getenv('DB_PORT', '3306')),
|
||||||
'charset': 'utf8mb4'
|
'charset': 'utf8mb4'
|
||||||
}
|
}
|
||||||
|
|
@ -51,7 +51,7 @@ APP_CONFIG = {
|
||||||
|
|
||||||
# Redis配置
|
# Redis配置
|
||||||
REDIS_CONFIG = {
|
REDIS_CONFIG = {
|
||||||
'host': os.getenv('REDIS_HOST', '10.100.51.161'),
|
'host': os.getenv('REDIS_HOST', 'localhost'),
|
||||||
'port': int(os.getenv('REDIS_PORT', '6379')),
|
'port': int(os.getenv('REDIS_PORT', '6379')),
|
||||||
'db': int(os.getenv('REDIS_DB', '0')),
|
'db': int(os.getenv('REDIS_DB', '0')),
|
||||||
'password': os.getenv('REDIS_PASSWORD', None),
|
'password': os.getenv('REDIS_PASSWORD', None),
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,6 @@
|
||||||
"model_name": "qwen-plus",
|
"model_name": "qwen-plus",
|
||||||
"template_text": "我正在进行声纹采集,这段语音将用于身份识别和验证。\n声纹技术能够识别每个人独特的声音特征,用于人声识别应用。",
|
"template_text": "我正在进行声纹采集,这段语音将用于身份识别和验证。\n声纹技术能够识别每个人独特的声音特征,用于人声识别应用。",
|
||||||
"DEFAULT_RESET_PASSWORD": "123456",
|
"DEFAULT_RESET_PASSWORD": "123456",
|
||||||
"MAX_FILE_SIZE": 208666624,
|
"MAX_FILE_SIZE": 209715200,
|
||||||
"TIMELINE_PAGESIZE": 10
|
"TIMELINE_PAGESIZE": 10
|
||||||
}
|
}
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue