Skip to content

Commit

Permalink
Fix incorrect cache lock of journal like api (#1279)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnNiang authored Feb 19, 2021
1 parent b57712e commit b412d5d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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;
Expand Down Expand Up @@ -127,7 +128,7 @@ public BaseCommentDTO comment(@RequestBody JournalCommentParam journalCommentPar
@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);
}
}

0 comments on commit b412d5d

Please sign in to comment.