diff --git a/src/com/hellogithub/dao/projectDao.java b/src/com/hellogithub/dao/projectDao.java index a68c562..e30da99 100644 --- a/src/com/hellogithub/dao/projectDao.java +++ b/src/com/hellogithub/dao/projectDao.java @@ -131,8 +131,8 @@ public class projectDao { try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql = "select * from project where projectId = ? order by startNum desc"; - projectEntityList = runner.query(conn, sql, new BeanListHandler<>(projectEntity.class),id); + String sql = "select * from project order by lookCount desc"; + projectEntityList = runner.query(conn, sql, new BeanListHandler<>(projectEntity.class)); conn.close(); } catch (SQLException e) { throw new RuntimeException(e); diff --git a/src/com/hellogithub/servlet/selectMostStarServlet.java b/src/com/hellogithub/servlet/selectMostStarServlet.java index 83caebc..67c1113 100644 --- a/src/com/hellogithub/servlet/selectMostStarServlet.java +++ b/src/com/hellogithub/servlet/selectMostStarServlet.java @@ -38,8 +38,8 @@ public class selectMostStarServlet 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 id = req.getParameter("xxxxx"); + String cate = req.getParameter("num"); + String id = req.getParameter("index"); PrintWriter writer = resp.getWriter(); String jsonString = JSONObject.toJSONString(projectService.retSelcetByStar(Integer.valueOf(cate),id)); writer.println(jsonString);