// ==========================================================================
// 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"
)

// TaskSignupInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
type TaskSignupInfoDao 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 TaskSignupInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
}

// TaskSignupInfoColumns defines and stores column names for table task_signup_info.
type TaskSignupInfoColumns struct {
	SignupId                string //                                                          
    TaskId                  string // 任务id                                                   
    TalentId                string // 达人id                                                   
    TalentPlatformInfoSnap  string // 达人平台信息快照                                         
    TalentPersonalInfoSnap  string // 达人个人信息快照                                         
    TalentPostAddr          string // 收货地址                                                 
    TaskLevelId             string // 报名选择的招募等级id(task_recruit_talent_level表中的id)  
    Status                  string // 报名状态 1等待反选 2等待玩家确认 3反选失败               
    CreateDate              string // 创建时间
}

//  taskSignupInfoColumns holds the columns for table task_signup_info.
var taskSignupInfoColumns = TaskSignupInfoColumns{
	SignupId:               "signup_id",                  
            TaskId:                 "task_id",                    
            TalentId:               "talent_id",                  
            TalentPlatformInfoSnap: "talent_platform_info_snap",  
            TalentPersonalInfoSnap: "talent_personal_info_snap",  
            TalentPostAddr:         "talent_post_addr",           
            TaskLevelId:            "task_level_id",              
            Status:                 "status",                     
            CreateDate:             "create_date",
}

// NewTaskSignupInfoDao creates and returns a new DAO object for table data access.
func NewTaskSignupInfoDao() *TaskSignupInfoDao {
	return &TaskSignupInfoDao{
		Group:   "default",
		Table:   "task_signup_info",
		Columns: taskSignupInfoColumns,
	}
}

// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *TaskSignupInfoDao) 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 *TaskSignupInfoDao) 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 *TaskSignupInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
	return dao.Ctx(ctx).Transaction(ctx, f)
}