wiki文档优化,增加不可编辑实现

This commit is contained in:
暮光:城中城
2019-03-09 22:23:30 +08:00
parent 840f6b457b
commit 5ca5feb9e8
15 changed files with 102 additions and 33 deletions

View File

@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* 文档控制器
@@ -94,6 +95,10 @@ public class WikiPageController {
Long id = wikiPage.getId();
if (id != null && id > 0) {
WikiPage wikiPageSel = wikiPageService.getById(id);
if (wikiPageSel == null || Objects.equals(wikiPageSel.getEditType(), 1)) {
return DocResponseJson.warn("当前页面不允许编辑!");
}
wikiPage.setUpdateTime(new Date());
wikiPage.setUpdateUserId(currentUser.getUserId());
wikiPage.setUpdateUserName(currentUser.getUsername());

View File

@@ -53,6 +53,10 @@ public class WikiSpaceController {
public ResponseJson<WikiSpace> update(WikiSpace wikiSpace) {
Long id = wikiSpace.getId();
if (id != null && id > 0) {
WikiSpace wikiSpaceSel = wikiSpaceService.getById(id);
if (Objects.equals(wikiSpaceSel.getEditType(), 1)) {
return DocResponseJson.warn("当前空间不允许编辑!");
}
wikiSpaceService.updateById(wikiSpace);
} else {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();