Java项目:汉服文化bbs商城系统(java+SpringBoot+Thymeleaf+html+layui+bootstrap+mysql)

本文主要是介绍Java项目:汉服文化bbs商城系统(java+SpringBoot+Thymeleaf+html+layui+bootstrap+mysql),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

源码获取:博客首页 "资源" 里下载!

项目介绍

汉服文化bbs商城系统,主要分为前后台。共分两种角色:管理员与普通用户;

管理员可登录前后台,普通用户仅可登录前台;普通用户登录后可发布、修改、删除自己的文章;
前台主要功能包括:
首页:文章列表、公告列表、汉服舞曲;
汉服形制:汉服发展史、汉服名词;
汉服礼仪;
汉服穿搭:汉服妆容、汉服摄影;
汉服活动:汉服事记;
推荐:汉服店铺、汉服推荐、汉服体验;
后台主要功能包括:
文章管理:查询、删除;
店铺推荐:新增推荐店、查看、修改、删除;
汉服体验店推荐:新增体验店、查看、修改、删除;
社团推荐:新增社团、查看、修改、删除;
汉服舞曲:新增舞曲、查看、删除;
公告管理:新增公告、查看、修改、删除;
留言管理:查询、修改、删除;

评论管理:查询、修改、删除;

环境需要

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版本;

技术栈

1. 后端:SpringBoot

2. 前端:Thymeleaf+html+layui+jQuery+bootstrap

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
3. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行;
4. 运行项目,输入http://localhost:8080/ 登录

 

 

 

 

 

后台管理订单控制层:

@Controller
@RequestMapping("/admin/order")
public class AdminOrderController {@Autowiredprivate OrderService orderService;/*** 打开订单列表页面* @return*/@RequestMapping("/toList.html")public String toList() {return "admin/order/list";}/*** 获取所有订单的总数* @return*/@ResponseBody@RequestMapping("/getTotal.do")public ResultBean<Integer> getTotal() {Pageable pageable = new PageRequest(1, 15, null);int total = (int) orderService.findAll(pageable).getTotalElements();return new ResultBean<>(total);}/*** 获取所有订单* @param pageindex* @param pageSize* @return*/@ResponseBody@RequestMapping("/list.do")public ResultBean<List<Order>> listData(int pageindex,@RequestParam(value = "pageSize", defaultValue = "15") int pageSize) {Pageable pageable = new PageRequest(pageindex, pageSize, null);List<Order> list = orderService.findAll(pageable).getContent();return new ResultBean<>(list);}/*** 获取订单项* @param orderId* @return*/@ResponseBody@RequestMapping("/getDetail.do")public ResultBean<List<OrderItem>> getDetail(int orderId) {List<OrderItem> list = orderService.findItems(orderId);return new ResultBean<>(list);}/*** 发货* @param id* @return*/@ResponseBody@RequestMapping("/send.do")public ResultBean<Boolean> send(int id) {orderService.updateStatus(id,3);return new ResultBean<>(true);}
}

后台用户管理控制层:

