当前位置:   article > 正文

使用Springboot+vue+微信小程序开发校园二手商城系统_基于springboot的校园二手商城交易微信小程序的系统架构设计

基于springboot的校园二手商城交易微信小程序的系统架构设计

作者主页:编程千纸鹤

作者简介:Java、前端、Python开发多年,做过高程,项目经理,架构师

主要内容:Java项目开发、Python项目开发、大学数据和AI项目开发、单片机项目设计、面试技术整理、最新技术分享

收藏点赞不迷路  关注作者有好处

文末获得源码

 项目编号:BS-XCX-024

一,环境介绍

语言环境:Java:  jdk1.8 

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse+微信开发者工具

开发技术:Springboot+vue+微信小程序

二,项目简介

本项止基于Springboot+vue+微信小程序实现了一个校园二手物品商城交易系统。系统的后台使用springboot+mybatis开发实现,后台管理页面使用Vue+ElementUI开发实现,用户端基于微信小程序开发实现。前端用户使用微信登录小程序后,可以在线浏览二手商品,并在线购买下单和评论等,同时自己也可以发布相应的二手商品,并管理自己的订单信息和销售信息。管理员登录后台管理系统可以管理人员、商品分类、商品、订单等相关信息。具体见下面展示。

三,系统展示

前端小程序

在商品详情里可以和发布人在线发消息交流,在线评论,在线下单交易

商品分类查询

发布二手商品

在线信息交流

个人中心:可以管理自己发布的商品,查看自己的收藏记录,查看自己的订单,查看己销售的订单,查看评论和消息回复等。

后台管理

分类管理

商品管理

其它略

