diff --git a/test/groupAgent/summary.http b/test/groupAgent/summary.http index 44ee03b..5f03eae 100644 --- a/test/groupAgent/summary.http +++ b/test/groupAgent/summary.http @@ -1,4 +1,4 @@ POST http://localhost:3000/bot?app=egg HTTP/1.1 content-type: application/json -{"schema":"2.0","header":{"event_id":"ad5a706e2175e4bc539da53fd54b6fa0","token":"tV9djUKSjzVnekV7xTg2Od06NFTcsBnj","create_time":"1732619538646","event_type":"im.message.receive_v1","tenant_key":"2ee61fe50f4f1657","app_id":"cli_a1eff35b43b89063"},"event":{"message":{"chat_id":"oc_8c789ce8f4ecc6695bb63ca6ec4c61ea","chat_type":"group","content":"{\"text\":\"@_user_1 总结日报\"}","create_time":"1732619538450","mentions":[{"id":{"open_id":"ou_032f507d08f9a7f28b042fcd086daef5","union_id":"on_7111660fddd8302ce47bf1999147c011","user_id":""},"key":"@_user_1","name":"小煎蛋","tenant_key":"2ee61fe50f4f1657"}],"message_id":"om_988659d8dcb79a54a02016ea1884e3df","message_type":"text","update_time":"1732619538450"},"sender":{"sender_id":{"open_id":"ou_470ac13b8b50fc472d9d8ee71e03de26","union_id":"on_9dacc59a539023df8b168492f5e5433c","user_id":"zhaoyingbo"},"sender_type":"user","tenant_key":"2ee61fe50f4f1657"}}} \ No newline at end of file +{"schema":"2.0","header":{"event_id":"ad5a706e2175e4bc539da53fd54b6fa0","token":"tV9djUKSjzVnekV7xTg2Od06NFTcsBnj","create_time":"1732619538646","event_type":"im.message.receive_v1","tenant_key":"2ee61fe50f4f1657","app_id":"cli_a1eff35b43b89063"},"event":{"message":{"chat_id":"oc_8c789ce8f4ecc6695bb63ca6ec4c61ea","chat_type":"group","content":"{\"text\":\"@_user_1 总结周报\"}","create_time":"1732619538450","mentions":[{"id":{"open_id":"ou_032f507d08f9a7f28b042fcd086daef5","union_id":"on_7111660fddd8302ce47bf1999147c011","user_id":""},"key":"@_user_1","name":"小煎蛋","tenant_key":"2ee61fe50f4f1657"}],"message_id":"om_988659d8dcb79a54a02016ea1884e3df","message_type":"text","update_time":"1732619538450"},"sender":{"sender_id":{"open_id":"ou_470ac13b8b50fc472d9d8ee71e03de26","union_id":"on_9dacc59a539023df8b168492f5e5433c","user_id":"zhaoyingbo"},"sender_type":"user","tenant_key":"2ee61fe50f4f1657"}}} \ No newline at end of file diff --git a/utils/time.ts b/utils/time.ts index bc2e6ea..ff29cd9 100644 --- a/utils/time.ts +++ b/utils/time.ts @@ -71,13 +71,13 @@ export const getSpecificTime = ( * @returns {{ startTime: string, endTime: string }} - 格式化后的开始时间和结束时间 */ export const getTimeRange = (timeScope: "daily" | "weekly" | "threeDays") => { - const startTimeMap = { - daily: getSpecificTime("today", 0), - weekly: getSpecificTime("oneWeekAgo", 0), - threeDays: getSpecificTime("twoDaysAgo", 0), + const startTimeMap: Record = { + daily: "today", + weekly: "oneWeekAgo", + threeDays: "twoDaysAgo", } return { - startTime: startTimeMap[timeScope] as string, + startTime: getSpecificTime(startTimeMap[timeScope], 0) as string, endTime: getSpecificTime("today", 24) as string, } }