add: 提交部分表设计

update: 1.所有model嵌入gorm公用model 2.所有model嵌入BaseModel
This commit is contained in:
2025-12-15 11:32:33 +08:00
parent 4455b39e42
commit ad946af5ee
21 changed files with 1109 additions and 321 deletions

View File

@@ -1,22 +1,17 @@
package model
import (
"time"
"gorm.io/gorm"
)
// RolePermission 角色-权限关联模型
type RolePermission struct {
ID uint `gorm:"primarykey" json:"id"`
RoleID uint `gorm:"not null;index;uniqueIndex:idx_role_permission_unique,where:deleted_at IS NULL" json:"role_id"`
PermID uint `gorm:"not null;index;uniqueIndex:idx_role_permission_unique,where:deleted_at IS NULL" json:"perm_id"`
Status int `gorm:"not null;default:1" json:"status"`
Creator uint `gorm:"not null" json:"creator"`
Updater uint `gorm:"not null" json:"updater"`
CreatedAt time.Time `gorm:"not null" json:"created_at"`
UpdatedAt time.Time `gorm:"not null" json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`
gorm.Model
BaseModel
RoleID uint `gorm:"not null;index;uniqueIndex:idx_role_permission_unique,where:deleted_at IS NULL" json:"role_id"`
PermID uint `gorm:"not null;index;uniqueIndex:idx_role_permission_unique,where:deleted_at IS NULL" json:"perm_id"`
Status int `gorm:"not null;default:1" json:"status"`
}
// TableName 指定表名