Эх сурвалжийг харах

query_next 最后一张提示

AnlaAnla 3 долоо хоног өмнө
parent
commit
e4f0ecc651
2 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 2 2
      Test/test01.py
  2. 1 1
      app/api/cards.py

+ 2 - 2
Test/test01.py

@@ -34,8 +34,8 @@ def send(url):
 
 
 if __name__ == '__main__':
-    base_url = 'http://127.0.0.1:7745/api/cards/query/1'
-    # base_url = 'http://127.0.0.1:7745/api/cards/query_next/5'
+    # base_url = 'http://127.0.0.1:7745/api/cards/query/1'
+    base_url = 'http://127.0.0.1:7745/api/cards/query_next/14'
 
     # base_url = 'http://192.168.31.243:7745/api/cards/query/6'
     send(base_url)

+ 1 - 1
app/api/cards.py

@@ -70,7 +70,7 @@ def get_next_card_details(id: int, db_conn: PooledMySQLConnection = db_dependenc
             next_card_row = cursor.fetchone()
 
             if not next_card_row:
-                raise HTTPException(status_code=404, detail=f"ID为 {id} 的下一个卡牌未找到。")
+                raise HTTPException(status_code=200, detail=f"当前为最后一张卡")
 
             next_card_id = next_card_row['id']
             # 获取单个卡牌的完整信息