123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- // ==========================================================================
- // Code generated by GoFrame CLI tool. DO NOT EDIT.
- // ==========================================================================
- package internal
- import (
- "context"
- "github.com/gogf/gf/database/gdb"
- "github.com/gogf/gf/frame/g"
- )
- // YounggeeInvoiceAddressDao is the manager for logic model data accessing and custom defined data operations functions management.
- type YounggeeInvoiceAddressDao struct {
- Table string // Table is the underlying table name of the DAO.
- Group string // Group is the database configuration group name of current DAO.
- Columns YounggeeInvoiceAddressColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
- }
- // YounggeeInvoiceAddressColumns defines and stores column names for table younggee_invoice_address.
- type YounggeeInvoiceAddressColumns struct {
- AddressId string // 发票收件地址id
- EnterpriseId string // 企业id
- Name string // 收件人姓名
- RegionCode string // 所在地区编码
- Address string // 详细地址
- Phone string // 手机号码
- UpdateAt string // 创建时间
- }
- // younggeeInvoiceAddressColumns holds the columns for table younggee_invoice_address.
- var younggeeInvoiceAddressColumns = YounggeeInvoiceAddressColumns{
- AddressId: "address_id",
- EnterpriseId: "enterprise_id",
- Name: "name",
- RegionCode: "region_code",
- Address: "address",
- Phone: "phone",
- UpdateAt: "update_at",
- }
- // NewYounggeeInvoiceAddressDao creates and returns a new DAO object for table data access.
- func NewYounggeeInvoiceAddressDao() *YounggeeInvoiceAddressDao {
- return &YounggeeInvoiceAddressDao{
- Group: "default",
- Table: "younggee_invoice_address",
- Columns: younggeeInvoiceAddressColumns,
- }
- }
- // DB retrieves and returns the underlying raw database management object of current DAO.
- func (dao *YounggeeInvoiceAddressDao) DB() gdb.DB {
- return g.DB(dao.Group)
- }
- // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
- func (dao *YounggeeInvoiceAddressDao) Ctx(ctx context.Context) *gdb.Model {
- return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
- }
- // Transaction wraps the transaction logic using function f.
- // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
- // It commits the transaction and returns nil if function f returns nil.
- //
- // Note that, you should not Commit or Rollback the transaction in function f
- // as it is automatically handled by this function.
- func (dao *YounggeeInvoiceAddressDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
- return dao.Ctx(ctx).Transaction(ctx, f)
- }
|