四,核心代码展示

  1. package com.spboot.tx.controller;
  2. import cn.hutool.core.bean.BeanUtil;
  3. import cn.hutool.core.util.StrUtil;
  4. import com.spboot.tx.mapper.*;
  5. import com.spboot.tx.pojo.*;
  6. import com.spboot.tx.service.*;
  7. import com.spboot.tx.utils.*;
  8. import io.swagger.annotations.*;
  9. import java.io.*;
  10. import java.util.*;
  11. import javax.annotation.Resource;
  12. import javax.servlet.ServletOutputStream;
  13. import javax.servlet.http.*;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.security.authentication.AuthenticationManager;
  16. import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
  17. import org.springframework.security.core.Authentication;
  18. import org.springframework.web.bind.annotation.*;
  19. @Api(tags = { "管理员控制器" })
  20. @RestController
  21. @RequestMapping("/api/admins")
  22. public class AdminsController {
  23. @Autowired
  24. public AdminsService adminsService;
  25. @Autowired
  26. public AdminsMapper adminsMapper;
  27. @Resource
  28. private HttpServletRequest request;
  29. @Resource
  30. private HttpServletResponse response;
  31. @ApiOperation(value = "获取全部管理员", httpMethod = "GET")
  32. @RequestMapping("/selectAll")
  33. public ResponseData<List<Admins>> selectAll() {
  34. return adminsService.selectAll();
  35. }
  36. @ApiOperation(value = "根据条件筛选获取管理员列表,并分页", httpMethod = "POST")
  37. @RequestMapping("/selectPages")
  38. public ResponseData selectPages(@RequestBody Map<String, Object> req) {
  39. return adminsService.selectPages(req);
  40. }
  41. @ApiOperation(value = "根据过滤信息获取相关数据", httpMethod = "POST")
  42. @RequestMapping("/filter")
  43. public ResponseData<List<Admins>> filter(@RequestBody Map<String, Object> req) {
  44. return adminsService.filter(req);
  45. }
  46. @Autowired
  47. private AuthenticationManager authenticationManager;
  48. @ApiOperation(value = "修改密码", httpMethod = "POST")
  49. @PostMapping("/editPassword")
  50. public ResponseData<Object> editPassword(
  51. @RequestParam(required = false) String oldPassword,
  52. @RequestParam(required = false) String newPwd,
  53. @RequestParam(required = false) String newPwd2
  54. ) {
  55. Authentication authentication = null;
  56. SessionUser user = Request.user();
  57. if (!user.getCx().equals("小程序")) {
  58. if (StrUtil.hasBlank(oldPassword) || StrUtil.hasBlank(newPwd) || StrUtil.hasBlank(newPwd2)) {
  59. return JsonResult.error("请输入密码");
  60. }
  61. if (!newPwd.equals(newPwd2)) {
  62. return JsonResult.error("确认密码不正确,请重试");
  63. }
  64. try {
  65. //会自动调用loadUserByUsername方法,若查到用户,且用户名密码正确,则验证通过。
  66. // 关于密码的解密,配置在WebSecurityConfig类中(与注册时的加密策略保持相同)
  67. String pwd = oldPassword;
  68. authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(user.getUsername(), pwd));
  69. } catch (Exception e) {
  70. e.printStackTrace();
  71. //当loadUserByUsername方法找不到用户时,会进入此异常
  72. //若查到用户,且用户名密码不匹配,会进入此异常
  73. return JsonResult.error("原密码错误");
  74. }
  75. Admins admins = adminsMapper.selectById(user.getId());
  76. admins.setPwd(newPwd);
  77. return adminsService.update(admins, new HashMap());
  78. }
  79. return JsonResult.error("此用户不支持修改密码");
  80. }
  81. @ApiOperation(value = "根据id获取信息", httpMethod = "GET")
  82. @RequestMapping("/findById")
  83. @ApiImplicitParam(name = "id", value = "管理员对应的id", dataType = "Integer")
  84. public ResponseData findById(@RequestParam Integer id) {
  85. return adminsService.findById(id);
  86. }
  87. @ApiOperation(value = "根据id更新数据", httpMethod = "POST")
  88. @RequestMapping("/update")
  89. @ApiImplicitParam(name = "data", value = "使用json数据提交", type = "json", dataTypeClass = Admins.class, paramType = "body")
  90. public ResponseData update(@RequestBody Map data) {
  91. Admins post = BeanUtil.mapToBean(data, Admins.class, true);
  92. return adminsService.update(post, data);
  93. }
  94. @ApiOperation(value = "插入一行数据,返回插入后的管理员", httpMethod = "POST")
  95. @RequestMapping("/insert")
  96. @ApiImplicitParam(name = "data", value = "使用json数据提交", type = "json", dataTypeClass = Admins.class, paramType = "body")
  97. public ResponseData insert(@RequestBody Map data) {
  98. Admins post = BeanUtil.mapToBean(data, Admins.class, true);
  99. return adminsService.insert(post, data);
  100. }
  101. @ApiOperation(value = "根据id列表删除数据", httpMethod = "POST")
  102. @RequestMapping("/delete")
  103. @ApiImplicitParam(name = "id", value = "管理员对应的id", type = "json", dataTypeClass = List.class)
  104. public ResponseData delete(@RequestBody List<Integer> id) {
  105. return adminsService.delete(id);
  106. }
  107. }
  1. package com.spboot.tx.controller;
  2. import cn.hutool.core.bean.BeanUtil;
  3. import com.spboot.tx.mapper.*;
  4. import com.spboot.tx.pojo.*;
  5. import com.spboot.tx.service.*;
  6. import com.spboot.tx.utils.*;
  7. import io.swagger.annotations.*;
  8. import java.io.*;
  9. import java.util.*;
  10. import javax.annotation.Resource;
  11. import javax.servlet.ServletOutputStream;
  12. import javax.servlet.http.*;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.*;
  15. @Api(tags = { "地区控制器" })
  16. @RestController
  17. @RequestMapping("/api/diqu")
  18. public class DiquController {
  19. @Autowired
  20. public DiquService diquService;
  21. @Resource
  22. private HttpServletRequest request;
  23. @Resource
  24. private HttpServletResponse response;
  25. @ApiOperation(value = "获取全部地区", httpMethod = "GET")
  26. @RequestMapping("/selectAll")
  27. public ResponseData<List<Diqu>> selectAll() {
  28. return diquService.selectAll();
  29. }
  30. @ApiOperation(value = "根据条件筛选获取地区列表,并分页", httpMethod = "POST")
  31. @RequestMapping("/selectPages")
  32. public ResponseData selectPages(@RequestBody Map<String, Object> req) {
  33. return diquService.selectPages(req);
  34. }
  35. @ApiOperation(value = "根据过滤信息获取相关数据", httpMethod = "POST")
  36. @RequestMapping("/filter")
  37. public ResponseData<List<Diqu>> filter(@RequestBody Map<String, Object> req) {
  38. return diquService.filter(req);
  39. }
  40. @ApiOperation(value = "根据id获取信息", httpMethod = "GET")
  41. @RequestMapping("/findById")
  42. @ApiImplicitParam(name = "id", value = "地区对应的id", dataType = "Integer")
  43. public ResponseData findById(@RequestParam Integer id) {
  44. return diquService.findById(id);
  45. }
  46. @ApiOperation(value = "根据id更新数据", httpMethod = "POST")
  47. @RequestMapping("/update")
  48. @ApiImplicitParam(name = "data", value = "使用json数据提交", type = "json", dataTypeClass = Diqu.class, paramType = "body")
  49. public ResponseData update(@RequestBody Map data) {
  50. Diqu post = BeanUtil.mapToBean(data, Diqu.class, true);
  51. return diquService.update(post, data);
  52. }
  53. @ApiOperation(value = "插入一行数据,返回插入后的地区", httpMethod = "POST")
  54. @RequestMapping("/insert")
  55. @ApiImplicitParam(name = "data", value = "使用json数据提交", type = "json", dataTypeClass = Diqu.class, paramType = "body")
  56. public ResponseData insert(@RequestBody Map data) {
  57. Diqu post = BeanUtil.mapToBean(data, Diqu.class, true);
  58. return diquService.insert(post, data);
  59. }
  60. @ApiOperation(value = "根据id列表删除数据", httpMethod = "POST")
  61. @RequestMapping("/delete")
  62. @ApiImplicitParam(name = "id", value = "地区对应的id", type = "json", dataTypeClass = List.class)
  63. public ResponseData delete(@RequestBody List<Integer> id) {
  64. return diquService.delete(id);
  65. }
  66. }

五,相关作品展示

基于Java开发、Python开发、PHP开发、C#开发等相关语言开发的实战项目

基于Nodejs、Vue等前端技术开发的前端实战项目

基于微信小程序和安卓APP应用开发的相关作品

基于51单片机等嵌入式物联网开发应用

基于各类算法实现的AI智能应用

基于大数据实现的各类数据管理和推荐系统

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/405270
推荐阅读
相关标签
  

闽ICP备14008679号