基于SSM的健身房預約系統設計與實現

末尾獲取源碼
開發語言:Java
Java開發工具:JDK1.8
后端框架:SSM
前端:Vue
數據庫:MySQL5.7和Navicat管理工具結合
服務器:Tomcat8.5
開發軟件:IDEA / Eclipse
是否Maven項目:是


目錄

一、項目簡介

二、系統功能

三、系統項目截圖

用戶信息管理

課堂信息管理

私教課程管理

自助健身管理

四、核心代碼

登錄相關

文件上傳

封裝


一、項目簡介

傳統辦法管理信息首先需要花費的時間比較多,其次數據出錯率比較高,而且對錯誤的數據進行更改也比較困難,最后,檢索數據費事費力。因此,在計算機上安裝健身房預約系統軟件來發揮其高效地信息處理的作用,可以規范信息管理流程,讓管理工作可以系統化和程序化,同時,健身房預約系統的有效運用可以幫助管理人員準確快速地處理信息。

健身房預約系統在對開發工具的選擇上也很慎重,為了便于開發實現,選擇的開發工具為Eclipse,選擇的數據庫工具為Mysql。以此搭建開發環境實現健身房預約系統的功能。其中管理員管理用戶,公告。

健身房預約系統是一款運用軟件開發技術設計實現的應用系統,在信息處理上可以達到快速的目的,不管是針對數據添加,數據維護和統計,以及數據查詢等處理要求,健身房預約系統都可以輕松應對。


二、系統功能

為了讓系統的編碼可以順利進行,特意對本系統功能進行細分設計,設計的系統功能結構見下圖。



三、系統項目截圖

用戶信息管理

此頁面提供給管理員的功能有:用戶信息的查詢管理,可以刪除用戶信息、修改用戶信息、新增用戶信息,還進行了對用戶名稱的模糊查詢的條件

?

課堂信息管理

此頁面提供給管理員的功能有:查看已發布的課堂信息數據,修改課堂信息,課堂信息作廢,即可刪除,還進行了對課堂信息名稱的模糊查詢 課堂信息信息的類型查詢等等一些條件。

?

?

私教課程管理

此頁面提供給管理員的功能有:根據私教課程進行條件查詢,還可以對私教課程進行新增、修改、查詢操作等等。

?

自助健身管理

此頁面提供給管理員的功能有:根據自助健身進行新增、修改、查詢操作等等。

?

?


四、核心代碼

登錄相關


package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登錄相關*/
@RequestMapping("users")
@RestController
public class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登錄*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("賬號或密碼不正確");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());return R.ok().put("token", token);}/*** 注冊*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用戶已存在");}userService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密碼重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null) {return R.error("賬號不存在");}user.setPassword("123456");userService.update(user,null);return R.ok("密碼已重置為:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", userService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 獲取用戶的session用戶信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用戶已存在");}userService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);userService.updateById(user);//全部更新return R.ok();}/*** 刪除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}

文件上傳

package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;/*** 上傳文件映射表*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{@Autowiredprivate ConfigService configService;/*** 上傳文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {if (file.isEmpty()) {throw new EIException("上傳文件不能為空");}String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}String fileName = new Date().getTime()+"."+fileExt;File dest = new File(upload.getAbsolutePath()+"/"+fileName);file.transferTo(dest);FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));if(StringUtils.isNotBlank(type) && type.equals("1")) {ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));if(configEntity==null) {configEntity = new ConfigEntity();configEntity.setName("faceFile");configEntity.setValue(fileName);} else {configEntity.setValue(fileName);}configService.insertOrUpdate(configEntity);}return R.ok().put("file", fileName);}/*** 下載文件*/@IgnoreAuth@RequestMapping("/download")public ResponseEntity<byte[]> download(@RequestParam String fileName) {try {File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}File file = new File(upload.getAbsolutePath()+"/"+fileName);if(file.exists()){/*if(!fileService.canRead(file, SessionManager.getSessionUser())){getResponse().sendError(403);}*/HttpHeaders headers = new HttpHeaders();headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    headers.setContentDispositionFormData("attachment", fileName);    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);}} catch (IOException e) {e.printStackTrace();}return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);}}

封裝

