增加了重传和重转录入口

main
mula.liu 2025-11-17 10:32:12 +08:00
parent 521ec4cc96
commit 955774b89a
3 changed files with 8 additions and 4 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
app.zip

Binary file not shown.

View File

@ -1,18 +1,22 @@
from fastapi import APIRouter, Depends
from app.core.database import get_db_connection
from app.core.response import create_api_response
from app.core.auth import get_current_user
from app.core.auth import get_current_user, get_optional_current_user
from app.models.models import Tag
from typing import List
from typing import List, Optional
import mysql.connector
router = APIRouter()
@router.get("/tags")
def get_user_tags(current_user: dict = Depends(get_current_user)):
def get_user_tags(current_user: Optional[dict] = Depends(get_optional_current_user)):
"""_summary_
获取当前用户创建的所有标签
获取当前用户创建的所有标签如果未认证则返回空列表
"""
# 如果未认证,返回空标签列表
if not current_user:
return create_api_response(code="200", message="获取标签列表成功", data=[])
query = "SELECT id, name, color FROM tags WHERE creator_id = %s ORDER BY name"
try:
with get_db_connection() as connection: