Files
epic-go/internal/dao/internal/system_mail_account.go
hu xiaotong fc41c5ca73 refactor(internal): 优化 OSS 预签名 URL 缓存刷新任务和英雄数据缓存逻辑
- 注释掉 OSS预签名 URL 缓存刷新任务的定时执行代码
- 在 hero/hero.go 中增加对 Redis缓存和英雄数据集的非空校验
- 修改 OSS预签名 URL 生成逻辑,自动替换为 CDN 域名
2025-07-25 17:08:39 +08:00

104 lines
3.7 KiB
Go

// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SystemMailAccountDao is the data access object for the table system_mail_account.
type SystemMailAccountDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SystemMailAccountColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SystemMailAccountColumns defines and stores column names for the table system_mail_account.
type SystemMailAccountColumns struct {
Id string // 主键
Mail string // 邮箱
Username string // 用户名
Password string // 密码
Host string // SMTP 服务器域名
Port string // SMTP 服务器端口
SslEnable string // 是否开启 SSL
StarttlsEnable string // 是否开启 STARTTLS
Creator string // 创建者
CreateTime string // 创建时间
Updater string // 更新者
UpdateTime string // 更新时间
Deleted string // 是否删除
}
// systemMailAccountColumns holds the columns for the table system_mail_account.
var systemMailAccountColumns = SystemMailAccountColumns{
Id: "id",
Mail: "mail",
Username: "username",
Password: "password",
Host: "host",
Port: "port",
SslEnable: "ssl_enable",
StarttlsEnable: "starttls_enable",
Creator: "creator",
CreateTime: "create_time",
Updater: "updater",
UpdateTime: "update_time",
Deleted: "deleted",
}
// NewSystemMailAccountDao creates and returns a new DAO object for table data access.
func NewSystemMailAccountDao(handlers ...gdb.ModelHandler) *SystemMailAccountDao {
return &SystemMailAccountDao{
group: "default",
table: "system_mail_account",
columns: systemMailAccountColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SystemMailAccountDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SystemMailAccountDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SystemMailAccountDao) Columns() SystemMailAccountColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SystemMailAccountDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SystemMailAccountDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SystemMailAccountDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}