package schema

import (
	"entgo.io/ent"
	"entgo.io/ent/dialect/entsql"
	"entgo.io/ent/schema"
	"entgo.io/ent/schema/field"
)

// Message holds the schema definition for the Message entity.
type Message struct {
	ent.Schema
}

// Fields of the Message.
func (Message) Fields() []ent.Field {
	return []ent.Field{
		field.String("wx_wxid").Optional().Default("").
			Annotations(entsql.WithComments(true)).
			Comment("属主微信id"),
		field.String("wxid").Default("").
			Annotations(entsql.WithComments(true)).
			Comment("微信id 公众号微信ID"),
		field.String("content").Default("").
			Annotations(entsql.WithComments(true)).
			Comment("微信消息内容"),
	}
}

// Edges of the Message.
func (Message) Edges() []ent.Edge {
	return nil
}

func (Message) Annotations() []schema.Annotation {
	return []schema.Annotation{
		entsql.WithComments(true),
		entsql.Annotation{Table: "messages"},
	}
}
