Add classification annotations

This commit is contained in:
2025-10-27 23:12:15 +08:00
parent 3990ec01c6
commit 5aacb88c22
44 changed files with 2769 additions and 2241 deletions

View File

@@ -9,14 +9,13 @@ import (
"gorm.io/gorm"
)
// ============================================================================
// 结构体定义
// ============================================================================
// Function 函数表模型
// 用于管理应用程序的函数代码
// UUID 为函数的唯一标识符,自动生成并转换为大写
// Alias 为函数别名,便于识别和管理
// Code 为函数代码内容
// Remark 为备注信息,用于描述函数用途
// CreatedAt/UpdatedAt 由 GORM 自动维护
type Function struct {
// ID主键自增
ID uint `gorm:"primaryKey;comment:函数ID自增主键" json:"id"`
@@ -44,6 +43,10 @@ type Function struct {
UpdatedAt time.Time `gorm:"comment:更新时间" json:"updated_at"`
}
// ============================================================================
// 结构体方法
// ============================================================================
// BeforeCreate 在创建记录前自动生成UUID和Number
func (function *Function) BeforeCreate(tx *gorm.DB) error {
// 生成UUID
@@ -59,4 +62,4 @@ func (function *Function) BeforeCreate(tx *gorm.DB) error {
// TableName 指定表名
func (Function) TableName() string {
return "functions"
}
}