feat: add producer account management

This commit is contained in:
2026-08-04 15:21:39 +08:00
parent fb59e80fd0
commit 402f050b17
21 changed files with 223 additions and 36 deletions

View File

@@ -5,15 +5,17 @@ import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
// Entity 是所有主表共享字段。id 是数据库自增主键identity 是应用生成的 UUID V7 业务标识。
type Entity struct {
ID uint64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"` // 数据库自增主键
Identity string `gorm:"column:identity;type:varchar(36);not null;uniqueIndex" json:"identity"` // UUID V7 业务标识
CreatedAt time.Time `gorm:"column:created_at;type:timestamptz;not null;index" json:"created_at"` // 创建时间
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamptz;not null" json:"updated_at"` // 更新时间
Status int `gorm:"column:status;not null;default:0;index" json:"status"` // 通用记录状态
ID uint64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"` // 数据库自增主键
Identity string `gorm:"column:identity;type:varchar(36);not null;uniqueIndex" json:"identity"` // UUID V7 业务标识
CreatedAt time.Time `gorm:"column:created_at;type:timestamptz;not null;index" json:"created_at"` // 创建时间
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamptz;not null" json:"updated_at"` // 更新时间
DeletedAt gorm.DeletedAt `gorm:"index"` // 软删除时间,非空表示记录已删除但仍保留在数据库中
Status int `gorm:"column:status;not null;default:0;index" json:"status"` // 通用记录状态
}
// NewIdentity 生成时间有序的 UUID V7 字符串,生成失败属于不可恢复的运行时错误。