41 lines
1.0 KiB
Go
41 lines
1.0 KiB
Go
// Code generated by sql2gorm. DO NOT EDIT.
|
|
package repo
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/samber/do"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
func init(){
|
|
do.Provide[RoleRepo](nil,NewRoleRepo)
|
|
}
|
|
|
|
// 表
|
|
type Role struct {
|
|
ID uint `gorm:"column:id;primary_key;AUTO_INCREMENT"` // id
|
|
Name string `gorm:"column:name;NOT NULL"` // 名称
|
|
CreatedBy string `gorm:"column:created_by"` // 创建人
|
|
CreatedOn time.Time `gorm:"column:created_on;default:CURRENT_TIMESTAMP;NOT NULL"` // 记录创建时间
|
|
ModifiedBy string `gorm:"column:modified_by"` // 修改人
|
|
ModifiedOn time.Time `gorm:"column:modified_on;default:CURRENT_TIMESTAMP"` // 记录修改时间
|
|
}
|
|
|
|
func (m *Role) TableName() string {
|
|
return "role"
|
|
}
|
|
|
|
type RoleRepo interface{
|
|
|
|
}
|
|
|
|
type roleRepo struct{
|
|
db *gorm.DB
|
|
}
|
|
|
|
func NewRoleRepo(i *do.Injector)(RoleRepo,error){
|
|
return &roleRepo{
|
|
db :do.MustInvoke[*gorm.DB](i),
|
|
},nil
|
|
} |