资源简介
该平台是一个网上商城,采用SSM框架,前台应用了jsp,ajax,jquery
代码片段和文件信息
package com.neu.shop.controller.admin;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.neu.shop.pojo.*;
import com.neu.shop.service.ActivityService;
import com.neu.shop.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpSession;
import java.util.List;
/**
* Created by 文辉 on 2017/7/27.
*/
@Controller
@RequestMapping(“/admin/activity“)
public class ActivityController {
@Autowired(required = false)
ActivityService activityService;
@Autowired(required = false)
GoodsService goodsService;
@RequestMapping(“/show“)
public String showActivity(@RequestParam(value = “page“defaultValue = “1“) Integer pn Model model HttpSession session) {
Admin admin = (Admin) session.getAttribute(“admin“);
if (admin == null) {
return “redirect:/admin/login“;
}
//一页显示几个数据
PageHelper.startPage(pn 10);
ActivityExample activityExample = new ActivityExample();
activityExample.or();
List activityList = activityService.getAllActivity(activityExample);
//显示几个页号
PageInfo page = new PageInfo(activityList5);
model.addAttribute(“pageInfo“ page);
return “activity“;
}
@RequestMapping(“/showjson“)
@ResponseBody
public Msg showActivityJson(@RequestParam(value = “page“defaultValue = “1“) Integer pn Model model HttpSession session) {
Admin admin = (Admin) session.getAttribute(“admin“);
if (admin == null) {
return Msg.fail(“请先登录“);
}
ActivityExample activityExample = new ActivityExample();
activityExample.or();
List activityList = activityService.getAllActivity(activityExample);
return Msg.success(“获取活动信息成功“).add(“activity“activityList);
}
@RequestMapping(“/add“)
public String showAddActivity(HttpSession session) {
Admin admin = (Admin) session.getAttribute(“admin“);
if (admin == null) {
return “redirect:/admin/login“;
}
return “addActivity“;
}
@RequestMapping(“/addResult“)
public String addActivity(Activity activity) {
activityService.insertActivitySelective(activity);
return “redirect:/admin/activity/show“;
}
@RequestMapping(“/update“)
@ResponseBody
public Msg updateActivity(Integer goodsid Integer activityid HttpSession session) {
Admin admin = (Admin) session.getAttribute(“admin“);
if (admin == null) {
return Msg.fail(“请先登录“);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-04-28 21:05 shop\
目录 0 2018-04-30 14:53 shop\.git\
文件 23 2018-04-15 20:51 shop\.git\HEAD
文件 298 2018-04-15 20:51 shop\.git\config
文件 73 2018-04-15 20:50 shop\.git\desc
目录 0 2018-04-15 20:50 shop\.git\hooks\
文件 478 2018-04-15 20:50 shop\.git\hooks\applypatch-msg.sample
文件 896 2018-04-15 20:50 shop\.git\hooks\commit-msg.sample
文件 189 2018-04-15 20:50 shop\.git\hooks\post-update.sample
文件 424 2018-04-15 20:50 shop\.git\hooks\pre-applypatch.sample
文件 1642 2018-04-15 20:50 shop\.git\hooks\pre-commit.sample
文件 1348 2018-04-15 20:50 shop\.git\hooks\pre-push.sample
文件 4951 2018-04-15 20:50 shop\.git\hooks\pre-reba
文件 544 2018-04-15 20:50 shop\.git\hooks\pre-receive.sample
文件 1239 2018-04-15 20:50 shop\.git\hooks\prepare-commit-msg.sample
文件 3610 2018-04-15 20:50 shop\.git\hooks\update.sample
文件 33155 2018-04-29 19:38 shop\.git\index
目录 0 2018-04-15 20:50 shop\.git\info\
文件 240 2018-04-15 20:50 shop\.git\info\exclude
目录 0 2018-04-15 20:51 shop\.git\logs\
文件 175 2018-04-15 20:51 shop\.git\logs\HEAD
目录 0 2018-04-15 20:51 shop\.git\logs\refs\
目录 0 2018-04-15 20:51 shop\.git\logs\refs\heads\
文件 175 2018-04-15 20:51 shop\.git\logs\refs\heads\master
目录 0 2018-04-15 20:51 shop\.git\logs\refs\remotes\
目录 0 2018-04-15 20:51 shop\.git\logs\refs\remotes\origin\
文件 175 2018-04-15 20:51 shop\.git\logs\refs\remotes\origin\HEAD
目录 0 2018-04-29 19:38 shop\.git\ob
目录 0 2018-04-28 21:37 shop\.git\ob
文件 253 2018-04-28 21:37 shop\.git\ob
目录 0 2018-04-29 16:17 shop\.git\ob
............此处省略916个文件信息
- 上一篇:javaweb网络商城源码
- 下一篇:Java编写类似Flash的播放器
评论
共有 条评论