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.

169 lines
5.1 KiB

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