Updated redis for set ops
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
8c999a9e7c
commit
f41b667b6c
@ -20,12 +20,11 @@ class RedisController @Autowired constructor(
|
||||
return redisTemplate.opsForValue().multiGet(listOf(key)) ?: listOf()
|
||||
}
|
||||
|
||||
@PostMapping("/{key}")
|
||||
@PostMapping
|
||||
fun set(
|
||||
@PathVariable("key") key: String,
|
||||
@RequestBody body: RedisKVModel
|
||||
): RedisKVModel {
|
||||
redisTemplate.opsForValue().set(key, body)
|
||||
redisTemplate.opsForValue().set(body.key ?: throw IllegalArgumentException("Key is required"), body)
|
||||
return body
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user