info_third_platform.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. // InfoThirdPlatformDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type InfoThirdPlatformDao 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 InfoThirdPlatformColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // InfoThirdPlatformColumns defines and stores column names for table info_third_platform.
  17. type InfoThirdPlatformColumns struct {
  18. PlatformId string // 平台id,主键
  19. PlatformName string // 平台名
  20. PlatformIcon string // 平台图标url
  21. PlatformTableName string // 平台数据表表名
  22. }
  23. // infoThirdPlatformColumns holds the columns for table info_third_platform.
  24. var infoThirdPlatformColumns = InfoThirdPlatformColumns{
  25. PlatformId: "platform_id",
  26. PlatformName: "platform_name",
  27. PlatformIcon: "platform_icon",
  28. PlatformTableName: "platform_table_name",
  29. }
  30. // NewInfoThirdPlatformDao creates and returns a new DAO object for table data access.
  31. func NewInfoThirdPlatformDao() *InfoThirdPlatformDao {
  32. return &InfoThirdPlatformDao{
  33. Group: "default",
  34. Table: "info_third_platform",
  35. Columns: infoThirdPlatformColumns,
  36. }
  37. }
  38. // DB retrieves and returns the underlying raw database management object of current DAO.
  39. func (dao *InfoThirdPlatformDao) DB() gdb.DB {
  40. return g.DB(dao.Group)
  41. }
  42. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  43. func (dao *InfoThirdPlatformDao) Ctx(ctx context.Context) *gdb.Model {
  44. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  45. }
  46. // Transaction wraps the transaction logic using function f.
  47. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  48. // It commits the transaction and returns nil if function f returns nil.
  49. //
  50. // Note that, you should not Commit or Rollback the transaction in function f
  51. // as it is automatically handled by this function.
  52. func (dao *InfoThirdPlatformDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  53. return dao.Ctx(ctx).Transaction(ctx, f)
  54. }