src/com/ischoolbar/programmer/controller/home/IndexController.java
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.ischoolbar.programmer.controller.home;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.ischoolbar.programmer.entity.common.Account;
import com.ischoolbar.programmer.service.common.AccountService;
import com.ischoolbar.programmer.service.common.ProductCategoryService;
import com.ischoolbar.programmer.service.common.ProductService;
import com.ischoolbar.programmer.util.MenuUtil;
/**
* 前台首页控制器
* @author Administrator
*
*/
@RequestMapping("/home")
@Controller
public class IndexController {
@Autowired
private AccountService accountService;
@Autowired
private ProductCategoryService productCategoryService;
@Autowired
private ProductService productService;
/**
* 前台首页页面
* @param model
* @return
*/
@RequestMapping(value = "/index",method = RequestMethod.GET)
public ModelAndView index(ModelAndView model){
model.addObject("productCategoryList", MenuUtil.getTreeCategory(productCategoryService.findList(new HashMap<String, Object>())));
Map<String, Object> queryMap = new HashMap<String, Object>();
queryMap.put("offset", 0);
queryMap.put("pageSize", 5);
queryMap.put("orderBy", "createTime");
queryMap.put("sort", "desc");
model.addObject("lastProductList", productService.findList(queryMap));
queryMap.put("orderBy", "sellNum");
model.addObject("sellProductList", productService.findList(queryMap));
model.addObject("allCategoryClass","shop_hd_menu_hover");
model.addObject("currentHome", "current_");
model.setViewName("home/index/index");
return model;
}
后面还有 138 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。