task_procedure_article_info.go 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // ==========================================================================
  2. // Code generated by GoFrame CLI tool. DO NOT EDIT.
  3. // ==========================================================================
  4. package internal
  5. import (
  6. "context"
  7. "github.com/gogf/gf/database/gdb"
  8. "github.com/gogf/gf/frame/g"
  9. )
  10. // TaskProcedureArticleInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type TaskProcedureArticleInfoDao 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 TaskProcedureArticleInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // TaskProcedureArticleInfoColumns defines and stores column names for table task_procedure_article_info.
  17. type TaskProcedureArticleInfoColumns struct {
  18. TpaId string //
  19. TaskBaseId string // 任务id(对应task_base_info表id字段)
  20. UploadLimitDay string // 上传作品天数限制
  21. UploadReduceRate string // 上传作品超时扣费比率(*100)
  22. ReviseLimitDay string // 作品修改天数限制
  23. ReviseReduceRate string // 作品修改超时扣费比率(*100)
  24. }
  25. // taskProcedureArticleInfoColumns holds the columns for table task_procedure_article_info.
  26. var taskProcedureArticleInfoColumns = TaskProcedureArticleInfoColumns{
  27. TpaId: "tpa_id",
  28. TaskBaseId: "task_base_id",
  29. UploadLimitDay: "upload_limit_day",
  30. UploadReduceRate: "upload_reduce_rate",
  31. ReviseLimitDay: "revise_limit_day",
  32. ReviseReduceRate: "revise_reduce_rate",
  33. }
  34. // NewTaskProcedureArticleInfoDao creates and returns a new DAO object for table data access.
  35. func NewTaskProcedureArticleInfoDao() *TaskProcedureArticleInfoDao {
  36. return &TaskProcedureArticleInfoDao{
  37. Group: "default",
  38. Table: "task_procedure_article_info",
  39. Columns: taskProcedureArticleInfoColumns,
  40. }
  41. }
  42. // DB retrieves and returns the underlying raw database management object of current DAO.
  43. func (dao *TaskProcedureArticleInfoDao) DB() gdb.DB {
  44. return g.DB(dao.Group)
  45. }
  46. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  47. func (dao *TaskProcedureArticleInfoDao) Ctx(ctx context.Context) *gdb.Model {
  48. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  49. }
  50. // Transaction wraps the transaction logic using function f.
  51. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  52. // It commits the transaction and returns nil if function f returns nil.
  53. //
  54. // Note that, you should not Commit or Rollback the transaction in function f
  55. // as it is automatically handled by this function.
  56. func (dao *TaskProcedureArticleInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  57. return dao.Ctx(ctx).Transaction(ctx, f)
  58. }