完整教程:【JAVA项目】基于JAVA的网上商城系统
一、项目介绍
本系统前端框架采用了比较流行的渐进式JavaScript框架Vue.js。运用Vue-Router实现动态路由,Ajax实现前后端通信,Element-plus组件库使页面飞快成型。后端部分:采用SpringBoot作为开发框架,同时集成MyBatis、Redis、阿里云oss对象存储等相关技能。
网上商城系统,可前后端分离
运行环境:idea
手艺栈:springboot,vue,mybatis,redis,elementplus
jwt令牌技术,不登录无法访问内容页面,换浏览器也不许可
二、系统特性
分为管理员,用户系统
管理员可以进行商品管理,商品分类管理,个人信息管理,修改密码和退出登录
用户可以查看所有商品,可以通过搜索框搜索商品,可以查看商品详情并加入到购物车,可以查看购物车并购买,还允许在个人中心对个人信息,个人密码,个人头像进行修改,并对自己的个人信息进行修改
三、平台实现
登陆界面








四、实现代码
package com.example.demo.Controller;
import com.example.demo.Service.CategoryService;
import com.example.demo.entity.Pojo.Category;
import com.example.demo.entity.Pojo.Flower;
import com.example.demo.entity.Result.PageBean;
import com.example.demo.entity.Result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/category")
public class CategoryController {
@Autowired
private CategoryService categoryService;
//获取列表
@GetMapping
public Result> getMessage(){
List cs= categoryService.list();
return Result.success(cs);
}
//新增
@PostMapping
public Result add(@RequestBody Category category){
categoryService.add(category);
return Result.success();
}
//获取详情
@GetMapping("/detail")
public Result detail(Integer id){
Category c= categoryService.findById(id);
return Result.success(c);
}
//更新商品分类
@PutMapping
public Result update(@RequestBody Category category){
categoryService.update(category);
return Result.success();
}
// 删除
@DeleteMapping
public Result delete(Integer id){
categoryService.delete(id);
return Result.success();
}
//分页查询
@GetMapping("/page")
public Result> page(Integer pageNum, Integer pageSize, String agriculturalName){
PageBean pageBean= categoryService.page(pageNum, pageSize, agriculturalName);
return Result.success(pageBean);
}
//根据分类查询
@GetMapping("/flower")
public Result> listByCategory(Integer pageNum, Integer pageSize, String categoryName){
PageBean pageBean= categoryService.getByCategoryId(pageNum, pageSize, categoryName);
return Result.success(pageBean);
}
}
联系方式绿泡泡公主号


浙公网安备 33010602011771号