model

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive added in v1.0.4

type Archive struct {
	ID          uint64           `gorm:"column:id;primaryKey;autoIncrement;comment:主键" json:"id" form:"id"` // 主键
	GatewayCode string           `gorm:"column:gateway_code;type:varchar(20);default:'';comment:网关编号" json:"gateway_code"`
	Code        string           `gorm:"column:code;type:varchar(20);default:'';comment:设备编号" json:"code"`
	Attribute   ArchiveAttribute `gorm:"serializer:json;column:attribute;type:varchar(255);default:'';comment:属性信息" json:"attribute"`
	CreatedAt   time.Time        `gorm:"column:created_at;type:datetime;not null;comment:创建时间" json:"created_at" form:"created_at"`
	UpdatedAt   time.Time        `gorm:"column:updated_at;type:datetime;not null;comment:更新时间" json:"updated_at" form:"updated_at"`
}

func (*Archive) TableName added in v1.0.4

func (*Archive) TableName() string

type ArchiveAttribute added in v1.0.6

type ArchiveAttribute struct {
	Regulate int     `json:"regulate" form:"regulate"`
	Weight   float32 `json:"weight" form:"weight"`
}

type Params

type Params struct {
	ID        uint64    `gorm:"column:id;primaryKey;autoIncrement;comment:主键" json:"id" form:"id"` // 主键
	Key       string    `gorm:"column:key;type:varchar(60);uniqueIndex:idx_params_key;default:'';comment:唯一标识Key" json:"key"`
	Value     string    `gorm:"column:value;type:varchar(255);default:'';comment:具体数值" json:"value"`
	CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;comment:创建时间" json:"created_at" form:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;comment:更新时间" json:"updated_at" form:"updated_at"`
}

func (*Params) TableName added in v1.0.4

func (*Params) TableName() string

type RegulateBuild added in v1.0.4

type RegulateBuild struct {
	GatewayCode string          `gorm:"column:gateway_code;type:varchar(20);default:'';comment:网关编号" json:"gateway_code"`
	ArchiveCode string          `gorm:"column:archive_code;type:varchar(20);default:'';comment:设备编号" json:"archive_code"`
	ArchiveName string          `gorm:"column:archive_name;type:varchar(100);default:'';comment:设备名称区域" json:"archive_name"`
	Params      []RegulateParam `gorm:"serializer:json;column:params;type:varchar(255);default:'';comment:参数信息" json:"params"`
	PrevDeg     uint8           `gorm:"column:prev_deg;type:tinyint(1);default:0;comment:调控前开度" json:"prev_deg"`
	NextDeg     uint8           `gorm:"column:next_deg;type:tinyint(1);default:0;comment:调控后开度" json:"next_deg"`
	Status      int             `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
	Remark      string          `gorm:"column:remark;type:varchar(255);default:'';comment:备注信息" json:"remark"`
	Date        time.Time       `gorm:"column:date;type:datetime;not null;comment:调控时间" json:"date" form:"date"`
}

func (*RegulateBuild) TableName added in v1.0.4

func (*RegulateBuild) TableName() string

type RegulateHouse added in v1.0.4

type RegulateHouse struct {
	GatewayCode string          `gorm:"column:gateway_code;type:varchar(20);default:'';comment:网关编号" json:"gateway_code"`
	ArchiveCode string          `gorm:"column:archive_code;type:varchar(20);default:'';comment:设备编号" json:"archive_code"`
	ArchiveName string          `gorm:"column:archive_name;type:varchar(100);default:'';comment:设备名称区域" json:"archive_name"`
	Params      []RegulateParam `gorm:"serializer:json;column:params;type:varchar(255);default:'';comment:参数信息" json:"params"`
	PrevDeg     uint8           `gorm:"column:prev_deg;type:tinyint(1);default:0;comment:调控前开度" json:"prev_deg"`
	NextDeg     uint8           `gorm:"column:next_deg;type:tinyint(1);default:0;comment:调控后开度" json:"next_deg"`
	Status      int             `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
	Remark      string          `gorm:"column:remark;type:varchar(255);default:'';comment:备注信息" json:"remark"`
	Date        time.Time       `gorm:"column:date;type:datetime;not null;comment:调控时间" json:"date" form:"date"`
}

func (*RegulateHouse) TableName added in v1.0.4

func (*RegulateHouse) TableName() string

type RegulateParam added in v1.1.0

type RegulateParam struct {
	Key   string `json:"key"`
	Title string `json:"title"`
	Value string `json:"value"`
}

type RegulateParams added in v1.0.4

type RegulateParams []RegulateParam

func (RegulateParams) ToString added in v1.1.0

func (this RegulateParams) ToString() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL