基于javaweb的校园二手交易平台(java+ssm+thymeleaf+html+jquery+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ZPPFhFqE-1666535355222)(https://pic1.imgdb.cn/files/52560/project20/20220520141132.jpg)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-RyGej2y0-1666535355224)(https://pic1.imgdb.cn/files/52560/project20/20220520141133.jpg)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-1hNyJbQg-1666535355225)(https://pic1.imgdb.cn/files/52560/project20/20220520141134.jpg)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-kuLOtFuv-1666535355225)(https://pic1.imgdb.cn/files/52560/project20/20220520141135.jpg)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Q2T55ZTx-1666535355227)(https://pic1.imgdb.cn/files/52560/project20/20220520141136.jpg)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-LT8vSLiD-1666535355230)(https://pic1.imgdb.cn/files/52560/project20/20220520141137.jpg)]
基于javaweb+ssm的校园二手交易平台(java+SSM+Thymeleaf+Html+jQuery+mysql)
项目介绍
本次设计的是一个校园二手交易平台(C2C),C2C指个人与个人之间的电子商务,买家可以查看所有卖家发布的商品,并且根据分类进行商品过滤,也可以根据站内搜索引擎进行商品的查询,并且与卖家联系,达成交易的意向,也可以发布求购的信息,让卖家查看之后,与之联系,进行交易。而此次主要是针对校园用户所设计的网站,对于数据的分类应该更多的考虑校园用户的需求,例如二手书籍、二手数码等的分类应该更加细致。由于是C2C的项目,因此本项目无需后台管理。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7版本;
技术栈
- 后端:Spring SpringMVC MyBatis 2. 前端:Thymeleaf+Html+jQuery
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行; 3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/xxx 登录
用户管理控制层:
@Controller
@RequestMapping(value = “user”)
public class UserController {
private final GoodService goodService;
private final OrderService orderService;
private final ReviewService reviewService;
private final UserService userService;
private final CollectService collectService;
@Autowired
public UserController(GoodService goodService, OrderService orderService,
ReviewService reviewService, UserService userService,
CollectService collectService) {
this.goodService = goodService;
this.orderService = orderService;
this.reviewService = reviewService;
this.userService = userService;
this.collectService = collectService;
@RequestMapping(value = “userProfile”, method = RequestMethod.GET)
public String getMyProfile(ModelMap model, HttpSession session) {
User user = (User) session.getAttribute(“user”);
if (user == null) {
return “redirect:/”;
List collects = collectService
.getCollectByUserId(user.getId());
for (Collect collect : collects) {
collect.setGood(goodService.getGoodById(collect.getGoodId()));
List goods = goodService.getGoodByUserId(user.getId());
List orders = orderService.getOrderByCustomerId(user.getId());
List reviews = reviewService.gerReviewByToUserId(user.getId());
List replies = reviewService.gerReplyByToUserId(user.getId());
List sellGoods = orderService.getOrderBySellerId(user.getId());
model.addAttribute(“collects”, collects);
model.addAttribute(“goods”, goods);
model.addAttribute(“orders”, orders);
model.addAttribute(“reviews”, reviews);
model.addAttribute(“replies”, replies);
model.addAttribute(“sellGoods”, sellGoods);
return “user/userProfile”;
@RequestMapping(value = “/review”, method = RequestMethod.GET)
public String getReviewInfo(@RequestParam(required = false) Integer goodId,
@RequestParam(required = false) Integer reviewId) {
System.out.println(“reviewId” + reviewId);
if (reviewId != null) {
System.out.println(“reviewId” + reviewId);
if (reviewService.updateReviewStatus(1, reviewId) == 1) {
return “redirect:/goods/goodInfo?goodId=” + goodId;
return “redirect:/user/userProfile”;
@RequestMapping(value = “/reply”, method = RequestMethod.GET)
public String getReplyInfo(
@RequestParam(required = false) Integer reviewId,
@RequestParam(required = false) Integer replyId) {
if (replyId != null) {
if (reviewService.updateReplyStatus(1, replyId) == 1) {
Integer goodId = reviewService.getGoodIdByReviewId(reviewId);
return “redirect:/goods/goodInfo?goodId=” + goodId;
return “redirect:/user/userProfile”;
@RequestMapping(value = “/userEdit”, method = RequestMethod.GET)
public String getUserEdit(ModelMap model,
@RequestParam(value = “userId”, required = false) Integer userId,
HttpSession session) {
User sessionUser = (User) session.getAttribute(“user”);</