作者主页:编程千纸鹤
作者简介:Java、前端、Pythone开发多年,做过高程,项目经理,架构师
主要内容:Java项目开发、毕业设计开发、面试技术整理、最新技术分享
鉴于 2022 北京冬奥会的成功举行,我国人民对于冰雪运动的热爱达到了前所未有的一
个高度,国内各大滑雪场的人流量日益增大,而国内疫情形式依旧严峻,固为减少人们线下
购票带来的密接影响,我们小组便开发了一个 online 的滑雪场信息网站.供用户以及滑雪场
工作人员进行使用,旨在提升服务效率与用户体验。
| 序号 | 名称 | 功能模块 |
| 1 | 首页信息展示 | 首页信息展示,主要包括了导航栏的展示,以及最新的雪具推荐列表的展示,场地列表的推荐,同时首页还包括站内的最新公告,以及当地的天气情况。 |
| 2 | 登录与注册 | 用户可在首页点击登录注册按钮进入登录注册页面,通过手机号进行注册,同时在注册后跳转至登录界面,登录成功后重新进入首页。 |
| 3 | 在线订票 | 已登录的用户可通过点击首页的推荐票或者导航栏的购买,进入场地票的详情列表页,可通过点击用户喜欢的场地票进行订票。未登录用户请求会被拦截。 |
| 4 | 在线评论及查看 | 游客(未登录的用户)可查看网站的所有评论信息(包括评论内容、评论者、日期),但不能在线评论,而已登录的用户除查看外,可进行在线评论。 |
| 5 | 场地信息详情 | 用户通过点击首页的场地推荐中的更多可进入场地的详情列表页,在此页面中,用户可清晰的看见场地的有关简介,以及人气值,和场地票的余数 |
| 6 | 雪具租赁 | 在进行场地票的预定时,旁边有雪具租赁的选项界面,对于有需求的用户可选择适合自己的品牌和尺寸的雪具进行租借,该界面会显示价格以及雪具的余量,当余量为0时,不可选取对应雪具 |
| 7 | 场地搜索 | 在页面的左上角有对应的搜索框,用户可通过搜索框进行场地的搜索。 |
| 8 | 后台管理 | 管理员在进行登录注册后,可进入后台,进行有关的管理,包括(用户管理、评论(留言)管理、雪具管理、订单管理、公告管理) |
| 9 | 个人信息管理 | 已登录的用户可点击页面上的头像进入个人信息页面,在此页面用户可查看个人基本信息以及个人的订单查看,同时可进行有关的信息更改,例如头像的更换、密码的修改、会员的充值(默认的注册用户为普通用户)。 |
根据当前对本系统改版需求的理解,本章对用户角色进行分析,对系统将要支持的核心业务流程进行描述,说明系统的子系统或功能模块的组成,并展示部分用户界面的示意图。
本方案的其它内容都是基于对业务需求的理解。随着对需求理解越来越深入和清晰,技术方案和工作量估算等将会发生变化。
以下为本系统的整体架构:

语言环境:Java: jdk1.8
数据库:Mysql: mysql5.7
应用服务器:Tomcat: tomcat8.5.31
开发工具:IDEA或eclipse
开发技术后台:Springboot+Mybatis
开发技术前台:Vue+Nodejs+ElementUI
前端展示:

前端用户登陆

留言

个人中心

最新资讯

后台管理系统

用户管理

公告管理

留言管理

雪具管理

订单管理

