优化表结构,重构模型,重新实现基于白银网关的提取节点流程

This commit is contained in:
2025-11-24 18:44:06 +08:00
parent 9a574f55cb
commit cb2a963a37
142 changed files with 6528 additions and 5808 deletions

29
web/core/model.go Normal file
View File

@@ -0,0 +1,29 @@
package core
import (
"platform/pkg/u"
"time"
"gorm.io/gorm"
)
type IModel interface {
GetID() int32
}
type Model struct {
ID int32 `json:"id" gorm:"column:id;primaryKey"`
CreatedAt time.Time `json:"created_at" gorm:"column:created_at"`
UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"`
DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"column:deleted_at"`
}
func (m *Model) GetID() int32 {
return m.ID
}
func GetIDs[T IModel](models []T) []int32 {
return u.Map(models, func(m T) int32 {
return m.GetID()
})
}