You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

165 lines
5.0 KiB

11 months ago
  1. // ==========================================================================
  2. // Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
  3. // ==========================================================================
  4. package internal
  5. import (
  6. "context"
  7. "github.com/gogf/gf/v2/database/gdb"
  8. "github.com/gogf/gf/v2/frame/g"
  9. )
  10. // VideoDao is the data access object for table cms_video.
  11. type VideoDao struct {
  12. table string // table is the underlying table name of the DAO.
  13. group string // group is the database configuration group name of current DAO.
  14. columns VideoColumns // columns contains all the column names of Table for convenient usage.
  15. }
  16. // VideoColumns defines and stores column names for table cms_video.
  17. type VideoColumns struct {
  18. Id string //
  19. Title string // 标题
  20. TitleSub string // 副标
  21. Letter string // 首字母
  22. Tag string // TAG
  23. Color string // 颜色
  24. Lock string // 锁定
  25. Copyright string // 版权
  26. IsEnd string // 完结
  27. Status string // 状态
  28. Class string // 扩展分类
  29. CategoryId string // 分类
  30. Pic string // 图片
  31. PicId string // 图片编号
  32. PicLocal string //
  33. PicThumb string // 缩略图
  34. PicSlide string // 轮播
  35. PicScreenshot string // 截图
  36. PicStatus string // 图片状态
  37. Actor string // 演员
  38. Director string // 导演
  39. Writer string // 编剧
  40. Remarks string // 备注
  41. Pubdate string // 发布时间
  42. Total string // 总集数
  43. Serial string // 连载数
  44. Duration string // 视频时长
  45. Tv string // 电视频道
  46. Weekday string // 节目周期
  47. Area string // 地区
  48. Lang string // 语言
  49. Jumpurl string // 跳转URL
  50. Version string // 资源版本
  51. Year string // 年份
  52. State string // 资源类别
  53. DoubanScore string // 豆瓣评分
  54. DoubanId string // 豆瓣ID
  55. Up string // 顶
  56. Down string // 踩
  57. Hits string // 人气
  58. HitsMonth string // 月人气
  59. HitsWeek string // 周人气
  60. HitsDay string // 天人气
  61. Content string // 内容
  62. CreatedAt string //
  63. Blurb string // 简要介绍
  64. UpdatedAt string //
  65. }
  66. // videoColumns holds the columns for table cms_video.
  67. var videoColumns = VideoColumns{
  68. Id: "id",
  69. Title: "title",
  70. TitleSub: "title_sub",
  71. Letter: "letter",
  72. Tag: "tag",
  73. Color: "color",
  74. Lock: "lock",
  75. Copyright: "copyright",
  76. IsEnd: "is_end",
  77. Status: "status",
  78. Class: "class",
  79. CategoryId: "category_id",
  80. Pic: "pic",
  81. PicId: "pic_id",
  82. PicLocal: "pic_local",
  83. PicThumb: "pic_thumb",
  84. PicSlide: "pic_slide",
  85. PicScreenshot: "pic_screenshot",
  86. PicStatus: "pic_status",
  87. Actor: "actor",
  88. Director: "director",
  89. Writer: "writer",
  90. Remarks: "remarks",
  91. Pubdate: "pubdate",
  92. Total: "total",
  93. Serial: "serial",
  94. Duration: "duration",
  95. Tv: "tv",
  96. Weekday: "weekday",
  97. Area: "area",
  98. Lang: "lang",
  99. Jumpurl: "jumpurl",
  100. Version: "version",
  101. Year: "year",
  102. State: "state",
  103. DoubanScore: "douban_score",
  104. DoubanId: "douban_id",
  105. Up: "up",
  106. Down: "down",
  107. Hits: "hits",
  108. HitsMonth: "hits_month",
  109. HitsWeek: "hits_week",
  110. HitsDay: "hits_day",
  111. Content: "content",
  112. CreatedAt: "created_at",
  113. Blurb: "blurb",
  114. UpdatedAt: "updated_at",
  115. }
  116. // NewVideoDao creates and returns a new DAO object for table data access.
  117. func NewVideoDao() *VideoDao {
  118. return &VideoDao{
  119. group: "cms",
  120. table: "cms_video",
  121. columns: videoColumns,
  122. }
  123. }
  124. // DB retrieves and returns the underlying raw database management object of current DAO.
  125. func (dao *VideoDao) DB() gdb.DB {
  126. return g.DB(dao.group)
  127. }
  128. // Table returns the table name of current dao.
  129. func (dao *VideoDao) Table() string {
  130. return dao.table
  131. }
  132. // Columns returns all column names of current dao.
  133. func (dao *VideoDao) Columns() VideoColumns {
  134. return dao.columns
  135. }
  136. // Group returns the configuration group name of database of current dao.
  137. func (dao *VideoDao) Group() string {
  138. return dao.group
  139. }
  140. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  141. func (dao *VideoDao) Ctx(ctx context.Context) *gdb.Model {
  142. return dao.DB().Model(dao.table).Safe().Ctx(ctx)
  143. }
  144. // Transaction wraps the transaction logic using function f.
  145. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  146. // It commits the transaction and returns nil if function f returns nil.
  147. //
  148. // Note that, you should not Commit or Rollback the transaction in function f
  149. // as it is automatically handled by this function.
  150. func (dao *VideoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
  151. return dao.Ctx(ctx).Transaction(ctx, f)
  152. }