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.

97 lines
3.2 KiB

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. // CollectTaskDao is the data access object for table cms_collect_task.
  11. type CollectTaskDao 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 CollectTaskColumns // columns contains all the column names of Table for convenient usage.
  15. }
  16. // CollectTaskColumns defines and stores column names for table cms_collect_task.
  17. type CollectTaskColumns struct {
  18. Id string //
  19. CollectId string // 采集
  20. Running string // 是否运行中
  21. Progress string // 进度
  22. Status string // 状态
  23. Current string // 当前
  24. Total string // 总记录
  25. PageCount string // 总页数
  26. CurrentPage string // 当前页
  27. StartTime string // 开始时间
  28. LastTime string // 最后提交时间
  29. EndTime string // 结束时间
  30. UpdateTime string // 采集多少时间内
  31. }
  32. // collectTaskColumns holds the columns for table cms_collect_task.
  33. var collectTaskColumns = CollectTaskColumns{
  34. Id: "id",
  35. CollectId: "collect_id",
  36. Running: "running",
  37. Progress: "progress",
  38. Status: "status",
  39. Current: "current",
  40. Total: "total",
  41. PageCount: "page_count",
  42. CurrentPage: "current_page",
  43. StartTime: "start_time",
  44. LastTime: "last_time",
  45. EndTime: "end_time",
  46. UpdateTime: "update_time",
  47. }
  48. // NewCollectTaskDao creates and returns a new DAO object for table data access.
  49. func NewCollectTaskDao() *CollectTaskDao {
  50. return &CollectTaskDao{
  51. group: "cms",
  52. table: "cms_collect_task",
  53. columns: collectTaskColumns,
  54. }
  55. }
  56. // DB retrieves and returns the underlying raw database management object of current DAO.
  57. func (dao *CollectTaskDao) DB() gdb.DB {
  58. return g.DB(dao.group)
  59. }
  60. // Table returns the table name of current dao.
  61. func (dao *CollectTaskDao) Table() string {
  62. return dao.table
  63. }
  64. // Columns returns all column names of current dao.
  65. func (dao *CollectTaskDao) Columns() CollectTaskColumns {
  66. return dao.columns
  67. }
  68. // Group returns the configuration group name of database of current dao.
  69. func (dao *CollectTaskDao) Group() string {
  70. return dao.group
  71. }
  72. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  73. func (dao *CollectTaskDao) Ctx(ctx context.Context) *gdb.Model {
  74. return dao.DB().Model(dao.table).Safe().Ctx(ctx)
  75. }
  76. // Transaction wraps the transaction logic using function f.
  77. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  78. // It commits the transaction and returns nil if function f returns nil.
  79. //
  80. // Note that, you should not Commit or Rollback the transaction in function f
  81. // as it is automatically handled by this function.
  82. func (dao *CollectTaskDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
  83. return dao.Ctx(ctx).Transaction(ctx, f)
  84. }