Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public Result updateArticle(@RequestBody Article article) {
Result r = new Result();

if (null == article.getId()) {
r.setResultCode(ResultCode.USER_NOT_EXIST);
r.setResultCode(ResultCode.PARAM_IS_BLANK);
return r;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public Result updateCategory(@RequestBody Category category) {
Result r = new Result();

if (null == category.getId()) {
r.setResultCode(ResultCode.USER_NOT_EXIST);
r.setResultCode(ResultCode.PARAM_IS_BLANK);
return r;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public Result updateTag(@RequestBody Tag tag) {
Result r = new Result();

if (null == tag.getId()) {
r.setResultCode(ResultCode.USER_NOT_EXIST);
r.setResultCode(ResultCode.PARAM_IS_BLANK);
return r;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public Integer updateArticle(Article article) {
oldArticle.setCategory(article.getCategory());
oldArticle.setTags(article.getTags());

return oldArticle.getId();
return articleRepository.save(oldArticle).getId();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Integer updateCategory(Category category) {
oldCategory.setAvatar(category.getAvatar());
oldCategory.setDescription(category.getDescription());

return oldCategory.getId();
return categoryRepository.save(oldCategory).getId();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Integer updateTag(Tag tag) {
oldTag.setTagname(tag.getTagname());
oldTag.setAvatar(tag.getAvatar());

return oldTag.getId();
return tagRepository.save(oldTag).getId();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public Long updateUser(User user) {
User oldUser = userRepository.findOne(user.getId());
oldUser.setNickname(user.getNickname());

return oldUser.getId();
return userRepository.save(oldUser).getId();
}

@Override
Expand Down
Loading