mingyang-admin-pay/rpc/ent/schema/pay_app.go

52 lines
1.2 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"
"github.com/saas-mingyang/mingyang-admin-common/orm/ent/mixins"
mixins2 "mingyang-admin-pay/rpc/ent/schema/mixins"
)
type App struct {
ent.Schema
}
// Fields of the App.
func (App) Fields() []ent.Field {
return []ent.Field{
field.String("app_key").Comment("appKey 应用标识"),
field.String("app_name").Comment("应用名称"),
field.String("order_notify_url").Optional().Comment("支付成功回调地址"),
field.String("refund_notify_url").Optional().Comment("退款成功回调地址"),
}
}
func (App) Mixin() []ent.Mixin {
return []ent.Mixin{
mixins.IDMixin{},
mixins.StatusMixin{},
mixins.TenantMixin{},
mixins2.SoftDeleteMixin{},
}
}
func (App) Edges() []ent.Edge {
return []ent.Edge{
edge.From("channel", PayChannel.Type).
Ref("app"),
edge.From("notify_task", PayNotifyTask.Type).
Ref("app"),
}
}
func (App) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.WithComments(true),
schema.Comment("PayApp Table | 支付应用表"),
entsql.Annotation{Table: "pay_app"},
}
}