circuitry.go 540 B

123456789101112131415161718192021222324
  1. package schema
  2. import (
  3. "errors"
  4. "github.com/jinzhu/gorm"
  5. )
  6. // Circuitry 站点系统图 表
  7. type Circuitry struct {
  8. gorm.Model
  9. CircuitryCode string `gorm:"not null;primary_key"` //系统图编号
  10. SubstationCode string `gorm:"not null;index;"` //所属站点编号
  11. ChartData string `gorm:"type:LONGTEXT"` //系统图表XML结构
  12. Operator string //操作人
  13. }
  14. // Validate 验证
  15. func (a *Circuitry) Validate() error {
  16. if a.SubstationCode == "" {
  17. return errors.New("参数不能为空")
  18. }
  19. return nil
  20. }