12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- // ==========================================================================
- // 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"
- )
- // NewUserSendLogDao is the data access object for the table new_user_send_log.
- type NewUserSendLogDao 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 NewUserSendLogColumns // columns contains all the column names of Table for convenient usage.
- }
- // NewUserSendLogColumns defines and stores column names for the table new_user_send_log.
- type NewUserSendLogColumns struct {
- Id string // 新注册用户发送记录表
- UserId string // mgo库的id
- Phone string //
- RuleId string // 规则表id
- State string // 发送状态:-1 :取消发送 0:待发送 1:已发送
- CreateTime string //
- UpdateTime string //
- }
- // newUserSendLogColumns holds the columns for the table new_user_send_log.
- var newUserSendLogColumns = NewUserSendLogColumns{
- Id: "id",
- UserId: "user_id",
- Phone: "phone",
- RuleId: "rule_id",
- State: "state",
- CreateTime: "create_time",
- UpdateTime: "update_time",
- }
- // NewNewUserSendLogDao creates and returns a new DAO object for table data access.
- func NewNewUserSendLogDao() *NewUserSendLogDao {
- return &NewUserSendLogDao{
- group: "default",
- table: "new_user_send_log",
- columns: newUserSendLogColumns,
- }
- }
- // DB retrieves and returns the underlying raw database management object of the current DAO.
- func (dao *NewUserSendLogDao) DB() gdb.DB {
- return g.DB(dao.group)
- }
- // Table returns the table name of the current DAO.
- func (dao *NewUserSendLogDao) Table() string {
- return dao.table
- }
- // Columns returns all column names of the current DAO.
- func (dao *NewUserSendLogDao) Columns() NewUserSendLogColumns {
- return dao.columns
- }
- // Group returns the database configuration group name of the current DAO.
- func (dao *NewUserSendLogDao) 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 *NewUserSendLogDao) Ctx(ctx context.Context) *gdb.Model {
- return dao.DB().Model(dao.table).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 *NewUserSendLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
- return dao.Ctx(ctx).Transaction(ctx, f)
- }
|