fix: 修复微信账单金额解析问题(半角¥符号支持)

- 修复 parse_amount 函数同时支持全角¥和半角¥
- 新增 MonthRangePicker 日期选择组件
- 新增 /api/monthly-stats 接口获取月度统计
- 分析页面月度趋势使用全量数据
- 新增健康检查路由
This commit is contained in:
2026-01-10 19:21:24 +08:00
parent 9247e1ec7f
commit eb76c3a8dc
20 changed files with 597 additions and 44 deletions

View File

@@ -11,14 +11,14 @@ import (
// Config 路由配置参数
type Config struct {
OutputDir string // 输出目录(用于静态文件服务)
PythonPath string // Python 路径(用于健康检查显示)
OutputDir string // 输出目录(用于静态文件服务)
Version string // 应用版本
}
// Setup 设置所有路由
func Setup(r *gin.Engine, cfg Config) {
// 健康检查
r.GET("/health", healthCheck(cfg.PythonPath))
r.GET("/health", healthCheck(cfg.Version))
// API 路由组
setupAPIRoutes(r)
@@ -28,11 +28,11 @@ func Setup(r *gin.Engine, cfg Config) {
}
// healthCheck 健康检查处理器
func healthCheck(pythonPath string) gin.HandlerFunc {
func healthCheck(version string) gin.HandlerFunc {
return func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"status": "ok",
"python_path": pythonPath,
"status": "ok",
"version": version,
})
}
}
@@ -49,5 +49,8 @@ func setupAPIRoutes(r *gin.Engine) {
// 账单查询
api.GET("/bills", handler.ListBills)
// 月度统计(全部数据)
api.GET("/monthly-stats", handler.MonthlyStats)
}
}