- 注释掉 OSS预签名 URL 缓存刷新任务的定时执行代码 - 在 hero/hero.go 中增加对 Redis缓存和英雄数据集的非空校验 - 修改 OSS预签名 URL 生成逻辑,自动替换为 CDN 域名
128 lines
4.6 KiB
Go
128 lines
4.6 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"
|
|
)
|
|
|
|
// InfraApiAccessLogDao is the data access object for the table infra_api_access_log.
|
|
type InfraApiAccessLogDao 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 InfraApiAccessLogColumns // columns contains all the column names of Table for convenient usage.
|
|
handlers []gdb.ModelHandler // handlers for customized model modification.
|
|
}
|
|
|
|
// InfraApiAccessLogColumns defines and stores column names for the table infra_api_access_log.
|
|
type InfraApiAccessLogColumns struct {
|
|
Id string // 日志主键
|
|
TraceId string // 链路追踪编号
|
|
UserId string // 用户编号
|
|
UserType string // 用户类型
|
|
ApplicationName string // 应用名
|
|
RequestMethod string // 请求方法名
|
|
RequestUrl string // 请求地址
|
|
RequestParams string // 请求参数
|
|
ResponseBody string // 响应结果
|
|
UserIp string // 用户 IP
|
|
UserAgent string // 浏览器 UA
|
|
OperateModule string // 操作模块
|
|
OperateName string // 操作名
|
|
OperateType string // 操作分类
|
|
BeginTime string // 开始请求时间
|
|
EndTime string // 结束请求时间
|
|
Duration string // 执行时长
|
|
ResultCode string // 结果码
|
|
ResultMsg string // 结果提示
|
|
Creator string // 创建者
|
|
CreateTime string // 创建时间
|
|
Updater string // 更新者
|
|
UpdateTime string // 更新时间
|
|
Deleted string // 是否删除
|
|
TenantId string // 租户编号
|
|
}
|
|
|
|
// infraApiAccessLogColumns holds the columns for the table infra_api_access_log.
|
|
var infraApiAccessLogColumns = InfraApiAccessLogColumns{
|
|
Id: "id",
|
|
TraceId: "trace_id",
|
|
UserId: "user_id",
|
|
UserType: "user_type",
|
|
ApplicationName: "application_name",
|
|
RequestMethod: "request_method",
|
|
RequestUrl: "request_url",
|
|
RequestParams: "request_params",
|
|
ResponseBody: "response_body",
|
|
UserIp: "user_ip",
|
|
UserAgent: "user_agent",
|
|
OperateModule: "operate_module",
|
|
OperateName: "operate_name",
|
|
OperateType: "operate_type",
|
|
BeginTime: "begin_time",
|
|
EndTime: "end_time",
|
|
Duration: "duration",
|
|
ResultCode: "result_code",
|
|
ResultMsg: "result_msg",
|
|
Creator: "creator",
|
|
CreateTime: "create_time",
|
|
Updater: "updater",
|
|
UpdateTime: "update_time",
|
|
Deleted: "deleted",
|
|
TenantId: "tenant_id",
|
|
}
|
|
|
|
// NewInfraApiAccessLogDao creates and returns a new DAO object for table data access.
|
|
func NewInfraApiAccessLogDao(handlers ...gdb.ModelHandler) *InfraApiAccessLogDao {
|
|
return &InfraApiAccessLogDao{
|
|
group: "default",
|
|
table: "infra_api_access_log",
|
|
columns: infraApiAccessLogColumns,
|
|
handlers: handlers,
|
|
}
|
|
}
|
|
|
|
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
|
func (dao *InfraApiAccessLogDao) DB() gdb.DB {
|
|
return g.DB(dao.group)
|
|
}
|
|
|
|
// Table returns the table name of the current DAO.
|
|
func (dao *InfraApiAccessLogDao) Table() string {
|
|
return dao.table
|
|
}
|
|
|
|
// Columns returns all column names of the current DAO.
|
|
func (dao *InfraApiAccessLogDao) Columns() InfraApiAccessLogColumns {
|
|
return dao.columns
|
|
}
|
|
|
|
// Group returns the database configuration group name of the current DAO.
|
|
func (dao *InfraApiAccessLogDao) 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 *InfraApiAccessLogDao) 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 *InfraApiAccessLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
|
return dao.Ctx(ctx).Transaction(ctx, f)
|
|
}
|