chore: update Go modules to version 1.25.5, restructure models into pkg/models, and remove unused model files for improved organization and dependency management

This commit is contained in:
keven1024
2025-12-14 16:12:17 +08:00
parent 208875841e
commit 313ce4455f
29 changed files with 175 additions and 160 deletions

28
pkg/models/pickupcode.go Normal file
View File

@@ -0,0 +1,28 @@
package models
import (
"fmt"
"time"
"pkg/utils"
"github.com/redis/go-redis/v9"
)
func GetRedisPickupData(pickupCode string) (string, error) {
rdb, ctx := utils.GetRedisClient()
ShareId, err := rdb.Get(ctx, fmt.Sprintf("015:pickupCode:%s", pickupCode)).Result()
if err == redis.Nil {
return "", nil
}
if err != nil {
return "", err
}
return ShareId, nil
}
func SetRedisPickupData(pickupCode string, shareId string) (bool, error) {
rdb, ctx := utils.GetRedisClient()
ok, err := rdb.SetNX(ctx, fmt.Sprintf("015:pickupCode:%s", pickupCode), shareId, time.Until(time.Now().Add(24*time.Hour))).Result()
return ok, err
}