From 2b479451c138c32a2bd977843ee65abb02777a4e Mon Sep 17 00:00:00 2001 From: syui Date: Fri, 17 May 2024 10:02:08 +0900 Subject: [PATCH] fix card random --- ent/migrate/schema.go | 2 +- ent/schema/card.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ent/migrate/schema.go b/ent/migrate/schema.go index ed674e3..c30a590 100644 --- a/ent/migrate/schema.go +++ b/ent/migrate/schema.go @@ -202,7 +202,7 @@ var ( {Name: "ten_post", Type: field.TypeString, Nullable: true}, {Name: "ten_get", Type: field.TypeString, Nullable: true}, {Name: "ten_at", Type: field.TypeTime, Nullable: true}, - {Name: "next", Type: field.TypeString, Nullable: true, Default: "20240424"}, + {Name: "next", Type: field.TypeString, Nullable: true, Default: "20240516"}, {Name: "room", Type: field.TypeInt, Nullable: true}, {Name: "model", Type: field.TypeBool, Nullable: true}, {Name: "model_at", Type: field.TypeTime, Nullable: true}, diff --git a/ent/schema/card.go b/ent/schema/card.go index 23e8a10..56a2f53 100644 --- a/ent/schema/card.go +++ b/ent/schema/card.go @@ -33,6 +33,8 @@ func (Card) Fields() []ent.Field { var a = rand.Intn(20) if a == 1 { card = rand.Intn(3) + 123 + } else if a == 2 { + card = rand.Intn(14) + 1 } else { card = 0 }