Commit 809c0d93 by 段启岩

修改API路径

parent 3cfb6540
...@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
public class PostPraiseApi { public class PostPraiseApi {
@ApiOperation("点赞") @ApiOperation("点赞")
@PostMapping("/blog/{targetId}/praise") @PostMapping("/post/{targetId}/praise")
public Response praise (@PathVariable("targetId") String targetId, public Response praise (@PathVariable("targetId") String targetId,
@RequestParam("targetType") Integer targetType) { @RequestParam("targetType") Integer targetType) {
Subject subject = SubjectUtils.getSubject(); Subject subject = SubjectUtils.getSubject();
...@@ -30,7 +30,7 @@ public class PostPraiseApi { ...@@ -30,7 +30,7 @@ public class PostPraiseApi {
} }
@ApiOperation("点赞") @ApiOperation("点赞")
@DeleteMapping("/blog/{targetId}/praise") @DeleteMapping("/post/{targetId}/praise")
public Response deletePraise (@PathVariable("targetId") String targetId, public Response deletePraise (@PathVariable("targetId") String targetId,
@RequestParam("targetType") Integer targetType) { @RequestParam("targetType") Integer targetType) {
Subject subject = SubjectUtils.getSubject(); Subject subject = SubjectUtils.getSubject();
......
...@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
public class ProjectPraiseApi { public class ProjectPraiseApi {
@ApiOperation("点赞") @ApiOperation("点赞")
@PostMapping("/blog/{targetId}/praise") @PostMapping("/project/{targetId}/praise")
public Response praise (@PathVariable("targetId") String targetId, public Response praise (@PathVariable("targetId") String targetId,
@RequestParam("targetType") Integer targetType) { @RequestParam("targetType") Integer targetType) {
Subject subject = SubjectUtils.getSubject(); Subject subject = SubjectUtils.getSubject();
...@@ -30,7 +30,7 @@ public class ProjectPraiseApi { ...@@ -30,7 +30,7 @@ public class ProjectPraiseApi {
} }
@ApiOperation("点赞") @ApiOperation("点赞")
@DeleteMapping("/blog/{targetId}/praise") @DeleteMapping("/project/{targetId}/praise")
public Response deletePraise (@PathVariable("targetId") String targetId, public Response deletePraise (@PathVariable("targetId") String targetId,
@RequestParam("targetType") Integer targetType) { @RequestParam("targetType") Integer targetType) {
Subject subject = SubjectUtils.getSubject(); Subject subject = SubjectUtils.getSubject();
......
...@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
public class QuestionPraiseApi { public class QuestionPraiseApi {
@ApiOperation("点赞") @ApiOperation("点赞")
@PostMapping("/blog/{targetId}/praise") @PostMapping("/question/{targetId}/praise")
public Response praise (@PathVariable("targetId") String targetId, public Response praise (@PathVariable("targetId") String targetId,
@RequestParam("targetType") Integer targetType) { @RequestParam("targetType") Integer targetType) {
Subject subject = SubjectUtils.getSubject(); Subject subject = SubjectUtils.getSubject();
...@@ -30,7 +30,7 @@ public class QuestionPraiseApi { ...@@ -30,7 +30,7 @@ public class QuestionPraiseApi {
} }
@ApiOperation("点赞") @ApiOperation("点赞")
@DeleteMapping("/blog/{targetId}/praise") @DeleteMapping("/question/{targetId}/praise")
public Response deletePraise (@PathVariable("targetId") String targetId, public Response deletePraise (@PathVariable("targetId") String targetId,
@RequestParam("targetType") Integer targetType) { @RequestParam("targetType") Integer targetType) {
Subject subject = SubjectUtils.getSubject(); Subject subject = SubjectUtils.getSubject();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment