用 Go (Gin + GORM + SQLite) 重写整个后端: - 单二进制部署,不依赖 Python/pip/SDK - net/http 原生客户端,无 Cloudflare TLS 指纹问题 - 多阶段 Dockerfile:Node 构建前端 + Go 构建后端 + Alpine 运行 - 内存占用从 ~95MB 降至 ~3MB - 完整保留所有 API 路由、JWT 认证、API Key 权限、审计日志
16 lines
686 B
Go
16 lines
686 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type CardLog struct {
|
|
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
|
|
CardID string `json:"card_id" gorm:"type:varchar(255)"`
|
|
CardholderID string `json:"cardholder_id" gorm:"type:varchar(255)"`
|
|
Action string `json:"action" gorm:"type:varchar(100);not null"`
|
|
Status string `json:"status" gorm:"type:varchar(50);not null"`
|
|
Operator string `json:"operator" gorm:"type:varchar(255);not null"`
|
|
RequestData string `json:"request_data" gorm:"type:text"`
|
|
ResponseData string `json:"response_data" gorm:"type:text"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"not null;autoCreateTime"`
|
|
}
|