younggee_assignment_info.go 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. // YounggeeAssignmentInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type YounggeeAssignmentInfoDao 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 YounggeeAssignmentInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // YounggeeAssignmentInfoColumns defines and stores column names for table younggee_assignment_info.
  17. type YounggeeAssignmentInfoColumns struct {
  18. AssignmentId string // 作业id,递增
  19. TaskId string // 任务id
  20. LinkUrl string // 作业连接
  21. PhotoUrl string // 作业截图
  22. ReviseOpinion string // 审核意见
  23. IsSubmit string // 是否提交
  24. IsReview string // 是否审核
  25. IsOk string // 是否合格
  26. CreateAt string // 创建时间
  27. SubmitAt string // 提交时间
  28. AgreeAt string // 同意时间
  29. RejectAt string // 驳回时间
  30. }
  31. // younggeeAssignmentInfoColumns holds the columns for table younggee_assignment_info.
  32. var younggeeAssignmentInfoColumns = YounggeeAssignmentInfoColumns{
  33. AssignmentId: "assignment_id",
  34. TaskId: "task_id",
  35. LinkUrl: "link_url",
  36. PhotoUrl: "photo_url",
  37. ReviseOpinion: "revise_opinion",
  38. IsSubmit: "is_submit",
  39. IsReview: "is_review",
  40. IsOk: "is_ok",
  41. CreateAt: "create_at",
  42. SubmitAt: "submit_at",
  43. AgreeAt: "agree_at",
  44. RejectAt: "reject_at",
  45. }
  46. // NewYounggeeAssignmentInfoDao creates and returns a new DAO object for table data access.
  47. func NewYounggeeAssignmentInfoDao() *YounggeeAssignmentInfoDao {
  48. return &YounggeeAssignmentInfoDao{
  49. Group: "default",
  50. Table: "younggee_assignment_info",
  51. Columns: younggeeAssignmentInfoColumns,
  52. }
  53. }
  54. // DB retrieves and returns the underlying raw database management object of current DAO.
  55. func (dao *YounggeeAssignmentInfoDao) DB() gdb.DB {
  56. return g.DB(dao.Group)
  57. }
  58. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  59. func (dao *YounggeeAssignmentInfoDao) Ctx(ctx context.Context) *gdb.Model {
  60. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  61. }
  62. // Transaction wraps the transaction logic using function f.
  63. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  64. // It commits the transaction and returns nil if function f returns nil.
  65. //
  66. // Note that, you should not Commit or Rollback the transaction in function f
  67. // as it is automatically handled by this function.
  68. func (dao *YounggeeAssignmentInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  69. return dao.Ctx(ctx).Transaction(ctx, f)
  70. }