代码拉取完成,页面将自动刷新
package schema
import (
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"github.com/suyuan32/simple-admin-common/orm/ent/mixins"
)
// Company holds the schema definition for the Company entity.
type Company struct {
ent.Schema
}
// Fields of the Company.
func (Company) Fields() []ent.Field {
return []ent.Field{
field.Int32("code").
Comment("Code | 公司编码").
Annotations(entsql.WithComments(true)),
field.String("nickname").
Comment("Nickname | 公司简称").
Annotations(entsql.WithComments(true)),
field.String("address").
Optional().
Comment("Address | 公司地址").
Annotations(entsql.WithComments(true)),
field.String("remark").
Optional().
Comment("Remark | 备注").
Annotations(entsql.WithComments(true)),
}
}
// Edges of the Company.
func (Company) Edges() []ent.Edge {
return []ent.Edge{
edge.To("devices", Device.Type),
edge.To("members", Member.Type),
}
}
// Mixin of the Company.
func (Company) Mixin() []ent.Mixin {
return []ent.Mixin{
mixins.IDMixin{},
mixins.StatusMixin{},
mixins.SortMixin{},
}
}
// Indexes of the Company.
func (Company) Indexes() []ent.Index {
return nil
}
// Annotations of the Company
func (Company) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.Annotation{Table: "client_companies"},
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。