Commit Graph
5 Commits
Author SHA1 Message Date
JianMiauandClaude Fable 5 121a5fee4c 新增讀取 Telegram 出席名單功能,讀取指定日期改為自動 fallback
根本原因:
Node-RED 的 Telegram bot「建喵打羽球」已把報名名單寫進同庫的 attendance 表,但配對器沒有任何入口讀取,每次仍需手動把出席者一個個打進名單。

影響:
- 新增 GET /api/attendance/:time,用既有 pool 讀 attendance 表,沒資料回 404
- 「讀取指定日期」改為兩段:先讀 badminton 配對資料,該日還沒配對時自動改載入出席名單
- 新增「讀取今日出席」按鈕可直接載入出席名單
- attendance 表沒有分區資訊,出席者一律先放 A 區、清空 B 區與既有配對,由使用者自行分配
- badminton 表結構與上傳流程不變

修法:
server.mjs 新增 attendance 端點;App.tsx 新增 findAttendance / loadAttendance / applyAttendance,loadResults 改用 findMatchResults 判斷後 fallback,移除不再使用的 loadMatchResults;README 補上讀取今日出席章節與 attendance 表結構。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-17 11:46:13 +08:00
JianMiauandClaude Fable 5 db67c19e85 自動放寬舊資料表過小的欄位,修正上傳失敗
根本原因:
badminton 資料表是舊系統先建立的,battlecombination 欄位型別比 TEXT 小;ensureTable 的 CREATE TABLE IF NOT EXISTS 對已存在的資料表不會生效,跨區平衡後 6 隊 × 3 輪的 JSON 超過欄位長度,寫入時噴出「Data too long for column 'battlecombination'」。

影響:
- server 啟動後第一次資料庫操作會自動把 personnel 與 battlecombination 放寬成 TEXT,不需手動下 SQL
- ensureTable 加上 tableReady 旗標,每個 process 只檢查一次,不再每個 request 都跑 CREATE TABLE

修法:
新增 widenLegacyColumns 查詢 information_schema,欄位型別不是 TEXT 系列時執行 ALTER TABLE MODIFY 放寬,並以模組層旗標記憶檢查結果。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 15:22:35 +08:00
JianMiau 2bed4f6df0 Add LINE push integration and target mode config 2026-04-15 16:22:19 +08:00
JianMiau 35eab44a7a Add loading match results by date 2026-04-15 10:11:53 +08:00
JianMiau 6c3ff0e3d1 Add DB upload flow and Docker deployment setup 2026-04-14 23:17:45 +08:00