重构 orm 代码生成逻辑,实现 bill 接口,优化请求字段检查与 list total 查询逻辑

This commit is contained in:
2025-04-11 17:36:34 +08:00
parent c1b4f8d605
commit 636bdcdb87
36 changed files with 794 additions and 193 deletions

View File

@@ -6,7 +6,8 @@ package models
import (
"platform/web/common"
"time"
"gorm.io/gorm"
)
const TableNameResourcePss = "resource_pss"
@@ -18,14 +19,14 @@ type ResourcePss struct {
Type int32 `gorm:"column:type;comment:套餐类型1-包时2-包量" json:"type"` // 套餐类型1-包时2-包量
Live int32 `gorm:"column:live;comment:可用时长(秒)" json:"live"` // 可用时长(秒)
Quota int32 `gorm:"column:quota;comment:配额数量" json:"quota"` // 配额数量
Expire time.Time `gorm:"column:expire;comment:过期时间" json:"expire"` // 过期时间
Expire common.LocalDateTime `gorm:"column:expire;comment:过期时间" json:"expire"` // 过期时间
Used int32 `gorm:"column:used;not null;comment:已用数量" json:"used"` // 已用数量
DailyLimit int32 `gorm:"column:daily_limit;not null;comment:每日限制" json:"daily_limit"` // 每日限制
DailyUsed int32 `gorm:"column:daily_used;not null;comment:今日已用数量" json:"daily_used"` // 今日已用数量
DailyLast time.Time `gorm:"column:daily_last;comment:今日最后使用时间" json:"daily_last"` // 今日最后使用时间
DailyLast common.LocalDateTime `gorm:"column:daily_last;comment:今日最后使用时间" json:"daily_last"` // 今日最后使用时间
CreatedAt common.LocalDateTime `gorm:"column:created_at;default:CURRENT_TIMESTAMP;comment:创建时间" json:"created_at"` // 创建时间
UpdatedAt common.LocalDateTime `gorm:"column:updated_at;default:CURRENT_TIMESTAMP;comment:更新时间" json:"updated_at"` // 更新时间
DeletedAt common.LocalDateTime `gorm:"column:deleted_at;comment:删除时间" json:"deleted_at"` // 删除时间
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:删除时间" json:"deleted_at"` // 删除时间
}
// TableName ResourcePss's table name