——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明






基于javaweb的SpringBoot汉服文化bbs系统(java+springboot+thymeleaf+html+layui+bootstrap+mysql+maven)
项目介绍
汉服文化bbs系统,主要分为前后台。共分两种角色:管理员与普通用户;
管理员可登录前后台,普通用户仅可登录前台;普通用户登录后可发布、修改、删除自己的文章; 前台主要功能包括: 首页:文章列表、公告列表、汉服舞曲; 汉服形制:汉服发展史、汉服名词; 汉服礼仪; 汉服穿搭:汉服妆容、汉服摄影; 汉服活动:汉服事记; 推荐:汉服店铺、汉服推荐、汉服体验; 后台主要功能包括: 文章管理:查询、删除; 店铺推荐:新增推荐店、查看、修改、删除; 汉服体验店推荐:新增体验店、查看、修改、删除; 社团推荐:新增社团、查看、修改、删除; 汉服舞曲:新增舞曲、查看、删除; 公告管理:新增公告、查看、修改、删除; 留言管理:查询、修改、删除;
评论管理:查询、修改、删除;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7版本;
技术栈
后端:SpringBoot
前端:Thymeleaf+html+layui+jQuery+bootstrap
使用说明
运行项目,输入http://localhost:8080/ 登录
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| } }
@RequestMapping("/delById") public JsonResult delById(Integer id){ return feedbackService.delById(id); } @RequestMapping("/findById") public JsonResult findById(Integer id){ return feedbackService.findById(id); } } package com.hanfu.controller;
@RequestMapping("sign") @RestController public class SignController { @Autowired private SignService signService;
@RequestMapping("/findPage") public ObjDat<Sign> findPage(Sign sign, HttpServletRequest request, @RequestParam(value="page", defaultValue="1") int page, @RequestParam(value="limit", defaultValue="10") int limit){ return signService.findPage(sign,page-1,limit); }
@RequestMapping("/edit") public JsonResult edit(Sign sign, HttpServletRequest request){ User user=(User)request.getSession().getAttribute("user");
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| @RequestMapping("/edit") public JsonResult edit(MultipartFile head, Music music, HttpServletRequest request) throws IOException { User user=(User)request.getSession().getAttribute("user"); if(user==null){ return JsonResult.error("请登录"); } if(head!=null){ File file = new File(path); if (!file.exists()) { file.mkdirs(); } String imgname= UUID.randomUUID().toString() + head.getOriginalFilename(); path = path + imgname; file = new File(path); head.transferTo(file); music.setPath(imgname); } String str=musicService.edit(music); if(str.equals("成功")){ return JsonResult.success("操作成功"); }else{ return JsonResult.error("操作失败"); } }
@RequestMapping("/delById") public JsonResult delById(Integer id){ return musicService.delById(id); }
@RequestMapping("/findById") public JsonResult findById(Integer id){ return musicService.findById(id); } } package com.hanfu.controller;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| return JsonResult.error("帐号以存在"); }
if(!user.getPassword().equals(user.getPasswordTwo())){ return JsonResult.error("两次密码不同"); } user.setName(user.getUsername()); user.setRole("user"); userDao.insert(user); return JsonResult.success(); }
@Override public JsonResult login(User user, HttpServletRequest request) { QueryWrapper<User> qw=new QueryWrapper<User>(); qw.eq("username",user.getUsername()); User item=userDao.selectOne(qw); if(item==null){ return JsonResult.error("请输入正确帐号!"); } if(!item.getPassword().equals(user.getPassword())){ return JsonResult.error("密码不正确"); } System.out.println("登录成功"); request.getSession().setAttribute("user",item); return JsonResult.success(item); }
@Override public String edit(User user) { if(user.getId()!=null){ try { userDao.updateById(user); } catch (Exception e) { e.printStackTrace(); return "失败"; }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| @RequestMapping("experience") @RestController @Scope("prototype") public class ExperienceController { @Value("${web.upload-path}") private String path; @Autowired private ExperienceService experienceService;
@RequestMapping("/findPage") public ObjDat<Experience> findPage(Experience experience, @RequestParam(value="page", defaultValue="1") int page, @RequestParam(value="limit", defaultValue="10") int limit){ return experienceService.findPage(experience,page-1,limit); }
@RequestMapping("/edit") public JsonResult edit(MultipartFile head, Experience experience, HttpServletRequest request) throws IOException { User user=(User)request.getSession().getAttribute("user");
if(user==null){ return JsonResult.error("请登录"); } if(experience.getId()==null){ experience.setUid(user.getId()); } if(head!=null){ File file = new File(path); if (!file.exists()) { file.mkdirs(); } String imgname= UUID.randomUUID().toString() + head.getOriginalFilename(); path = path + imgname; file = new File(path); head.transferTo(file); experience.setPath(imgname); } String str=experienceService.edit(experience); if(str.equals("成功")){ return JsonResult.success("操作成功"); }else{ return JsonResult.error("操作失败"); } } @RequestMapping("/delById") public JsonResult delById(Integer id){ return experienceService.delById(id); }
@RequestMapping("/findById") public JsonResult findById(Integer id){ return experienceService.findById(id);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| public JsonResult findById(Integer id){ return signService.findById(id); }
} package com.hanfu.controller;
@RequestMapping("/user") @RestController @Scope("prototype") public class UserController { @Autowired private UserService userService;
@Value("${web.upload-path}") private String path;
@RequestMapping("/edit") public JsonResult edit(MultipartFile head, User user) throws IOException { String str=userService.edit(user); if(str.equals("成功")){ return JsonResult.success("操作成功"); }else{ return JsonResult.error("操作失败"); } }
@RequestMapping("/login") public JsonResult login(User user, HttpServletRequest request) throws Exception{ return userService.login(user,request); }
@RequestMapping("/registered") public JsonResult registered(User user){ return userService.registered(user); }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| @RequestMapping("/delById") public JsonResult delById(Integer id){ return signService.delById(id); } @RequestMapping("/findById") public JsonResult findById(Integer id){ return signService.findById(id); }
} package com.hanfu.controller;
@RequestMapping("/user") @RestController @Scope("prototype") public class UserController { @Autowired private UserService userService;
@Value("${web.upload-path}") private String path;
@RequestMapping("/edit") public JsonResult edit(MultipartFile head, User user) throws IOException { String str=userService.edit(user); if(str.equals("成功")){ return JsonResult.success("操作成功"); }else{ return JsonResult.error("操作失败"); } }
@RequestMapping("/login") public JsonResult login(User user, HttpServletRequest request) throws Exception{
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=051422322105200jo
https://javayms.pages.dev?id=051422322105200jo