export some method

This commit is contained in:
Yavolte 2025-06-11 22:20:44 +08:00
parent 43b48e1469
commit b32fd7d53f
1 changed files with 17 additions and 0 deletions

View File

@ -235,6 +235,23 @@ func (m *Model) TableName() string {
return m.naming.ModuleName
}
func (m *Model) Naming() types.Naming {
return m.naming
}
func (m *Model) SetDB(db *gorm.DB) *gorm.DB {
m.db = db
return m.db
}
func (m *Model) HasScenario(s string) bool {
return m.hasScenario(s)
}
func (m *Model) HasPermission(ctx context.Context, s string) (err error) {
return m.hasPermission(ctx, s)
}
// Fields 返回搜索的模型的字段
func (m *Model) Fields() []*schema.Field {
return m.statement.Schema.Fields