src/com/controller/ArticleController.java
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.controller;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import com.entity.Article;
import com.entity.Users;
import com.server.ArticleServer;
import com.server.CateServer;
import com.server.OrdersServer;
import com.server.UsersServier;
import com.util.PageBean;
@Controller
public class ArticleController {
@Resource
private ArticleServer articleService;
@Resource
private OrdersServer orderServer;
@Resource
private UsersServier userService;
@Resource
private CateServer cateService;
//
@RequestMapping("showArticle.do")
public String showArticle(int id,ModelMap map,HttpSession session){
/* Map<String,Object> bmap=new HashMap<String,Object>();
bmap.put("uid", id);*/
// map.put("blist", articleService.getAll(bmap));
map.put("article", articleService.getById(id));
return "read";
}
@RequestMapping("admin/addArticle.do")
public String addArticle(HttpServletRequest request,Article article,HttpSession session){
Timestamp time=new Timestamp(System.currentTimeMillis());
//Users u=(Users)session.getAttribute("user");
/*if(u==null||u.equals("")){
return "redirect:showIndex.do";
}else{*/
//bbs.setUid(u.getId());
/*bbs.setPubtime(time.toString());
bbs.setIsdel("1");*/
article.setAddtime(time.toString().substring(0, 19));
articleService.add(article);
return "redirect:articleList.do";
后面还有 78 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
