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

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

// TaskRecruitRequirementsColumns defines and stores column names for table task_recruit_requirements.
type TaskRecruitRequirementsColumns struct {
	TrrId             string //                                                                                                                                                                                                                  
    TaskBaseId        string // 关联的task_base_info中的id                                                                                                                                                                                       
    TalentSkillsOn    string // 达人擅长领域要求,info_tallent_skilled_area表中的id列表，以逗号分隔    ['不限', '母婴', '美妆护肤', '时尚穿搭', '旅游', '美食', '数码科技', '健康养生', '情感', '宠物', '运动健身', '家居生活', '搞笑', '音乐'],  
    InteractType      string // 指定互动形式的内容                                                                                                                                                                                               
    RegionCode        string // 地域码,info_region表中的self_code值                                                                                                                                                                              
    Gender            string // 限制可接任务的性别,0女 1男 2不限制                                                                                                                                                                               
    OtherRequirement  string // 其他要求
}

//  taskRecruitRequirementsColumns holds the columns for table task_recruit_requirements.
var taskRecruitRequirementsColumns = TaskRecruitRequirementsColumns{
	TrrId:            "trr_id",             
            TaskBaseId:       "task_base_id",       
            TalentSkillsOn:   "talent_skills_on",   
            InteractType:     "interact_type",      
            RegionCode:       "region_code",        
            Gender:           "gender",             
            OtherRequirement: "other_requirement",
}

// NewTaskRecruitRequirementsDao creates and returns a new DAO object for table data access.
func NewTaskRecruitRequirementsDao() *TaskRecruitRequirementsDao {
	return &TaskRecruitRequirementsDao{
		Group:   "default",
		Table:   "task_recruit_requirements",
		Columns: taskRecruitRequirementsColumns,
	}
}

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