refactor: 重构项目结构
- 将 Python 代码移至 analyzer/ 目录(含 venv) - 拆分 Go 服务器代码为模块化结构: - config/: 配置加载 - model/: 请求/响应模型 - service/: 业务逻辑 - handler/: API处理器 - 添加 .gitignore 文件 - 删除旧的独立脚本文件
This commit is contained in:
11
server/model/request.go
Normal file
11
server/model/request.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package model
|
||||
|
||||
// UploadRequest 上传请求参数
|
||||
type UploadRequest struct {
|
||||
Year string `form:"year"` // 年份筛选
|
||||
Month string `form:"month"` // 月份筛选
|
||||
Start string `form:"start"` // 起始日期
|
||||
End string `form:"end"` // 结束日期
|
||||
Format string `form:"format"` // 输出格式: csv/json
|
||||
}
|
||||
|
||||
43
server/model/response.go
Normal file
43
server/model/response.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package model
|
||||
|
||||
// UploadData 上传响应数据
|
||||
type UploadData struct {
|
||||
BillType string `json:"bill_type,omitempty"` // alipay/wechat
|
||||
FileURL string `json:"file_url,omitempty"` // 下载链接
|
||||
FileName string `json:"file_name,omitempty"` // 文件名
|
||||
}
|
||||
|
||||
// UploadResponse 上传响应
|
||||
type UploadResponse struct {
|
||||
Result bool `json:"result"`
|
||||
Message string `json:"message"`
|
||||
Data *UploadData `json:"data,omitempty"`
|
||||
}
|
||||
|
||||
// ReviewRecord 需要复核的记录
|
||||
type ReviewRecord struct {
|
||||
Time string `json:"time"` // 交易时间
|
||||
Category string `json:"category"` // 交易分类
|
||||
Merchant string `json:"merchant"` // 交易对方
|
||||
Description string `json:"description"` // 商品说明
|
||||
IncomeExpense string `json:"income_expense"` // 收/支
|
||||
Amount string `json:"amount"` // 金额
|
||||
Remark string `json:"remark"` // 备注
|
||||
ReviewLevel string `json:"review_level"` // 复核等级: HIGH/LOW
|
||||
}
|
||||
|
||||
// ReviewData 复核响应数据
|
||||
type ReviewData struct {
|
||||
Total int `json:"total"` // 总数
|
||||
High int `json:"high"` // 高优先级数量
|
||||
Low int `json:"low"` // 低优先级数量
|
||||
Records []ReviewRecord `json:"records,omitempty"` // 需要复核的记录
|
||||
}
|
||||
|
||||
// ReviewResponse 复核记录响应
|
||||
type ReviewResponse struct {
|
||||
Result bool `json:"result"`
|
||||
Message string `json:"message"`
|
||||
Data *ReviewData `json:"data,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user