使用Springboot+vue+微信小程序开发校园二手商城系统

简介: 使用Springboot+vue+微信小程序开发校园二手商城系统

项目编号:BS-XCX-024

一,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

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

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

二,项目简介

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

三,系统展示

前端小程序

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

商品分类查询

发布二手商品

在线信息交流

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

后台管理

分类管理

商品管理

其它略

四,核心代码展示

package com.spboot.tx.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.spboot.tx.mapper.*;
import com.spboot.tx.pojo.*;
import com.spboot.tx.service.*;
import com.spboot.tx.utils.*;
import io.swagger.annotations.*;
import java.io.*;
import java.util.*;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;
@Api(tags = { "管理员控制器" })
@RestController
@RequestMapping("/api/admins")
public class AdminsController {
    @Autowired
    public AdminsService adminsService;
    @Autowired
    public AdminsMapper adminsMapper;
    @Resource
    private HttpServletRequest request;
    @Resource
    private HttpServletResponse response;
    @ApiOperation(value = "获取全部管理员", httpMethod = "GET")
    @RequestMapping("/selectAll")
    public ResponseData<List<Admins>> selectAll() {
        return adminsService.selectAll();
    }
    @ApiOperation(value = "根据条件筛选获取管理员列表,并分页", httpMethod = "POST")
    @RequestMapping("/selectPages")
    public ResponseData selectPages(@RequestBody Map<String, Object> req) {
        return adminsService.selectPages(req);
    }
    @ApiOperation(value = "根据过滤信息获取相关数据", httpMethod = "POST")
    @RequestMapping("/filter")
    public ResponseData<List<Admins>> filter(@RequestBody Map<String, Object> req) {
        return adminsService.filter(req);
    }
    @Autowired
    private AuthenticationManager authenticationManager;
    @ApiOperation(value = "修改密码", httpMethod = "POST")
    @PostMapping("/editPassword")
    public ResponseData<Object> editPassword(
        @RequestParam(required = false) String oldPassword,
        @RequestParam(required = false) String newPwd,
        @RequestParam(required = false) String newPwd2
    ) {
        Authentication authentication = null;
        SessionUser user = Request.user();
        if (!user.getCx().equals("小程序")) {
            if (StrUtil.hasBlank(oldPassword) || StrUtil.hasBlank(newPwd) || StrUtil.hasBlank(newPwd2)) {
                return JsonResult.error("请输入密码");
            }
            if (!newPwd.equals(newPwd2)) {
                return JsonResult.error("确认密码不正确,请重试");
            }
            try {
                //会自动调用loadUserByUsername方法,若查到用户,且用户名密码正确,则验证通过。
                // 关于密码的解密,配置在WebSecurityConfig类中(与注册时的加密策略保持相同)
                String pwd = oldPassword;
                authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(user.getUsername(), pwd));
            } catch (Exception e) {
                e.printStackTrace();
                //当loadUserByUsername方法找不到用户时,会进入此异常
                //若查到用户,且用户名密码不匹配,会进入此异常
                return JsonResult.error("原密码错误");
            }
            Admins admins = adminsMapper.selectById(user.getId());
            admins.setPwd(newPwd);
            return adminsService.update(admins, new HashMap());
        }
        return JsonResult.error("此用户不支持修改密码");
    }
    @ApiOperation(value = "根据id获取信息", httpMethod = "GET")
    @RequestMapping("/findById")
    @ApiImplicitParam(name = "id", value = "管理员对应的id", dataType = "Integer")
    public ResponseData findById(@RequestParam Integer id) {
        return adminsService.findById(id);
    }
    @ApiOperation(value = "根据id更新数据", httpMethod = "POST")
    @RequestMapping("/update")
    @ApiImplicitParam(name = "data", value = "使用json数据提交", type = "json", dataTypeClass = Admins.class, paramType = "body")
    public ResponseData update(@RequestBody Map data) {
        Admins post = BeanUtil.mapToBean(data, Admins.class, true);
        return adminsService.update(post, data);
    }
    @ApiOperation(value = "插入一行数据,返回插入后的管理员", httpMethod = "POST")
    @RequestMapping("/insert")
    @ApiImplicitParam(name = "data", value = "使用json数据提交", type = "json", dataTypeClass = Admins.class, paramType = "body")
    public ResponseData insert(@RequestBody Map data) {
        Admins post = BeanUtil.mapToBean(data, Admins.class, true);
        return adminsService.insert(post, data);
    }
    @ApiOperation(value = "根据id列表删除数据", httpMethod = "POST")
    @RequestMapping("/delete")
    @ApiImplicitParam(name = "id", value = "管理员对应的id", type = "json", dataTypeClass = List.class)
    public ResponseData delete(@RequestBody List<Integer> id) {
        return adminsService.delete(id);
    }
}
package com.spboot.tx.controller;
import cn.hutool.core.bean.BeanUtil;
import com.spboot.tx.mapper.*;
import com.spboot.tx.pojo.*;
import com.spboot.tx.service.*;
import com.spboot.tx.utils.*;
import io.swagger.annotations.*;
import java.io.*;
import java.util.*;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = { "地区控制器" })
@RestController
@RequestMapping("/api/diqu")
public class DiquController {
    @Autowired
    public DiquService diquService;
    @Resource
    private HttpServletRequest request;
    @Resource
    private HttpServletResponse response;
    @ApiOperation(value = "获取全部地区", httpMethod = "GET")
    @RequestMapping("/selectAll")
    public ResponseData<List<Diqu>> selectAll() {
        return diquService.selectAll();
    }
    @ApiOperation(value = "根据条件筛选获取地区列表,并分页", httpMethod = "POST")
    @RequestMapping("/selectPages")
    public ResponseData selectPages(@RequestBody Map<String, Object> req) {
        return diquService.selectPages(req);
    }
    @ApiOperation(value = "根据过滤信息获取相关数据", httpMethod = "POST")
    @RequestMapping("/filter")
    public ResponseData<List<Diqu>> filter(@RequestBody Map<String, Object> req) {
        return diquService.filter(req);
    }
    @ApiOperation(value = "根据id获取信息", httpMethod = "GET")
    @RequestMapping("/findById")
    @ApiImplicitParam(name = "id", value = "地区对应的id", dataType = "Integer")
    public ResponseData findById(@RequestParam Integer id) {
        return diquService.findById(id);
    }
    @ApiOperation(value = "根据id更新数据", httpMethod = "POST")
    @RequestMapping("/update")
    @ApiImplicitParam(name = "data", value = "使用json数据提交", type = "json", dataTypeClass = Diqu.class, paramType = "body")
    public ResponseData update(@RequestBody Map data) {
        Diqu post = BeanUtil.mapToBean(data, Diqu.class, true);
        return diquService.update(post, data);
    }
    @ApiOperation(value = "插入一行数据,返回插入后的地区", httpMethod = "POST")
    @RequestMapping("/insert")
    @ApiImplicitParam(name = "data", value = "使用json数据提交", type = "json", dataTypeClass = Diqu.class, paramType = "body")
    public ResponseData insert(@RequestBody Map data) {
        Diqu post = BeanUtil.mapToBean(data, Diqu.class, true);
        return diquService.insert(post, data);
    }
    @ApiOperation(value = "根据id列表删除数据", httpMethod = "POST")
    @RequestMapping("/delete")
    @ApiImplicitParam(name = "id", value = "地区对应的id", type = "json", dataTypeClass = List.class)
    public ResponseData delete(@RequestBody List<Integer> id) {
        return diquService.delete(id);
    }
}

