// Code generated by sql2gorm. DO NOT EDIT. package repo import ( "time" "github.com/samber/do" "gorm.io/gorm" ) func init(){ do.Provide[UserOrganizationRepo](nil,NewUserOrganizationRepo) } // 用户组织表 type UserOrganization struct { ID uint `gorm:"column:id;primary_key;AUTO_INCREMENT"` // id UserID uint `gorm:"column:user_id;NOT NULL"` // 用户id OrgID uint `gorm:"column:org_id;NOT NULL"` // 组织id Leader int `gorm:"column:leader;default:0"` // 是否是组织领导:一个组织只能有一个领导人 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 *UserOrganization) TableName() string { return "user_organization" } type UserOrganizationRepo interface{ } type userOrganizationRepo struct{ db *gorm.DB } func NewUserOrganizationRepo(i *do.Injector)(UserOrganizationRepo,error){ return &userOrganizationRepo{ db:do.MustInvoke[*gorm.DB](i), },nil }