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.

167 lines
5.1 KiB

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