diff --git a/internal/application/purchase/dto.go b/internal/application/purchase/dto.go index 1dab50a..0834427 100644 --- a/internal/application/purchase/dto.go +++ b/internal/application/purchase/dto.go @@ -10,10 +10,15 @@ type PurchaseDTO struct { ContentType purchase.ContentType `json:"contentType"` Price float64 `json:"price"` Status int8 `json:"status"` + Duration int `json:"duration"` // 购买时长(月),文章为0表示永久 CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` } +/* + 过期时间计算出来 +*/ + // ToDTO 转换为DTO func ToDTO(p *purchase.Purchase) *PurchaseDTO { if p == nil {