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

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

// PlatformKuaishouAccountInfoColumns defines and stores column names for table platform_kuaishou_account_info.
type PlatformKuaishouAccountInfoColumns struct {
	KuaishouId          string //                                                    
    TalentId            string // 达人账号id(talent_info表id值)                      
    PlatformId          string // 平台id，与third_platform_info中的id相同            
    PlatformName        string // 平台名称(冗余)                                     
    PlatformIconUrl     string // 平台icon的url(冗余)                                
    PlatformAccountId   string // 在平台上的账号                                     
    PlatformNickname    string // 在平台上的昵称                                     
    HomePageUrl         string // 主页链接                                           
    FansCount           string // 粉丝数                                             
    CompositionCount    string // 作品数量                                           
    SkilledAt           string // 擅长领域(info_tallent_skilled_area表中的id的数组)  
    IsSupportLive       string // 是否支持直播                                       
    IsOpenCart          string // 是否开通购物车                                     
    IsAppearInVideo     string // 是否出镜                                           
    HomePageCaptureUrl  string // 主页截图图片url                                    
    AccountFrom         string // 账号来源(仅B端批量上传的账号需要填写)              
    SubmitDate          string // 提交时间                                           
    ExamineFailAdminId  string // 审核失败操作管理员id(user表中的id)                 
    ExamineDate         string // 审核日期                                           
    ExamineFailReason   string // 审核失败原因                                       
    UpdatedAt           string // 更新时间                                           
    ExamineSucAdminId   string // 审核成功操作管理员id(user表中的id)
}

//  platformKuaishouAccountInfoColumns holds the columns for table platform_kuaishou_account_info.
var platformKuaishouAccountInfoColumns = PlatformKuaishouAccountInfoColumns{
	KuaishouId:         "kuaishou_id",            
            TalentId:           "talent_id",              
            PlatformId:         "platform_id",            
            PlatformName:       "platform_name",          
            PlatformIconUrl:    "platform_icon_url",      
            PlatformAccountId:  "platform_account_id",    
            PlatformNickname:   "platform_nickname",      
            HomePageUrl:        "home_page_url",          
            FansCount:          "fans_count",             
            CompositionCount:   "composition_count",      
            SkilledAt:          "skilled_at",             
            IsSupportLive:      "is_support_live",        
            IsOpenCart:         "is_open_cart",           
            IsAppearInVideo:    "is_appear_in_video",     
            HomePageCaptureUrl: "home_page_capture_url",  
            AccountFrom:        "account_from",           
            SubmitDate:         "submit_date",            
            ExamineFailAdminId: "examine_fail_admin_id",  
            ExamineDate:        "examine_date",           
            ExamineFailReason:  "examine_fail_reason",    
            UpdatedAt:          "updated_at",             
            ExamineSucAdminId:  "examine_suc_admin_id",
}

// NewPlatformKuaishouAccountInfoDao creates and returns a new DAO object for table data access.
func NewPlatformKuaishouAccountInfoDao() *PlatformKuaishouAccountInfoDao {
	return &PlatformKuaishouAccountInfoDao{
		Group:   "default",
		Table:   "platform_kuaishou_account_info",
		Columns: platformKuaishouAccountInfoColumns,
	}
}

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