Fix incorrect cache lock of journal like api (#1279)

pull/1286/head
John Niang 2021-02-19 23:32:57 +08:00 committed by GitHub
parent b57712e23e
commit b412d5da2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.util.HtmlUtils;
import run.halo.app.cache.lock.CacheLock;
import run.halo.app.cache.lock.CacheParam;
import run.halo.app.model.dto.BaseCommentDTO;
import run.halo.app.model.dto.JournalDTO;
import run.halo.app.model.dto.JournalWithCmtCountDTO;
@ -127,7 +128,7 @@ public class JournalController {
@PostMapping("{id:\\d+}/likes")
@ApiOperation("Likes a journal")
@CacheLock(autoDelete = false, traceRequest = true)
public void like(@PathVariable("id") Integer id) {
public void like(@PathVariable("id") @CacheParam Integer id) {
journalService.increaseLike(id);
}
}