From e7ee979872c8167ad53cbeeb802e4c05502fcef2 Mon Sep 17 00:00:00 2001 From: Qing Date: Fri, 30 Jun 2023 23:21:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/hellogithub/dao/projectDao.java | 2 +- src/com/hellogithub/entity/projectEntity.java | 34 +++++++++++++++---- .../servlet/selectLastByCateServlet.java | 2 +- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/com/hellogithub/dao/projectDao.java b/src/com/hellogithub/dao/projectDao.java index dc9fe02..0b20c09 100644 --- a/src/com/hellogithub/dao/projectDao.java +++ b/src/com/hellogithub/dao/projectDao.java @@ -91,7 +91,7 @@ public class projectDao { try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql = "select * from project "; + String sql = "select * from project;"; projectEntityList = runner.query(conn, sql, new BeanListHandler<>(projectEntity.class)); } catch (SQLException e) { throw new RuntimeException(e); diff --git a/src/com/hellogithub/entity/projectEntity.java b/src/com/hellogithub/entity/projectEntity.java index 3ea3c23..46f14de 100644 --- a/src/com/hellogithub/entity/projectEntity.java +++ b/src/com/hellogithub/entity/projectEntity.java @@ -10,11 +10,19 @@ public class projectEntity { String projectTitle; String projectDescription; int startNum; - Date submitTime; + String submitTime; int categoryId; int isValid; String fileAddress; int periodicals; + String projectName; + + Integer lookCount; + + + public int getPeriodicals() { + return periodicals; + } public int getProjectId() { return projectId; @@ -72,11 +80,11 @@ public class projectEntity { this.startNum = startNum; } - public Date getSubmitTime() { + public String getSubmitTime() { return submitTime; } - public void setSubmitTime(Date submitTime) { + public void setSubmitTime(String submitTime) { this.submitTime = submitTime; } @@ -104,11 +112,23 @@ public class projectEntity { this.fileAddress = fileAddress; } - public int getPeriodicals() { - return periodicals; - } - public void setPeriodicals(int 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; + } } diff --git a/src/com/hellogithub/servlet/selectLastByCateServlet.java b/src/com/hellogithub/servlet/selectLastByCateServlet.java index 6256a6a..49a2f35 100644 --- a/src/com/hellogithub/servlet/selectLastByCateServlet.java +++ b/src/com/hellogithub/servlet/selectLastByCateServlet.java @@ -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.setContentType("application/json;charset=UTF-8"); - String cate = req.getParameter("xxxxxxx"); + String cate = req.getParameter("num"); PrintWriter writer = resp.getWriter(); String jsonString = JSONObject.toJSONString(projectService.retLatestProject(Integer.valueOf(cate))); writer.println(jsonString);