|
@ -11,14 +11,14 @@ import ( |
|
|
"github.com/gogf/gf/v2/frame/g" |
|
|
"github.com/gogf/gf/v2/frame/g" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
// ActivityInteractiveRecordDao is the data access object for the table activity_interactive_record.
|
|
|
|
|
|
|
|
|
// ActivityInteractiveRecordDao is the data access object for table activity_interactive_record.
|
|
|
type ActivityInteractiveRecordDao struct { |
|
|
type ActivityInteractiveRecordDao struct { |
|
|
table string // table is the underlying table name of the DAO.
|
|
|
table string // table is the underlying table name of the DAO.
|
|
|
group string // group is the database configuration group name of the current DAO.
|
|
|
|
|
|
|
|
|
group string // group is the database configuration group name of current DAO.
|
|
|
columns ActivityInteractiveRecordColumns // columns contains all the column names of Table for convenient usage.
|
|
|
columns ActivityInteractiveRecordColumns // columns contains all the column names of Table for convenient usage.
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// ActivityInteractiveRecordColumns defines and stores column names for the table activity_interactive_record.
|
|
|
|
|
|
|
|
|
// ActivityInteractiveRecordColumns defines and stores column names for table activity_interactive_record.
|
|
|
type ActivityInteractiveRecordColumns struct { |
|
|
type ActivityInteractiveRecordColumns struct { |
|
|
Id string //
|
|
|
Id string //
|
|
|
Jwcode string //
|
|
|
Jwcode string //
|
|
@ -30,7 +30,7 @@ type ActivityInteractiveRecordColumns struct { |
|
|
ContentTitle string //
|
|
|
ContentTitle string //
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// activityInteractiveRecordColumns holds the columns for the table activity_interactive_record.
|
|
|
|
|
|
|
|
|
// activityInteractiveRecordColumns holds the columns for table activity_interactive_record.
|
|
|
var activityInteractiveRecordColumns = ActivityInteractiveRecordColumns{ |
|
|
var activityInteractiveRecordColumns = ActivityInteractiveRecordColumns{ |
|
|
Id: "id", |
|
|
Id: "id", |
|
|
Jwcode: "jwcode", |
|
|
Jwcode: "jwcode", |
|
@ -45,42 +45,42 @@ var activityInteractiveRecordColumns = ActivityInteractiveRecordColumns{ |
|
|
// NewActivityInteractiveRecordDao creates and returns a new DAO object for table data access.
|
|
|
// NewActivityInteractiveRecordDao creates and returns a new DAO object for table data access.
|
|
|
func NewActivityInteractiveRecordDao() *ActivityInteractiveRecordDao { |
|
|
func NewActivityInteractiveRecordDao() *ActivityInteractiveRecordDao { |
|
|
return &ActivityInteractiveRecordDao{ |
|
|
return &ActivityInteractiveRecordDao{ |
|
|
group: "live", |
|
|
|
|
|
|
|
|
group: "default", |
|
|
table: "activity_interactive_record", |
|
|
table: "activity_interactive_record", |
|
|
columns: activityInteractiveRecordColumns, |
|
|
columns: activityInteractiveRecordColumns, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
|
|
|
|
|
|
|
|
// DB retrieves and returns the underlying raw database management object of current DAO.
|
|
|
func (dao *ActivityInteractiveRecordDao) DB() gdb.DB { |
|
|
func (dao *ActivityInteractiveRecordDao) DB() gdb.DB { |
|
|
return g.DB(dao.group) |
|
|
return g.DB(dao.group) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Table returns the table name of the current DAO.
|
|
|
|
|
|
|
|
|
// Table returns the table name of current dao.
|
|
|
func (dao *ActivityInteractiveRecordDao) Table() string { |
|
|
func (dao *ActivityInteractiveRecordDao) Table() string { |
|
|
return dao.table |
|
|
return dao.table |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Columns returns all column names of the current DAO.
|
|
|
|
|
|
|
|
|
// Columns returns all column names of current dao.
|
|
|
func (dao *ActivityInteractiveRecordDao) Columns() ActivityInteractiveRecordColumns { |
|
|
func (dao *ActivityInteractiveRecordDao) Columns() ActivityInteractiveRecordColumns { |
|
|
return dao.columns |
|
|
return dao.columns |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Group returns the database configuration group name of the current DAO.
|
|
|
|
|
|
|
|
|
// Group returns the configuration group name of database of current dao.
|
|
|
func (dao *ActivityInteractiveRecordDao) Group() string { |
|
|
func (dao *ActivityInteractiveRecordDao) Group() string { |
|
|
return dao.group |
|
|
return dao.group |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
|
|
|
|
|
|
|
|
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
|
|
func (dao *ActivityInteractiveRecordDao) Ctx(ctx context.Context) *gdb.Model { |
|
|
func (dao *ActivityInteractiveRecordDao) Ctx(ctx context.Context) *gdb.Model { |
|
|
return dao.DB().Model(dao.table).Safe().Ctx(ctx) |
|
|
return dao.DB().Model(dao.table).Safe().Ctx(ctx) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Transaction wraps the transaction logic using function f.
|
|
|
// 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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
|
|
// It commits the transaction and returns nil if function f returns nil.
|
|
|
// It commits the transaction and returns nil if function f returns nil.
|
|
|
//
|
|
|
//
|
|
|
// Note: Do not commit or roll back the transaction in function f,
|
|
|
|
|
|
|
|
|
// Note that, you should not Commit or Rollback the transaction in function f
|
|
|
// as it is automatically handled by this function.
|
|
|
// as it is automatically handled by this function.
|
|
|
func (dao *ActivityInteractiveRecordDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { |
|
|
func (dao *ActivityInteractiveRecordDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { |
|
|
return dao.Ctx(ctx).Transaction(ctx, f) |
|
|
return dao.Ctx(ctx).Transaction(ctx, f) |
|
|