@Controller
@RequestMapping("/admin/user")
public class AdminUserController {@Autowiredprivate UserService userService;/*** 打开用户列表页面* @return*/@RequestMapping("/toList.html")public String toList() {return "admin/user/list";}/*** 打开编辑页面* @param id* @param map* @return*/@RequestMapping("/toEdit.html")public String toEdit(int id, Map<String, Object> map) {User user = userService.findById(id);map.put("user", user);return "admin/user/edit";}/*** 获取所有用户列表** @param pageindex* @return*/@ResponseBody@RequestMapping("/list.do")public ResultBean<List<User>> findAllUser(int pageindex,@RequestParam(value = "pageSize", defaultValue = "15") int pageSize) {Pageable pageable = new PageRequest(pageindex, pageSize, null);List<User> users = userService.findAll(pageable).getContent();return new ResultBean<>(users);}@ResponseBody@RequestMapping("/getTotal.do")public ResultBean<Integer> geTotal() {Pageable pageable = new PageRequest(1, 15, null);int total = (int) userService.findAll(pageable).getTotalElements();return new ResultBean<>(total);}@ResponseBody@RequestMapping("/del.do")public ResultBean<Boolean> del(int id) {userService.delById(id);return new ResultBean<>(true);}@ResponseBody@RequestMapping(method = RequestMethod.POST, value = "/update.do")public ResultBean<Boolean> update(int id,String username,String password,String name,String phone,String email,String addr) {// 更新前先查询User user = userService.findById(id);user.setId(id);user.setName(name);user.setUsername(username);user.setPassword(password);user.setAddr(addr);user.setEmail(email);user.setPhone(phone);userService.update(user);return new ResultBean<>(true);}
}

前台用户订单管理:

@Controller
@RequestMapping("/order")
public class OrderController {@Autowiredprivate OrderService orderService;/*** 打开订单列表页面** @return*/@RequestMapping("/toList.html")public String toOrderList() {return "mall/order/list";}/*** 查询用户订单列表** @param request* @return*/@RequestMapping("/list.do")@ResponseBodypublic ResultBean<List<Order>> listData(HttpServletRequest request) {List<Order> orders = orderService.findUserOrder(request);return new ResultBean<>(orders);}/*** 查询订单详情** @param orderId* @return*/@RequestMapping("/getDetail.do")@ResponseBodypublic ResultBean<List<OrderItem>> getDetail(int orderId) {List<OrderItem> orderItems = orderService.findItems(orderId);return new ResultBean<>(orderItems);}/*** 提交订单** @param name* @param phone* @param addr* @param request* @param response*/@RequestMapping("/submit.do")public void submit(String name,String phone,String addr,HttpServletRequest request,HttpServletResponse response) throws Exception {orderService.submit(name, phone, addr, request, response);}/*** 支付方法** @param orderId*/@RequestMapping("pay.do")@ResponseBodypublic ResultBean<Boolean> pay(int orderId, HttpServletResponse response) throws IOException {orderService.pay(orderId);return new ResultBean<>(true);}/*** 确认收货* @param orderId* @param response* @return* @throws IOException*/@RequestMapping("receive.do")@ResponseBodypublic ResultBean<Boolean> receive(int orderId, HttpServletResponse response) throws IOException {orderService.receive(orderId);return new ResultBean<>(true);}}

前台商品控制层:

@Controller
@RequestMapping("/product")
public class ProductController {@Autowiredprivate ProductService productService;@Autowiredprivate ClassificationService classificationService;@Autowiredprivate ShopCartService shopCartService;/*** 获取商品信息** @param id* @return*/@RequestMapping("/get.do")public ResultBean<Product> getProduct(int id) {Product product = productService.findById(id);return new ResultBean<>(product);}/*** 打开商品详情页面** @param id* @param map* @return*/@RequestMapping("/get.html")public String toProductPage(int id, Map<String, Object> map) {Product product = productService.findById(id);map.put("product", product);return "mall/product/info";}/*** 查找热门商品** @return*/@ResponseBody@RequestMapping("/hot.do")public ResultBean<List<Product>> getHotProduct() {List<Product> products = productService.findHotProduct();return new ResultBean<>(products);}/*** 查找最新商品** @param pageNo* @param pageSize* @return*/@ResponseBody@RequestMapping("/new.do")public ResultBean<List<Product>> getNewProduct(int pageNo, int pageSize) {Pageable pageable = new PageRequest(pageNo, pageSize);List<Product> products = productService.findNewProduct(pageable);return new ResultBean<>(products);}/*** 打开分类查看商品页面** @return*/@RequestMapping("/category.html")public String toCatePage(int cid, Map<String, Object> map) {Classification classification = classificationService.findById(cid);map.put("category", classification);return "mall/product/category";}@RequestMapping("/toCart.html")public String toCart(){return "mall/product/cart";}/*** 按一级分类查找商品** @param cid* @param pageNo* @param pageSize* @return*/@ResponseBody@RequestMapping("/category.do")public ResultBean<List<Product>> getCategoryProduct(int cid, int pageNo, int pageSize) {Pageable pageable = new PageRequest(pageNo, pageSize);List<Product> products = productService.findByCid(cid, pageable);return new ResultBean<>(products);}/*** 按二级分类查找商品** @param csId* @param pageNo* @param pageSize* @return*/@ResponseBody@RequestMapping("/categorySec.do")public ResultBean<List<Product>> getCategorySecProduct(int csId, int pageNo, int pageSize) {Pageable pageable = new PageRequest(pageNo, pageSize);List<Product> products = productService.findByCsid(csId, pageable);return new ResultBean<>(products);}/*** 根据一级分类查询它所有的二级分类* @param cid* @return*/@ResponseBody@RequestMapping("/getCategorySec.do")public ResultBean<List<Classification>> getCategorySec(int cid){List<Classification> list = classificationService.findByParentId(cid);return new ResultBean<>(list);}/*** 加购物车** @param productId* @param request* @return*/@ResponseBody@RequestMapping("/addCart.do")public ResultBean<Boolean> addToCart(int productId, HttpServletRequest request) throws Exception {shopCartService.addCart(productId, request);return new ResultBean<>(true);}/*** 移除购物车** @param productId* @param request* @return*/@ResponseBody@RequestMapping("/delCart.do")public ResultBean<Boolean> delToCart(int productId, HttpServletRequest request) throws Exception {shopCartService.remove(productId, request);return new ResultBean<>(true);}/*** 查看购物车商品* @param request* @return*/@ResponseBody@RequestMapping("/listCart.do")public ResultBean<List<OrderItem>> listCart(HttpServletRequest request) throws Exception {List<OrderItem> orderItems = shopCartService.listCart(request);return new ResultBean<>(orderItems);}}

