基于SpringBoot的校园闲置物品交易系统

收藏关注不迷路,源码文章末


一、项目介绍

  校园闲置物品交易系统在对开发工具的选择上也很慎重,为了便于开发实现,选择的开发工具为Eclipse,选择的数据库工具为Mysql。以此搭建开发环境实现校园闲置物品交易系统的功能。其中管理员管理用户,新闻资讯。
校园闲置物品交易系统是一款运用软件开发技术设计实现的应用系统,在信息处理上可以达到快速的目的,不管是针对数据添加,数据维护和统计,以及数据查询等处理要求,校园闲置物品交易系统都可以轻松应对。
关键词:校园闲置物品交易系统;SpringBoot框架,系统分析,数据库设计

二、开发环境

开发语言:Java
框架:springboot
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven
————————————————

三、功能介绍

为了让系统的编码可以顺利进行,特意对本系统功能进行细分设计,设计的系统功能结构见下图。
在这里插入图片描述

图4.1 系统功能结构图

四、核心代码

部分代码:

package com.example.controller;

import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.example.common.Result;
import com.example.common.ResultCode;
import com.example.entity.Caiwu;
import com.example.exception.CustomException;
import com.example.service.CaiwuService;
import com.example.utils.MapWrapperUtils;
import com.example.utils.jwt.JwtUtil;
import com.example.vo.CaiwuVo;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(value = "/caiwu")
public class CaiwuController {

    @Resource
    private CaiwuService caiwuService;

    @PostMapping
    public Result<Caiwu> add(@RequestBody CaiwuVo caiwu) {
        caiwuService.add(caiwu);
           return Result.success(caiwu);
    }
	
	

    @PostMapping("/deleteList")
    public Result<Caiwu> deleteList(@RequestBody CaiwuVo caiwu) {
        caiwuService.deleteList(caiwu.getList());
        return Result.success();
    }

    @DeleteMapping("/{id}")
    public Result delete(@PathVariable Long id) {
        caiwuService.delete(id);
        return Result.success();
    }

    @PutMapping
    public Result update(@RequestBody CaiwuVo caiwu) {
        caiwuService.update(caiwu);
        return Result.success();
    }

    @GetMapping("/{id}")
    public Result<Caiwu> detail(@PathVariable Integer id) {
        Caiwu caiwu = caiwuService.findById(id);
        return Result.success(caiwu);
    }

    @GetMapping
    public Result<List<Caiwu>> all() {
        return Result.success(caiwuService.list());
    }

    @PostMapping("/page")
    public Result<CaiwuVo> page(@RequestBody CaiwuVo caiwuVo) {
        return Result.success(caiwuService.findPage(caiwuVo));
    }
	    @PostMapping("/login")
    public Result login(@RequestBody Caiwu caiwu, HttpServletRequest request) {
        if (StrUtil.isBlank(caiwu.getZhanghao()) || StrUtil.isBlank(caiwu.getMima())) {
            throw new CustomException(ResultCode.PARAM_LOST_ERROR);
        }
        Caiwu login = caiwuService.login(caiwu);
//        if(!login.getStatus()){
//            return Result.error("1001","状态限制,无法登录系统");
//        }
        if(login != null) {
            HashMap hashMap = new HashMap();
            hashMap.put("user", login);
            Map<String, Object> map = MapWrapperUtils.builder(MapWrapperUtils.KEY_USER_ID,caiwu.getId());
            String token = JwtUtil.creatToken(map);
            hashMap.put("token", token);
            return Result.success(hashMap);
        }else {
            return Result.error();
        }
    }
    @PutMapping("/updatePassword")
    public Result updatePassword(@RequestBody Caiwu info, HttpServletRequest request) {
        Caiwu caiwu = caiwuService.findById(info.getId());
        String oldPassword = SecureUtil.md5(info.getMima());
        if (!oldPassword.equals(caiwu.getMima())) {
            return Result.error(ResultCode.PARAM_PASSWORD_ERROR.code, ResultCode.PARAM_PASSWORD_ERROR.msg);
        }
        info.setMima(SecureUtil.md5(info.getNewPassword()));
        Caiwu caiwu1 = new Caiwu();
        BeanUtils.copyProperties(info, caiwu1);
        caiwuService.update(caiwu1);
        return Result.success();
    }
}

五、效果图

请添加图片描述

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

六、文章目录

