From 2fa257d8155d9babfdf7f5d2578b4bce95ddd9fa Mon Sep 17 00:00:00 2001 From: JevonsAn Date: Tue, 22 Nov 2016 22:54:57 +0800 Subject: [PATCH 01/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=9E=B6=E6=9E=84=EF=BC=8C=E5=90=8C=E6=97=B6=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml | 172 ---------------- .../30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml | 185 +++++++++++++++++ .../3ac11ac6-9623-45ae-9aee-51395197a1ca.xml | 188 ------------------ src/dao/PaperDao.java | 3 +- src/dao/UserDao.java | 37 +--- 5 files changed, 197 insertions(+), 388 deletions(-) delete mode 100644 .idea/dataSources/28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml create mode 100644 .idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml delete mode 100644 .idea/dataSources/3ac11ac6-9623-45ae-9aee-51395197a1ca.xml diff --git a/.idea/dataSources/28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml b/.idea/dataSources/28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml deleted file mode 100644 index f5c61a6..0000000 --- a/.idea/dataSources/28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - 1 - - - - - - - - - -
-
-
-
-
-
- - 1 - varchar(100)|0 - - - 1 - int(11)|0 - 1 - - - 1 - varchar(1000)|0 - - - date|0 - - - 1 - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(10000)|0 - - - 1 - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - id - - 1 - - - id - 1 - - - id - paper_id_uindex - - - 1 - int(11)|0 - 1 - - - 1 - varchar(100)|0 - - - 1 - varchar(20)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(1000)|0 - - - varchar(300)|0 - - - varchar(100)|0 - - - id - - 1 - - - username - - 1 - - - id - 1 - - - id - user_id_uindex - - - username - user_username_uindex - - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - \ No newline at end of file diff --git a/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml b/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml new file mode 100644 index 0000000..c8c008c --- /dev/null +++ b/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml @@ -0,0 +1,185 @@ + + + + + 1 + + + + + + + + + +
+
+
+ + 1 + varchar(100)|0 + + + 1 + int(11)|0 + 1 + + + 1 + varchar(1000)|0 + + + date|0 + + + 1 + varchar(100)|0 + + + varchar(100)|0 + + + varchar(100)|0 + + + varchar(10000)|0 + + + 1 + varchar(100)|0 + + + varchar(100)|0 + + + varchar(100)|0 + + + id + + 1 + + + id + 1 + + + id + paper_id_uindex + + + 1 + int(11)|0 + 1 + + + 1 + varchar(100)|0 + + + 1 + varchar(20)|0 + + + varchar(100)|0 + + + varchar(100)|0 + + + varchar(100)|0 + + + varchar(1000)|0 + + + varchar(300)|0 + + + varchar(100)|0 + + + id + + 1 + + + username + + 1 + + + id + 1 + + + id + user_id_uindex + + + username + user_username_uindex + + + 1 + int(11)|0 + 1 + + + 1 + int(11)|0 + + + 1 + int(11)|0 + + + 1 + int(11)|0 + '0' + + + varchar(1000)|0 + + + int(11)|0 + '0' + + + int(11)|0 + + + id + + 1 + + + paper_id + + + + user_id + + + + id + 1 + + + id + user_paper_tree_id_uindex + + + user_id + ~.user.PRIMARY + update + delete + + + paper_id + ~.paper.paper_id_uindex + update + delete + + + \ No newline at end of file diff --git a/.idea/dataSources/3ac11ac6-9623-45ae-9aee-51395197a1ca.xml b/.idea/dataSources/3ac11ac6-9623-45ae-9aee-51395197a1ca.xml deleted file mode 100644 index ce338d1..0000000 --- a/.idea/dataSources/3ac11ac6-9623-45ae-9aee-51395197a1ca.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - 1 - - - - -
-
-
-
-
-
-
-
-
- - 1 - varchar(100)|0 - - - 1 - int(11)|0 - 1 - - - 1 - varchar(1000)|0 - - - date|0 - - - 1 - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(10000)|0 - - - 1 - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - id - - 1 - - - id - 1 - - - id - paper_id_uindex - - - 1 - int(11)|0 - 1 - - - 1 - varchar(100)|0 - - - 1 - varchar(20)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(1000)|0 - - - varchar(300)|0 - - - varchar(100)|0 - - - id - - 1 - - - username - - 1 - - - id - 1 - - - id - user_id_uindex - - - username - user_username_uindex - - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - \ No newline at end of file diff --git a/src/dao/PaperDao.java b/src/dao/PaperDao.java index 17a7562..0ff78a6 100644 --- a/src/dao/PaperDao.java +++ b/src/dao/PaperDao.java @@ -21,8 +21,7 @@ public Statement newDao() try { Class.forName("com.mysql.jdbc.Driver"); - //conn = DriverManager.getConnection("jdbc:mysql://123.207.154.130:3306/papermanage", "root", "coding"); - conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/papermanage", "root", "19951224"); + conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/papermanage", "root", "coding"); stmt = conn.createStatement(); return stmt; } diff --git a/src/dao/UserDao.java b/src/dao/UserDao.java index e53ada1..a31784d 100644 --- a/src/dao/UserDao.java +++ b/src/dao/UserDao.java @@ -23,8 +23,7 @@ public Statement newDao() try { Class.forName("com.mysql.jdbc.Driver"); - //conn = DriverManager.getConnection("jdbc:mysql://123.207.154.130:3306/papermanage", "root", "coding"); - conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/papermanage", "root", "19951224"); + conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/papermanage", "root", "coding"); stmt = conn.createStatement(); return stmt; } @@ -159,17 +158,6 @@ public int insertNewUser(String username, String password) try { int m = stmt.executeUpdate(sql); - if (m != 0) - { - sql = "select id from user where username='" + username + "';"; - rs = stmt.executeQuery(sql); - if (rs.next()) - { - int id = rs.getInt(1); - String sql1 = "CREATE TABLE user_" + id + " (paper_id int(10) NOT NULL,state int(10) NOT NULL DEFAULT '0',treehead int(10),UNIQUE KEY `user_1_paper_id_uindex` (`paper_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; - stmt.executeUpdate(sql1); - } - } return m; } catch (SQLException e) @@ -193,23 +181,20 @@ public int insertNewUser(String username, String password) public int updatePaperState(int user_id, int paper_id, int state) { stmt = newDao(); - String sql0 = "SELECT table_name FROM information_schema.TABLES WHERE table_name ='user_" + user_id + "';"; ResultSet rs=null; try { - rs = stmt.executeQuery(sql0); - if (!rs.next()) + String sql0="Select id from user_paper_tree where user_id="+user_id+" and paper_id="+paper_id+" ;"; + rs=stmt.executeQuery(sql0); + int id=0; + String sql2=""; + if (rs.next()) { - String sql1 = "CREATE TABLE user_" + user_id + " (paper_id int(10) NOT NULL,state int(10) NOT NULL DEFAULT '0',treehead int(10),UNIQUE KEY `user_1_paper_id_uindex` (`paper_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; - stmt.executeUpdate(sql1); - } - ResultSet rs2=stmt.executeQuery("SELECT * FROM user_" + user_id + " WHERE paper_id="+paper_id+";"); - String sql2; - if (rs2.next()){ - sql2="UPDATE user_" + user_id + " SET state="+state+" WHERE paper_id="+paper_id+";"; + id=rs.getInt(1); + sql2="UPDATE user_paper_tree SET state="+state+" WHERE id="+id+";"; } else { - sql2 = "INSERT INTO user_" + user_id + "(paper_id, state) VALUES ('" + paper_id + "','" + state + "');"; + sql2 = "INSERT INTO user_paper_tree (user_id, paper_id, state) VALUES ('"+user_id+ "','" + paper_id + "','" + state + "');"; } return stmt.executeUpdate(sql2); } @@ -233,7 +218,7 @@ public int updatePaperState(int user_id, int paper_id, int state) public Collection getPaperidByState(int user_id, int state) { stmt = newDao(); - String sql2 = "select paper_id from user_" + user_id + " WHERE state=" + state + ";"; + String sql2 = "select paper_id from user_paper_tree where user_id="+user_id+" and state=" + state + ";"; ResultSet rs4=null; try { @@ -263,7 +248,7 @@ public Collection getPaperidByState(int user_id, int state) } public int getPaperState(int user_id, int paper_id){ - String sql = "select state from user_" + user_id + " WHERE paper_id=" + paper_id + ";"; + String sql = "select state from user_paper_tree where user_id="+user_id+" and paper_id="+paper_id+" ;"; ResultSet rs=null; try { From 7d48e9a652bb2db0037eb92f1ba5a40d0090f66e Mon Sep 17 00:00:00 2001 From: JevonsAn Date: Wed, 23 Nov 2016 22:51:20 +0800 Subject: [PATCH 02/30] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=BB=BA=E6=A0=91?= =?UTF-8?q?=E7=9A=84=E9=83=A8=E5=88=86=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml | 143 ++++++++++++------ src/dao/UserDao.java | 21 +++ src/service/Service.java | 4 + src/struts.xml | 3 + src/web/action/AddTreeLabel.java | 70 +++++++++ web/usertree.jsp | 23 +++ 6 files changed, 220 insertions(+), 44 deletions(-) create mode 100644 src/web/action/AddTreeLabel.java create mode 100644 web/usertree.jsp diff --git a/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml b/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml index c8c008c..c7a80f8 100644 --- a/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml +++ b/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml @@ -14,168 +14,223 @@
-
- +
+
+
+ 1 varchar(100)|0 - + 1 int(11)|0 1 - + 1 varchar(1000)|0 - + date|0 - + 1 varchar(100)|0 - + varchar(100)|0 - + varchar(100)|0 - + varchar(10000)|0 - + 1 varchar(100)|0 - + varchar(100)|0 - + varchar(100)|0 - + id 1 - + id 1 - + id paper_id_uindex - + 1 int(11)|0 1 - + 1 varchar(100)|0 - + 1 varchar(20)|0 - + varchar(100)|0 - + varchar(100)|0 - + varchar(100)|0 - + varchar(1000)|0 - + varchar(300)|0 - + varchar(100)|0 - + id 1 - + username 1 - + id 1 - + id user_id_uindex - + username user_username_uindex - + 1 int(11)|0 1 - + 1 int(11)|0 - + 1 int(11)|0 - + + 1 + varchar(45)|0 + + + longtext|0 + + + 1 + datetime|0 + + + id + 1 + + 1 int(11)|0 - '0' + 1 - + + 1 + int(11)|0 + + + 1 varchar(1000)|0 - + + int(11)|0 + + + int(11)|0 + + + id + + 1 + + + id + 1 + + + id + user_tree_id_uindex + + + 1 + int(11)|0 + 1 + + + 1 + int(11)|0 + + + 1 + int(11)|0 + + + 1 int(11)|0 '0' - + int(11)|0 - + id 1 - + paper_id - + user_id - + id 1 - + id user_paper_tree_id_uindex - + user_id ~.user.PRIMARY update delete - + paper_id ~.paper.paper_id_uindex update diff --git a/src/dao/UserDao.java b/src/dao/UserDao.java index a31784d..ce536cc 100644 --- a/src/dao/UserDao.java +++ b/src/dao/UserDao.java @@ -276,4 +276,25 @@ public int getPaperState(int user_id, int paper_id){ closeDao(); } } + + public int addTreeLabel(String labelname,String label_father,int user_id){ + String sql = "insert into user_tree(user_id,labelname,label_father) values('" + user_id + "','" + labelname + "','" + label_father +"');"; + try + { + stmt = newDao(); + int m = stmt.executeUpdate(sql); + if (!(m <= 0)) + return m; + else + return 0; + } + catch (SQLException e) + { + e.printStackTrace(); + return -1; + } + finally { + closeDao(); + } + } } diff --git a/src/service/Service.java b/src/service/Service.java index 7448553..bf0e576 100644 --- a/src/service/Service.java +++ b/src/service/Service.java @@ -87,4 +87,8 @@ public int addPaper(String title, Collection authors, String fileURI, Co public int getPaperState(int user_id, int paper_id){ return userDao.getPaperState(user_id,paper_id); } + + public int addTreeLabel(String labelname,String label_father,int user_id){ + return userDao.addTreeLabel(labelname,label_father,user_id); + } } diff --git a/src/struts.xml b/src/struts.xml index bfe3b7c..7bf4c22 100644 --- a/src/struts.xml +++ b/src/struts.xml @@ -37,5 +37,8 @@ showPaperState + + showPaperState + \ No newline at end of file diff --git a/src/web/action/AddTreeLabel.java b/src/web/action/AddTreeLabel.java new file mode 100644 index 0000000..bc11b50 --- /dev/null +++ b/src/web/action/AddTreeLabel.java @@ -0,0 +1,70 @@ +package web.action; +import com.opensymphony.xwork2.ActionSupport; +import model.User; +import org.apache.struts2.ServletActionContext; +import service.Service; + +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; + +public class AddTreeLabel extends ActionSupport{ + private String labelname; + //private int user_id; + private String label_father; + + private Service service; + + public AddTreeLabel() + { + super(); + service = new Service(); + } + + @Override + public String execute() throws Exception + { + if(labelname!=null) + { + Object obj = ServletActionContext.getRequest().getSession().getAttribute("user"); + if(obj == null) + return ERROR; + //else + int uid = ((User) obj).getId(); + int stat = service.addTreeLabel(labelname,label_father,uid); + if(stat > 0) + return SUCCESS; + else + return ERROR; + } + else + return ERROR; + } + + public String getLabelname() { + return labelname; + } + + public void setLabelname(String labelname) { + this.labelname = labelname; + } + + /*public int getUser_id() { + return user_id; + } + + public void setUser_id(int user_id) { + this.user_id = user_id; + }*/ + + public String getLabel_father() { + return label_father; + } + + public void setLabel_father(String label_father) { + this.label_father = label_father; + } +} + + diff --git a/web/usertree.jsp b/web/usertree.jsp new file mode 100644 index 0000000..ef519ba --- /dev/null +++ b/web/usertree.jsp @@ -0,0 +1,23 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> +<%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %> +<% Boolean useDatatable = false;%> +<%@ include file="includes/header.jsp" %> + + + 用户研究树 + + +
+

添加论文

+ + + + +
+ + + + +<%@ include file="includes/footer.jsp" %> \ No newline at end of file From d47a751c6227d1a49d817bdfcdff2814d29f38a7 Mon Sep 17 00:00:00 2001 From: JevonsAn Date: Sat, 26 Nov 2016 20:29:06 +0800 Subject: [PATCH 03/30] =?UTF-8?q?=E6=A0=91=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E6=88=90=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml | 477 ++++++++++-------- .../storage.xml | 2 + .idea/misc.xml | 18 +- src/dao/UserDao.java | 37 ++ src/model/Tree.java | 34 ++ src/service/Service.java | 26 + src/struts.xml | 5 +- src/web/action/ShowUserTree.java | 54 ++ web/showusertree.jsp | 20 + web/usertree.jsp | 9 +- 10 files changed, 440 insertions(+), 242 deletions(-) create mode 100644 .idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae/storage.xml create mode 100644 src/model/Tree.java create mode 100644 src/web/action/ShowUserTree.java create mode 100644 web/showusertree.jsp diff --git a/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml b/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml index c7a80f8..2a6857c 100644 --- a/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml +++ b/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml @@ -1,240 +1,277 @@ - - - 1 + + + + 1 + 1 - - - - - - - - -
-
-
-
-
- - 1 - varchar(100)|0 - - - 1 - int(11)|0 - 1 - - - 1 - varchar(1000)|0 - - - date|0 - - - 1 - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(10000)|0 - - - 1 - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - id - - 1 + + + + + + + + +
+
+
+
+
+ + 1 + int(11)|0 + 1 + 1 + + + 2 + int(11)|0 + 1 + + + 3 + int(11)|0 + 1 + + + 4 + varchar(45)|0 + 1 + + + 5 + longtext|0 + + + 6 + datetime|0 + 1 + + + id + 1 + + + 1 + varchar(100)|0 + 1 + + + 2 + int(11)|0 + 1 + 1 + + + 3 + varchar(1000)|0 + 1 + + + 4 + date|0 + + + 5 + varchar(100)|0 + 1 + + + 6 + varchar(100)|0 + + + 7 + varchar(100)|0 + + + 8 + varchar(10000)|0 + + + 9 + varchar(100)|0 + 1 + + + 10 + varchar(100)|0 + + + 11 + varchar(100)|0 + + + id + 1 - - id - 1 + + id + 1 - - id - paper_id_uindex + + id + paper_id_uindex - - 1 - int(11)|0 - 1 - - - 1 - varchar(100)|0 - - - 1 - varchar(20)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(1000)|0 - - - varchar(300)|0 - - - varchar(100)|0 - - - id - - 1 + + 1 + int(11)|0 + 1 + 1 + + + 2 + varchar(100)|0 + 1 + + + 3 + varchar(20)|0 + 1 + + + 4 + varchar(100)|0 + + + 5 + varchar(100)|0 + + + 6 + varchar(100)|0 + + + 7 + varchar(1000)|0 + + + 8 + varchar(300)|0 + + + 9 + varchar(100)|0 + + + id + 1 - - username - - 1 + + username + 1 - - id - 1 - - - id - user_id_uindex - - - username - user_username_uindex - - - 1 - int(11)|0 - 1 - - - 1 - int(11)|0 - - - 1 - int(11)|0 - - - 1 - varchar(45)|0 - - - longtext|0 - - - 1 - datetime|0 - - - id - 1 + + id + 1 - - 1 - int(11)|0 - 1 - - - 1 - int(11)|0 - - - 1 - varchar(1000)|0 - - - int(11)|0 - - - int(11)|0 - - - id - - 1 - - - id - 1 + + id + user_id_uindex - - id - user_tree_id_uindex + + username + user_username_uindex - - 1 - int(11)|0 - 1 - - - 1 - int(11)|0 - - - 1 - int(11)|0 - - - 1 - int(11)|0 - '0' - - - int(11)|0 - - - id - - 1 + + 1 + int(11)|0 + 1 + 1 + + + 2 + int(11)|0 + 1 + + + 3 + int(11)|0 + 1 + + + 4 + int(11)|0 + 1 + '0' + + + 5 + varchar(1000)|0 + + + id + 1 - - paper_id - + + paper_id - - user_id - + + user_id - - id - 1 + + id + 1 - - id - user_paper_tree_id_uindex + + id + user_paper_tree_id_uindex - - user_id - ~.user.PRIMARY - update - delete + + user_id + papermanage + user + PRIMARY + id + update + delete - - paper_id - ~.paper.paper_id_uindex - update - delete + + paper_id + papermanage + paper + paper_id_uindex + id + update + delete + + 1 + int(11)|0 + 1 + 1 + + + 2 + int(11)|0 + 1 + + + 3 + varchar(1000)|0 + 1 + + + 4 + int(11)|0 + + + 5 + varchar(1000)|0 + + + id + 1 + + + id + 1 + + + id + user_tree_id_uindex + \ No newline at end of file diff --git a/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae/storage.xml b/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae/storage.xml new file mode 100644 index 0000000..df5f60e --- /dev/null +++ b/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae/storage.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 237ef4c..fad080b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -7,23 +7,7 @@ - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/src/dao/UserDao.java b/src/dao/UserDao.java index ce536cc..39d7a36 100644 --- a/src/dao/UserDao.java +++ b/src/dao/UserDao.java @@ -1,5 +1,7 @@ package dao; +import model.Tree; import model.User; +import model.Paper; import java.sql.*; import java.util.Collection; @@ -297,4 +299,39 @@ public int addTreeLabel(String labelname,String label_father,int user_id){ closeDao(); } } + + public Collection getChildTree(int user_id, String label_father){ + //Tree tree=new Tree(); + String sql="select * from user_tree where user_id="+user_id+" and label_father="+label_father+" ;"; + Collection trees=new LinkedList<>(); + if (stmt!=null) + stmt=newDao(); + try { + ResultSet rs=stmt.executeQuery(sql); + while(rs.next()){ + Tree tree1=new Tree(); + tree1.setLabelname(rs.getString("labelname")); + trees.add(tree1); + } + } catch (SQLException e) { + e.printStackTrace(); + } + return trees; + } + + public Collection getTreePapers(String labelname, int user_id){ + String sql="select paperid from user_paper_tree where user_id="+user_id+" and labelname="+labelname+" ;"; + Collection papers=new LinkedList<>(); + if (stmt!=null) + stmt=newDao(); + try { + ResultSet rs=stmt.executeQuery(sql); + while(rs.next()){ + papers.add(rs.getInt(1)); + } + } catch (SQLException e) { + e.printStackTrace(); + } + return papers; + } } diff --git a/src/model/Tree.java b/src/model/Tree.java new file mode 100644 index 0000000..180dd00 --- /dev/null +++ b/src/model/Tree.java @@ -0,0 +1,34 @@ +package model; +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; + +public class Tree { + private Collection childTree; + private String labelname; + private Collection papers; + + public Collection getChildTree() { + return childTree; + } + + public void setChildTree(Collection childTree) { + this.childTree = childTree; + } + + public String getLabelname() { + return labelname; + } + + public void setLabelname(String labelname) { + this.labelname = labelname; + } + + public Collection getPapers() { + return papers; + } + + public void setPapers(Collection papers) { + this.papers = papers; + } +} diff --git a/src/service/Service.java b/src/service/Service.java index bf0e576..ff2de9c 100644 --- a/src/service/Service.java +++ b/src/service/Service.java @@ -3,6 +3,7 @@ import dao.PaperDao; import dao.UserDao; import model.Paper; +import model.Tree; import model.User; import java.util.Collection; @@ -91,4 +92,29 @@ public int getPaperState(int user_id, int paper_id){ public int addTreeLabel(String labelname,String label_father,int user_id){ return userDao.addTreeLabel(labelname,label_father,user_id); } + + public Tree getUserTree(int user_id){ + Tree tree=new Tree(); + tree.setChildTree(getTree(user_id,"空")); + return tree; + } + + public Collection getTree(int user_id, String labelname){ + Collection trees = userDao.getChildTree(user_id,labelname); + if (trees==null) + return null; + else{ + for (Tree tree : trees) { + tree.setChildTree(getTree(user_id,tree.getLabelname())); + Collection paperids=userDao.getTreePapers(tree.getLabelname(),user_id); + Collection papers=new LinkedList<>(); + for (Integer paperid : paperids) { + Paper paper=getPaperById(paperid); + papers.add(paper); + } + tree.setPapers(papers); + } + } + return trees; + } } diff --git a/src/struts.xml b/src/struts.xml index 7bf4c22..c593460 100644 --- a/src/struts.xml +++ b/src/struts.xml @@ -38,7 +38,10 @@ showPaperState - showPaperState + usertree.jsp + + + showusertree.jsp \ No newline at end of file diff --git a/src/web/action/ShowUserTree.java b/src/web/action/ShowUserTree.java new file mode 100644 index 0000000..8b8fee1 --- /dev/null +++ b/src/web/action/ShowUserTree.java @@ -0,0 +1,54 @@ +package web.action; +import com.opensymphony.xwork2.ActionSupport; +import model.Tree; +import model.User; +import org.apache.struts2.ServletActionContext; +import service.Service; + +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; +public class ShowUserTree extends ActionSupport{ + private Tree tree; + private Service service; + private int user_id; + //private String + + public ShowUserTree() + { + super(); + service = new Service(); + tree=null; + } + + @Override + public String execute() throws Exception + { + Object obj = ServletActionContext.getRequest().getSession().getAttribute("user"); + if(obj == null) + return ERROR; + int uid = ((User) obj).getId(); + tree = service.getUserTree(uid); + if(tree != null) + return SUCCESS; + else + return ERROR; + } + public Tree getTree() { + + return tree; + } + + public void setTree(Tree tree) { + this.tree = tree; + } + + public int getUser_id() { + return user_id; + } + + public void setUser_id(int user_id) { + this.user_id = user_id; + } +} diff --git a/web/showusertree.jsp b/web/showusertree.jsp new file mode 100644 index 0000000..34d8edb --- /dev/null +++ b/web/showusertree.jsp @@ -0,0 +1,20 @@ +<%@ page import="model.Tree" %><%-- + Created by IntelliJ IDEA. + User: Jevons + Date: 2016/11/24 + Time: 21:22 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + 我的研究树 + + + <% + Tree tree= + + %> + + + diff --git a/web/usertree.jsp b/web/usertree.jsp index ef519ba..6aca233 100644 --- a/web/usertree.jsp +++ b/web/usertree.jsp @@ -3,16 +3,17 @@ <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> <%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %> <% Boolean useDatatable = false;%> -<%@ include file="includes/header.jsp" %> +<%--@ include file="includes/header.jsp" --%> 用户研究树
-

添加论文

+

添加新的标签

- + +
@@ -20,4 +21,4 @@ -<%@ include file="includes/footer.jsp" %> \ No newline at end of file +<%--@ include file="includes/footer.jsp" --%> \ No newline at end of file From 65265bfc6b530a637ece32285c49031464d21935 Mon Sep 17 00:00:00 2001 From: JevonsAn Date: Sun, 27 Nov 2016 03:16:01 +0800 Subject: [PATCH 04/30] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=A0=91=E7=9A=84=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml | 122 +++++++++--------- src/model/Tree.java | 10 ++ web/showusertree.jsp | 34 +++-- 3 files changed, 98 insertions(+), 68 deletions(-) diff --git a/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml b/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml index 2a6857c..24cc31b 100644 --- a/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml +++ b/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml @@ -14,212 +14,213 @@ -
-
-
-
-
- + +
+
+
+
+
+ 1 int(11)|0 1 1 - + 2 int(11)|0 1 - + 3 int(11)|0 1 - + 4 varchar(45)|0 1 - + 5 longtext|0 - + 6 datetime|0 1 - + id 1 - + 1 varchar(100)|0 1 - + 2 int(11)|0 1 1 - + 3 varchar(1000)|0 1 - + 4 date|0 - + 5 varchar(100)|0 1 - + 6 varchar(100)|0 - + 7 varchar(100)|0 - + 8 varchar(10000)|0 - + 9 varchar(100)|0 1 - + 10 varchar(100)|0 - + 11 varchar(100)|0 - + id 1 - + id 1 - + id paper_id_uindex - + 1 int(11)|0 1 1 - + 2 varchar(100)|0 1 - + 3 varchar(20)|0 1 - + 4 varchar(100)|0 - + 5 varchar(100)|0 - + 6 varchar(100)|0 - + 7 varchar(1000)|0 - + 8 varchar(300)|0 - + 9 varchar(100)|0 - + id 1 - + username 1 - + id 1 - + id user_id_uindex - + username user_username_uindex - + 1 int(11)|0 1 1 - + 2 int(11)|0 1 - + 3 int(11)|0 1 - + 4 int(11)|0 1 '0' - + 5 varchar(1000)|0 - + id 1 - + paper_id - + user_id - + id 1 - + id user_paper_tree_id_uindex - + user_id papermanage user @@ -228,7 +229,7 @@ update delete - + paper_id papermanage paper @@ -237,39 +238,40 @@ update delete - + 1 int(11)|0 1 1 - + 2 int(11)|0 1 - + 3 varchar(1000)|0 1 - + 4 int(11)|0 - + 5 varchar(1000)|0 + 'null' - + id 1 - + id 1 - + id user_tree_id_uindex diff --git a/src/model/Tree.java b/src/model/Tree.java index 180dd00..c33726f 100644 --- a/src/model/Tree.java +++ b/src/model/Tree.java @@ -8,6 +8,8 @@ public class Tree { private String labelname; private Collection papers; + private int depth; + public Collection getChildTree() { return childTree; } @@ -31,4 +33,12 @@ public Collection getPapers() { public void setPapers(Collection papers) { this.papers = papers; } + + public int getDepth() { + return depth; + } + + public void setDepth(int depth) { + this.depth = depth; + } } diff --git a/web/showusertree.jsp b/web/showusertree.jsp index 34d8edb..6496c69 100644 --- a/web/showusertree.jsp +++ b/web/showusertree.jsp @@ -1,18 +1,36 @@ -<%@ page import="model.Tree" %><%-- - Created by IntelliJ IDEA. - User: Jevons - Date: 2016/11/24 - Time: 21:22 - To change this template use File | Settings | File Templates. ---%> +<%@ page import="service.Service" %> +<%@ page import="model.Tree" %> +<%@ page import="org.apache.struts2.ServletActionContext" %> +<%@ page import="model.User" %> +<%@ page import="java.util.Collection" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> 我的研究树 + <%! String s=""; %> + <%! + void printtree(Tree tree){ + if (tree!=null){ + s+=(tree.getLabelname()); + s+='\n'; + Collection ctrees=tree.getChildTree(); + for (Tree ctree : ctrees) { + printtree(ctree); + } + } + } + %> <% - Tree tree= + Service service=new Service(); + Object obj = ServletActionContext.getRequest().getSession().getAttribute("user"); + int uid = ((User) obj).getId(); + Tree tree=service.getUserTree(uid); + + + for (int ) + %> From d21b021a265d219040469e04af18881d63175807 Mon Sep 17 00:00:00 2001 From: S-H-Y-GitHub <932495000@qq.com> Date: Wed, 30 Nov 2016 15:03:07 +0800 Subject: [PATCH 05/30] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml | 728 ++++++++++-------- .../3ac11ac6-9623-45ae-9aee-51395197a1ca.xml | 546 +++++++------ 2 files changed, 712 insertions(+), 562 deletions(-) diff --git a/.idea/dataSources/28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml b/.idea/dataSources/28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml index 4cc632c..3e140a3 100644 --- a/.idea/dataSources/28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml +++ b/.idea/dataSources/28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml @@ -1,337 +1,451 @@ - - - 1 + + + + 1 + 1 - - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
- - 1 - varchar(100)|0 - - - 1 - int(11)|0 - 1 - - - 1 - varchar(1000)|0 - - - date|0 - - - 1 - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(10000)|0 - - - 1 - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - id - - 1 + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+ + 1 + int(11)|0 + 1 + 1 + + + 2 + int(11)|0 + 1 + + + 3 + int(11)|0 + 1 + + + 4 + varchar(45)|0 + 1 + + + 5 + longtext|0 + + + 6 + datetime|0 + 1 + + + id + 1 + + + 1 + varchar(100)|0 + 1 + + + 2 + int(11)|0 + 1 + 1 + + + 3 + varchar(1000)|0 + 1 + + + 4 + date|0 + + + 5 + varchar(100)|0 + 1 + + + 6 + varchar(100)|0 + + + 7 + varchar(100)|0 + + + 8 + varchar(10000)|0 + + + 9 + varchar(100)|0 + 1 + + + 10 + varchar(100)|0 + + + 11 + varchar(100)|0 + + + id + 1 - - id - 1 + + id + 1 - - id - paper_id_uindex + + id + paper_id_uindex - - 1 - int(11)|0 - 1 - - - 1 - varchar(100)|0 - - - 1 - varchar(20)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(1000)|0 - - - varchar(300)|0 - - - varchar(100)|0 - - - id - - 1 + + 1 + int(11)|0 + 1 + 1 + + + 2 + varchar(100)|0 + 1 + + + 3 + varchar(20)|0 + 1 + + + 4 + varchar(100)|0 + + + 5 + varchar(100)|0 + + + 6 + varchar(100)|0 + + + 7 + varchar(1000)|0 + + + 8 + varchar(300)|0 + + + 9 + varchar(100)|0 + + + id + 1 - - username - - 1 + + username + 1 - - id - 1 + + id + 1 - - id - user_id_uindex + + id + user_id_uindex - - username - user_username_uindex + + username + user_username_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - 1 - int(11)|0 - 1 - - - 1 - int(11)|0 - - - 1 - int(11)|0 - - - 1 - varchar(45)|0 - - - longtext|0 - - - 1 - datetime|0 - - - id - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 + + + paper_id + user_1_paper_id_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + + + 2 + int(10)|0 + + + 3 + varchar(2000)|0 + + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(11)|0 + 1 + 1 + + + 2 + int(11)|0 + 1 + + + 3 + int(11)|0 + 1 + + + 4 + int(11)|0 + 1 + '0' + + + 5 + varchar(1000)|0 + + + 6 + int(11)|0 + '0' + + + 7 + int(11)|0 + + + id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + + + user_id + + + id + 1 + + + id + user_paper_tree_id_uindex + + user_id + papermanage + user + id + update + delete + + + paper_id + papermanage + paper + id + update + delete + \ No newline at end of file diff --git a/.idea/dataSources/3ac11ac6-9623-45ae-9aee-51395197a1ca.xml b/.idea/dataSources/3ac11ac6-9623-45ae-9aee-51395197a1ca.xml index 23dbfcc..e64071a 100644 --- a/.idea/dataSources/3ac11ac6-9623-45ae-9aee-51395197a1ca.xml +++ b/.idea/dataSources/3ac11ac6-9623-45ae-9aee-51395197a1ca.xml @@ -1,282 +1,318 @@ - - - 1 + + + + 1 + 1 - - - -
-
-
-
-
-
-
-
-
-
- - 1 - varchar(100)|0 - - - 1 - int(11)|0 - 1 - - - 1 - varchar(1000)|0 - - - date|0 - - - 1 - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(10000)|0 - - - 1 - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - id - - 1 + + + +
+
+
+
+
+
+
+
+
+
+ + 1 + varchar(100)|0 + 1 + + + 2 + int(11)|0 + 1 + 1 + + + 3 + varchar(1000)|0 + 1 + + + 4 + date|0 + + + 5 + varchar(100)|0 + 1 + + + 6 + varchar(100)|0 + + + 7 + varchar(100)|0 + + + 8 + varchar(10000)|0 + + + 9 + varchar(100)|0 + 1 + + + 10 + varchar(100)|0 + + + 11 + varchar(100)|0 + + + id + 1 - - id - 1 + + id + 1 - - id - paper_id_uindex + + id + paper_id_uindex - - 1 - int(11)|0 - 1 - - - 1 - varchar(100)|0 - - - 1 - varchar(20)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(100)|0 - - - varchar(1000)|0 - - - varchar(300)|0 - - - varchar(100)|0 - - - id - - 1 + + 1 + int(11)|0 + 1 + 1 + + + 2 + varchar(100)|0 + 1 + + + 3 + varchar(20)|0 + 1 + + + 4 + varchar(100)|0 + + + 5 + varchar(100)|0 + + + 6 + varchar(100)|0 + + + 7 + varchar(1000)|0 + + + 8 + varchar(300)|0 + + + 9 + varchar(100)|0 + + + id + 1 - - username - - 1 + + username + 1 - - id - 1 + + id + 1 - - id - user_id_uindex + + id + user_id_uindex - - username - user_username_uindex + + username + user_username_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex - - int(10)|0 - - - int(10)|0 - - - varchar(2000)|0 - - - 1 - int(10)|0 - - - 1 - int(10)|0 - '0' - - - int(10)|0 - - - paper_id - - 1 + + 1 + int(10)|0 + + + 2 + int(10)|0 + + + 3 + varchar(2000)|0 + + + 1 + int(10)|0 + 1 + + + 2 + int(10)|0 + 1 + '0' + + + 3 + int(10)|0 + + + paper_id + 1 - - paper_id - user_1_paper_id_uindex + + paper_id + user_1_paper_id_uindex \ No newline at end of file From 27f3d8bf167f76ea827762524a39c8dafeef0d02 Mon Sep 17 00:00:00 2001 From: S-H-Y-GitHub <932495000@qq.com> Date: Thu, 1 Dec 2016 13:41:58 +0800 Subject: [PATCH 06/30] =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=8A=A8=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dao/LogDao.java | 63 ++++++++++++++++++++++++++++++++++++++++++++ src/dao/UserDao.java | 6 ----- src/model/Log.java | 13 +-------- 3 files changed, 64 insertions(+), 18 deletions(-) create mode 100644 src/dao/LogDao.java diff --git a/src/dao/LogDao.java b/src/dao/LogDao.java new file mode 100644 index 0000000..104bc5d --- /dev/null +++ b/src/dao/LogDao.java @@ -0,0 +1,63 @@ +package dao; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; +public class LogDao +{ + private Statement stmt; + private Connection conn; + + public Statement newDao() + { + if (stmt!=null) + return stmt; + try + { + Class.forName("com.mysql.jdbc.Driver"); + conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/papermanage", "root", "coding"); + stmt = conn.createStatement(); + return stmt; + } + catch (SQLException e) + { + System.err.println("MySQL连接错误@dao.Dao"); + e.printStackTrace(); + return null; + } + catch (Exception e) + { + System.err.println("MySQL驱动程序错误@dao.Dao"); + e.printStackTrace(); + return null; + } + } + + public int closeDao() + { + try + { + if (stmt!=null) + stmt.close(); + if (conn!=null) + conn.close(); + stmt=null; + conn=null; + return 1; + } + catch (SQLException e) + { + System.err.println("MySQL连接错误@dao.Dao.closeDao"); + e.printStackTrace(); + return -1; + } + catch (Exception e) + { + System.err.println("MySQL驱动程序错误@dao.Dao.closeDao"); + e.printStackTrace(); + return -2; + } + } + +} diff --git a/src/dao/UserDao.java b/src/dao/UserDao.java index a31784d..89cc220 100644 --- a/src/dao/UserDao.java +++ b/src/dao/UserDao.java @@ -9,12 +9,6 @@ public class UserDao { private Statement stmt; private Connection conn; - /** - * 构造方法,进行数据库的连接 - */ - public UserDao() { } - - protected void finalize(){ } public Statement newDao() { diff --git a/src/model/Log.java b/src/model/Log.java index 9ab2951..c3ce475 100644 --- a/src/model/Log.java +++ b/src/model/Log.java @@ -15,10 +15,7 @@ public class Log implements Serializable public static final int ADD = 1; public static final int DELETE = 2; public static final int EDIT = 3; - /** - * 操作对象的ID - */ - private int id; + private Date time; private Boolean isPrivate; private int target; @@ -26,14 +23,6 @@ public class Log implements Serializable private int operator; - public int getId() - { - return id; - } - public void setId(int id) - { - this.id = id; - } public Date getTime() { return time; From 951eb3aa765654fb9d93fa4dc4f7f5138ea55de7 Mon Sep 17 00:00:00 2001 From: S-H-Y-GitHub <932495000@qq.com> Date: Thu, 1 Dec 2016 16:51:19 +0800 Subject: [PATCH 07/30] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml | 251 ++++++++++-------- src/dao/LogDao.java | 48 +++- src/model/Log.java | 29 +- src/service/Service.java | 8 + src/struts.xml | 3 + src/web/action/ListLogs.java | 34 +++ web/logs.jsp | 8 + 7 files changed, 267 insertions(+), 114 deletions(-) create mode 100644 src/web/action/ListLogs.java create mode 100644 web/logs.jsp diff --git a/.idea/dataSources/28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml b/.idea/dataSources/28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml index 3e140a3..d6d4c0e 100644 --- a/.idea/dataSources/28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml +++ b/.idea/dataSources/28179e24-55d2-4f4f-ac0e-48af0bcb62a2.xml @@ -13,425 +13,466 @@ -
-
-
-
-
-
-
-
-
-
-
-
-
- +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + 1 + int(11)|0 + 1 + + + 2 + datetime|0 + + + 3 + int(11)|0 + + + 4 + int(11)|0 + + + 5 + int(11)|0 + + + 6 + int(11)|0 + + + operatorid + + + id + 1 + + + operatorid + papermanage + user + id + no-action + no-action + + 1 int(11)|0 1 1 - + 2 int(11)|0 1 - + 3 int(11)|0 1 - + 4 varchar(45)|0 1 - + 5 longtext|0 - + 6 datetime|0 1 - + id 1 - + 1 varchar(100)|0 1 - + 2 int(11)|0 1 1 - + 3 varchar(1000)|0 1 - + 4 date|0 - + 5 varchar(100)|0 1 - + 6 varchar(100)|0 - + 7 varchar(100)|0 - + 8 varchar(10000)|0 - + 9 varchar(100)|0 1 - + 10 varchar(100)|0 - + 11 varchar(100)|0 - + id 1 - + id 1 - + id paper_id_uindex - + 1 int(11)|0 1 1 - + 2 varchar(100)|0 1 - + 3 varchar(20)|0 1 - + 4 varchar(100)|0 - + 5 varchar(100)|0 - + 6 varchar(100)|0 - + 7 varchar(1000)|0 - + 8 varchar(300)|0 - + 9 varchar(100)|0 - + id 1 - + username 1 - + id 1 - + id user_id_uindex - + username user_username_uindex - + 1 int(10)|0 1 - + 2 int(10)|0 1 '0' - + 3 int(10)|0 - + paper_id 1 - + paper_id user_1_paper_id_uindex - + 1 int(10)|0 1 - + 2 int(10)|0 1 '0' - + 3 int(10)|0 - + paper_id 1 - + paper_id user_1_paper_id_uindex - + 1 int(10)|0 1 - + 2 int(10)|0 1 '0' - + 3 int(10)|0 - + paper_id 1 - + paper_id user_1_paper_id_uindex - + 1 int(10)|0 1 - + 2 int(10)|0 1 '0' - + 3 int(10)|0 - + paper_id 1 - + paper_id user_1_paper_id_uindex - + 1 int(10)|0 1 - + 2 int(10)|0 1 '0' - + 3 int(10)|0 - + paper_id 1 - + paper_id user_1_paper_id_uindex - + 1 int(10)|0 1 - + 2 int(10)|0 1 '0' - + 3 int(10)|0 - + paper_id 1 - + paper_id user_1_paper_id_uindex - + 1 int(10)|0 - + 2 int(10)|0 - + 3 varchar(2000)|0 - + 1 int(10)|0 1 - + 2 int(10)|0 1 '0' - + 3 int(10)|0 - + paper_id 1 - + paper_id user_1_paper_id_uindex - + 1 int(10)|0 1 - + 2 int(10)|0 1 '0' - + 3 int(10)|0 - + paper_id 1 - + paper_id user_1_paper_id_uindex - + 1 int(11)|0 1 1 - + 2 int(11)|0 1 - + 3 int(11)|0 1 - + 4 int(11)|0 1 '0' - + 5 varchar(1000)|0 - + 6 int(11)|0 '0' - + 7 int(11)|0 - + id 1 - + paper_id - + user_id - + id 1 - + id user_paper_tree_id_uindex - + user_id papermanage user @@ -439,7 +480,7 @@ update delete - + paper_id papermanage paper diff --git a/src/dao/LogDao.java b/src/dao/LogDao.java index 104bc5d..be1cf28 100644 --- a/src/dao/LogDao.java +++ b/src/dao/LogDao.java @@ -1,9 +1,10 @@ package dao; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.sql.Statement; +import model.Log; + +import java.sql.*; +import java.util.Collection; +import java.util.LinkedList; public class LogDao { private Statement stmt; @@ -59,5 +60,44 @@ public int closeDao() return -2; } } + public Collection getAllLogs() + { + Collection logs = new LinkedList<>(); + String sql = "select * from log;"; + stmt = newDao(); + ResultSet rs=null; + try + { + rs = stmt.executeQuery(sql); + Log log; + while (rs.next()) + { + log = new Log(); + log.setId(rs.getInt("id")); + log.setOperatorid(rs.getInt("operatorid")); + log.setTarget(rs.getInt("target")); + log.setTargetid(rs.getInt("targetid")); + log.setTime(rs.getDate("time")); + log.setType(rs.getInt("type")); + logs.add(log); + } + } + catch (SQLException e) + { + System.err.println("MySQL查询错误@dao.LogDao.getAllLogs"); + e.printStackTrace(); + return null; + } + finally { + if (rs!=null) + try { + rs.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + closeDao(); + } + return logs; + } } diff --git a/src/model/Log.java b/src/model/Log.java index c3ce475..6090ec5 100644 --- a/src/model/Log.java +++ b/src/model/Log.java @@ -8,6 +8,7 @@ public class Log implements Serializable public static final int PAPER = 1; public static final int NOTE = 2; public static final int USER = 3; + //对收藏的操作,这种操作定义为type=4|5|6,target=1 public static final int TOREAD = 4; public static final int READ = 5; public static final int STUDIED = 6; @@ -16,13 +17,23 @@ public class Log implements Serializable public static final int DELETE = 2; public static final int EDIT = 3; + private int id; private Date time; private Boolean isPrivate; private int target; + private int targetid; private int type; - private int operator; + private int operatorid; + public int getId() + { + return id; + } + public void setId(int id) + { + this.id = id; + } public Date getTime() { return time; @@ -55,12 +66,20 @@ public void setType(int type) { this.type = type; } - public int getOperator() + public int getOperatorid() + { + return operatorid; + } + public void setOperatorid(int operatorid) + { + this.operatorid = operatorid; + } + public int getTargetid() { - return operator; + return targetid; } - public void setOperator(int operator) + public void setTargetid(int targetid) { - this.operator = operator; + this.targetid = targetid; } } diff --git a/src/service/Service.java b/src/service/Service.java index 57b8349..0fc0327 100644 --- a/src/service/Service.java +++ b/src/service/Service.java @@ -1,7 +1,9 @@ package service; +import dao.LogDao; import dao.NoteDao; import dao.PaperDao; import dao.UserDao; +import model.Log; import model.Note; import model.Paper; import model.User; @@ -15,6 +17,7 @@ public class Service private UserDao userDao; private PaperDao paperDao; private NoteDao noteDao; + private LogDao logDao; public Service() { @@ -22,6 +25,7 @@ public Service() userDao = new UserDao(); paperDao = new PaperDao(); noteDao = new NoteDao(); + logDao = new LogDao(); } public int login(String username, String password) @@ -115,4 +119,8 @@ public Collection getNotesByPaper(int pid) { return noteDao.getNotesByPaper(pid); } + public Collection getAllLogs() + { + return logDao.getAllLogs(); + } } diff --git a/src/struts.xml b/src/struts.xml index 477bca0..5d28501 100644 --- a/src/struts.xml +++ b/src/struts.xml @@ -46,5 +46,8 @@ listNotes + + logs.jsp + \ No newline at end of file diff --git a/src/web/action/ListLogs.java b/src/web/action/ListLogs.java new file mode 100644 index 0000000..49664ff --- /dev/null +++ b/src/web/action/ListLogs.java @@ -0,0 +1,34 @@ +package web.action; + +import com.opensymphony.xwork2.ActionSupport; +import model.Log; +import service.Service; + +import java.util.Collection; +public class ListLogs extends ActionSupport +{ + private Collection logs; + private Service service; + public ListLogs() + { + super(); + service = new Service(); + } + + @Override + public String execute() throws Exception + { + logs = service.getAllLogs(); + if(logs!=null) + return SUCCESS; + return ERROR; + } + public Collection getLogs() + { + return logs; + } + public void setLogs(Collection logs) + { + this.logs = logs; + } +} diff --git a/web/logs.jsp b/web/logs.jsp new file mode 100644 index 0000000..5d7baf5 --- /dev/null +++ b/web/logs.jsp @@ -0,0 +1,8 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> +<%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %> +<% Boolean useDatatable = false;%> +<%@ include file="includes/header.jsp" %> +logs +<%@ include file="includes/footer.jsp" %> \ No newline at end of file From b1dd417c367ade906c4c6e3ed4196ded76e86823 Mon Sep 17 00:00:00 2001 From: S-H-Y-GitHub <932495000@qq.com> Date: Thu, 1 Dec 2016 16:57:09 +0800 Subject: [PATCH 08/30] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dao/LogDao.java | 40 +++++++++++++++++++++++++++++++++++++++- src/service/Service.java | 4 ++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/dao/LogDao.java b/src/dao/LogDao.java index be1cf28..525a308 100644 --- a/src/dao/LogDao.java +++ b/src/dao/LogDao.java @@ -99,5 +99,43 @@ public Collection getAllLogs() } return logs; } - + public Collection getLogsByUser(int uid) + { + Collection logs = new LinkedList<>(); + String sql = "select * from log WHERE operatorid='"+uid+"';"; + stmt = newDao(); + ResultSet rs=null; + try + { + rs = stmt.executeQuery(sql); + Log log; + while (rs.next()) + { + log = new Log(); + log.setId(rs.getInt("id")); + log.setOperatorid(rs.getInt("operatorid")); + log.setTarget(rs.getInt("target")); + log.setTargetid(rs.getInt("targetid")); + log.setTime(rs.getDate("time")); + log.setType(rs.getInt("type")); + logs.add(log); + } + } + catch (SQLException e) + { + System.err.println("MySQL查询错误@dao.LogDao.getLogsByUser"); + e.printStackTrace(); + return null; + } + finally { + if (rs!=null) + try { + rs.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + closeDao(); + } + return logs; + } } diff --git a/src/service/Service.java b/src/service/Service.java index 0fc0327..4ce3cfc 100644 --- a/src/service/Service.java +++ b/src/service/Service.java @@ -123,4 +123,8 @@ public Collection getAllLogs() { return logDao.getAllLogs(); } + public Collection getLogsByUser(int uid) + { + return logDao.getLogsByUser(uid); + } } From d927261227a64226ec849c44b8ca40a29090b194 Mon Sep 17 00:00:00 2001 From: S-H-Y-GitHub <932495000@qq.com> Date: Thu, 1 Dec 2016 23:19:10 +0800 Subject: [PATCH 09/30] debuging --- src/dao/PaperDao.java | 1 - src/utils/FormatLog.java | 35 ++++++++++++++++++++ src/web/action/ListLogs.java | 6 +++- src/web/action/ShowUserDetails.java | 21 +++++++++++- web/logs.jsp | 31 ++++++++++++++++-- web/user.jsp | 50 ++++++++++++++--------------- 6 files changed, 114 insertions(+), 30 deletions(-) create mode 100644 src/utils/FormatLog.java diff --git a/src/dao/PaperDao.java b/src/dao/PaperDao.java index fe73be8..7406773 100644 --- a/src/dao/PaperDao.java +++ b/src/dao/PaperDao.java @@ -1,6 +1,5 @@ package dao; import model.Paper; -import org.jetbrains.annotations.Nullable; import java.sql.*; import java.util.Collection; diff --git a/src/utils/FormatLog.java b/src/utils/FormatLog.java new file mode 100644 index 0000000..b2b4ae3 --- /dev/null +++ b/src/utils/FormatLog.java @@ -0,0 +1,35 @@ +package utils; + +import model.Log; +import model.User; + +import java.util.Collection; +import java.util.LinkedList; +public class FormatLog +{/* + public static Collection formatLogs(Collection logs) + { + if (logs != null) + { + Collection results = new LinkedList<>(); + for (Log log : logs) + results.add(formatLog(log)); + return results; + } + return null; + } + + public static String formatLog(Log log) + { + String result; + if (log.getId() == 0 || log.getOperatorid() == 0 || log.getTarget() == 0 || log.getTargetid() == 0 || log.getType() == 0 || log.getTime() == null) + return "当前日志实例未完全初始化"; + if (log.getTarget() == Log.PAPER) + { + if(log.getType() == Log.ADD) + { + User operator = service; + } + } + }*/ +} diff --git a/src/web/action/ListLogs.java b/src/web/action/ListLogs.java index 49664ff..5e0fbca 100644 --- a/src/web/action/ListLogs.java +++ b/src/web/action/ListLogs.java @@ -1,5 +1,6 @@ package web.action; +import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; import model.Log; import service.Service; @@ -18,10 +19,13 @@ public ListLogs() @Override public String execute() throws Exception { + /* logs = service.getAllLogs(); if(logs!=null) return SUCCESS; - return ERROR; + return ERROR;*/ + ActionContext.getContext().put("123","456"); + return SUCCESS; } public Collection getLogs() { diff --git a/src/web/action/ShowUserDetails.java b/src/web/action/ShowUserDetails.java index 94b794d..a07b8f8 100644 --- a/src/web/action/ShowUserDetails.java +++ b/src/web/action/ShowUserDetails.java @@ -1,8 +1,10 @@ package web.action; import com.opensymphony.xwork2.ActionSupport; +import model.Log; import model.Note; import model.User; +import org.apache.struts2.ServletActionContext; import service.Service; import java.util.Collection; @@ -12,6 +14,7 @@ public class ShowUserDetails extends ActionSupport private int id; private Service service; private Collection notes; + private Collection logs; public ShowUserDetails() { @@ -27,7 +30,15 @@ public String execute() throws Exception { notes = service.getNotesByUser(id); if(notes != null) - return SUCCESS; + { + logs = service.getLogsByUser(id); + if(logs!=null) + { + ServletActionContext.getRequest().setAttribute("logs",logs); + return SUCCESS; + } + return ERROR; + } //else return ERROR; } @@ -57,4 +68,12 @@ public void setNotes(Collection notes) { this.notes = notes; } + public Collection getLogs() + { + return logs; + } + public void setLogs(Collection logs) + { + this.logs = logs; + } } diff --git a/web/logs.jsp b/web/logs.jsp index 5d7baf5..9bd87c3 100644 --- a/web/logs.jsp +++ b/web/logs.jsp @@ -2,7 +2,34 @@ <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> <%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %> -<% Boolean useDatatable = false;%> +<% Boolean useDatatable = true;%> <%@ include file="includes/header.jsp" %> -logs +<%-- + +

数据库中没有日志╮(╯_╰)╭

+
+ +
+ + + + + + + + + + + + + + +
时间事件
+ + + //事件 +
+ +--%> + <%@ include file="includes/footer.jsp" %> \ No newline at end of file diff --git a/web/user.jsp b/web/user.jsp index 617c485..0171243 100644 --- a/web/user.jsp +++ b/web/user.jsp @@ -46,32 +46,32 @@ - - - + + + <% if (userp != null && userp.getId() == iruid) { %> - + <%}%> - - - + + <% if (userp != null && userp.getId() == iruid) { %> - diff --git a/web/paper.jsp b/web/paper.jsp index a21008a..8c81bda 100644 --- a/web/paper.jsp +++ b/web/paper.jsp @@ -2,8 +2,9 @@ <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> <%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %> -<% Boolean useDatatable = false;%> <%@ include file="includes/header.jsp" %> +论文:<s:property value="paper.title"/>|文献管理系统 +<%@include file="includes/header2.jsp" %>
 
diff --git a/web/paperlist.jsp b/web/paperlist.jsp index 31dd402..0f9b655 100644 --- a/web/paperlist.jsp +++ b/web/paperlist.jsp @@ -2,8 +2,108 @@ <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> <%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %> -<% Boolean useDatatable = true;%> <%@ include file="includes/header.jsp" %> +论文列表|文献管理系统 + + + + + + +<%@include file="includes/header2.jsp" %>

数据库中没有论文╮(╯_╰)╭

@@ -28,7 +128,10 @@ - <%if(userp != null) {%> + <% + if (userp != null) + { + %> <%}%> @@ -44,12 +147,12 @@ <% - if(userp != null) + if (userp != null) { %>
篇名作者发表时间篇名作者发表时间收藏收藏
+    + - - - + + + <% if (userp != null && userp.getId() == iruid) { %> - + <%}%> - - - + + <% if (userp != null && userp.getId() == iruid) { %> - - <% - Log log = (Log) ActionContext.getContext().get("log"); - log.hashCode(); - String event,time; - if (log.getId() == 0 || log.getOperatorid() == 0 || log.getTarget() == 0 || log.getTargetid() == 0 || log.getType() == 0 || log.getTime() == null) - { - event = "当前日志实例未完全初始化"; - time = "NaT"; - } - else - { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - time = sdf.format(log.getTime()); - // TODO: 2016/12/2 处理event - } - %> - + @@ -33,5 +30,5 @@
篇名作者发表时间篇名作者发表时间收藏收藏
+    + - - - + + + <% if (userp != null && userp.getId() == iruid) { %> - + <%}%> - - - + + <% if (userp != null && userp.getId() == iruid) { %> - + <% + Log log = (Log) ActionContext.getContext().get("log"); + log.hashCode(); + String event,time; + if (log.getId() == 0 || log.getOperatorid() == 0 || log.getTarget() == 0 || log.getTargetid() == 0 || log.getType() == 0 || log.getTime() == null) + { + event = "当前日志实例未完全初始化"; + time = "NaT"; + } + else + { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + time = sdf.format(log.getTime()); + // TODO: 2016/12/2 处理event + } + %>
篇名作者发表时间篇名作者发表时间收藏收藏
+    +
- + <%=time%> - //事件 + <%=event%>
---%> + <%@ include file="includes/footer.jsp" %> \ No newline at end of file From 345994949cc8b3f40da52794a0a36c356613132d Mon Sep 17 00:00:00 2001 From: JevonsAn Date: Fri, 2 Dec 2016 00:51:47 +0800 Subject: [PATCH 11/30] =?UTF-8?q?=E7=A0=94=E7=A9=B6=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=A0=91=E9=83=A8=E5=88=86=E5=9F=BA=E6=9C=AC=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml | 1 + src/dao/UserDao.java | 53 +++++++++++-- src/service/Service.java | 77 +++++++++++++++++-- src/struts.xml | 6 ++ src/web/action/ChangePaperLabel.java | 54 +++++++++++++ src/web/action/DeleteTreeLabel.java | 40 ++++++++++ src/web/action/ShowUserTree.java | 34 ++++++-- web/showusertree.jsp | 45 ++++------- web/usertree.jsp | 29 +++++-- 9 files changed, 283 insertions(+), 56 deletions(-) create mode 100644 src/web/action/ChangePaperLabel.java create mode 100644 src/web/action/DeleteTreeLabel.java diff --git a/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml b/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml index 24cc31b..8da2bbc 100644 --- a/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml +++ b/.idea/dataSources/30707c8d-2abc-4ac8-b150-faeccad4a5ae.xml @@ -201,6 +201,7 @@ 5 varchar(1000)|0 + 'null' id diff --git a/src/dao/UserDao.java b/src/dao/UserDao.java index 39d7a36..71224bc 100644 --- a/src/dao/UserDao.java +++ b/src/dao/UserDao.java @@ -302,10 +302,9 @@ public int addTreeLabel(String labelname,String label_father,int user_id){ public Collection getChildTree(int user_id, String label_father){ //Tree tree=new Tree(); - String sql="select * from user_tree where user_id="+user_id+" and label_father="+label_father+" ;"; + String sql="select * from user_tree where user_id="+user_id+" and label_father='"+label_father+"' ;"; Collection trees=new LinkedList<>(); - if (stmt!=null) - stmt=newDao(); + stmt=newDao(); try { ResultSet rs=stmt.executeQuery(sql); while(rs.next()){ @@ -320,10 +319,9 @@ public Collection getChildTree(int user_id, String label_father){ } public Collection getTreePapers(String labelname, int user_id){ - String sql="select paperid from user_paper_tree where user_id="+user_id+" and labelname="+labelname+" ;"; + String sql="select paper_id from user_paper_tree where user_id="+user_id+" and labelname='"+labelname+"' ;"; Collection papers=new LinkedList<>(); - if (stmt!=null) - stmt=newDao(); + stmt=newDao(); try { ResultSet rs=stmt.executeQuery(sql); while(rs.next()){ @@ -334,4 +332,47 @@ public Collection getTreePapers(String labelname, int user_id){ } return papers; } + + public int deleteTreeLabel(String labelname,int user_id){ + String sql="SELECT label_father FROM user_tree where labelname='"+labelname+"' and user_id="+user_id+";"; + stmt=newDao(); + try { + ResultSet rs=stmt.executeQuery(sql); + String father="null"; + if (rs.next()){ + father=rs.getString(1); + } + String sql2="Update user_tree set label_father='"+father+"' where label_father='"+labelname+"' and user_id="+user_id+";"; + stmt.executeUpdate(sql2); + String sql22="Update user_paper_tree set labelname='"+father+"' where labelname='"+labelname+"' and user_id="+user_id+";"; + stmt.executeUpdate(sql22); + String sql3="delete from user_tree where labelname='"+labelname+"';"; + return stmt.executeUpdate(sql3); + } catch (SQLException e) { + e.printStackTrace(); + return -1; + } + } + + public int updatePaperLabel(String labelname,int user_id ,int paper_id){ + String sql="update user_paper_tree set labelname='"+labelname+"' where user_id="+user_id+" and paper_id="+paper_id+";"; + stmt=newDao(); + try { + return stmt.executeUpdate(sql); + } catch (SQLException e) { + e.printStackTrace(); + return -1; + } + } + + public int updateTreeLabel(String labelname, String newlabelname, int user_id){ + String sql="update user_tree set labelname='"+newlabelname+"' where user_id="+user_id+" and labelname='"+labelname+"';"; + try { + return stmt.executeUpdate(sql); + } catch (SQLException e) { + e.printStackTrace(); + return -1; + } + } + } diff --git a/src/service/Service.java b/src/service/Service.java index ff2de9c..3ff65d2 100644 --- a/src/service/Service.java +++ b/src/service/Service.java @@ -6,8 +6,8 @@ import model.Tree; import model.User; -import java.util.Collection; -import java.util.LinkedList; +import java.util.*; + public class Service { private UserDao userDao; @@ -93,19 +93,48 @@ public int addTreeLabel(String labelname,String label_father,int user_id){ return userDao.addTreeLabel(labelname,label_father,user_id); } - public Tree getUserTree(int user_id){ + public Tree getUserTree(int user_id){ Tree tree=new Tree(); - tree.setChildTree(getTree(user_id,"空")); + tree.setChildTree(getTree(user_id,"null",0)); return tree; } - public Collection getTree(int user_id, String labelname){ + public LinkedList getUserTreeList(int user_id){ + LinkedList trees=new LinkedList<>(); + LinkedList queue=new LinkedList<>(); + Tree ftree=new Tree(); + ftree.setLabelname("null"); + int depth=-1; + ftree.setDepth(depth); + queue.add(ftree); + int size=queue.size(); + while (size!=0){ + for (int i=0;i ctree = userDao.getChildTree(user_id, queue.getFirst().getLabelname()); + int pos=trees.indexOf(queue.getFirst()); + int d=queue.getFirst().getDepth(); + for (Tree tree1 : ctree) { + if (tree1!=null) { + tree1.setDepth(d+1); + trees.add(++pos, tree1); + queue.add(tree1); + } + } + queue.remove(); + size = queue.size(); + } + } + return trees; + } + + public Collection getTree(int user_id, String labelname,int depth){ Collection trees = userDao.getChildTree(user_id,labelname); + int newdepth=depth+1; if (trees==null) return null; else{ for (Tree tree : trees) { - tree.setChildTree(getTree(user_id,tree.getLabelname())); + tree.setChildTree(getTree(user_id,tree.getLabelname(),newdepth)); Collection paperids=userDao.getTreePapers(tree.getLabelname(),user_id); Collection papers=new LinkedList<>(); for (Integer paperid : paperids) { @@ -113,8 +142,44 @@ public Collection getTree(int user_id, String labelname){ papers.add(paper); } tree.setPapers(papers); + tree.setDepth(depth); } } return trees; } + + public int updatePaperlabel(int user_id ,int paper_id ,String newlabelname){ + return userDao.updatePaperLabel(newlabelname,user_id,paper_id); + } + + public int deleteTreeLabel(int user_id,String labelname){ + return userDao.deleteTreeLabel(labelname,user_id); + } + + public Collection getLabelPapers(int user_id, String labelname){ + Collection papers=new LinkedList<>(); + LinkedList queue=new LinkedList<>(); + Tree ftree=new Tree(); + ftree.setLabelname(labelname); + queue.add(ftree); + int size=queue.size(); + while (size!=0){ + for (int i=0;i ctree = userDao.getChildTree(user_id, queue.getFirst().getLabelname()); + int d=queue.getFirst().getDepth(); + for (Tree tree1 : ctree) { + if (tree1!=null) { + Collection paperids=userDao.getTreePapers(tree1.getLabelname(),user_id); + for (Integer paperid : paperids) { + papers.add(getPaperById(paperid)); + } + queue.add(tree1); + } + } + queue.remove(); + size = queue.size(); + } + } + return papers; + } } diff --git a/src/struts.xml b/src/struts.xml index c593460..48dcc48 100644 --- a/src/struts.xml +++ b/src/struts.xml @@ -43,5 +43,11 @@ showusertree.jsp + + usertree.jsp + + + usertree.jsp + \ No newline at end of file diff --git a/src/web/action/ChangePaperLabel.java b/src/web/action/ChangePaperLabel.java new file mode 100644 index 0000000..f7e9bad --- /dev/null +++ b/src/web/action/ChangePaperLabel.java @@ -0,0 +1,54 @@ +package web.action; +import com.opensymphony.xwork2.ActionSupport; +import model.*; +import org.apache.struts2.ServletActionContext; +import service.Service; + +/** + * Created by Jevons on 2016/11/30. + */ +public class ChangePaperLabel extends ActionSupport{ + + private String newlabelname; + private int paper_id; + private Service service; + //private int user_id; + //private int paper_id; + + public ChangePaperLabel() + { + super(); + service = new Service(); + } + + @Override + public String execute() throws Exception { + Object obj = ServletActionContext.getRequest().getSession().getAttribute("user"); + if(obj == null) + return ERROR; + int uid = ((User) obj).getId(); + int res=service.updatePaperlabel(uid,paper_id,newlabelname); + if(res > 0) + return SUCCESS; + else + return ERROR; + } + + + + public int getPaper_id() { + return paper_id; + } + + public void setPaper_id(int paper_id) { + this.paper_id = paper_id; + } + + public String getNewlabelname() { + return newlabelname; + } + + public void setNewlabelname(String newlabelname) { + this.newlabelname = newlabelname; + } +} diff --git a/src/web/action/DeleteTreeLabel.java b/src/web/action/DeleteTreeLabel.java new file mode 100644 index 0000000..5e3c21e --- /dev/null +++ b/src/web/action/DeleteTreeLabel.java @@ -0,0 +1,40 @@ +package web.action; +import com.opensymphony.xwork2.ActionSupport; +import model.*; +import org.apache.struts2.ServletActionContext; +import service.Service; + +public class DeleteTreeLabel extends ActionSupport{ + private String labelname; + private Service service; + //private int user_id; + //private int paper_id; + + public DeleteTreeLabel() + { + super(); + service = new Service(); + } + + @Override + public String execute() throws Exception + { + Object obj = ServletActionContext.getRequest().getSession().getAttribute("user"); + if(obj == null) + return ERROR; + int uid = ((User) obj).getId(); + int res = service.deleteTreeLabel(uid,labelname); + if(res > 0) + return SUCCESS; + else + return ERROR; + } + + public String getLabelname() { + return labelname; + } + + public void setLabelname(String labelname) { + this.labelname = labelname; + } +} diff --git a/src/web/action/ShowUserTree.java b/src/web/action/ShowUserTree.java index 8b8fee1..8b8defc 100644 --- a/src/web/action/ShowUserTree.java +++ b/src/web/action/ShowUserTree.java @@ -1,7 +1,6 @@ package web.action; import com.opensymphony.xwork2.ActionSupport; -import model.Tree; -import model.User; +import model.*; import org.apache.struts2.ServletActionContext; import service.Service; @@ -10,16 +9,18 @@ import java.util.Collection; import java.util.Date; public class ShowUserTree extends ActionSupport{ - private Tree tree; + //private Tree tree; private Service service; private int user_id; + private Collection trees; + private Collection papers; //private String public ShowUserTree() { super(); service = new Service(); - tree=null; + trees=null; } @Override @@ -29,12 +30,15 @@ public String execute() throws Exception if(obj == null) return ERROR; int uid = ((User) obj).getId(); - tree = service.getUserTree(uid); - if(tree != null) + Tree tree=service.getUserTree(uid); + trees = service.getUserTreeList(uid); + papers=service.getLabelPapers(uid,"null"); + if(trees != null) return SUCCESS; else return ERROR; } + /* public Tree getTree() { return tree; @@ -42,7 +46,7 @@ public Tree getTree() { public void setTree(Tree tree) { this.tree = tree; - } + }*/ public int getUser_id() { return user_id; @@ -51,4 +55,20 @@ public int getUser_id() { public void setUser_id(int user_id) { this.user_id = user_id; } + + public Collection getTrees() { + return trees; + } + + public void setTrees(Collection trees) { + this.trees = trees; + } + + public Collection getPapers() { + return papers; + } + + public void setPapers(Collection papers) { + this.papers = papers; + } } diff --git a/web/showusertree.jsp b/web/showusertree.jsp index 6496c69..0334eda 100644 --- a/web/showusertree.jsp +++ b/web/showusertree.jsp @@ -1,38 +1,25 @@ -<%@ page import="service.Service" %> -<%@ page import="model.Tree" %> -<%@ page import="org.apache.struts2.ServletActionContext" %> -<%@ page import="model.User" %> -<%@ page import="java.util.Collection" %> +<%@ taglib prefix="s" uri="/struts-tags" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> 我的研究树 - <%! String s=""; %> - <%! - void printtree(Tree tree){ - if (tree!=null){ - s+=(tree.getLabelname()); - s+='\n'; - Collection ctrees=tree.getChildTree(); - for (Tree ctree : ctrees) { - printtree(ctree); - } - } - } - %> - <% - Service service=new Service(); - Object obj = ServletActionContext.getRequest().getSession().getAttribute("user"); - int uid = ((User) obj).getId(); - Tree tree=service.getUserTree(uid); - - - for (int ) - - - %> + + + + + +
+ + + + +
+ + + +
diff --git a/web/usertree.jsp b/web/usertree.jsp index 6aca233..2dbe832 100644 --- a/web/usertree.jsp +++ b/web/usertree.jsp @@ -9,14 +9,27 @@ 用户研究树 -
-

添加新的标签

- - - - - -
+

添加新的标签

+ + + + + + +

删除标签

+ + + + + +

把论文添加到标签下

+ + + + + + + From 42d1c23dfb004c31dd9b3f4b8f0ffda53a5e1b7b Mon Sep 17 00:00:00 2001 From: S-H-Y-GitHub <932495000@qq.com> Date: Fri, 2 Dec 2016 14:50:20 +0800 Subject: [PATCH 12/30] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/FormatLog.java | 97 ++++++++++++++++++++++++++++++++---- src/web/action/ListLogs.java | 7 +-- src/web/model/FrontLog.java | 25 ++++++++++ web/logs.jsp | 18 +------ 4 files changed, 114 insertions(+), 33 deletions(-) create mode 100644 src/web/model/FrontLog.java diff --git a/src/utils/FormatLog.java b/src/utils/FormatLog.java index b2b4ae3..3226aa6 100644 --- a/src/utils/FormatLog.java +++ b/src/utils/FormatLog.java @@ -1,17 +1,22 @@ package utils; import model.Log; +import model.Note; +import model.Paper; import model.User; +import service.Service; +import web.model.FrontLog; +import java.text.SimpleDateFormat; import java.util.Collection; import java.util.LinkedList; public class FormatLog -{/* - public static Collection formatLogs(Collection logs) +{ + public static Collection formatLogs(Collection logs) { if (logs != null) { - Collection results = new LinkedList<>(); + Collection results = new LinkedList<>(); for (Log log : logs) results.add(formatLog(log)); return results; @@ -19,17 +24,87 @@ public static Collection formatLogs(Collection logs) return null; } - public static String formatLog(Log log) + public static FrontLog formatLog(Log log) { - String result; - if (log.getId() == 0 || log.getOperatorid() == 0 || log.getTarget() == 0 || log.getTargetid() == 0 || log.getType() == 0 || log.getTime() == null) - return "当前日志实例未完全初始化"; + FrontLog result = new FrontLog(); + Service service = new Service(); + if (log.getId() == 0 || log.getOperatorid() == 0 || log.getTarget() == 0 + || log.getTargetid() == 0 || log.getType() == 0 || log.getTime() == null) + { + result.setEvent("当前日志实例未完全初始化"); + result.setTime("NaT"); + return result; + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + result.setTime(sdf.format(log.getTime())); if (log.getTarget() == Log.PAPER) { - if(log.getType() == Log.ADD) - { - User operator = service; + if (log.getType() == Log.ADD) + {//新增论文 + User operator = service.getUserById(log.getOperatorid()); + Paper paper = service.getPaperById(log.getTargetid()); + String event = "" + + operator.getUsername() + "" + + "添加了论文:" + + paper.getTitle() + ""; + result.setEvent(event); + } + else if (log.getType() == Log.TOREAD) + {//计划读论文 + User operator = service.getUserById(log.getOperatorid()); + Paper paper = service.getPaperById(log.getTargetid()); + String event = "" + + operator.getUsername() + "" + + "计划读论文:" + + paper.getTitle() + ""; + result.setEvent(event); + } + else if (log.getType() == Log.READ) + {//粗读论文 + User operator = service.getUserById(log.getOperatorid()); + Paper paper = service.getPaperById(log.getTargetid()); + String event = "" + + operator.getUsername() + "" + + "已粗读论文:" + + paper.getTitle() + ""; + result.setEvent(event); + } + else if (log.getType() == Log.STUDIED) + {//精读论文 + User operator = service.getUserById(log.getOperatorid()); + Paper paper = service.getPaperById(log.getTargetid()); + String event = "" + + operator.getUsername() + "" + + "已精读论文:" + + paper.getTitle() + ""; + result.setEvent(event); + } + // TODO: 2016/12/2 修改和删除论文 + } + else if(log.getTarget()==Log.NOTE) + { + if (log.getType()==Log.ADD) + {//新增笔记 + User operator = service.getUserById(log.getOperatorid()); + Note note = service.getNoteById(log.getOperatorid()); + String event = "" + + operator.getUsername() + "" + + "新增了笔记:" + + note.getTitle() + ""; + result.setEvent(event); + } + // TODO: 2016/12/2 修改和删除笔记 + } + else if (log.getTarget()==Log.USER) + { + if (log.getType()==Log.ADD) + {//用户注册 + User operator = service.getUserById(log.getOperatorid()); + String event = "" + + operator.getUsername()+"注册成为本系统第"+operator.getId()+"位会员"; + result.setEvent(event); } } - }*/ + return result; + } } diff --git a/src/web/action/ListLogs.java b/src/web/action/ListLogs.java index 392e3fe..4fe2acf 100644 --- a/src/web/action/ListLogs.java +++ b/src/web/action/ListLogs.java @@ -20,14 +20,11 @@ public ListLogs() @Override public String execute() throws Exception { - /* + logs = service.getAllLogs(); if(logs!=null) return SUCCESS; - return ERROR;*/ - logs = new LinkedList<>(); - logs.add(new Log()); - return SUCCESS; + return ERROR; } public Collection getLogs() { diff --git a/src/web/model/FrontLog.java b/src/web/model/FrontLog.java new file mode 100644 index 0000000..aff407a --- /dev/null +++ b/src/web/model/FrontLog.java @@ -0,0 +1,25 @@ +package web.model; + +import java.io.Serializable; +public class FrontLog implements Serializable +{ + private String time; + private String event; + + public String getEvent() + { + return event; + } + public void setEvent(String event) + { + this.event = event; + } + public String getTime() + { + return time; + } + public void setTime(String time) + { + this.time = time; + } +} diff --git a/web/logs.jsp b/web/logs.jsp index 0b77de5..bdb756f 100644 --- a/web/logs.jsp +++ b/web/logs.jsp @@ -20,25 +20,9 @@
- <%=time%> + <%=event%> From 9081f5e20b39b7ec8e6d33a03e72badbc946355f Mon Sep 17 00:00:00 2001 From: S-H-Y-GitHub <932495000@qq.com> Date: Fri, 2 Dec 2016 15:09:03 +0800 Subject: [PATCH 13/30] =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/web/action/ListLogs.java | 17 ++++++++++------- src/web/action/ShowUserDetails.java | 15 ++++++++------- web/logs.jsp | 11 ++++------- web/user.jsp | 21 ++++++++++++++++++++- 4 files changed, 42 insertions(+), 22 deletions(-) diff --git a/src/web/action/ListLogs.java b/src/web/action/ListLogs.java index 4fe2acf..f87ab47 100644 --- a/src/web/action/ListLogs.java +++ b/src/web/action/ListLogs.java @@ -1,15 +1,15 @@ package web.action; -import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; import model.Log; import service.Service; +import utils.FormatLog; +import web.model.FrontLog; import java.util.Collection; -import java.util.LinkedList; public class ListLogs extends ActionSupport { - private Collection logs; + private Collection logs; private Service service; public ListLogs() { @@ -21,16 +21,19 @@ public ListLogs() public String execute() throws Exception { - logs = service.getAllLogs(); - if(logs!=null) + Collection logs1 = service.getAllLogs(); + if(logs1 !=null) + { + logs = FormatLog.formatLogs(logs1); return SUCCESS; + } return ERROR; } - public Collection getLogs() + public Collection getLogs() { return logs; } - public void setLogs(Collection logs) + public void setLogs(Collection logs) { this.logs = logs; } diff --git a/src/web/action/ShowUserDetails.java b/src/web/action/ShowUserDetails.java index a07b8f8..25b010c 100644 --- a/src/web/action/ShowUserDetails.java +++ b/src/web/action/ShowUserDetails.java @@ -4,8 +4,9 @@ import model.Log; import model.Note; import model.User; -import org.apache.struts2.ServletActionContext; import service.Service; +import utils.FormatLog; +import web.model.FrontLog; import java.util.Collection; public class ShowUserDetails extends ActionSupport @@ -14,7 +15,7 @@ public class ShowUserDetails extends ActionSupport private int id; private Service service; private Collection notes; - private Collection logs; + private Collection logs; public ShowUserDetails() { @@ -31,10 +32,10 @@ public String execute() throws Exception notes = service.getNotesByUser(id); if(notes != null) { - logs = service.getLogsByUser(id); - if(logs!=null) + Collection logs1 = service.getLogsByUser(id); + if(logs1!=null) { - ServletActionContext.getRequest().setAttribute("logs",logs); + logs = FormatLog.formatLogs(logs1); return SUCCESS; } return ERROR; @@ -68,11 +69,11 @@ public void setNotes(Collection notes) { this.notes = notes; } - public Collection getLogs() + public Collection getLogs() { return logs; } - public void setLogs(Collection logs) + public void setLogs(Collection logs) { this.logs = logs; } diff --git a/web/logs.jsp b/web/logs.jsp index bdb756f..ca2e7ce 100644 --- a/web/logs.jsp +++ b/web/logs.jsp @@ -1,6 +1,3 @@ -<%@ page import="com.opensymphony.xwork2.ActionContext" %> -<%@ page import="model.Log" %> -<%@ page import="java.text.SimpleDateFormat" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> @@ -19,13 +16,13 @@
- - <%=event%> +
- + <%@ include file="includes/footer.jsp" %> \ No newline at end of file diff --git a/web/user.jsp b/web/user.jsp index 0171243..734e15f 100644 --- a/web/user.jsp +++ b/web/user.jsp @@ -218,7 +218,26 @@
- todo<%--todo--%> + + + + + + + + + + + + + + + +
时间事件
+ + + +
From 731c752083c7326cc096cfb16e7c5f093b991ef8 Mon Sep 17 00:00:00 2001 From: S-H-Y-GitHub <932495000@qq.com> Date: Fri, 2 Dec 2016 15:18:55 +0800 Subject: [PATCH 14/30] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=85=A5=E5=8F=A3=20---------------------=20=E8=87=B3=E6=AD=A4?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=8A=9F=E8=83=BD=E5=89=8D=E7=AB=AF=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/FormatLog.java | 1 + src/web/action/ShowUserDetails.java | 12 ++++++------ web/includes/header.jsp | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/utils/FormatLog.java b/src/utils/FormatLog.java index 3226aa6..718f421 100644 --- a/src/utils/FormatLog.java +++ b/src/utils/FormatLog.java @@ -104,6 +104,7 @@ else if (log.getTarget()==Log.USER) + operator.getUsername()+"注册成为本系统第"+operator.getId()+"位会员"; result.setEvent(event); } + // TODO: 2016/12/2 用户资料修改 } return result; } diff --git a/src/web/action/ShowUserDetails.java b/src/web/action/ShowUserDetails.java index 25b010c..d82f0d6 100644 --- a/src/web/action/ShowUserDetails.java +++ b/src/web/action/ShowUserDetails.java @@ -30,10 +30,10 @@ public String execute() throws Exception if (user != null) { notes = service.getNotesByUser(id); - if(notes != null) + if (notes != null) { Collection logs1 = service.getLogsByUser(id); - if(logs1!=null) + if (logs1 != null) { logs = FormatLog.formatLogs(logs1); return SUCCESS; @@ -53,14 +53,14 @@ public void setUser(User user) { this.user = user; } - public void setId(int id) - { - this.id = id; - } public int getId() { return id; } + public void setId(int id) + { + this.id = id; + } public Collection getNotes() { return notes; diff --git a/web/includes/header.jsp b/web/includes/header.jsp index 365689e..7763911 100644 --- a/web/includes/header.jsp +++ b/web/includes/header.jsp @@ -1,5 +1,5 @@ -<%@ page import="utils.CheckLogin" %> <%@ page import="model.User" %> +<%@ page import="utils.CheckLogin" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> @@ -143,7 +143,7 @@
篇名 作者 发表时间收藏