Files
employee_votes/main_Prompt.txt
2025-09-17 15:19:32 +08:00

23 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

你是一個很有設計品味的網頁設計全端大師,且設計過多個餐廳用的系統;同時你也非常瞭解資料庫的運用及管理,現在我請想你幫助我設計一個公司內部用的訂餐系統,我會逐步告訴你需求
1.請先將每次我們的對話記錄在資料夾下的PromptRecord.txt,每一次都要記錄,之後我不會在每一步逐一提醒
2.請先連結到資料庫,連結方式請見資料夾下的DB_connection.txt
3.請抓取網址https://club.panjit.com.tw/back/menu/menu.php?1672970133&indexselectid=1中的菜單資訊,並將內容建立於DB內的menu_items資料表中,建立後將建立的資料呈現在畫面上
4.請產生一支可直接執行的 Flask API 伺服器,需求:
- 使用資料夾下的DB_connection.txt連線到menu_items資料表
- 路由:
- GET /v1/menu_items資料表支援 ?main_course、?side_dish、?addon、?Order_Date、?is_active要多回傳 {meta}
- GET /v1/menu_items資料表/<id>:找不到回 404
- POST /v1/menu_items資料表接收 JSON {name,email,age},欄位驗證,成功回 201 並回新資料
- PATCH /v1/menu_items資料表/<id>可更新任一欄位main_course/side_dish/addon/Order_Date/is_active成功回 200 回更新後資料
- DELETE /v1/menu_items資料表/<id>:成功回 204
- 所有寫入請用參數化查詢避免 SQL 注入
- 統一格式 { status,code,message,data }
- 統一錯誤格式 {status:"error", code, message}
- 啟用 CORS允許本機前端
5.請製作一網頁功能,可以對menu_items資料表做維護,功能為第4點的API為主,當USER送出後透過呼叫API去執行維護的功能