task_signup_info.go 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. // TaskSignupInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type TaskSignupInfoDao 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 TaskSignupInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // TaskSignupInfoColumns defines and stores column names for table task_signup_info.
  17. type TaskSignupInfoColumns struct {
  18. SignupId string //
  19. TaskId string // 任务id
  20. TalentId string // 达人id
  21. TalentPlatformInfoSnap string // 达人平台信息快照
  22. TalentPersonalInfoSnap string // 达人个人信息快照
  23. TalentPostAddr string // 收货地址
  24. TaskLevelId string // 报名选择的招募等级id(task_recruit_talent_level表中的id)
  25. Status string // 报名状态 1等待反选 2等待玩家确认 3反选失败
  26. CreateDate string // 创建时间
  27. }
  28. // taskSignupInfoColumns holds the columns for table task_signup_info.
  29. var taskSignupInfoColumns = TaskSignupInfoColumns{
  30. SignupId: "signup_id",
  31. TaskId: "task_id",
  32. TalentId: "talent_id",
  33. TalentPlatformInfoSnap: "talent_platform_info_snap",
  34. TalentPersonalInfoSnap: "talent_personal_info_snap",
  35. TalentPostAddr: "talent_post_addr",
  36. TaskLevelId: "task_level_id",
  37. Status: "status",
  38. CreateDate: "create_date",
  39. }
  40. // NewTaskSignupInfoDao creates and returns a new DAO object for table data access.
  41. func NewTaskSignupInfoDao() *TaskSignupInfoDao {
  42. return &TaskSignupInfoDao{
  43. Group: "default",
  44. Table: "task_signup_info",
  45. Columns: taskSignupInfoColumns,
  46. }
  47. }
  48. // DB retrieves and returns the underlying raw database management object of current DAO.
  49. func (dao *TaskSignupInfoDao) DB() gdb.DB {
  50. return g.DB(dao.Group)
  51. }
  52. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  53. func (dao *TaskSignupInfoDao) Ctx(ctx context.Context) *gdb.Model {
  54. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  55. }
  56. // Transaction wraps the transaction logic using function f.
  57. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  58. // It commits the transaction and returns nil if function f returns nil.
  59. //
  60. // Note that, you should not Commit or Rollback the transaction in function f
  61. // as it is automatically handled by this function.
  62. func (dao *TaskSignupInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  63. return dao.Ctx(ctx).Transaction(ctx, f)
  64. }