Skip to content

Commit

Permalink
修改代码报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Aug 15, 2017
1 parent e9680ee commit 753ccce
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>cn.com.xiaoyaoji</groupId>
<artifactId>xiaoyaoji</artifactId>
<packaging>pom</packaging>
<version>2.0.1.2</version>
<version>2.0.15</version>
<description>小幺鸡,简单好用的在线文档管理工具</description>
<url>http://www.xiaoyaoji.cn</url>

Expand Down
2 changes: 1 addition & 1 deletion xiaoyaoji-biz/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>xiaoyaoji</artifactId>
<groupId>cn.com.xiaoyaoji</groupId>
<version>2.0.1.2</version>
<version>2.0.15</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import cn.com.xiaoyaoji.data.handler.StringResultHandler;
import cn.com.xiaoyaoji.integration.file.FileManager;
import cn.com.xiaoyaoji.util.JdbcUtils;
import cn.com.xiaoyaoji.utils.SqlUtils;
import cn.com.xiaoyaoji.util.SqlUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cn.com.xiaoyaoji.data.bean;


import cn.com.xiaoyaoji.utils.SqlUtils;
import cn.com.xiaoyaoji.util.SqlUtils;

/**
* @author: zhoujingjie
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
import org.apache.log4j.Logger;

import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import java.util.List;
import java.util.*;

/**
* @author: zhoujingjie
Expand Down Expand Up @@ -83,4 +82,39 @@ public List<Doc> searchDocs(String text, String projectId) {
public String getFirstDocId(String projectId) {
return DataFactory.instance().getFirstDocId(projectId);
}


/**
* 获取属性菜单的文档
* @param projectId 项目id
* @return docs
*/
public List<Doc> getProjectDocs(String projectId){
// 获取该项目下所有接口
List<Doc> docs = ResultUtils.list(ServiceFactory.instance().getDocsByProjectId(projectId));
return treeDocs(docs);
}

public List<Doc> getProjectDocs(String projectId, boolean full){
// 获取该项目下所有接口
List<Doc> docs = ResultUtils.list(ServiceFactory.instance().getDocsByProjectId(projectId, full));
return treeDocs(docs);
}

private List<Doc> treeDocs(List<Doc> docs ){
Map<String,List<Doc>> docMap = new LinkedHashMap<>();
//root
docMap.put("0",new ArrayList<Doc>());
//
for(Doc doc:docs){
docMap.put(doc.getId(),doc.getChildren());
}
for(Doc doc:docs){
List<Doc> temp = docMap.get(doc.getParentId());
if(temp!=null){
temp.add(doc);
}
}
return docMap.get("0");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@ public static ProjectService instance(){
* 获取属性菜单的文档
* @param projectId 项目id
* @return docs
* @see DocService#getProjectDocs(String)
*/
@Deprecated
public List<Doc> getProjectDocs(String projectId){
// 获取该项目下所有接口
List<Doc> docs = ResultUtils.list(ServiceFactory.instance().getDocsByProjectId(projectId));
return treeDocs(docs);
}

/**
* @see DocService#getProjectDocs(String, boolean)
* @param projectId
* @param full
* @return
*/
@Deprecated
public List<Doc> getProjectDocs(String projectId, boolean full){
// 获取该项目下所有接口
List<Doc> docs = ResultUtils.list(ServiceFactory.instance().getDocsByProjectId(projectId, full));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.com.xiaoyaoji.utils;
package cn.com.xiaoyaoji.util;


import cn.com.xiaoyaoji.core.annotations.Alias;
Expand Down
2 changes: 1 addition & 1 deletion xiaoyaoji-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>xiaoyaoji</artifactId>
<groupId>cn.com.xiaoyaoji</groupId>
<version>2.0.1.2</version>
<version>2.0.15</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,17 @@ public Object search(@RequestParam String text, @RequestParam("projectId") Strin
return new _HashMap<>()
.add("docs", docs);
}

@GetMapping("/list/{projectId}")
public Object getDocs(@PathVariable("projectId")String projectId,User user){
ServiceTool.checkUserHasAccessPermission(projectId,user);
return DocService.instance().getProjectDocs(projectId);
}

@PostMapping("/copy")
public Object copy(@RequestParam("projectId")String projectId,
@RequestParam("formId")String fromId,
@RequestParam("toId") String toId){
return null;
}
}
47 changes: 43 additions & 4 deletions xiaoyaoji-web/src/main/webapp/WEB-INF/content/doc/doc-left.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@
</li>
</c:if>--%>
<li class="line" v-if="menu.isFolder"></li>
<%--<li>
<li>
<div class="dl-menu-name">移动</div>
</li>--%>
<%--<li>
</li>
<li>
<div class="dl-menu-name">复制</div>
</li>--%>
</li>
<li v-on:click="updateName($event)" uk-toggle="target: #docCreateModal">
<div class="dl-menu-name">重命名</div>
</li>
Expand All @@ -141,6 +141,45 @@
</div>
</div>

<div id="docCopyModal" v-cloak uk-modal>
<div class="uk-modal-dialog">
<button class="uk-modal-close-default" type="button" uk-close></button>

<div class="uk-modal-header">
<h2 class="uk-modal-title">复制文档</h2>
</div>

<div class="uk-modal-body" uk-overflow-auto>
<div class="uk-form-stacked">
<div class="uk-margin">
<label class="uk-form-label" for="form-stacked-select">选择项目</label>
<div class="uk-form-controls">
<select class="uk-select" id="form-stacked-select">
<option>Option 01</option>
<option>Option 02</option>
</select>
</div>
</div>
<div class="uk-margin">
<label class="uk-form-label" for="form-stacked-select">选择分类</label>
<div class="uk-form-controls">
<ul>
<li></li>
</ul>
</div>
</div>
</div>
</div>

<div class="uk-modal-footer uk-text-right">
<button class="uk-button uk-button-default uk-modal-close" type="button">Cancel</button>
<button class="uk-button uk-button-primary" type="button">Save</button>
</div>

</div>
</div>


<div class="dl-placehoder" v-cloak>
本文档由<a href="http://www.xiaoyaoji.com.cn" target="_blank">小幺鸡</a>编辑
</div>
Expand Down

0 comments on commit 753ccce

Please sign in to comment.