更新
This commit is contained in:
@@ -115,7 +115,7 @@ public class articleService {
|
||||
public int deleteArticle(int articleId){return articleDao.deleteArticle(articleId);
|
||||
}
|
||||
|
||||
public int updateArticle(int articleId , int userId , String articleContent, String publishTime ,int readCount ,String articleTitle ,int isValid ,String articleIco ){
|
||||
public int updateArticle(int articleId , int userId , String articleContent, String publishTime ,int readCount ,String articleTitle ,int isValid ,String articleIco ){
|
||||
return articleDao.updateArticleDetail(articleId,userId,articleContent,publishTime,readCount,articleTitle,isValid,articleIco);
|
||||
}
|
||||
public List<articleEntity> selectAllArticle(){return articleDao.selectAllArticle();}
|
||||
|
@@ -14,7 +14,7 @@ public class categoryService {
|
||||
|
||||
public categoryEntity retNum(int id ){return categoryDao.retNum(id);}
|
||||
|
||||
public int updateCategory(int categoryId , int isValid , String category, String categoryName){return categoryDao.updateCategoryDetail(categoryId,isValid,category,categoryName);}
|
||||
public int updateCategory(int categoryId , int isValid , String category, String categoryName){return categoryDao.updateCategoryDetail(categoryId,isValid,category,categoryName);}
|
||||
|
||||
public int deleteCategory(int id ){return categoryDao.deleteCategory(id);}
|
||||
|
||||
|
@@ -39,14 +39,17 @@ public class projectService {
|
||||
projectEntity projectEntity = projectEntityList.get(i);
|
||||
categoryEntity categoryEntity = categoryDao.retNum(projectEntity.getCategoryId());
|
||||
projectEntity.setCategoryName(categoryEntity.getCategoryName());
|
||||
now =projectEntity.getCategoryName();
|
||||
if(i == 0) tem = now;
|
||||
now = projectEntity.getCategoryName();
|
||||
if(i == 0) {
|
||||
tem = now;
|
||||
}
|
||||
if(!tem.equals(now)){
|
||||
dataMap.put(tem,projectEntityListTem);
|
||||
tem=now;
|
||||
projectEntityListTem = new ArrayList<>();
|
||||
|
||||
}
|
||||
projectEntityListTem.add(projectEntity);
|
||||
projectEntityListTem.add(projectEntity);
|
||||
}
|
||||
if(projectEntityListTem.size()!= 0) dataMap.put(now,projectEntityListTem);
|
||||
return JSONObject.toJSONString(dataMap);
|
||||
|
@@ -45,7 +45,7 @@ public class selectTermServlet extends HttpServlet {
|
||||
// setResultOK("123",writer);
|
||||
}
|
||||
|
||||
public void setResult(Integer code, String msg, PrintWriter writer) {
|
||||
public void setResult(Integer code, String msg, PrintWriter writer){
|
||||
HashMap<String, Object> result = new HashMap<>();
|
||||
result.put("code", code);
|
||||
result.put("msg", msg);
|
||||
|
@@ -45,7 +45,7 @@ public class updateArticleByAdminServlet extends HttpServlet {
|
||||
setResultError("管理员未登录", writer);
|
||||
}else{
|
||||
int articleId= Integer.parseInt(req.getParameter("articleId"));
|
||||
String username = req.getParameter("username");
|
||||
int userId = Integer.parseInt(req.getParameter("userId"));
|
||||
String articleContent = req.getParameter("articleContent");
|
||||
String articleTitle = req.getParameter("articleTitle");
|
||||
String articleIco = req.getParameter("articleIco");
|
||||
@@ -54,7 +54,6 @@ public class updateArticleByAdminServlet extends HttpServlet {
|
||||
|
||||
Date publishTime= new java.sql.Date(new java.util.Date().getTime());
|
||||
String time= String.valueOf(publishTime);
|
||||
int userId = userService.selectIdByName(username);
|
||||
int bool = articleService.updateArticle(articleId,userId,articleContent, time,
|
||||
readCount,articleTitle,isValid,articleIco
|
||||
);
|
||||
|
Reference in New Issue
Block a user