refactor(backend): simplify response structure in GetCompressImage function and add GetRedisFileKeysAll function for retrieving all file keys

This commit is contained in:
keven1024
2025-06-01 17:59:19 +08:00
parent 657751a7d7
commit ed9d56c6d9
2 changed files with 6 additions and 4 deletions

View File

@@ -67,8 +67,5 @@ func GetCompressImage(c echo.Context) error {
})
}
}
return utils.HTTPSuccessHandler(c, map[string]any{
"status": "success",
"data": taskInfo,
})
return utils.HTTPSuccessHandler(c, *taskInfo)
}

View File

@@ -58,3 +58,8 @@ func SetRedisFileInfo(fileId string, fileInfo RedisFileInfo) error {
_, err = rdb.HSet(ctx, "015:fileInfoMap", fileId, string(jsonData)).Result()
return err
}
func GetRedisFileKeysAll() ([]string, error) {
rdb, ctx := utils.GetRedisClient()
return rdb.HKeys(ctx, "015:fileInfoMap").Result()
}