Commit 65b07337 by 段启岩

controller添加api前缀

parent 258aa545
...@@ -13,10 +13,7 @@ import io.swagger.annotations.Api; ...@@ -13,10 +13,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid; import javax.validation.Valid;
...@@ -26,6 +23,7 @@ import javax.validation.Valid; ...@@ -26,6 +23,7 @@ import javax.validation.Valid;
*/ */
@Api(tags = "CMS内容API") @Api(tags = "CMS内容API")
@RestController @RestController
@RequestMapping("/api")
public class ContentApi { public class ContentApi {
private IContentService contentService; private IContentService contentService;
...@@ -44,7 +42,7 @@ public class ContentApi { ...@@ -44,7 +42,7 @@ public class ContentApi {
*/ */
@Anonymous @Anonymous
@ApiOperation("内容列表") @ApiOperation("内容列表")
@GetMapping("/api/channel/{channelId}/contents") @GetMapping("/channel/{channelId}/contents")
public Response getContentPage(@PathVariable("channelId") Integer channelId, public Response getContentPage(@PathVariable("channelId") Integer channelId,
@RequestParam("type") Integer contentType, @RequestParam("type") Integer contentType,
@Valid PageForm pageForm, BindingResult bindingResult) { @Valid PageForm pageForm, BindingResult bindingResult) {
...@@ -64,7 +62,7 @@ public class ContentApi { ...@@ -64,7 +62,7 @@ public class ContentApi {
@Anonymous @Anonymous
@ApiOperation("内容详情") @ApiOperation("内容详情")
@GetMapping("/api/content/{contentId}") @GetMapping("/content/{contentId}")
public Response<ContentDetail> getContentDetail(@PathVariable("contentId") Integer contentId) { public Response<ContentDetail> getContentDetail(@PathVariable("contentId") Integer contentId) {
try { try {
......
...@@ -27,6 +27,7 @@ import javax.validation.Valid; ...@@ -27,6 +27,7 @@ import javax.validation.Valid;
*/ */
@Api(tags = "项目API") @Api(tags = "项目API")
@RestController @RestController
@RequestMapping("/api")
public class ProjectApi { public class ProjectApi {
private IProjectService projectService; private IProjectService projectService;
......
...@@ -25,6 +25,7 @@ import javax.validation.Valid; ...@@ -25,6 +25,7 @@ import javax.validation.Valid;
*/ */
@Api(tags = "项目评论API") @Api(tags = "项目评论API")
@RestController @RestController
@RequestMapping("/api")
public class ProjectCommentApi { public class ProjectCommentApi {
private IProjectCommentService projectCommentService; private IProjectCommentService projectCommentService;
......
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