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

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

// PlatformDianpingAccountInfoColumns defines and stores column names for table platform_dianping_account_info.
type PlatformDianpingAccountInfoColumns struct {
	DianpingId         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 // 粉丝数
	GotLikeCount       string // 点赞数
	MembershipLevel    string // 会员等级
	IsAppearInVideo    string // 是否出镜
	HomePageCaptureUrl string // 主页截图图片url
	AccountFrom        string // 账号来源(仅B端批量上传的账号需要填写)
	ExamineStatus      string // 审核状态 1待审核 2审核通过 3审核失败
	SubmitDate         string // 提交时间
	ExamineFailAdminId string // 审核失败操作管理员id(user表中的id)
	ExamineDate        string // 审核日期
	ExamineFailReason  string // 审核失败原因
	UpdatedAt          string // 更新时间
	ExamineSucAdminId  string // 审核成功操作管理员id(user表中的id)
}

//  platformDianpingAccountInfoColumns holds the columns for table platform_dianping_account_info.
var platformDianpingAccountInfoColumns = PlatformDianpingAccountInfoColumns{
	DianpingId:         "dianping_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",
	GotLikeCount:       "got_like_count",
	MembershipLevel:    "membership_level",
	IsAppearInVideo:    "is_appear_in_video",
	HomePageCaptureUrl: "home_page_capture_url",
	AccountFrom:        "account_from",
	ExamineStatus:      "examine_status",
	SubmitDate:         "submit_date",
	ExamineFailAdminId: "examine_fail_admin_id",
	ExamineDate:        "examine_date",
	ExamineFailReason:  "examine_fail_reason",
	UpdatedAt:          "updated_at",
	ExamineSucAdminId:  "examine_suc_admin_id",
}

// NewPlatformDianpingAccountInfoDao creates and returns a new DAO object for table data access.
func NewPlatformDianpingAccountInfoDao() *PlatformDianpingAccountInfoDao {
	return &PlatformDianpingAccountInfoDao{
		Group:   "default",
		Table:   "platform_dianping_account_info",
		Columns: platformDianpingAccountInfoColumns,
	}
}

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