12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- // ==========================================================================
- // 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"
- )
- // YounggeeSecBriefDao is the manager for logic model data accessing and custom defined data operations functions management.
- type YounggeeSecBriefDao 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 YounggeeSecBriefColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
- }
- // YounggeeSecBriefColumns defines and stores column names for table younggee_sec_brief.
- type YounggeeSecBriefColumns struct {
- SectionBriefId string // brief的Id
- FileUrl string // 文件url
- FileUid string // 文件uid
- SelectionId string // 所属选品id
- CreatedAt string // 创建时间
- FileName string // 文件名称
- }
- // younggeeSecBriefColumns holds the columns for table younggee_sec_brief.
- var younggeeSecBriefColumns = YounggeeSecBriefColumns{
- SectionBriefId: "section_brief_id",
- FileUrl: "file_url",
- FileUid: "file_uid",
- SelectionId: "selection_id",
- CreatedAt: "created_at",
- FileName: "file_name",
- }
- // NewYounggeeSecBriefDao creates and returns a new DAO object for table data access.
- func NewYounggeeSecBriefDao() *YounggeeSecBriefDao {
- return &YounggeeSecBriefDao{
- Group: "default",
- Table: "younggee_sec_brief",
- Columns: younggeeSecBriefColumns,
- }
- }
- // DB retrieves and returns the underlying raw database management object of current DAO.
- func (dao *YounggeeSecBriefDao) 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 *YounggeeSecBriefDao) 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 *YounggeeSecBriefDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
- return dao.Ctx(ctx).Transaction(ctx, f)
- }
|