mirror of https://github.com/halo-dev/halo
pref: journals likes api. (#1266)
parent
f567b94f91
commit
48ca0492d1
|
@ -126,6 +126,7 @@ public class JournalController {
|
||||||
|
|
||||||
@PostMapping("{id:\\d+}/likes")
|
@PostMapping("{id:\\d+}/likes")
|
||||||
@ApiOperation("Likes a journal")
|
@ApiOperation("Likes a journal")
|
||||||
|
@CacheLock(autoDelete = false, traceRequest = true)
|
||||||
public void like(@PathVariable("id") Integer id) {
|
public void like(@PathVariable("id") Integer id) {
|
||||||
journalService.increaseLike(id);
|
journalService.increaseLike(id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,6 +196,7 @@ public class PostController {
|
||||||
|
|
||||||
@PostMapping("{postId:\\d+}/likes")
|
@PostMapping("{postId:\\d+}/likes")
|
||||||
@ApiOperation("Likes a post")
|
@ApiOperation("Likes a post")
|
||||||
|
@CacheLock(autoDelete = false, traceRequest = true)
|
||||||
public void like(@PathVariable("postId") Integer postId) {
|
public void like(@PathVariable("postId") Integer postId) {
|
||||||
postService.increaseLike(postId);
|
postService.increaseLike(postId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,9 @@ public class ApiAuthenticationFilter extends AbstractAuthenticationFilter {
|
||||||
addExcludeUrlPatterns(
|
addExcludeUrlPatterns(
|
||||||
"/api/content/**/comments",
|
"/api/content/**/comments",
|
||||||
"/api/content/**/comments/**",
|
"/api/content/**/comments/**",
|
||||||
"/api/content/options/comment"
|
"/api/content/options/comment",
|
||||||
|
"/api/content/journals/*/likes",
|
||||||
|
"/api/content/posts/*/likes"
|
||||||
);
|
);
|
||||||
|
|
||||||
// set failure handler
|
// set failure handler
|
||||||
|
|
Loading…
Reference in New Issue