1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- // ==========================================================================
- // 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"
- )
- // YounggeeMessageInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
- type YounggeeMessageInfoDao 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 YounggeeMessageInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
- }
- // YounggeeMessageInfoColumns defines and stores column names for table younggee_message_info.
- type YounggeeMessageInfoColumns struct {
- Id string // id,递增
- MessageId string // 消息内容id,对应info_message
- MessageType string // 消息类型,1-4分别表示成功、通知、错误、警告
- TalentId string // 达人id
- ProjectName string // 项目名称
- CreatedAt string // 消息创建时间
- IsReaded string // 是否已读,1表示未读,2表示已读
- IsDeleted string // 是否删除,1表示未删,2表示已删
- }
- // younggeeMessageInfoColumns holds the columns for table younggee_message_info.
- var younggeeMessageInfoColumns = YounggeeMessageInfoColumns{
- Id: "id",
- MessageId: "message_id",
- MessageType: "message_type",
- TalentId: "talent_id",
- ProjectName: "project_name",
- CreatedAt: "created_at",
- IsReaded: "is_readed",
- IsDeleted: "is_deleted",
- }
- // NewYounggeeMessageInfoDao creates and returns a new DAO object for table data access.
- func NewYounggeeMessageInfoDao() *YounggeeMessageInfoDao {
- return &YounggeeMessageInfoDao{
- Group: "default",
- Table: "younggee_message_info",
- Columns: younggeeMessageInfoColumns,
- }
- }
- // DB retrieves and returns the underlying raw database management object of current DAO.
- func (dao *YounggeeMessageInfoDao) 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 *YounggeeMessageInfoDao) 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 *YounggeeMessageInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
- return dao.Ctx(ctx).Transaction(ctx, f)
- }
|