This commit is contained in:
2023-06-30 23:21:23 +08:00
parent 6764c13501
commit e7ee979872
3 changed files with 29 additions and 9 deletions

View File

@@ -91,7 +91,7 @@ public class projectDao {
try { try {
Connection conn = JdbcUtils.getConnection(); Connection conn = JdbcUtils.getConnection();
QueryRunner runner = new QueryRunner(); QueryRunner runner = new QueryRunner();
String sql = "select * from project "; String sql = "select * from project;";
projectEntityList = runner.query(conn, sql, new BeanListHandler<>(projectEntity.class)); projectEntityList = runner.query(conn, sql, new BeanListHandler<>(projectEntity.class));
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException(e); throw new RuntimeException(e);

View File

@@ -10,11 +10,19 @@ public class projectEntity {
String projectTitle; String projectTitle;
String projectDescription; String projectDescription;
int startNum; int startNum;
Date submitTime; String submitTime;
int categoryId; int categoryId;
int isValid; int isValid;
String fileAddress; String fileAddress;
int periodicals; int periodicals;
String projectName;
Integer lookCount;
public int getPeriodicals() {
return periodicals;
}
public int getProjectId() { public int getProjectId() {
return projectId; return projectId;
@@ -72,11 +80,11 @@ public class projectEntity {
this.startNum = startNum; this.startNum = startNum;
} }
public Date getSubmitTime() { public String getSubmitTime() {
return submitTime; return submitTime;
} }
public void setSubmitTime(Date submitTime) { public void setSubmitTime(String submitTime) {
this.submitTime = submitTime; this.submitTime = submitTime;
} }
@@ -104,11 +112,23 @@ public class projectEntity {
this.fileAddress = fileAddress; this.fileAddress = fileAddress;
} }
public int getPeriodicals() {
return periodicals;
}
public void setPeriodicals(int periodicals) { public void setPeriodicals(int periodicals) {
this.periodicals = periodicals; this.periodicals = periodicals;
} }
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public Integer getLookCount() {
return lookCount;
}
public void setLookCount(Integer lookCount) {
this.lookCount = lookCount;
}
} }

View File

@@ -42,7 +42,7 @@ public class selectLastByCateServlet extends HttpServlet {
resp.setHeader("Access-Control-Allow-Headers", "access-control-allow-origin, authority, content-type, version-info, X-Requested-With"); resp.setHeader("Access-Control-Allow-Headers", "access-control-allow-origin, authority, content-type, version-info, X-Requested-With");
resp.setContentType("application/json;charset=UTF-8"); resp.setContentType("application/json;charset=UTF-8");
String cate = req.getParameter("xxxxxxx"); String cate = req.getParameter("num");
PrintWriter writer = resp.getWriter(); PrintWriter writer = resp.getWriter();
String jsonString = JSONObject.toJSONString(projectService.retLatestProject(Integer.valueOf(cate))); String jsonString = JSONObject.toJSONString(projectService.retLatestProject(Integer.valueOf(cate)));
writer.println(jsonString); writer.println(jsonString);