41 lines
1.4 KiB
Go
41 lines
1.4 KiB
Go
// Code generated by sql2gorm. DO NOT EDIT.
|
|
package repo
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/samber/do"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// 组织表
|
|
type Organization struct {
|
|
ID uint `gorm:"column:id;primary_key;AUTO_INCREMENT"` // id
|
|
Name string `gorm:"column:name;NOT NULL"` // 组织名
|
|
ParentID uint `gorm:"column:parent_id;default:0"` // 上级组织id
|
|
Sort uint `gorm:"column:sort;default:0"` // 层级序号
|
|
Status int `gorm:"column:status;default:1"` // 状态:0-无效,1-有效
|
|
Path string `gorm:"column:path"` // 全路径
|
|
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 *Organization) TableName() string {
|
|
return "organization"
|
|
}
|
|
|
|
type OrganizationRepo interface{
|
|
|
|
}
|
|
|
|
type orginizationRepo struct{
|
|
db *gorm.DB
|
|
}
|
|
|
|
func NewOrganization(i *do.Injector)(OrganizationRepo,error){
|
|
return &orginizationRepo{
|
|
db:do.MustInvoke[*gorm.DB](i),
|
|
},nil
|
|
} |