info_talent_skilled_area.go 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. // InfoTalentSkilledAreaDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type InfoTalentSkilledAreaDao 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 InfoTalentSkilledAreaColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // InfoTalentSkilledAreaColumns defines and stores column names for table info_talent_skilled_area.
  17. type InfoTalentSkilledAreaColumns struct {
  18. SkilledId string //
  19. SkilledAreas string // 擅长领域
  20. }
  21. // infoTalentSkilledAreaColumns holds the columns for table info_talent_skilled_area.
  22. var infoTalentSkilledAreaColumns = InfoTalentSkilledAreaColumns{
  23. SkilledId: "skilled_id",
  24. SkilledAreas: "skilled_areas",
  25. }
  26. // NewInfoTalentSkilledAreaDao creates and returns a new DAO object for table data access.
  27. func NewInfoTalentSkilledAreaDao() *InfoTalentSkilledAreaDao {
  28. return &InfoTalentSkilledAreaDao{
  29. Group: "default",
  30. Table: "info_talent_skilled_area",
  31. Columns: infoTalentSkilledAreaColumns,
  32. }
  33. }
  34. // DB retrieves and returns the underlying raw database management object of current DAO.
  35. func (dao *InfoTalentSkilledAreaDao) DB() gdb.DB {
  36. return g.DB(dao.Group)
  37. }
  38. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  39. func (dao *InfoTalentSkilledAreaDao) Ctx(ctx context.Context) *gdb.Model {
  40. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  41. }
  42. // Transaction wraps the transaction logic using function f.
  43. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  44. // It commits the transaction and returns nil if function f returns nil.
  45. //
  46. // Note that, you should not Commit or Rollback the transaction in function f
  47. // as it is automatically handled by this function.
  48. func (dao *InfoTalentSkilledAreaDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  49. return dao.Ctx(ctx).Transaction(ctx, f)
  50. }