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 {
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);

View File

@@ -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;
}
}

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.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);