重构 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 TableNameTrade = "trade"
@@ -25,10 +26,10 @@ type Trade struct {
Status int32 `gorm:"column:status;not null;comment:订单状态0-待支付1-已支付2-已取消3-已退款" json:"status"` // 订单状态0-待支付1-已支付2-已取消3-已退款
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"` // 删除时间
Type int32 `gorm:"column:type;not null" json:"type"`
CancelAt time.Time `gorm:"column:cancel_at" json:"cancel_at"`
PaidAt time.Time `gorm:"column:paid_at" json:"paid_at"`
CancelAt common.LocalDateTime `gorm:"column:cancel_at" json:"cancel_at"`
PaidAt common.LocalDateTime `gorm:"column:paid_at" json:"paid_at"`
}
// TableName Trade's table name