diff --git a/niu/db.go b/niu/db.go index 04c303d..5526068 100644 --- a/niu/db.go +++ b/niu/db.go @@ -2,6 +2,7 @@ package niu import ( "fmt" + "github.com/RomiChan/syncx" "github.com/jinzhu/gorm" "github.com/sirupsen/logrus" @@ -27,7 +28,6 @@ func ensureTable[T userInfo | AuctionInfo](gid int64, prefix string) error { } func tableFor(gid int64, prefix string) *gorm.DB { - switch prefix { case usr: err := ensureTable[userInfo](gid, usr) diff --git a/niu/main.go b/niu/main.go index 612fe09..251de78 100644 --- a/niu/main.go +++ b/niu/main.go @@ -4,13 +4,14 @@ package niu import ( "errors" "fmt" - "github.com/google/uuid" - "github.com/jinzhu/gorm" "os" "strconv" "strings" "sync" + "github.com/google/uuid" + "github.com/jinzhu/gorm" + "github.com/FloatTech/floatbox/file" "github.com/FloatTech/AnimeAPI/wallet" diff --git a/niu/models.go b/niu/models.go index a57222d..4b77a74 100644 --- a/niu/models.go +++ b/niu/models.go @@ -4,12 +4,13 @@ package niu import ( "errors" "fmt" - "github.com/google/uuid" - "github.com/jinzhu/gorm" "math" "math/rand" "sort" "time" + + "github.com/google/uuid" + "github.com/jinzhu/gorm" ) var ( @@ -259,7 +260,6 @@ func (u *userInfo) checkProps(props, propSort string) error { } func (u *userInfo) purchaseItem(productID, quantity int) (money int, err error) { - m := map[int]int{ 1: 300, // 伟哥 2: 300, // 媚药