From fe19922eff4a952e6e4b2d5001cf2bcb31b2cecc Mon Sep 17 00:00:00 2001 From: shiran Date: Sat, 18 Apr 2026 10:52:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=85=8D=E9=A2=9D?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=AD=97=E6=AE=B5=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=97=B6=E9=97=B4=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在MailLog结构体中添加QuotaID字段用于关联配额信息 - 在UpdateQuotaReq结构体中增加ExpireAt、CycleUnit和CycleResetAt字段, 支持配额过期时间和周期设置 - 将CheckLog中的时间相关字段从string类型改为time.Time类型, 提高时间处理的准确性 --- types.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/types.go b/types.go index e9ca42f..9ef7059 100644 --- a/types.go +++ b/types.go @@ -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 {