uniugm/admin/apps/user/model/history.go

36 lines
577 B
Go
Raw Normal View History

2025-05-05 10:30:33 +08:00
package model
import (
"admin/internal/db"
"admin/internal/global"
"time"
)
func init() {
db.RegisterTableModels(History{})
}
// History 用户执行历史
type History struct {
ID int `gorm:"primarykey" readonly:"true"`
UserId int
UserName string
ProjectId int
Resource string
Method string
Data string `gorm:"type:longtext"`
CreateTime time.Time
}
func (m *History) TableName() string {
return "history"
}
func (m *History) GetId() int {
return m.ID
}
func (m *History) Create() error {
return global.GLOB_DB.Create(m).Error
}