diff --git a/ent/migrate/schema.go b/ent/migrate/schema.go index f9d5f37..4c2d3bf 100644 --- a/ent/migrate/schema.go +++ b/ent/migrate/schema.go @@ -63,7 +63,7 @@ var ( {Name: "password", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true}, - {Name: "next", Type: field.TypeString, Nullable: true, Default: "20230504"}, + {Name: "next", Type: field.TypeString, Nullable: true, Default: "20230521"}, {Name: "group_users", Type: field.TypeInt, Nullable: true}, } // UsersTable holds the schema information for the "users" table. diff --git a/ent/schema/card.go b/ent/schema/card.go index da86686..b62809b 100644 --- a/ent/schema/card.go +++ b/ent/schema/card.go @@ -111,6 +111,14 @@ func (Card) Fields() []ent.Field { cp = 300 + cp + rand.Intn(500) } + if skill == "critical" { + cp = 300 + cp + rand.Intn(500) + } + + if card == 22 { + cp = 800 + cp + rand.Intn(1500) + } + return cp }). Optional(), diff --git a/tmp/card_add.zsh b/tmp/card_add.zsh new file mode 100755 index 0000000..932adaf --- /dev/null +++ b/tmp/card_add.zsh @@ -0,0 +1,20 @@ +#!/bin/zsh +echo id card cp +read +host=https://api.syui.ai +pass=`cat ~/.config/atr/api_card.json|jq -r .password` +if [ -z "$1" ];then + exit +fi +if [ -z "$2" ];then + exit +fi +if [ -z "$3" ];then + exit +fi + +id=$1 +card=$2 +cp=$3 +s="normal" +curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id,\"card\":$card,\"status\":\"$s\",\"cp\":$cp,\"password\":\"$pass\"}" -sL $host/cards