123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- // ==========================================================================
- // Code generated by GoFrame CLI tool. DO NOT EDIT.
- // ==========================================================================
- package internal
- import (
- "context"
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/frame/g"
- )
- // YounggeeTaskLogDao is the manager for logic model data accessing and custom defined data operations functions management.
- type YounggeeTaskLogDao struct {
- Table string // Table is the underlying table name of the DAO.
- Group string // Group is the database configuration group name of current DAO.
- Columns YounggeeTaskLogColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
- }
- // YounggeeTaskLogColumns defines and stores column names for table younggee_task_log.
- type YounggeeTaskLogColumns struct {
- LogId string // 任务日志id
- TaskId string // 任务id
- Content string // 内容
- LogAt string // 时间
- }
- // younggeeTaskLogColumns holds the columns for table younggee_task_log.
- var younggeeTaskLogColumns = YounggeeTaskLogColumns{
- LogId: "log_id",
- TaskId: "task_id",
- Content: "content",
- LogAt: "log_at",
- }
- // NewYounggeeTaskLogDao creates and returns a new DAO object for table data access.
- func NewYounggeeTaskLogDao() *YounggeeTaskLogDao {
- return &YounggeeTaskLogDao{
- Group: "default",
- Table: "younggee_task_log",
- Columns: younggeeTaskLogColumns,
- }
- }
- // DB retrieves and returns the underlying raw database management object of current DAO.
- func (dao *YounggeeTaskLogDao) DB() gdb.DB {
- return g.DB(dao.Group)
- }
- // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
- func (dao *YounggeeTaskLogDao) Ctx(ctx context.Context) *gdb.Model {
- return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
- }
- // Transaction wraps the transaction logic using function f.
- // 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.
- //
- // Note that, you should not Commit or Rollback the transaction in function f
- // as it is automatically handled by this function.
- func (dao *YounggeeTaskLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
- return dao.Ctx(ctx).Transaction(ctx, f)
- }
|