package com.utils;import java.util.HashMap;
import java.util.Map;/*** 返回數據*/
public class R extends HashMap<String, Object> {private static final long serialVersionUID = 1L;public R() {put("code", 0);}public static R error() {return error(500, "未知異常,請聯系管理員");}public static R error(String msg) {return error(500, msg);}public static R error(int code, String msg) {R r = new R();r.put("code", code);r.put("msg", msg);return r;}public static R ok(String msg) {R r = new R();r.put("msg", msg);return r;}public static R ok(Map<String, Object> map) {R r = new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put(String key, Object value) {super.put(key, value);return this;}
}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/214435.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/214435.shtml
英文地址,請注明出處:http://en.pswp.cn/news/214435.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

網絡安全攻擊預警/態勢預測算法匯總

總結&#xff1a; 網絡安全攻擊預警/態勢預測算法眾多&#xff0c;主要包括&#xff1a; 基于統計學的算法&#xff1a;協方差矩陣、馬爾可夫模型等&#xff1b; 基于機器學習的算法&#xff1a;貝葉斯網絡、聚類算法、支持向量機SVM、遺傳算法、層次分析法AHP、決策樹等&am…

每日一道算法題 1

借鑒文章&#xff1a;Java-敏感字段加密 - 嗶哩嗶哩 題目描述 給定一個由多個命令字組成的命令字符串&#xff1b; 1、字符串長度小于等于127字節&#xff0c;只包含大小寫字母&#xff0c;數字&#xff0c;下劃線和偶數個雙引號 2、命令字之間以一個或多個下劃線_進行分割…

Proxmark3 Easy救磚-20231209

事情是這樣的&#xff0c;在淘寶買了個PM3&#xff0c;拿到手后刷固件的&#xff0c;一不小心刷成磚頭了&#xff0c;現象就是四個燈全亮&#xff0c;插上電腦USB不識別。問商家他也不太懂&#xff0c;也是個半吊子技術&#xff0c;遠程給我刷機搞了半天也沒有搞定&#xff0c;…

微表情檢測(三)----基于光流特征的微表情檢測

Micro-expression spotting based on optical flow features 基于光流特征的微表情檢測 Abstract 本文提出了一種高精度和可解釋性的自動微表情檢測方法。首先&#xff0c;我們設計了基于鼻尖位置的圖像對齊方法&#xff0c;以消除由頭部晃動引起的全局位移。其次&#xff0…

C語言中的一維數組與二維數組

目錄 一維數組數組的創建初始化使用在內存中的存儲 二維數組創建初始化使用在內存中的存儲 數組越界 一維數組 數組的創建 數組是一組相同類型元素的集合。 int arr1[10]; char arr3[10]; float arr4[10]; double arr5[10];下面這個數組能否成功創建&#xff1f; int count…

Linux上編譯和測試V8引擎源碼

介紹 V8引擎是一款高性能的JavaScript引擎&#xff0c;廣泛應用于Chrome瀏覽器和Node.js等項目中。在本篇博客中&#xff0c;我們將介紹如何在Linux系統上使用depot_tools工具編譯和測試V8引擎源碼。 步驟一&#xff1a;安裝depot_tools depot_tools是一個用于Chromium開發…

學習IO的第七天

作業&#xff1a;使用消息隊列完成兩個進程間的相互通信 #include <head.h>struct msgbuf {long mtype; //消息類型char mtext[1024]; //正文大小 };#define SIZE (sizeof(struct msgbuf)-sizeof(long))int main(int argc, const char *argv[]) {//1.創…

打印一個整數的每一位和求階乘(遞歸和非遞歸的C語言實現)

文章目錄 打印一個整數的每一位思考遞歸非遞歸 求階乘遞歸非遞歸證明0的階乘為1 寫代碼中遇到的VS輸出窗口提示信息為什么VS平臺32位和64位的long都是4字節&#xff1f;%zu是什么格式說明符VS下_int128為什么用不了 打印一個整數的每一位 思考 負數和0都是整數&#xff0c;我…

DevEco Studio將編輯器整體文本改為簡體中文

我們打開編輯器 隨便進入一個項目 這里 我們左上角目錄 選擇 File下面菜單中的 Settings… 打開配置界面 然后在設置窗口左側導航欄中 選擇 Plugins 插件 然后上方導航欄中 選擇 Installed 參考下圖 然后 找到這個Chinese(Simplified) Chinese是什么應該不用我多說吧 我們把…

區塊鏈擴容問題研究【06】

1.Plasma&#xff1a;Plasma 是一種基于以太坊區塊鏈的 Layer2 擴容方案&#xff0c;它通過建立一個分層結構的區塊鏈網絡&#xff0c;將大量的交易放到子鏈上進行處理&#xff0c;從而提高了以太坊的吞吐量。Plasma 還可以通過智能合約實現跨鏈交易&#xff0c;使得不同的區塊…

Python面經【8】- Python設計模式專題-上卷

Python面經【8】- Python設計模式專題-上卷 一、接口二、單例模式(1) 方法一&#xff1a;使用模塊(2) 方法二&#xff1a; 裝飾器實現【手撕 理解】&#xff08;單下劃線 閉包 裝飾器 類方法&#xff09;(3) 方法三&#xff1a;基于__new__方法【new和init 】 設計模式是一…

簡單的 u-popup 彈出框

uniapp中的popup組件可以用于彈出簡單的提示框、操作框、菜單等。它可以通過position屬性控制彈出框的位置&#xff0c;不同的position值會使得彈出框呈現不同的彈出形式 目錄 一、實現思路 二、實現步驟 ①view部分展示 ②JavaScript 內容 ③css中樣式展示 三、效果展示 …

Linux系統---基于Pipe實現一個簡單Client-Server system

顧得泉&#xff1a;個人主頁 個人專欄&#xff1a;《Linux操作系統》 《C/C》 《LeedCode刷題》 鍵盤敲爛&#xff0c;年薪百萬&#xff01; 一、題目要求 Server是一個服務器進程&#xff0c;只能進行整數平方運算。Client要計算一個整數的平方的平方的平方&#xff0c;即…

聊聊 Jetpack Compose 原理 -- 穿透刺客 CompositionLocal

Compose 官方說明一直很簡潔&#xff1a;CompositionLocal 是通過組合隱式向下傳遞數據的工具。 我們先來看一段代碼&#xff1a; class MainActivity : ComponentActivity() {override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setCo…

datav-輪播排名-對數據進行處理

前言 對于大屏需求我們排名數據輪播也是經常需要用到的需求&#xff0c;datav也是給我們提供了 不是說我們自己不能寫&#xff0c;而是提供好的輪子比我們自己 寫的&#xff0c;更全面&#xff0c;更周到&#xff0c; 沒有特殊需求的話&#xff0c;使用datav配置一下完成這個…

mysqlsh導入json,最終還得靠navicat導入json

工作需要將一個巨大的10G的json導入mysql數據庫。 看到mysql官方有對json導入的支持。 如下&#xff1a; MySQL :: Import JSON to MySQL made easy with the MySQL Shell $ mysqlsh rootlocalhost:33300/test --import /path_to_file/zips.json Creating a session to root…

產品經理進階:以客戶為中心的8個維度

目錄 簡介 以客戶為中心 流程和組織維度 產品維度 CSDN學院《硬件產品進階課》

python:六種算法(DBO、RFO、WOA、GWO、PSO、GA)求解23個測試函數(python代碼)

一、六種算法簡介 1、蜣螂優化算法DBO 2、紅狐優化算法RFO 3、鯨魚優化算法WOA 4、灰狼優化算法GWO 5、粒子群優化算法PSO 6、遺傳算法GA 二、6種算法求解23個函數 &#xff08;1&#xff09;23個函數簡介 參考文獻&#xff1a; [1] Yao X, Liu Y, Lin G M. Evolution…

讀書筆記 | 自我管理的關鍵是提高執行力

哈嘍啊&#xff0c;你好&#xff0c;我是雷工&#xff01; 有句話說&#xff0c;能管好自己才是真的本事。 自我管理&#xff0c;管好自己很重要。 我們之所以懂得這么多的道理&#xff0c;卻依然過不好這一生&#xff1f; 很大部分原因是因為管不住自己&#xff0c;做不到。 …

性能測試基礎

性能測試分類 客戶端性能&#xff1a;測試APP自身的性能&#xff0c;例如CPU、內存消耗&#xff1b;web頁面元素渲染速度 服務端性能&#xff1a;測試服務端項目程序的支持的并發、處理能力、響應時間等&#xff0c;主要通過接口來做性能測試 性能測試指標 并發 同時向服務…