代码格式优化
This commit is contained in:
parent
4a814a16fa
commit
1a6142c446
@ -97,8 +97,6 @@ public class CommonApiController {
|
|||||||
return GlobalResultGenerator.genSuccessResult(map);
|
return GlobalResultGenerator.genSuccessResult(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/article/{id}")
|
@GetMapping("/article/{id}")
|
||||||
public GlobalResult<Map<String, Object>> detail(@PathVariable Integer id){
|
public GlobalResult<Map<String, Object>> detail(@PathVariable Integer id){
|
||||||
ArticleDTO articleDTO = articleService.findArticleDTOById(id,1);
|
ArticleDTO articleDTO = articleService.findArticleDTOById(id,1);
|
||||||
|
@ -35,7 +35,7 @@ public class TopicController {
|
|||||||
@GetMapping("/{name}")
|
@GetMapping("/{name}")
|
||||||
public GlobalResult articles(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows, @PathVariable String name){
|
public GlobalResult articles(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows, @PathVariable String name){
|
||||||
PageHelper.startPage(page, rows);
|
PageHelper.startPage(page, rows);
|
||||||
List<ArticleDTO> list = articleService.findArticlesByTopicName(name);
|
List<ArticleDTO> list = articleService.findArticlesByTopicUri(name);
|
||||||
PageInfo<ArticleDTO> pageInfo = new PageInfo(list);
|
PageInfo<ArticleDTO> pageInfo = new PageInfo(list);
|
||||||
Map map = Utils.getArticlesGlobalResult(pageInfo);
|
Map map = Utils.getArticlesGlobalResult(pageInfo);
|
||||||
return GlobalResultGenerator.genSuccessResult(map);
|
return GlobalResultGenerator.genSuccessResult(map);
|
||||||
|
@ -34,7 +34,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/{nickname}/articles")
|
@GetMapping("/{nickname}/articles")
|
||||||
public GlobalResult userArticles(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows, @PathVariable String nickname){
|
public GlobalResult userArticles(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "12") Integer rows, @PathVariable String nickname){
|
||||||
UserDTO userDTO = userService.findUserDTOByNickname(nickname);
|
UserDTO userDTO = userService.findUserDTOByNickname(nickname);
|
||||||
if (userDTO == null){
|
if (userDTO == null){
|
||||||
return GlobalResultGenerator.genErrorResult("用户不存在!");
|
return GlobalResultGenerator.genErrorResult("用户不存在!");
|
||||||
|
Loading…
Reference in New Issue
Block a user