签入脚本

This commit is contained in:
小蚂蚁云
2026-10-20 11:37:25 +08:00
commit 7f5e8470af
909 changed files with 4045080 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// 自定义模板:hack/tpl/dao_index.tpl
// - 构造时挂载全局模型钩子(审计字段 / 软删除改写;主键交数据库自增)
// - Ctx 覆写注入软删除与租户隔离条件(架构红线执行点)
// =================================================================================
package dao
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"easygoadmin/internal/dao/internal"
"easygoadmin/internal/model/hooks"
)
// jobDao is the data access object for the table goframe_job.
// You can define custom methods on it to extend its functionality as needed.
type jobDao struct {
*internal.JobDao
}
var (
// Job is a globally accessible object for table goframe_job operations.
Job = jobDao{
internal.NewJobDao(func(m *gdb.Model) *gdb.Model {
// 全局钩子:Insert 补齐审计字段/租户ID(主键自增);Update 盖章;Delete 改写为软删除
return m.Hook(hooks.Handler())
}),
}
)
// Ctx 覆写:在 SQL 构建之前注入架构红线条件 ——
// 所有表追加 del_flag=0;租户级表对租户上下文追加 tenant_id IN (0, 当前租户)。
// 业务代码必须经由本方法访问模型,禁止绕过 dao 直连 DB。
func (d *jobDao) Ctx(ctx context.Context) *gdb.Model {
return hooks.ApplyCtx(ctx, d.JobDao.Ctx(ctx), "goframe_job")
}
// Add your custom methods and functionality below.