info_auto_default_handle.go 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. // InfoAutoDefaultHandleDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type InfoAutoDefaultHandleDao 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 InfoAutoDefaultHandleColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // InfoAutoDefaultHandleColumns defines and stores column names for table info_auto_default_handle.
  17. type InfoAutoDefaultHandleColumns struct {
  18. AutoDefaultId string // 自动处理规则id
  19. SketchReplaceNotUpload string // 初稿违约 产品置换 未上传初稿
  20. SketchReplaceTimeOut string // 初稿违约 产品置换 超时未上传初稿
  21. SketchOtherNotUpload string // 初稿违约 自报价、固定稿费 未上传初稿
  22. SketchOtherTimeOut string // 初稿违约 自报价、固定稿费 超时未上传初稿
  23. ScriptReplaceNotUpload string // 脚本违约 产品置换 未上传脚本
  24. ScriptReplaceTimeOut string // 脚本违约 产品置换 超时未上传脚本
  25. ScriptOtherNotUpload string // 脚本违约 自报价、固定稿费 未上传脚本
  26. ScriptOtherTimeOut string // 脚本违约 自报价、固定稿费 超时未上传脚本
  27. LinkReplaceNotUpload string // 链接违约 产品置换 未上传链接
  28. LinkReplaceTimeOut string // 链接违约 产品置换 超时未上传链接
  29. LinkOtherNotUpload string // 链接违约 自报价、固定稿费 未上传链接
  30. LinkOtherTimeOut string // 链接违约 自报价、固定稿费 超时未上传链接
  31. DataReplaceNotUpload string // 数据违约 产品置换 未上传数据
  32. DataReplaceTimeOut string // 数据违约 产品置换 超时未上传数据
  33. DataOtherNotUpload string // 数据违约 自报价、固定稿费 未上传数据
  34. DataOtherTimeOut string // 数据违约 自报价、固定稿费 超时未上传数据
  35. }
  36. // infoAutoDefaultHandleColumns holds the columns for table info_auto_default_handle.
  37. var infoAutoDefaultHandleColumns = InfoAutoDefaultHandleColumns{
  38. AutoDefaultId: "auto_default_id",
  39. SketchReplaceNotUpload: "sketch_replace_not_upload",
  40. SketchReplaceTimeOut: "sketch_replace_time_out",
  41. SketchOtherNotUpload: "sketch_other_not_upload",
  42. SketchOtherTimeOut: "sketch_other_time_out",
  43. ScriptReplaceNotUpload: "script_replace_not_upload",
  44. ScriptReplaceTimeOut: "script_replace_time_out",
  45. ScriptOtherNotUpload: "script_other_not_upload",
  46. ScriptOtherTimeOut: "script_other_time_out",
  47. LinkReplaceNotUpload: "link_replace_not_upload",
  48. LinkReplaceTimeOut: "link_replace_time_out",
  49. LinkOtherNotUpload: "link_other_not_upload",
  50. LinkOtherTimeOut: "link_other_time_out",
  51. DataReplaceNotUpload: "data_replace_not_upload",
  52. DataReplaceTimeOut: "data_replace_time_out",
  53. DataOtherNotUpload: "data_other_not_upload",
  54. DataOtherTimeOut: "data_other_time_out",
  55. }
  56. // NewInfoAutoDefaultHandleDao creates and returns a new DAO object for table data access.
  57. func NewInfoAutoDefaultHandleDao() *InfoAutoDefaultHandleDao {
  58. return &InfoAutoDefaultHandleDao{
  59. Group: "default",
  60. Table: "info_auto_default_handle",
  61. Columns: infoAutoDefaultHandleColumns,
  62. }
  63. }
  64. // DB retrieves and returns the underlying raw database management object of current DAO.
  65. func (dao *InfoAutoDefaultHandleDao) DB() gdb.DB {
  66. return g.DB(dao.Group)
  67. }
  68. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  69. func (dao *InfoAutoDefaultHandleDao) Ctx(ctx context.Context) *gdb.Model {
  70. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  71. }
  72. // Transaction wraps the transaction logic using function f.
  73. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  74. // It commits the transaction and returns nil if function f returns nil.
  75. //
  76. // Note that, you should not Commit or Rollback the transaction in function f
  77. // as it is automatically handled by this function.
  78. func (dao *InfoAutoDefaultHandleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  79. return dao.Ctx(ctx).Transaction(ctx, f)
  80. }