59 lines
1.4 KiB
Go
59 lines
1.4 KiB
Go
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"
|
|
"entgo.io/ent/schema/index"
|
|
"github.com/saas-mingyang/mingyang-admin-common/orm/ent/mixins"
|
|
mixins2 "mingyang-admin-pay/rpc/ent/schema/mixins"
|
|
)
|
|
|
|
type PayNotifyLog struct {
|
|
ent.Schema
|
|
}
|
|
|
|
// Fields of the PayNotifyLog.
|
|
func (PayNotifyLog) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Uint64("task_id").Comment("任务ID | 任务ID"),
|
|
field.Uint32("notify_count").Comment("通知次数 | 通知次数").Default(0),
|
|
field.String("response").Optional().Comment("响应内容 | 响应内容"),
|
|
field.String("notify_status").Optional().Comment("通知状态 | 通知状态"),
|
|
}
|
|
}
|
|
|
|
func (PayNotifyLog) Mixin() []ent.Mixin {
|
|
return []ent.Mixin{
|
|
mixins.IDMixin{},
|
|
mixins.StatusMixin{},
|
|
mixins.TenantMixin{},
|
|
mixins2.SoftDeleteMixin{},
|
|
}
|
|
|
|
}
|
|
func (PayNotifyLog) Edges() []ent.Edge {
|
|
return []ent.Edge{
|
|
edge.To("task", PayNotifyTask.Type).
|
|
Field("task_id").
|
|
Unique().
|
|
Required(),
|
|
}
|
|
}
|
|
|
|
func (PayNotifyLog) Indexes() []ent.Index {
|
|
return []ent.Index{
|
|
index.Fields("task_id"),
|
|
}
|
|
}
|
|
|
|
func (PayNotifyLog) Annotations() []schema.Annotation {
|
|
return []schema.Annotation{
|
|
entsql.WithComments(true),
|
|
schema.Comment("PayNotifyLog Table | 异步通知日志表"),
|
|
entsql.Annotation{Table: "pay_notify_log"},
|
|
}
|
|
}
|