 源码获取:博客首页 "资源" 里下载!

这篇关于Java项目:汉服文化bbs商城系统(java+SpringBoot+Thymeleaf+html+layui+bootstrap+mysql)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/285164

相关文章

Python将博客内容html导出为Markdown格式

《Python将博客内容html导出为Markdown格式》Python将博客内容html导出为Markdown格式,通过博客url地址抓取文章,分析并提取出文章标题和内容,将内容构建成html,再转... 目录一、为什么要搞?二、准备如何搞?三、说搞咱就搞!抓取文章提取内容构建html转存markdown

在React中引入Tailwind CSS的完整指南

《在React中引入TailwindCSS的完整指南》在现代前端开发中,使用UI库可以显著提高开发效率,TailwindCSS是一个功能类优先的CSS框架,本文将详细介绍如何在Reac... 目录前言一、Tailwind css 简介二、创建 React 项目使用 Create React App 创建项目

vue使用docxtemplater导出word

《vue使用docxtemplater导出word》docxtemplater是一种邮件合并工具,以编程方式使用并处理条件、循环,并且可以扩展以插入任何内容,下面我们来看看如何使用docxtempl... 目录docxtemplatervue使用docxtemplater导出word安装常用语法 封装导出方

Java编译生成多个.class文件的原理和作用

《Java编译生成多个.class文件的原理和作用》作为一名经验丰富的开发者,在Java项目中执行编译后,可能会发现一个.java源文件有时会产生多个.class文件,从技术实现层面详细剖析这一现象... 目录一、内部类机制与.class文件生成成员内部类(常规内部类)局部内部类(方法内部类)匿名内部类二、

SpringBoot实现数据库读写分离的3种方法小结

《SpringBoot实现数据库读写分离的3种方法小结》为了提高系统的读写性能和可用性,读写分离是一种经典的数据库架构模式,在SpringBoot应用中,有多种方式可以实现数据库读写分离,本文将介绍三... 目录一、数据库读写分离概述二、方案一:基于AbstractRoutingDataSource实现动态

Python FastAPI+Celery+RabbitMQ实现分布式图片水印处理系统

《PythonFastAPI+Celery+RabbitMQ实现分布式图片水印处理系统》这篇文章主要为大家详细介绍了PythonFastAPI如何结合Celery以及RabbitMQ实现简单的分布式... 实现思路FastAPI 服务器Celery 任务队列RabbitMQ 作为消息代理定时任务处理完整

Springboot @Autowired和@Resource的区别解析

《Springboot@Autowired和@Resource的区别解析》@Resource是JDK提供的注解,只是Spring在实现上提供了这个注解的功能支持,本文给大家介绍Springboot@... 目录【一】定义【1】@Autowired【2】@Resource【二】区别【1】包含的属性不同【2】@

springboot循环依赖问题案例代码及解决办法

《springboot循环依赖问题案例代码及解决办法》在SpringBoot中,如果两个或多个Bean之间存在循环依赖(即BeanA依赖BeanB,而BeanB又依赖BeanA),会导致Spring的... 目录1. 什么是循环依赖?2. 循环依赖的场景案例3. 解决循环依赖的常见方法方法 1:使用 @La

Java枚举类实现Key-Value映射的多种实现方式

《Java枚举类实现Key-Value映射的多种实现方式》在Java开发中,枚举(Enum)是一种特殊的类,本文将详细介绍Java枚举类实现key-value映射的多种方式,有需要的小伙伴可以根据需要... 目录前言一、基础实现方式1.1 为枚举添加属性和构造方法二、http://www.cppcns.co

Elasticsearch 在 Java 中的使用教程

《Elasticsearch在Java中的使用教程》Elasticsearch是一个分布式搜索和分析引擎,基于ApacheLucene构建,能够实现实时数据的存储、搜索、和分析,它广泛应用于全文... 目录1. Elasticsearch 简介2. 环境准备2.1 安装 Elasticsearch2.2 J