eta_author.go 738 B

1234567891011121314151617181920212223
  1. package eta
  2. import (
  3. "eta/eta_mini_ht_api/models"
  4. )
  5. type ReportAuthor struct {
  6. Id int `gorm:"primaryKey;autoIncrement;column:id;comment:主键"`
  7. AuthorType int `gorm:"default:1;comment:'类型,1:中文;2:英文'"`
  8. ReportAuthor string `gorm:"type:varchar(50);default:''"`
  9. Enable bool `gorm:"default:1;comment:'是否启用,0:禁用,1:启用'"`
  10. IsDelete bool `gorm:"default:0;comment:'是否删除,0:未删除,1:已删除'"`
  11. }
  12. func (ra ReportAuthor) TableName() string {
  13. return "report_author"
  14. }
  15. func GetReportAuthorList() (authors []ReportAuthor, err error) {
  16. db := models.ETA()
  17. err = db.Model(&ReportAuthor{}).Where("author_type = ?", 1).Find(&authors).Error
  18. return
  19. }