mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
refactor(backend): simplify response structure in GetCompressImage function and add GetRedisFileKeysAll function for retrieving all file keys
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user