132 lines
4.7 KiB
Go
132 lines
4.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"
|
|
)
|
|
|
|
// SystemSmsLogDao is the data access object for the table system_sms_log.
|
|
type SystemSmsLogDao 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 SystemSmsLogColumns // columns contains all the column names of Table for convenient usage.
|
|
handlers []gdb.ModelHandler // handlers for customized model modification.
|
|
}
|
|
|
|
// SystemSmsLogColumns defines and stores column names for the table system_sms_log.
|
|
type SystemSmsLogColumns struct {
|
|
Id string // 编号
|
|
ChannelId string // 短信渠道编号
|
|
ChannelCode string // 短信渠道编码
|
|
TemplateId string // 模板编号
|
|
TemplateCode string // 模板编码
|
|
TemplateType string // 短信类型
|
|
TemplateContent string // 短信内容
|
|
TemplateParams string // 短信参数
|
|
ApiTemplateId string // 短信 API 的模板编号
|
|
Mobile string // 手机号
|
|
UserId string // 用户编号
|
|
UserType string // 用户类型
|
|
SendStatus string // 发送状态
|
|
SendTime string // 发送时间
|
|
ApiSendCode string // 短信 API 发送结果的编码
|
|
ApiSendMsg string // 短信 API 发送失败的提示
|
|
ApiRequestId string // 短信 API 发送返回的唯一请求 ID
|
|
ApiSerialNo string // 短信 API 发送返回的序号
|
|
ReceiveStatus string // 接收状态
|
|
ReceiveTime string // 接收时间
|
|
ApiReceiveCode string // API 接收结果的编码
|
|
ApiReceiveMsg string // API 接收结果的说明
|
|
Creator string // 创建者
|
|
CreateTime string // 创建时间
|
|
Updater string // 更新者
|
|
UpdateTime string // 更新时间
|
|
Deleted string // 是否删除
|
|
}
|
|
|
|
// systemSmsLogColumns holds the columns for the table system_sms_log.
|
|
var systemSmsLogColumns = SystemSmsLogColumns{
|
|
Id: "id",
|
|
ChannelId: "channel_id",
|
|
ChannelCode: "channel_code",
|
|
TemplateId: "template_id",
|
|
TemplateCode: "template_code",
|
|
TemplateType: "template_type",
|
|
TemplateContent: "template_content",
|
|
TemplateParams: "template_params",
|
|
ApiTemplateId: "api_template_id",
|
|
Mobile: "mobile",
|
|
UserId: "user_id",
|
|
UserType: "user_type",
|
|
SendStatus: "send_status",
|
|
SendTime: "send_time",
|
|
ApiSendCode: "api_send_code",
|
|
ApiSendMsg: "api_send_msg",
|
|
ApiRequestId: "api_request_id",
|
|
ApiSerialNo: "api_serial_no",
|
|
ReceiveStatus: "receive_status",
|
|
ReceiveTime: "receive_time",
|
|
ApiReceiveCode: "api_receive_code",
|
|
ApiReceiveMsg: "api_receive_msg",
|
|
Creator: "creator",
|
|
CreateTime: "create_time",
|
|
Updater: "updater",
|
|
UpdateTime: "update_time",
|
|
Deleted: "deleted",
|
|
}
|
|
|
|
// NewSystemSmsLogDao creates and returns a new DAO object for table data access.
|
|
func NewSystemSmsLogDao(handlers ...gdb.ModelHandler) *SystemSmsLogDao {
|
|
return &SystemSmsLogDao{
|
|
group: "default",
|
|
table: "system_sms_log",
|
|
columns: systemSmsLogColumns,
|
|
handlers: handlers,
|
|
}
|
|
}
|
|
|
|
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
|
func (dao *SystemSmsLogDao) DB() gdb.DB {
|
|
return g.DB(dao.group)
|
|
}
|
|
|
|
// Table returns the table name of the current DAO.
|
|
func (dao *SystemSmsLogDao) Table() string {
|
|
return dao.table
|
|
}
|
|
|
|
// Columns returns all column names of the current DAO.
|
|
func (dao *SystemSmsLogDao) Columns() SystemSmsLogColumns {
|
|
return dao.columns
|
|
}
|
|
|
|
// Group returns the database configuration group name of the current DAO.
|
|
func (dao *SystemSmsLogDao) 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 *SystemSmsLogDao) 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 *SystemSmsLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
|
return dao.Ctx(ctx).Transaction(ctx, f)
|
|
}
|