feat: 添加配额相关字段并优化日志时间类型

- 在MailLog结构体中添加QuotaID字段用于关联配额信息
- 在UpdateQuotaReq结构体中增加ExpireAt、CycleUnit和CycleResetAt字段,
  支持配额过期时间和周期设置
- 将CheckLog中的时间相关字段从string类型改为time.Time类型,
  提高时间处理的准确性
This commit is contained in:
shiran
2026-04-18 10:52:37 +08:00
parent 5b4774e9c1
commit fe19922eff
+9 -5
View File
@@ -154,6 +154,7 @@ type MailLog struct {
GormModel
UserID int `json:"user_id"`
AccountID uint `json:"account_id"`
QuotaID *uint `json:"quota_id"`
ChannelID *uint `json:"channel_id"`
SenderAccountID *uint `json:"sender_account_id"`
SignatureID *uint `json:"signature_id"`
@@ -220,8 +221,11 @@ type CreateQuotaReq struct {
}
type UpdateQuotaReq struct {
Total *int `json:"total,omitempty"`
Status *int8 `json:"status,omitempty"`
Total *int `json:"total,omitempty"`
Status *int8 `json:"status,omitempty"`
ExpireAt *string `json:"expire_at,omitempty"`
CycleUnit *string `json:"cycle_unit,omitempty"`
CycleResetAt *string `json:"cycle_reset_at,omitempty"`
}
type QuotaListQuery struct {
@@ -452,12 +456,12 @@ type CheckLog struct {
ID uint `json:"id"`
SenderAccountID uint `json:"sender_account_id"`
VerificationCode string `json:"verification_code"`
SentAt string `json:"sent_at"`
SentAt time.Time `json:"sent_at"`
Received bool `json:"received"`
ReceivedAt *string `json:"received_at"`
ReceivedAt *time.Time `json:"received_at"`
LatencyMs int `json:"latency_ms"`
ErrorMessage string `json:"error_message"`
CreatedAt string `json:"created_at"`
CreatedAt time.Time `json:"created_at"`
}
type CheckLogQuery struct {