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

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

// PlatformZhihuAccountInfoColumns defines and stores column names for table platform_zhihu_account_info.
type PlatformZhihuAccountInfoColumns struct {
	ZhihuId             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 // 粉丝数                                   
    GotAgreeCount       string // 被赞同总数                               
    GotLikeCount        string // 被喜欢总数                               
    GotCollectCount     string // 被收藏总数                               
    AnswerCount         string // 回答总数                                 
    CreativeLevel       string // 创作等级                                 
    TotalReadPlayCount  string // 总阅读播放量                             
    HomePageCaptureUrl  string // 主页截图                                 
    AccountFrom         string // 账号来源(仅B端批量上传的账号需要填写)    
    SubmitDate          string // 提交时间                                 
    ExamineFailAdminId  string // 审核失败操作管理员id(user表中的id)       
    ExamineDate         string // 审核日期                                 
    ExamineFailReason   string // 审核失败原因                             
    UpdatedAt           string // 更新时间                                 
    ExamineSucAdminId   string // 审核成功操作管理员id(user表中的id)
}

//  platformZhihuAccountInfoColumns holds the columns for table platform_zhihu_account_info.
var platformZhihuAccountInfoColumns = PlatformZhihuAccountInfoColumns{
	ZhihuId:            "zhihu_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",             
            GotAgreeCount:      "got_agree_count",        
            GotLikeCount:       "got_like_count",         
            GotCollectCount:    "got_collect_count",      
            AnswerCount:        "answer_count",           
            CreativeLevel:      "creative_level",         
            TotalReadPlayCount: "total_read_play_count",  
            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",
}

// NewPlatformZhihuAccountInfoDao creates and returns a new DAO object for table data access.
func NewPlatformZhihuAccountInfoDao() *PlatformZhihuAccountInfoDao {
	return &PlatformZhihuAccountInfoDao{
		Group:   "default",
		Table:   "platform_zhihu_account_info",
		Columns: platformZhihuAccountInfoColumns,
	}
}

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