youngee_talent_delivery_address.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. // YoungeeTalentDeliveryAddressDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type YoungeeTalentDeliveryAddressDao 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 YoungeeTalentDeliveryAddressColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // YoungeeTalentDeliveryAddressColumns defines and stores column names for table youngee_talent_delivery_address.
  17. type YoungeeTalentDeliveryAddressColumns struct {
  18. AddressId string //
  19. TalentId string // 达人id(youngee_talent_info表中的id)
  20. RegionCode string // 区域码,取info_region表中的self_code字段值
  21. DetailAddr string // 详细地址
  22. PhoneNumber string // 联系电话
  23. ReceiverName string // 收货人名字
  24. DefaultTag string // 是否默认收货地址
  25. }
  26. // youngeeTalentDeliveryAddressColumns holds the columns for table youngee_talent_delivery_address.
  27. var youngeeTalentDeliveryAddressColumns = YoungeeTalentDeliveryAddressColumns{
  28. AddressId: "address_id",
  29. TalentId: "talent_id",
  30. RegionCode: "region_code",
  31. DetailAddr: "detail_addr",
  32. PhoneNumber: "phone_number",
  33. ReceiverName: "receiver_name",
  34. DefaultTag: "default_tag",
  35. }
  36. // NewYoungeeTalentDeliveryAddressDao creates and returns a new DAO object for table data access.
  37. func NewYoungeeTalentDeliveryAddressDao() *YoungeeTalentDeliveryAddressDao {
  38. return &YoungeeTalentDeliveryAddressDao{
  39. Group: "default",
  40. Table: "youngee_talent_delivery_address",
  41. Columns: youngeeTalentDeliveryAddressColumns,
  42. }
  43. }
  44. // DB retrieves and returns the underlying raw database management object of current DAO.
  45. func (dao *YoungeeTalentDeliveryAddressDao) DB() gdb.DB {
  46. return g.DB(dao.Group)
  47. }
  48. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  49. func (dao *YoungeeTalentDeliveryAddressDao) Ctx(ctx context.Context) *gdb.Model {
  50. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  51. }
  52. // Transaction wraps the transaction logic using function f.
  53. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  54. // It commits the transaction and returns nil if function f returns nil.
  55. //
  56. // Note that, you should not Commit or Rollback the transaction in function f
  57. // as it is automatically handled by this function.
  58. func (dao *YoungeeTalentDeliveryAddressDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  59. return dao.Ctx(ctx).Transaction(ctx, f)
  60. }