english_report_email_op_log.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. const (
  7. EnglishReportEmailOpLogTypeAdd = iota + 1
  8. EnglishReportEmailOpLogTypeEdit
  9. EnglishReportEmailOpLogTypeDel
  10. EnglishReportEmailOpLogTypeImport
  11. EnglishReportEmailOpLogTypeEditEnabled
  12. EnglishReportEmailOpLogTypeMoveToCurrent
  13. )
  14. // EnglishReportEmailOpLog 英文邮箱/联系人-操作日志表
  15. type EnglishReportEmailOpLog struct {
  16. Id int `orm:"column(id);pk"`
  17. CompanyId int `description:"客户ID"`
  18. EmailId int `description:"联系人ID"`
  19. AdminId int `description:"操作人ID"`
  20. OptionData string `description:"操作数据-JSON"`
  21. OptionType int `description:"操作类型:1-新增;2-编辑;3-删除;4-导入"`
  22. CreateTime time.Time `description:"创建时间"`
  23. }
  24. func (item *EnglishReportEmailOpLog) TableName() string {
  25. return "english_report_email_op_log"
  26. }
  27. func (item *EnglishReportEmailOpLog) Create() (err error) {
  28. o := orm.NewOrmUsingDB("rddp")
  29. id, err := o.Insert(item)
  30. if err != nil {
  31. return
  32. }
  33. item.Id = int(id)
  34. return
  35. }
  36. func (item *EnglishReportEmailOpLog) MultiCreate(items []*EnglishReportEmailOpLog) (err error) {
  37. o := orm.NewOrmUsingDB("rddp")
  38. _, err = o.InsertMulti(len(items), items)
  39. return
  40. }
  41. func (item *EnglishReportEmailOpLog) Update(cols []string) (err error) {
  42. o := orm.NewOrmUsingDB("rddp")
  43. _, err = o.Update(item, cols...)
  44. return
  45. }