new_user_send_log.go 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. // NewUserSendLogDao is the data access object for the table new_user_send_log.
  11. type NewUserSendLogDao struct {
  12. table string // table is the underlying table name of the DAO.
  13. group string // group is the database configuration group name of the current DAO.
  14. columns NewUserSendLogColumns // columns contains all the column names of Table for convenient usage.
  15. }
  16. // NewUserSendLogColumns defines and stores column names for the table new_user_send_log.
  17. type NewUserSendLogColumns struct {
  18. Id string // 新注册用户发送记录表
  19. UserId string // mgo库的id
  20. Phone string //
  21. RuleId string // 规则表id
  22. State string // 发送状态:-1 :取消发送 0:待发送 1:已发送
  23. CreateTime string //
  24. UpdateTime string //
  25. }
  26. // newUserSendLogColumns holds the columns for the table new_user_send_log.
  27. var newUserSendLogColumns = NewUserSendLogColumns{
  28. Id: "id",
  29. UserId: "user_id",
  30. Phone: "phone",
  31. RuleId: "rule_id",
  32. State: "state",
  33. CreateTime: "create_time",
  34. UpdateTime: "update_time",
  35. }
  36. // NewNewUserSendLogDao creates and returns a new DAO object for table data access.
  37. func NewNewUserSendLogDao() *NewUserSendLogDao {
  38. return &NewUserSendLogDao{
  39. group: "default",
  40. table: "new_user_send_log",
  41. columns: newUserSendLogColumns,
  42. }
  43. }
  44. // DB retrieves and returns the underlying raw database management object of the current DAO.
  45. func (dao *NewUserSendLogDao) DB() gdb.DB {
  46. return g.DB(dao.group)
  47. }
  48. // Table returns the table name of the current DAO.
  49. func (dao *NewUserSendLogDao) Table() string {
  50. return dao.table
  51. }
  52. // Columns returns all column names of the current DAO.
  53. func (dao *NewUserSendLogDao) Columns() NewUserSendLogColumns {
  54. return dao.columns
  55. }
  56. // Group returns the database configuration group name of the current DAO.
  57. func (dao *NewUserSendLogDao) Group() string {
  58. return dao.group
  59. }
  60. // Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
  61. func (dao *NewUserSendLogDao) Ctx(ctx context.Context) *gdb.Model {
  62. return dao.DB().Model(dao.table).Safe().Ctx(ctx)
  63. }
  64. // Transaction wraps the transaction logic using function f.
  65. // It rolls back the transaction and returns the error if function f returns a non-nil error.
  66. // It commits the transaction and returns nil if function f returns nil.
  67. //
  68. // Note: Do not commit or roll back the transaction in function f,
  69. // as it is automatically handled by this function.
  70. func (dao *NewUserSendLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
  71. return dao.Ctx(ctx).Transaction(ctx, f)
  72. }