项目介绍
校园二手交易系统
一、技术栈
基于springboot的校园二手市场:
二、项目功能介绍
1、后台功能介绍
1、菜单管理 2、角色管理
3、用户管理 4、日志管理
5、数据备份 6、分类管理
7、物品管理 8、求购物品
9、用户管理 10、评论管理
11、举报管理 12、公告管理
13、网站设置 14、搜索功能
2、前台功能介绍
1、用户注册 2、用户注册 3、个人资料编辑 4、发布商品(卖) 5、购买商品(买) 6、求购专区 7、发表评论 8、搜索商品
三、后台页面展示
四、前台页面展示
五、部分代码
package com.yuanlrc.campus_market.controller.admin;
import java.util.List;
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.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yuanlrc.campus_market.bean.PageBean;
import com.yuanlrc.campus_market.bean.Result;
import com.yuanlrc.campus_market.entity.common.Comment;
import com.yuanlrc.campus_market.entity.common.Goods;
import com.yuanlrc.campus_market.entity.common.Student;
import com.yuanlrc.campus_market.service.common.CommentService;
import com.yuanlrc.campus_market.service.common.GoodsService;
import com.yuanlrc.campus_market.service.common.StudentService;
/**
* 后台物品评论管理控制器
* @author Administrator
*
*/
@RequestMapping("/admin/comment")
@Controller
public class CommentController {
@Autowired
private GoodsService goodsService;
@Autowired
private StudentService studentService;
@Autowired
private CommentService commentService;
/**
* 物品评论管理列表页面
* @param name
* @param pageBean
* @param model
* @return
*/
@RequestMapping(value="/list")
public String list(Comment comment,PageBean<Comment> pageBean,Model model){
if(comment.getStudent() != null && comment.getStudent().getSn() != null){
Student student = studentService.findBySn(comment.getStudent().getSn());
if(student != null){
comment.setStudent(student);
}
}
List<Goods> goodsList = null;
if(comment.getGoods() != null && comment.getGoods().getName() != null){
goodsList = goodsService.findListByName(comment.getGoods().getName());
}
model.addAttribute("title", "物品评论列表");
model.addAttribute("content", comment.getContent());
model.addAttribute("name", comment.getGoods() == null ? null : comment.getGoods().getName());
model.addAttribute("sn", comment.getStudent() == null ? null : comment.getStudent().getSn());
model.addAttribute("pageBean", commentService.findlist(pageBean, comment,goodsList));
return "admin/comment/list";
}
/**
* 物品评论删除操作
* @param id
* @return
*/
@RequestMapping(value="/delete",method=RequestMethod.POST)
@ResponseBody
public Result<Boolean> delete(@RequestParam(name="id",required=true)Long id){
commentService.delete(id);
return Result.success(true);
}
}
package com.yuanlrc.campus_market.controller.admin;
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.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yuanlrc.campus_market.bean.PageBean;
import com.yuanlrc.campus_market.bean.Result;
import com.yuanlrc.campus_market.entity.common.Student;
import com.yuanlrc.campus_market.entity.common.WantedGoods;
import com.yuanlrc.campus_market.service.common.StudentService;
import com.yuanlrc.campus_market.service.common.WantedGoodsService;
/**
* 后台求购物品管理控制器
* @author Administrator
*
*/
@RequestMapping("/admin/wanted_goods")
@Controller
public class WantedGoodsController {
@Autowired
private WantedGoodsService wantedGoodsService;
@Autowired
private StudentService studentService;
/**
* 求购物品管理列表页面
* @param name
* @param pageBean
* @param model
* @return
*/
@RequestMapping(value="/list")
public String list(WantedGoods wantedGoods,PageBean<WantedGoods> pageBean,Model model){
if(wantedGoods.getStudent() != null && wantedGoods.getStudent().getSn() != null){
Student student = studentService.findBySn(wantedGoods.getStudent().getSn());
if(student != null){
wantedGoods.setStudent(student);
}
}
model.addAttribute("title", "求购物品列表");
model.addAttribute("name", wantedGoods.getName());
model.addAttribute("sn", wantedGoods.getStudent() == null ? null : wantedGoods.getStudent().getSn());
model.addAttribute("pageBean", wantedGoodsService.findWantedGoodslist(pageBean, wantedGoods));
return "admin/wanted_goods/list";
}
/**
* 求购物品删除操作
* @param id
* @return
*/
@RequestMapping(value="/delete",method=RequestMethod.POST)
@ResponseBody
public Result<Boolean> delete(@RequestParam(name="id",required=true)Long id){
wantedGoodsService.delete(id);
return Result.success(true);
}
}
package com.yuanlrc.campus_market.controller.home;
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.RequestMethod;
import com.yuanlrc.campus_market.bean.PageBean;
import com.yuanlrc.campus_market.entity.common.WantedGoods;
import com.yuanlrc.campus_market.service.common.WantedGoodsService;
/**
* 求购物品控制器
* @author Administrator
*
*/
@RequestMapping("/home/wanted_goods")
@Controller
public class HomeWantedGoodsController {
@Autowired
private WantedGoodsService wantedGoodsService;
/**
* 求购物品列表页面
* @param model
* @param pageBean
* @param WantedGoods
* @return
*/
@RequestMapping(value="/list",method=RequestMethod.GET)
public String list(Model model,PageBean<WantedGoods> pageBean,WantedGoods WantedGoods){
model.addAttribute("pageBean", wantedGoodsService.findlist(pageBean, WantedGoods));
return "home/wanted_goods/list";
}
}