// ========================================================================== // Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. // ========================================================================== package internal import ( "context" "github.com/gogf/gf/v2/database/gdb" "github.com/gogf/gf/v2/frame/g" ) // VideoDao is the data access object for table cms_video. type VideoDao 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 VideoColumns // columns contains all the column names of Table for convenient usage. } // VideoColumns defines and stores column names for table cms_video. type VideoColumns struct { Id string // SourceUrl string // 源地址 CollectId string // 站点 Title string // 标题 TitleSub string // 副标 Letter string // 首字母 Tag string // TAG Color string // 颜色 Lock string // 锁定 Copyright string // 版权 IsEnd string // 完结 Status string // 状态 Class string // 扩展分类 CategoryId string // 分类 Pic string // 图片 PicId string // 图片编号 PicLocal string // PicThumb string // 缩略图 PicSlide string // 轮播 PicScreenshot string // 截图 PicStatus string // 图片状态 Actor string // 演员 Director string // 导演 Writer string // 编剧 Remarks string // 备注 Pubdate string // 发布时间 Total string // 总集数 Serial string // 连载数 Duration string // 视频时长 Tv string // 电视频道 Weekday string // 节目周期 Area string // 地区 Lang string // 语言 Jumpurl string // 跳转URL Version string // 资源版本 Year string // 年份 State string // 资源类别 DoubanScore string // 豆瓣评分 DoubanId string // 豆瓣ID Up string // 顶 Down string // 踩 Hits string // 人气 HitsMonth string // 月人气 HitsWeek string // 周人气 HitsDay string // 天人气 Content string // 内容 CreatedAt string // Blurb string // 简要介绍 UpdatedAt string // } // videoColumns holds the columns for table cms_video. var videoColumns = VideoColumns{ Id: "id", SourceUrl: "source_url", CollectId: "collect_id", Title: "title", TitleSub: "title_sub", Letter: "letter", Tag: "tag", Color: "color", Lock: "lock", Copyright: "copyright", IsEnd: "is_end", Status: "status", Class: "class", CategoryId: "category_id", Pic: "pic", PicId: "pic_id", PicLocal: "pic_local", PicThumb: "pic_thumb", PicSlide: "pic_slide", PicScreenshot: "pic_screenshot", PicStatus: "pic_status", Actor: "actor", Director: "director", Writer: "writer", Remarks: "remarks", Pubdate: "pubdate", Total: "total", Serial: "serial", Duration: "duration", Tv: "tv", Weekday: "weekday", Area: "area", Lang: "lang", Jumpurl: "jumpurl", Version: "version", Year: "year", State: "state", DoubanScore: "douban_score", DoubanId: "douban_id", Up: "up", Down: "down", Hits: "hits", HitsMonth: "hits_month", HitsWeek: "hits_week", HitsDay: "hits_day", Content: "content", CreatedAt: "created_at", Blurb: "blurb", UpdatedAt: "updated_at", } // NewVideoDao creates and returns a new DAO object for table data access. func NewVideoDao() *VideoDao { return &VideoDao{ group: "cms", table: "cms_video", columns: videoColumns, } } // DB retrieves and returns the underlying raw database management object of current DAO. func (dao *VideoDao) DB() gdb.DB { return g.DB(dao.group) } // Table returns the table name of current dao. func (dao *VideoDao) Table() string { return dao.table } // Columns returns all column names of current dao. func (dao *VideoDao) Columns() VideoColumns { return dao.columns } // Group returns the configuration group name of database of current dao. func (dao *VideoDao) Group() string { return dao.group } // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *VideoDao) 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 *VideoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) }