代码拉取完成,页面将自动刷新
package schema
import (
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/index"
"github.com/suyuan32/simple-admin-common/orm/ent/mixins"
)
// DeviceOnTimeDaily holds the schema definition for the DeviceOnTimeDaily entity.
type DeviceOnTimeDaily struct {
ent.Schema
}
// Fields of the DeviceOnTimeDaily.
func (DeviceOnTimeDaily) Fields() []ent.Field {
return []ent.Field{
field.String("iotID").
Comment("Iot Id | 设备ID").
Annotations(entsql.WithComments(true)),
field.String("deviceName").
Comment("Device Name | 设备名称").
Annotations(entsql.WithComments(true)),
field.String("productKey").
Comment("Product Key | 产品Key").
Annotations(entsql.WithComments(true)),
field.String("time").
Optional().
Comment("Time | 记录时间").
Annotations(entsql.WithComments(true)),
field.String("value").
Optional().
Comment("Value | 统计总时间").
Annotations(entsql.WithComments(true)),
}
}
// Edges of the DeviceOnTimeDaily.
func (DeviceOnTimeDaily) Edges() []ent.Edge {
return nil
}
// Mixin of the DeviceOnTimeDaily.
func (DeviceOnTimeDaily) Mixin() []ent.Mixin {
return []ent.Mixin{
mixins.IDMixin{},
mixins.StatusMixin{},
mixins.SortMixin{},
}
}
// Indexes of the DeviceOnTimeDaily.
func (DeviceOnTimeDaily) Indexes() []ent.Index {
return []ent.Index{
index.Fields("iotID", "time").Unique(),
}
}
// Annotations of the DeviceOnTimeDaily
func (DeviceOnTimeDaily) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.Annotation{Table: "thing_device_on_time_daily"},
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。