report.go 416 B

123456789101112131415161718192021222324252627
  1. package mysql
  2. import "github.com/jinzhu/gorm"
  3. type Report struct {
  4. gorm.Model
  5. Message string `gorm:"type:longtext"`
  6. Source string
  7. Line string
  8. Colno string
  9. Err string `gorm:"type:longtext"`
  10. Aid string
  11. Sid string
  12. Uid string
  13. Channel string
  14. Path string
  15. }
  16. func (report *Report) Create() error {
  17. res := DB.Create(report)
  18. if res.Error != nil {
  19. return res.Error
  20. }
  21. return nil
  22. }