五,相关作品展示

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

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

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

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

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

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

相关文章
|
10天前
|
前端开发 JavaScript Java
【03】Java+若依+vue.js技术栈实现钱包积分管理系统项目-若依框架搭建-服务端-后台管理-整体搭建-优雅草卓伊凡商业项目实战
【03】Java+若依+vue.js技术栈实现钱包积分管理系统项目-若依框架搭建-服务端-后台管理-整体搭建-优雅草卓伊凡商业项目实战
57 13
【03】Java+若依+vue.js技术栈实现钱包积分管理系统项目-若依框架搭建-服务端-后台管理-整体搭建-优雅草卓伊凡商业项目实战
|
11天前
|
人工智能 JavaScript 关系型数据库
【02】Java+若依+vue.js技术栈实现钱包积分管理系统项目-商业级电玩城积分系统商业项目实战-ui设计图figmaUI设计准备-figma汉化插件-mysql数据库设计-优雅草卓伊凡商业项目实战
【02】Java+若依+vue.js技术栈实现钱包积分管理系统项目-商业级电玩城积分系统商业项目实战-ui设计图figmaUI设计准备-figma汉化插件-mysql数据库设计-优雅草卓伊凡商业项目实战
57 14
【02】Java+若依+vue.js技术栈实现钱包积分管理系统项目-商业级电玩城积分系统商业项目实战-ui设计图figmaUI设计准备-figma汉化插件-mysql数据库设计-优雅草卓伊凡商业项目实战
|
9天前
|
SQL JavaScript 安全
【04】Java+若依+vue.js技术栈实现钱包积分管理系统项目-若依框架二次开发准备工作-以及建立初步后端目录菜单列-优雅草卓伊凡商业项目实战
【04】Java+若依+vue.js技术栈实现钱包积分管理系统项目-若依框架二次开发准备工作-以及建立初步后端目录菜单列-优雅草卓伊凡商业项目实战
47 11
【04】Java+若依+vue.js技术栈实现钱包积分管理系统项目-若依框架二次开发准备工作-以及建立初步后端目录菜单列-优雅草卓伊凡商业项目实战
|
13天前
|
人工智能 JavaScript 安全
【01】Java+若依+vue.js技术栈实现钱包积分管理系统项目-商业级电玩城积分系统商业项目实战-需求改为思维导图-设计数据库-确定基础架构和设计-优雅草卓伊凡商业项目实战
【01】Java+若依+vue.js技术栈实现钱包积分管理系统项目-商业级电玩城积分系统商业项目实战-需求改为思维导图-设计数据库-确定基础架构和设计-优雅草卓伊凡商业项目实战
57 13
【01】Java+若依+vue.js技术栈实现钱包积分管理系统项目-商业级电玩城积分系统商业项目实战-需求改为思维导图-设计数据库-确定基础架构和设计-优雅草卓伊凡商业项目实战
|
4月前
|
JSON 小程序 JavaScript
uni-app开发微信小程序的报错[渲染层错误]排查及解决
uni-app开发微信小程序的报错[渲染层错误]排查及解决
975 7
|
4月前
|
小程序 JavaScript 前端开发
uni-app开发微信小程序:四大解决方案,轻松应对主包与vendor.js过大打包难题
uni-app开发微信小程序:四大解决方案,轻松应对主包与vendor.js过大打包难题
930 1
|
4月前
|
小程序 前端开发 测试技术
微信小程序的开发完整流程是什么?
微信小程序的开发完整流程是什么?
278 7
|
4月前
|
缓存 小程序 索引
uni-app开发微信小程序时vant组件van-tabs的使用陷阱及解决方案
uni-app开发微信小程序时vant组件van-tabs的使用陷阱及解决方案
335 1
|
4月前
|
小程序 前端开发 数据安全/隐私保护
微信小程序全栈开发中的身份认证与授权机制
【10月更文挑战第3天】随着移动互联网的发展,微信小程序凭借便捷的用户体验和强大的社交传播能力,成为企业拓展业务的新渠道。本文探讨了小程序全栈开发中的身份认证与授权机制,包括手机号码验证、微信登录、第三方登录及角色权限控制等方法,并强调了安全性、用户体验和合规性的重要性,帮助开发者更好地理解和应用这一关键技术。
141 5
|
4月前
|
小程序 前端开发 JavaScript
微信小程序全栈开发中的PWA技术应用
【10月更文挑战第3天】微信小程序作为新兴应用形态,凭借便捷体验与社交传播能力,成为企业拓展业务的新渠道。本文探讨了微信小程序全栈开发中的PWA技术应用,包括离线访问、后台运行、桌面图标及原生体验等方面,助力开发者提升小程序性能与用户体验。PWA技术在不同平台的兼容性、性能优化及用户体验是实践中需注意的关键点。
98 5

热门文章

最新文章