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

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

// PlatformWeiboAccountInfoColumns defines and stores column names for table platform_weibo_account_info.
type PlatformWeiboAccountInfoColumns struct {
	WeiboId             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 // 粉丝数                                             
    WeiboTotalNum       string // 微博总量                                           
    IsSupportReporting  string // 是否支持报备                                       
    IsSupportLive       string // 是否支持直播                                       
    CanMakeVideo        string // 是否可以制作视频                                   
    IsAppearInVideo     string // 是否出镜                                           
    SkilledAt           string // 擅长领域(info_tallent_skilled_area表中的id的数组)  
    HomePageCaptureUrl  string // 主页截图链接                                       
    AccountFrom         string // 账号来源(仅B端批量上传的账号需要填写)              
    SubmitDate          string // 提交时间                                           
    ExamineFailAdminId  string // 审核失败操作管理员id(user表中的id)                 
    ExamineDate         string // 审核日期                                           
    ExamineFailReason   string // 审核失败原因                                       
    UpdatedAt           string // 更新时间                                           
    ExamineSucAdminId   string // 审核成功操作管理员id(user表中的id)
}

//  platformWeiboAccountInfoColumns holds the columns for table platform_weibo_account_info.
var platformWeiboAccountInfoColumns = PlatformWeiboAccountInfoColumns{
	WeiboId:            "weibo_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",             
            WeiboTotalNum:      "weibo_total_num",        
            IsSupportReporting: "is_support_reporting",   
            IsSupportLive:      "is_support_live",        
            CanMakeVideo:       "can_make_video",         
            IsAppearInVideo:    "is_appear_in_video",     
            SkilledAt:          "skilled_at",             
            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",
}

// NewPlatformWeiboAccountInfoDao creates and returns a new DAO object for table data access.
func NewPlatformWeiboAccountInfoDao() *PlatformWeiboAccountInfoDao {
	return &PlatformWeiboAccountInfoDao{
		Group:   "default",
		Table:   "platform_weibo_account_info",
		Columns: platformWeiboAccountInfoColumns,
	}
}

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