mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
feat(backend): update SetRedisPickupData to return success status for Redis storage
This commit is contained in:
@@ -20,8 +20,8 @@ func GetRedisPickupData(pickupCode string) (string, error) {
|
||||
return ShareId, nil
|
||||
}
|
||||
|
||||
func SetRedisPickupData(pickupCode string, shareId string) error {
|
||||
func SetRedisPickupData(pickupCode string, shareId string) (bool, error) {
|
||||
rdb, ctx := utils.GetRedisClient()
|
||||
_, err := rdb.Set(ctx, fmt.Sprintf("015:pickupCode:%s", pickupCode), shareId, time.Until(time.Now().Add(24*time.Hour))).Result()
|
||||
return err
|
||||
ok, err := rdb.SetNX(ctx, fmt.Sprintf("015:pickupCode:%s", pickupCode), shareId, time.Until(time.Now().Add(24*time.Hour))).Result()
|
||||
return ok, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user