目 录
目 录 III
第1章 绪论 1
1.1选题动因 1
1.2目的和意义 1
1.3论文结构安排 2
第2章 开发环境与技术 3
2.1 MYSQL数据库 3
2.2 Tomcat 介绍 3
2.3 vue技术 4
2.4 SpringBoot框架 5
第3章 系统分析 5
3.1可行性分析 5
3.1.1操作可行性分析 5
3.1.2经济可行性分析 6
3.1.3技术可行性分析 6
3.2系统流程分析 6
3.3系统性能分析 8
第4章 系统设计 9
4.1界面设计原则 9
4.2功能结构设计 10
4.3数据库设计 10
4.3.2 数据库物理设计 13
第5章 系统实现 17
5.1用户信息管理 17
5.2闲置物品管理 17
5.3资讯类型管理 18
5.1资讯信息管理 19
第6章 系统测试 20
6.1软件测试 20
6.2测试环境 20
6.3测试测试用例 20
6.4测试结果 21
结 论 22
参考文献 24
致 谢 25

  • 16
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
<?php include("top.php"); ?> <table width="766" height="438" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="209" height="438" valign="top" bgcolor="#Ffffff"><?php include("left.php");?></td> <td width="581" align="center" valign="top" bgcolor="#FFFFFF"><table width="550" height="32" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="32" background="images/hogoods.gif"> </td> </tr> </table> <table width="550" height="10" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td background="images/line1.gif"></td> </tr> </table> <?php $sql=mysql_query("select count(*) as total from tb_shangpin order by cishu desc ",$conn); $info=mysql_fetch_array($sql); $total=$info[total]; if($total==0) { echo "本站暂无推荐产品!"; } else { ?> <table width="550" height="70" border="0" align="center" cellpadding="0" cellspacing="0"> <?php $pagesize=20; if ($total<=$pagesize){ $pagecount=1; } if(($total%$pagesize)!=0){ $pagecount=intval($total/$pagesize)+1; }else{ $pagecount=$total/$pagesize; } if(($_GET[page])==""){ $page=1; }else{ $page=intval($_GET[page]); } $sql1=mysql_query("select * from tb_shangpin order by cishu desc limit ".($page-1)*$pagesize.",$pagesize ",$conn); while($info1=mysql_fetch_array($sql1)) { ?> <tr> <td width="89" rowspan="6"><div align="center"> <?php if($info1[tupian]=="") { echo "暂无图片!"; } else { ?> <a href="lookinfo.php?id=<?php echo $info1[id];?>" ><img border="0" width="80" height="80" src="<?php echo $info1[tupian];?>"></a> <?php } ?> </div></td> <td width="93" height="20"><div align="center" style="color: #000000">商品名称:</div></td> <td colspan="5"><div align="left"> <a href="lookinfo.php?id=<?php echo $info1[id];?>"><?php echo $info1[mingcheng];?></a></div></td> </tr> <tr> <td width="93" height="20"><div align="center" style="color: #000000">商品品牌:</div></td> <td width="101" height="20"><div align="left"><?php echo $info1[pinpai];?></div></td> <td width="62"><div align="center" style="color: #000000">商品型号:</div></td> <td colspan="3"><div align="left"><?php echo $info1[xinghao];?></div></td> </tr> <tr> <td width="93" height="20"><div align="center" style="color: #000000">商品简介:</div></td> <td height="20" colspan="5"><div align="left"><?php echo $info1[jianjie];?></div></td> </tr> <tr> <td height="20"><div align="center" style="color: #000000">上市日期:</div></td> <td height="20"><div align="left"><?php echo $info1[addtime];?></div></td> <td height="20"><div align="center" style="color: #000000">剩余数量:</div></td> <td width="69" height="20"><div align="left"><?php echo $info1[shuliang];?></div></td> <td width="63"><div align="center" style="color: #000000">商品等级:</div></td> <td width="73"><div align="left"><?php echo $info1[dengji];?></div></td> </tr> <tr> <td height="20"><div align="center" style="color: #000000">购入价:</div></td> <td height="20"><div align="left"><?php echo $info1[gourujia];?>元</div></td> <td height="20"><div align="center" style="color: #000000">转让价:</div></td> <td height="20"><div align="left"><?php echo $info1[zhuanrangjia];?>元</div></td> <td height="20"><div align="center" style="color: #000000">折扣:</div></td> <td height="20"><div align="left"><?php echo (ceil(($info1[zhuanrangjia]/$info1[gourujia])*100))."%";?></div></td> </tr> <tr> <td height="20" colspan="6" width="461"><div align="center">    <a href="addgouwuche.php?id=<?php echo $info1[id];?>"><img src="images/goumai_btn.gif" width="60" height="18" border="0" style=" cursor:hand"></a></div></td> </tr> <tr> <td height="10" colspan="7" background="images/line1.gif"></td> </tr> <?php } ?> </table> <table width="550" height="25" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center">本站共有热门产品  <?php echo $total; ?>  件 每页显示 <?php echo $pagesize;?> 件 第 <?php echo $page;?> 页/共 <?php echo $pagecount; ?> 页 <?php if($page>=2) { ?> <a href="showhot.php?page=1" title="首页"><font face="webdings"> 9 </font></a> <a href="showhot.php?id=<?php echo $id;?>&page=<?php echo $page-1;?>" title="前一页"><font face="webdings"> 7 </font></a> <?php } if($pagecount<=4){ for($i=1;$i<=$pagecount;$i++){ ?> <a href="showhot.php?page=<?php echo $i;?>"><?php echo $i;?></a> <?php } }else{ for($i=1;$i<=4;$i++){ ?> <a href="showhot.php?page=<?php echo $i;?>"><?php echo $i;?></a> <?php }?> <a href="showhot.php?page=<?php echo $page-1;?>" title="后一页"><font face="webdings"> 8 </font></a> <a href="showhot.php?id=<?php echo $id;?>&page=<?php echo $pagecount;?>" title="尾页"><font face="webdings"> : </font></a> <?php }?> </div></td> </tr> </table> <?php } ?></td> </tr> </table> <?php include("bottom.php"); ?>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

QQ1039692211

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值