- package com.cupk.controller;
-
- import cn.hutool.core.lang.Assert;
- import cn.hutool.core.map.MapUtil;
- import cn.hutool.crypto.SecureUtil;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.cupk.common.dto.UserDto;
- import com.cupk.common.lang.Result;
- import com.cupk.entity.User;
- import com.cupk.service.UserService;
- import com.cupk.util.JwtUtils;
- import org.apache.shiro.SecurityUtils;
- import org.apache.shiro.authz.annotation.RequiresAuthentication;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.*;
-
- import javax.servlet.http.HttpServletResponse;
-
- @RestController
- public class AccountController {
-
- @Autowired
- UserService userService;
-
- @Autowired
- JwtUtils jwtUtils;
-
- private String salt = "2000.10.22";
-
- /**
- * 用户登陆
- * @param userDto
- * @param response
- * @return
- */
- @PostMapping("/login")
- public Result login(@Validated @RequestBody UserDto userDto, HttpServletResponse response){
- User user = userService.getOne(new QueryWrapper
().eq("phone", userDto.getPhone())); - Assert.notNull(user,"用户不存在");//断言拦截
- //判断账号密码是否错误 因为是md5加密所以这里md5判断
- if(!user.getPassword().equals(SecureUtil.md5(userDto.getPassword()+salt))){
- //密码不同则抛出异常
- return Result.fail("密码不正确");
- }
- String jwt = jwtUtils.generateToken(user.getId());
-
- userDto.setImg(user.getImg());
- userDto.setToken(jwt);
- //将token 放在入header里面
- response.setHeader("Authorization",jwt);
- response.setHeader("Access-control-Expose-Headers","Authorization");
-
- return Result.succ(200,"登录成功",userDto);
- }
-
- /**
- * 退出登录
- * @return
- */
- //需要认证权限才能退出登录
- @RequiresAuthentication
- @RequestMapping("/logout")
- public Result logout() {
- //退出登录
- SecurityUtils.getSubject().logout();
- return Result.succ("退出成功");
- }
- }
-
- package com.cupk.controller;
-
-
- import cn.hutool.core.lang.Assert;
- import cn.hutool.core.map.MapUtil;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.cupk.common.dto.AdminDto;
- import com.cupk.common.lang.Result;
- import com.cupk.entity.Admin;
- import com.cupk.service.AdminService;
- import com.cupk.util.JwtUtils;
- import org.apache.shiro.SecurityUtils;
- import org.apache.shiro.authz.AuthorizationInfo;
- import org.apache.shiro.authz.annotation.RequiresAuthentication;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.*;
-
- import javax.servlet.http.HttpServletResponse;
-
- @RestController
- @RequestMapping("/admin")
- public class AdminController {
- @Autowired
- AdminService adminService;
-
- @Autowired
- JwtUtils jwtUtils;
-
- /**
- * 管理员登陆
- * @param adminDto
- * @param response
- * @return
- */
- @PostMapping("/adminLogin")
- public Result adminLogin(@Validated @RequestBody AdminDto adminDto, HttpServletResponse response){
- Admin admin = adminService.getOne(new QueryWrapper
().eq("admin_name", adminDto.getAdminName())); - Assert.notNull(admin,"管理员不存在");//断言拦截
- if(!adminDto.getAdminPwd().equals(admin.getAdminPwd())){
- //密码不同则抛出异常
- return Result.fail("密码不正确");
- }
- String jwt = jwtUtils.generateToken(admin.getId());
- adminDto.setToken(jwt);
-
- //将token 放在我们的header里面
- response.setHeader("Authorization",jwt);
- response.setHeader("Access-control-Expose-Headers","Authorization");
- return Result.succ(200,"success",adminDto);
- }
-
- //需要认证权限才能退出登录
-
- /**
- * 管理员退出登陆
- * @return
- */
- @RequiresAuthentication
- @RequestMapping("/adminLogout")
- public Result adminLogout() {
- //退出登录
- SecurityUtils.getSubject().logout();
- return Result.succ("退出成功");
- }
- @GetMapping("/adminInfo")
- public Result findAdminInfoByName(@RequestParam String adminName){
- Admin admin = adminService.getOne(new QueryWrapper
().eq("admin_name",adminName)); - return Result.succ(200,"查询成功", admin);
- }
- }
- package com.cupk.controller;
-
-
- import cn.hutool.core.bean.BeanUtil;
- import cn.hutool.core.lang.Assert;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.baomidou.mybatisplus.core.metadata.IPage;
- import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
- import com.cupk.common.lang.Result;
- import com.cupk.entity.Evaluate;
- import com.cupk.entity.Notice;
- import com.cupk.service.EvaluateService;
- import com.cupk.util.ShiroUtil;
- import org.apache.shiro.authz.annotation.RequiresAuthentication;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.*;
-
- import java.util.List;
- @RequestMapping("/evaluate")
- @RestController
- public class EvaluateController {
- @Autowired
- EvaluateService evaluateService;
-
- /**
- * 评论列表
- * @return
- */
- @GetMapping("/evaluates")
- public Result evaList(@RequestParam(defaultValue = "1") Integer currentPage) {
- if(currentPage == null || currentPage < 1) currentPage = 1;
- Page page = new Page(currentPage, 50000);
- QueryWrapper
queryWrapper = new QueryWrapper<>(); - queryWrapper.like("uid","");
- queryWrapper.orderByDesc("e_time");
- IPage pageData = evaluateService.page(page,queryWrapper.orderByDesc("e_time"));
- return Result.succ(pageData);
- }
-
- /**
- * 根据评论id查询
- * @param id
- * @return
- */
- @GetMapping("/evaluate/{id}")
- public Result findEva(@PathVariable Integer id) {
- Evaluate evaluate = evaluateService.getById(id);
- //判断是否为空 为空则断言异常
- Assert.notNull(evaluate, "该评价不存在");
- return Result.succ(evaluate);
- }
-
- /**
- *
- * @param currentPage
- * @param uid
- * @return
- */
- @GetMapping("/findEva")
- public Result evaLists(@RequestParam(defaultValue = "1") Integer currentPage,
- @RequestParam(defaultValue = "") Integer uid){
- if(currentPage == null || currentPage < 1) currentPage = 1;
- Page page = new Page(currentPage, 50000);
- QueryWrapper
queryWrapper = new QueryWrapper(); -
- queryWrapper.eq("uid",uid);
-
- IPage pageData = evaluateService.page(page,queryWrapper.orderByDesc("e_time"));
- return Result.succ(pageData);
- }
- /**
- * 评论分页
- */
- @GetMapping("/evaluateList")
- public Result evalueList(@RequestParam(defaultValue = "1") Integer pageNum,
- @RequestParam(defaultValue = "5") Integer pageSize,
- @RequestParam(defaultValue = "") Integer uid) {
-
- if (pageNum == null || pageNum < 1) pageNum = 1;
- Page page = new Page(pageNum, pageSize);
- QueryWrapper
queryWrapper = new QueryWrapper(); - if (uid!=null) {
- queryWrapper.like("uid", uid);
- }
- IPage pageData = evaluateService.page(page, queryWrapper.orderByAsc("e_time"));
- return Result.succ(pageData);
- }
-
-
- /**
- * 添加评论
- * @param evaluate
- * @return
- */
- @RequiresAuthentication
- @PostMapping("/evaluate/addEva")
- public Result edit(@Validated @RequestBody Evaluate evaluate) {
-
- //一个空对象用于赋值
- Evaluate temp = new Evaluate();
- if (evaluate.getId() != null) {
- temp = evaluateService.getById(evaluate.getId());//将数据库的内容传递给temp
- } else {
- temp.setUid(ShiroUtil.getProfile().getId());
- temp.setUname(ShiroUtil.getProfile().getNickname());
- temp.setUImg(ShiroUtil.getProfile().getImg());
- temp.setContent(evaluate.getContent());
- temp.setETime(evaluate.getETime());
- }
- BeanUtil.copyProperties(evaluate, temp);
- evaluateService.save(temp);
-
- return Result.succ("成功发表评价");
- }
-
- /**
- * 单个删除
- * @param id
- * @return
- */
- @DeleteMapping("/delEva")
- public boolean delEvaList(@RequestParam Integer id){
- return evaluateService.removeById(id);
- }
-
- /**
- * 批量删除
- * @param ids
- * @return
- */
- @PostMapping("/delEvas")
- public boolean delEvaList(@RequestBody(required = false) List
ids) { - return evaluateService.removeByIds (ids);
- }
-
- }
- package com.cupk.controller;
-
-
-
- import cn.hutool.core.bean.BeanUtil;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.baomidou.mybatisplus.core.metadata.IPage;
- import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
- import com.cupk.common.lang.Result;
- import com.cupk.entity.Gear;
- import com.cupk.service.GearService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.*;
-
- import java.util.List;
-
- /**
- * 雪具相关接口
- */
-
- @RestController
- @RequestMapping("/gear")
- public class GearController {
- @Autowired
- GearService gearService;
-
- /**
- * 雪具列表
- * @param pageNum
- * @param brand
- * @param category
- * @return
- */
- @GetMapping("/gears")
- public Result gearList(@RequestParam(defaultValue = "1") Integer pageNum,
- @RequestParam(defaultValue = "2") Integer pageSize,
- @RequestParam(defaultValue = "") String brand,
- @RequestParam(defaultValue = "") String category,
- @RequestParam(defaultValue = "") String size){
- if(pageNum == null || pageNum < 1) pageNum = 1;
- Page page = new Page(pageNum, pageSize);
- QueryWrapper
queryWrapper = new QueryWrapper(); - if (!"".equals(brand)){
- queryWrapper.like("brand",brand);
- }
- if (!"".equals(category)){
- queryWrapper.like("category",category);
- }
- if(!"".equals(size)){
- queryWrapper.like("size",size);
- }
- IPage pageData = gearService.page(page,queryWrapper.orderByAsc("brand"));
- return Result.succ(pageData);
- }
- /**
- * 编辑雪具信息
- * @param gear
- * @return
- */
- @PostMapping("/edit")
- public Result edit(@Validated @RequestBody Gear gear) {
- //一个空对象用于赋值
- Gear temp = null;
- //如果有id则是编辑
- if (gear.getId() != null) {
- temp = gearService.getById(gear.getId());//将数据库的内容传递给temp
- } else {
- temp = new Gear();
- temp.setBrand(gear.getBrand());
- temp.setCategory(gear.getCategory());
- temp.setDeposit(gear.getDeposit());
- temp.setGImg(gear.getGImg());
- temp.setSize(gear.getSize());
- temp.setStock(gear.getStock());
- temp.setRent(gear.getRent()) ;
- }
- BeanUtil.copyProperties(gear, temp);
- gearService.saveOrUpdate(temp);
-
- return Result.succ("修改成功");
- }
- /**
- * 单个删除
- * @param id
- * @return
- */
- @DeleteMapping("/delGear")
- public boolean delEvaList(@RequestParam Integer id){
- return gearService.removeById(id);
- }
-
- /**
- * 批量删除
- * @param ids
- * @return
- */
- @PostMapping ("/delGears")
- public boolean delEvaList(@RequestBody(required = false) List
ids) { - return gearService.removeByIds (ids);
- }
-
-
- }
项目基本功能完整,立意新颖,前后端分离开发的模式也是现在主流的开发方式,适合做毕业设计使用