123456789101112131415161718192021222324 |
- package schema
- import (
- "errors"
- "github.com/jinzhu/gorm"
- )
- // Circuitry 站点系统图 表
- type Circuitry struct {
- gorm.Model
- CircuitryCode string `gorm:"not null;primary_key"` //系统图编号
- SubstationCode string `gorm:"not null;index;"` //所属站点编号
- ChartData string `gorm:"type:LONGTEXT"` //系统图表XML结构
- Operator string //操作人
- }
- // Validate 验证
- func (a *Circuitry) Validate() error {
- if a.SubstationCode == "" {
- return errors.New("参数不能为空")
- }
- return nil
- }
|