Compare commits

...

2 Commits
main ... main

Author SHA1 Message Date
段志宇 7e46c7fc3d 1
1 day ago
段志宇 8bb8c56ff3 1
1 day ago

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

@ -0,0 +1,190 @@
DROP DATABASE IF EXISTS gym_management_system ;
CREATE DATABASE gym_management_system CHARACTER SET utf8;
use gym_management_system ;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`admin_account` int NOT NULL COMMENT '管理员账号',
`admin_password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '管理员密码',
PRIMARY KEY (`admin_account`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of admin
-- ----------------------------
INSERT INTO `admin` VALUES (1001, '123456');
INSERT INTO `admin` VALUES (1002, '123456');
INSERT INTO `admin` VALUES (1003, '123456');
-- ----------------------------
-- Table structure for classtable
-- ----------------------------
DROP TABLE IF EXISTS `class_table`;
CREATE TABLE `class_table` (
`c_id` int NOT NULL AUTO_INCREMENT COMMENT '预约表id',
`class_id` int NULL DEFAULT NULL COMMENT '预约id',
`class_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '器材名称',
`class_begin` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '时间',
`coach` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地点',
PRIMARY KEY (`c_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of classtable
-- ----------------------------
INSERT INTO `class_table` VALUES (1,10001, '跑步机1', '8:00-9:00', '一号房间');
INSERT INTO `class_table` VALUES (2,10002, '跑步机1', '9:00-10:00', '一号房间');
INSERT INTO `class_table` VALUES (3,10003, '跑步机1', '10:00-11:00', '一号房间');
INSERT INTO `class_table` VALUES (4,10004, '跑步机1', '11:00-12:00', '一号房间');
INSERT INTO `class_table` VALUES (5,10005, '跑步机1', '14:00-15:00', '一号房间');
INSERT INTO `class_table` VALUES (6,10006, '跑步机1', '15:00-16:00', '一号房间');
INSERT INTO `class_table` VALUES (7,10007, '跑步机1', '16:00-17:00', '一号房间');
INSERT INTO `class_table` VALUES (8,10008, '跑步机1', '17:00-18:00', '一号房间');
INSERT INTO `class_table` VALUES (9,10009, '跑步机1', '20:00-21:00', '一号房间');
INSERT INTO `class_table` VALUES (10,10010, '跑步机1', '21:00-22:00', '一号房间');
INSERT INTO `class_table` VALUES (11,10011, '杠铃1', '8:00-9:00', '一号房间');
INSERT INTO `class_table` VALUES (12,10012, '杠铃1', '9:00-10:00', '一号房间');
INSERT INTO `class_table` VALUES (13,10013, '杠铃1', '10:00-11:00', '一号房间');
INSERT INTO `class_table` VALUES (14,10014, '杠铃1', '11:00-12:00', '一号房间');
INSERT INTO `class_table` VALUES (15,10015, '杠铃1', '14:00-15:00', '一号房间');
INSERT INTO `class_table` VALUES (16,10016, '杠铃1', '15:00-16:00', '一号房间');
INSERT INTO `class_table` VALUES (17,10017, '杠铃1', '16:00-17:00', '一号房间');
INSERT INTO `class_table` VALUES (18,10018, '杠铃1', '17:00-18:00', '一号房间');
INSERT INTO `class_table` VALUES (19,10019, '杠铃1', '20:00-21:00', '一号房间');
INSERT INTO `class_table` VALUES (20,10020, '杠铃1', '21:00-22:00', '一号房间');
INSERT INTO `class_table` VALUES (21,10011, '哑铃1', '8:00-9:00', '一号房间');
INSERT INTO `class_table` VALUES (22,10012, '哑铃1', '9:00-10:00', '一号房间');
INSERT INTO `class_table` VALUES (23,10013, '哑铃1', '10:00-11:00', '一号房间');
INSERT INTO `class_table` VALUES (24,10014, '哑铃1', '11:00-12:00', '一号房间');
INSERT INTO `class_table` VALUES (25,10015, '哑铃1', '14:00-15:00', '一号房间');
INSERT INTO `class_table` VALUES (26,10016, '哑铃1', '15:00-16:00', '一号房间');
INSERT INTO `class_table` VALUES (27,10017, '哑铃1', '16:00-17:00', '一号房间');
INSERT INTO `class_table` VALUES (28,10018, '哑铃1', '17:00-18:00', '一号房间');
INSERT INTO `class_table` VALUES (29,10019, '哑铃1', '20:00-21:00', '一号房间');
INSERT INTO `class_table` VALUES (30,10020, '哑铃1', '21:00-22:00', '一号房间');
INSERT INTO `class_table` VALUES (31,10001, '跑步机2', '8:00-9:00', '二号房间');
INSERT INTO `class_table` VALUES (32,10003, '跑步机2', '10:00-11:00', '二号房间');
INSERT INTO `class_table` VALUES (33,10004, '跑步机2', '11:00-12:00', '二号房间');
INSERT INTO `class_table` VALUES (34,10005, '跑步机2', '14:00-15:00', '二号房间');
INSERT INTO `class_table` VALUES (35,10006, '跑步机2', '15:00-16:00', '二号房间');
INSERT INTO `class_table` VALUES (36,10007, '跑步机2', '16:00-17:00', '二号房间');
INSERT INTO `class_table` VALUES (37,10008, '跑步机2', '17:00-18:00', '二号房间');
INSERT INTO `class_table` VALUES (38,10009, '跑步机2', '20:00-21:00', '二号房间');
INSERT INTO `class_table` VALUES (39,10010, '跑步机2', '21:00-22:00', '二号房间');
DROP TABLE IF EXISTS `record_table`;
CREATE TABLE `record_table` (
`date` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '预约时间',
`ruser` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户账号',
`record_id` int NULL DEFAULT NULL COMMENT '预约id',
`record_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '器材名称',
`record_begin` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '时间',
`location` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地点',
PRIMARY KEY (`date`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
INSERT INTO `record_table` VALUES ('2024-11-18 15:01:20',202009867,10001, '跑步机', '8:00-9:00', '一号房间');
INSERT INTO `record_table` VALUES ('2024-11-18 15:11:20',202009867,10002, '跑步机', '9:00-10:00', '一号房间');
INSERT INTO `record_table` VALUES ('2024-11-18 15:21:20',202009867,10005, '跑步机', '9:00-10:00', '一号房间');
INSERT INTO `record_table` VALUES ('2024-11-18 15:31:20',202009867,10003, '跑步机', '9:00-10:00', '一号房间');
-- ----------------------------
-- Table structure for member
-- ----------------------------
DROP TABLE IF EXISTS `member`;
CREATE TABLE `member` (
`member_account` int NOT NULL COMMENT '用户账号',
`member_password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户密码',
`member_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户姓名',
`member_gender` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '用户性别',
`member_age` int NULL DEFAULT NULL COMMENT '用户年龄',
`member_height` int NULL DEFAULT NULL COMMENT '用户身高',
`member_weight` int NULL DEFAULT NULL COMMENT '用户体重',
`member_phone` bigint NULL DEFAULT NULL COMMENT '用户电话',
PRIMARY KEY (`member_account`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of member
-- ----------------------------
INSERT INTO `member` VALUES (202009867, '123456', '张三', '', 24, 182, 60, 13515548482);
INSERT INTO `member` VALUES (202100788, '123456', '李四', '', 31, 178, 60, 13131554873);
INSERT INTO `member` VALUES (202132539, '123456', '王五', '', 31, 178, 60, 13154875489);
INSERT INTO `member` VALUES (202186416, '123456', '马六', '', 23, 160, 45, 13124576857);
INSERT INTO `member` VALUES (202106725, '123456', 'Tom', '', 24, 178, 88, 13758784959);
INSERT INTO `member` VALUES (202183406, '123456', 'Tylor', '', 19, 170, 60, 13786457488);
INSERT INTO `member` VALUES (202176587, '123456', 'Jack', '', 33, 177, 90, 13767546666);
INSERT INTO `member` VALUES (202156754, '123456', 'Mike', '', 36, 166, 67, 13786532448);
INSERT INTO `member` VALUES (202153468, '123456', 'Emma', '', 25, 173, 44, 13786457124);
INSERT INTO `member` VALUES (202121345, '123456', 'Ava', '', 28, 160, 40, 13754457488);
INSERT INTO `member` VALUES (202189776, '123456', 'Chloe', '', 27, 170, 50, 13986337489);
INSERT INTO `member` VALUES (202123664, '123456', 'Lily', '', 25, 165, 51, 15986457423);
-- ----------------------------
-- Table structure for equipment
-- ----------------------------
DROP TABLE IF EXISTS `equipment`;
CREATE TABLE `equipment` (
`equipment_id` int NOT NULL AUTO_INCREMENT COMMENT '器材id',
`equipment_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '器材名称',
`equipment_location` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '器材位置',
`equipment_status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '器材状态',
`equipment_message` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '器材备注信息',
PRIMARY KEY (`equipment_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of equipment
-- ----------------------------
INSERT INTO `equipment` VALUES (1, '哑铃1', '1号房间', '正常', '');
INSERT INTO `equipment` VALUES (2, '杠铃1', '2号房间', '损坏', '待维修');
INSERT INTO `equipment` VALUES (3, '跑步机1', '2号房间', '维修中', '联系厂家维修');
INSERT INTO `equipment` VALUES (4, '跑步机2', '2号房间', '正常', '');
INSERT INTO `equipment` VALUES (5, '跑步机3', '2号房间', '正常', '');
INSERT INTO `equipment` VALUES (6, '杠铃1', '1号房间', '正常', '');
INSERT INTO `equipment` VALUES (7, '杠铃2', '1号房间', '正常', '');
-- ----------------------------
-- Records for target_record
-- ----------------------------
DROP TABLE IF EXISTS `target_record`;
CREATE TABLE `target_record` (
`tuser` int NULL DEFAULT NULL COMMENT '用户账号',
`tp_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称',
`tep_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '器材名称',
`tr_location` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '器材位置',
`ttime` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '锻炼时长',
`tdate` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci Not NULL COMMENT '锻炼时间',
PRIMARY KEY (`tdate`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
INSERT INTO `target_record` VALUES (202009867,'跑步','跑步机','1号房','30min','2021年1月2日 10:20');
SET FOREIGN_KEY_CHECKS = 1;
DROP TABLE IF EXISTS `real_record`;
CREATE TABLE `real_record` (
`ruser` int NULL DEFAULT NULL COMMENT '用户账号',
`rp_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称',
`rep_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '器材名称',
`rr_location` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '器材位置',
`rtime` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '锻炼时长',
`rdate` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci Not NULL COMMENT '锻炼时间',
PRIMARY KEY (`rdate`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
INSERT INTO `real_record` VALUES (202009867,'跑步','跑步机','1号房','30min','2021年1月2日 10:20');
INSERT INTO `real_record` VALUES (202009867,'跑步','跑步机','1号房','30min','2021年1月3日 10:21');
INSERT INTO `real_record` VALUES (202009867,'跑步','跑步机','1号房','30min','2021年1月4日 11:20');
INSERT INTO `real_record` VALUES (202009867,'跑步','跑步机','1号房','30min','2021年1月8日 10:20');
INSERT INTO `real_record` VALUES (202009867,'跑步','跑步机','1号房','30min','2021年1月9日 14:20');
INSERT INTO `real_record` VALUES (202009867,'跑步','跑步机','1号房','30min','2021年1月1日 10:90');

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.milotnt</groupId>
<artifactId>gym-management-system</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>gym-management-system</name>
<description>gym-management-system</description>
<properties>
<java.version>1.8</java.version>
<mysql.version>8.0.25</mysql.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,13 @@
package com.milotnt;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class GymManagementSystemApplication {
public static void main(String[] args) {
SpringApplication.run(GymManagementSystemApplication.class, args);
}
}

@ -0,0 +1,50 @@
package com.milotnt.controller;
import com.milotnt.pojo.ClassTable;
import com.milotnt.service.ClassTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
/**
* @author
* @date
*/
@Controller
@RequestMapping("/class")
public class ClassController {
@Autowired
private ClassTableService classTableService;
//查询预约信息
@RequestMapping("/selClass")
public String selectClass(Model model) {
List<ClassTable> classList = classTableService.findAll();
model.addAttribute("classList", classList);
return "selectClass";
}
//跳转新增预约信息页面
@RequestMapping("/toAddClass")
public String toAddClass() {
return "addClass";
}
//新增预约信息
@RequestMapping("/addClass")
public String addClass(ClassTable classTable) {
classTableService.insertClass(classTable);
return "redirect:selClass";
}
//删除预约信息
@RequestMapping("/delClass")
public String deleteClass(Integer classId) {
classTableService.deleteClassByClassId(classId);
return "redirect:selClass";
}
}

@ -0,0 +1,69 @@
package com.milotnt.controller;
import com.milotnt.pojo.Equipment;
import com.milotnt.service.EquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpSession;
import java.util.List;
/**
* @author lhl
* @date 24/11
*/
@Controller
@RequestMapping("/equipment")
public class EquipmentController {
@Autowired
private EquipmentService equipmentService;
//查询器材
@RequestMapping("/selEquipment")
public String selectEquipment(Model model, HttpSession session) {
List<Equipment> equipmentList = equipmentService.findAll();
session.setAttribute("equipmentList", equipmentList);
model.addAttribute("equipmentList", equipmentList);
return "selectEquipment";
}
//删除器材
@RequestMapping("/delEquipment")
public String deleteEquipment(Integer equipmentId) {
equipmentService.deleteByEquipmentId(equipmentId);
return "redirect:selEquipment";
}
//跳转修改器材页面
@RequestMapping("/toUpdateEquipment")
public String toUpdateEquipment(Integer equipmentId, Model model) {
List<Equipment> equipmentList = equipmentService.selectByEquipmentId(equipmentId);
model.addAttribute("equipmentList", equipmentList);
return "updateEquipment";
}
//修改器材
@RequestMapping("/updateEquipment")
public String updateEquipment(Equipment equipment) {
equipmentService.updateEquipmentByEquipmentId(equipment);
return "redirect:selEquipment";
}
//跳转新增器材页面
@RequestMapping("/toAddEquipment")
public String toAddEquipment() {
return "addEquipment";
}
//新增器材
@RequestMapping("/addEquipment")
public String addEquipment(Equipment equipment) {
equipmentService.insertEquipment(equipment);
return "redirect:selEquipment";
}
}

@ -0,0 +1,133 @@
package com.milotnt.controller;
import com.milotnt.pojo.Admin;
import com.milotnt.pojo.Member;
import com.milotnt.service.AdminService;
import com.milotnt.service.EquipmentService;
import com.milotnt.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Random;
/**
* @author lhl
* @date 24/11
*/
@Controller
public class LoginController {
@Autowired
private MemberService memberService;
@Autowired
private AdminService adminService;
@Autowired
private EquipmentService equipmentService;
//主页、跳转管理员登录页面
@RequestMapping("/")
public String toAdminLogin() {
return "adminLogin";
}
//跳转用户登录页面
@RequestMapping("/toUserLogin")
public String toUserLogin() {
return "userLogin";
}
//跳转注册页面
@RequestMapping("/toUserRegist")
public String toUserRegist() {
return "userRegist";
}
//管理员登录
@RequestMapping("/adminLogin")
public String adminLogin(Admin admin, Model model, HttpSession session) {
Admin admin1 = adminService.adminLogin(admin);
if (admin1 != null) {
//会员人数
Integer memberTotal = memberService.selectTotalCount();
model.addAttribute("memberTotal", memberTotal);
session.setAttribute("memberTotal", memberTotal);
//健身房总人数
Integer humanTotal = memberTotal;
model.addAttribute("humanTotal", humanTotal);
session.setAttribute("humanTotal", humanTotal);
//器材数
Integer equipmentTotal = equipmentService.selectTotalCount();
model.addAttribute("equipmentTotal", equipmentTotal);
session.setAttribute("equipmentTotal", equipmentTotal);
return "adminMain";
}
model.addAttribute("msg", "您输入的账号或密码有误,请重新输入!");
return "adminLogin";
}
//用户登录
@RequestMapping("/userLogin")
public String userLogin(Member member, Model model, HttpSession session) {
Member member1 = memberService.userLogin(member);
Member member2 = memberService.selectByPhoneAndPassword(member);
if (member1 != null) {
model.addAttribute("member", member1);
session.setAttribute("user", member1);
return "userMain";
}
if(member2 != null) {
model.addAttribute("member", member2);
session.setAttribute("user", member2);
return "userMain";
}
model.addAttribute("msg", "您输入的账号或密码有误,请重新输入!");
return "userLogin";
}
//跳转管理员主页
@RequestMapping("/toAdminMain")
public String toAdminMain(Model model, HttpSession session) {
Integer memberTotal = (Integer) session.getAttribute("memberTotal");
Integer employeeTotal = (Integer) session.getAttribute("employeeTotal");
Integer humanTotal = (Integer) session.getAttribute("humanTotal");
Integer equipmentTotal = (Integer) session.getAttribute("equipmentTotal");
model.addAttribute("memberTotal", memberTotal);
model.addAttribute("employeeTotal", employeeTotal);
model.addAttribute("humanTotal", humanTotal);
model.addAttribute("equipmentTotal", equipmentTotal);
return "adminMain";
}
//跳转用户主页
@RequestMapping("/toUserMain")
public String toUserMain(Model model, HttpSession session) {
Member member = (Member) session.getAttribute("user");
model.addAttribute("member", member);
return "userMain";
}
//注册成功
@RequestMapping("/addUser")
public String addUser(Member member) {
//用户账号&卡号随机生成
Random random = new Random();
String account1 = "21";
for (int i = 0; i < 5; i++) {
account1 += random.nextInt(10);
}
Integer account = Integer.parseInt(account1);
member.setMemberAccount(account);
memberService.insertMember(member);
return "redirect:toUserLogin";
}
}

@ -0,0 +1,99 @@
package com.milotnt.controller;
import com.milotnt.pojo.Member;
import com.milotnt.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Random;
@Controller
@RequestMapping("/member")
public class MemberController {
@Autowired
private MemberService memberService;
//查询会员
@RequestMapping("/selMember")
public String selectMember(Model model) {
List<Member> memberList = memberService.findAll();
model.addAttribute("memberList", memberList);
return "selectMember";
}
//跳转新增会员页面
@RequestMapping("/toAddMember")
public String toAddMember() {
return "addMember";
}
//新增用户
@RequestMapping("/addMember")
public String addMember(Member member) {
//用户账号&卡号随机生成
Random random = new Random();
String account1 = "21";
for (int i = 0; i < 5; i++) {
account1 += random.nextInt(10);
}
Integer account = Integer.parseInt(account1);
member.setMemberAccount(account);
memberService.insertMember(member);
return "redirect:selMember";
}
//新增用户
//删除会员
@RequestMapping("/delMember")
public String deleteMember(Integer memberAccount) {
memberService.deleteByMemberAccount(memberAccount);
return "redirect:selMember";
}
//跳转会员修改页面
@RequestMapping("/toUpdateMember")
public String toUpdateMember(Integer memberAccount, Model model) {
List<Member> memberList = memberService.selectByMemberAccount(memberAccount);
model.addAttribute("memberList", memberList);
return "updateMember";
}
//修改会员信息
@RequestMapping("/updateMember")
public String updateMember(Member member) {
memberService.updateMemberByMemberAccount(member);
return "redirect:selMember";
}
//跳转会员卡查询页面
@RequestMapping("/toSelByCard")
public String toSelectByCardId() {
return "selectByMemberAccount";
}
//根据会员卡号查询
@RequestMapping("/selByCard")
public String selectByCardId(Model model, Integer memberAccount) {
List<Member> memberList = memberService.selectByMemberAccount(memberAccount);
if (memberList != null) {
model.addAttribute("memberList", memberList);
} else {
String message = "会员卡号不存在!";
model.addAttribute("noMessage", message);
}
return "selectByMemberAccount";
}
}

@ -0,0 +1,185 @@
package com.milotnt.controller;
import com.milotnt.pojo.*;
import com.milotnt.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpSession;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
* @author
* @date 24/11/18
*/
@Controller
@RequestMapping("/user")
public class UserController {
@Autowired
private ClassTableService classTableService;
@Autowired
private MemberService memberService;
@Autowired
private RecordTableService recordTableService;
@Autowired
private TargetRecordService targetRecordService;
@Autowired
private RealRecordService realRecordService;
//跳转个人信息页面
@RequestMapping("/toUserInfo")
public String toUserInformation(Model model, HttpSession session) {
Member member = (Member) session.getAttribute("user");
model.addAttribute("member", member);
return "userInformation";
}
//跳转修改个人信息页面
@RequestMapping("/toUpdateInfo")
public String toUpdateUserInformation(HttpSession session, Model model) {
Member member = (Member) session.getAttribute("user");
model.addAttribute("member", member);
return "updateUserInformation";
}
//修改个人信息
@RequestMapping("/updateInfo")
public String updateUserInformation(HttpSession session, Member member) {
Member member1 = (Member) session.getAttribute("user");
member.setMemberAccount(member1.getMemberAccount());
memberService.updateMemberByMemberAccount(member);
return "userInformation";
}
//跳转预约信息
@RequestMapping("/toUserBook")
public String selectClass(Model model) {
List<ClassTable> classList = classTableService.findAll();
model.addAttribute("classList", classList);
return "userBook";
}
//跳转我的预约记录
@RequestMapping("/toUserBookRecord")
public String toUserBookRecord(Model model, HttpSession session) {
Member member = (Member) session.getAttribute("user");
Integer ruser = member.getMemberAccount();
List<RecordTable> recordList = recordTableService.findAll(ruser);
model.addAttribute("recordList", recordList);
return "userBookRecord";
}
//删除预约记录
@RequestMapping("delUserRecord")
public String delUserRecord(Integer recordId, HttpSession session) {
Member member = (Member) session.getAttribute("user");
Integer ruser = member.getMemberAccount();
recordTableService.deleteRecord(recordId,ruser);
return "redirect:toUserBookRecord";
}
//获取时间函数
public static String getCurrentDateTime(){
// 获取当前日期和时间
LocalDateTime currentDateTime = LocalDateTime.now();
// 格式化为 "yyyy-MM-dd HH:mm:ss" 字符串格式
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
return currentDateTime.format(formatter);
}
//新增预期目标
@RequestMapping("/addTargetRecord")
public String addTargetRecord(String tpName, String tepName, String trLocation, String tTime,Model model, HttpSession session) {
Member member = (Member) session.getAttribute("user");
Integer tuser = member.getMemberAccount();
String tdate = getCurrentDateTime();
TargetRecord targetRecord = new TargetRecord(tuser,tpName,tepName,trLocation,tTime,tdate);
targetRecordService.insertTargetRecord(targetRecord);
List<TargetRecord> TargetRecord = targetRecordService.findLatestTargetRecord(tuser);
model.addAttribute("TargetRecord", TargetRecord);
model.addAttribute("member", member);
return "timer";
}
//新增真实锻炼记录
@RequestMapping("/addRealRecord")
public String addRealRecord(String rpName, String repName, String rrLocation, String rTime,Model model, HttpSession session) {
Member member = (Member) session.getAttribute("user");
Integer ruser = member.getMemberAccount();
String rdate = getCurrentDateTime();
RealRecord realRecord = new RealRecord(ruser,rpName,repName,rrLocation,rTime,rdate);
realRecordService.insertRealRecord(realRecord);
model.addAttribute("realRecord", realRecord);
return "redirect:toEndRecord";
}
//跳转锻炼结束
@RequestMapping("/toEndRecord")
public String toEndRecord(Model model, HttpSession session) {
Member member = (Member) session.getAttribute("user");
Integer ruser = member.getMemberAccount();
List<TargetRecord> targetRecord = targetRecordService.findLatestTargetRecord(ruser);
model.addAttribute("targetRecord", targetRecord);
List<RealRecord> realRecord = realRecordService.findLatestRealRecord(ruser);
model.addAttribute("realRecord", realRecord);
return "endRecord";
}
//跳转我的锻炼记录
@RequestMapping("/toUserRealRecord")
public String toUserRealRecord(Model model, HttpSession session) {
Member member = (Member) session.getAttribute("user");
Integer ruser = member.getMemberAccount();
List<RealRecord> RealRecord = realRecordService.findAll(ruser);
model.addAttribute("RealRecord", RealRecord);
return "userClass";
}
//跳转我的预约记录并添加预约记录
@RequestMapping("/userBook")
public String userBook(Integer recordId,String recordName,String recordBegin,String Location,Model model, HttpSession session) {
Member member = (Member) session.getAttribute("user");
Integer ruser = member.getMemberAccount();
String date = getCurrentDateTime();
RecordTable recordTable = new RecordTable(date,ruser,recordId,recordName,recordBegin,Location);
recordTableService.insertRecord(recordTable);
return "redirect:toUserBookRecord";
}
//删除锻炼记录
@RequestMapping("delRealRecord")
public String deleteRealRecord(String rDate) {
realRecordService.deleteRealRecord(rDate);
return "redirect:toUserRealRecord";
}
//跳转预约信息页面
@RequestMapping("/toApplyClass")
public String toUserApplyClass(Model model, HttpSession session) {
Member member = (Member) session.getAttribute("user");
List<ClassTable> classList = classTableService.findAll();
model.addAttribute("member", member);
model.addAttribute("classList", classList);
return "userApplyClass";
}
//新增预约信息
@RequestMapping("/addClass")
public String addClass(ClassTable classTable) {
classTableService.insertClass(classTable);
return "redirect:selClass";
}
}

@ -0,0 +1,12 @@
package com.milotnt.mapper;
import com.milotnt.pojo.Admin;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface AdminMapper {
Admin selectByAccountAndPassword(Admin admin);
}

@ -0,0 +1,31 @@
package com.milotnt.mapper;
import com.milotnt.pojo.ClassTable;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author lhl
* @date 24/11
*/
@Mapper
public interface ClassTableMapper {
//查询所有课程
List<ClassTable> findAll();
//根据id删除课程
Boolean deleteClassByClassId(Integer classId);
//添加课程
Boolean insertClass(ClassTable classTable);
//根据id查询课表
ClassTable selectByClassId(Integer classId);
//根据id删除已预约的课程
Boolean deleteOrderByClassId(Integer classId);
}

@ -0,0 +1,30 @@
package com.milotnt.mapper;
import com.milotnt.pojo.Equipment;
import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper
public interface EquipmentMapper {
//查询所有器械
List<Equipment> findAll();
//根据id删除器械
Boolean deleteByEquipmentId(Integer equipmentId);
//添加器材
Boolean insertEquipment(Equipment equipment);
//根据id修改器械信息
Boolean updateEquipmentByEquipmentId(Equipment equipment);
//根据id查询器械
List<Equipment> selectByEquipmentId(Integer equipmentId);
//查询器械总数
Integer selectTotalCount();
}

@ -0,0 +1,35 @@
package com.milotnt.mapper;
import com.milotnt.pojo.Member;
import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper
public interface MemberMapper {
//查询会员信息
List<Member> findAll();
//新增会员信息
Boolean insertMember(Member member);
//根据会员账号修改会员信息
Boolean updateMemberByMemberAccount(Member member);
//查询会员账号密码
Member selectByAccountAndPassword(Member member);
//根据会员账号删除会员信息
Boolean deleteByMemberAccount(Integer memberAccount);
//查询会员数
Integer selectTotalCount();
//根据会员账号查询会员
List<Member> selectByMemberAccount(Integer memberAccount);
List<Member> selectByMemberPhone(Integer memberPhone);
Member selectByPhoneAndPassword(Member member);
}

@ -0,0 +1,31 @@
package com.milotnt.mapper;
import com.milotnt.pojo.RealRecord;
import com.milotnt.pojo.TargetRecord;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author lhl
* @date 24/11
*/
@Mapper
public interface RealRecordMapper {
//查询所有课程
List<RealRecord> findAll(Integer ruser);
//根据id删除课程
Boolean deleteRealRecord(String rDate);
//添加课程
Boolean insertRealRecord(RealRecord realRecord);
List<RealRecord> selectRealRecord(String rDate);
List<RealRecord> findLatestRealRecord();
List<RealRecord> findLatestRealRecord(Integer ruser);
}

@ -0,0 +1,26 @@
package com.milotnt.mapper;
import com.milotnt.pojo.RecordTable;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author lhl
* @date 24/11
*/
@Mapper
public interface RecordTableMapper {
//查询所有课程
List<RecordTable> findAll(Integer ruser);
//根据id删除课程
Boolean deleteRecord(Integer recordId, Integer ruser);
//添加课程
Boolean insertRecord(RecordTable recordTable);
List<RecordTable> selectRecord(Integer recordId);
}

@ -0,0 +1,31 @@
package com.milotnt.mapper;
import com.milotnt.pojo.RecordTable;
import com.milotnt.pojo.TargetRecord;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author lhl
* @date 24/11
*/
@Mapper
public interface TargetRecordMapper {
//查询所有课程
List<TargetRecord> findAll();
//根据id删除课程
Boolean deleteTargetRecord(String tDate);
//添加预期目标
Boolean insertTargetRecord(TargetRecord targetRecord);
List<TargetRecord> selectTargetRecord(String tDate);
List<TargetRecord> findLatestTargetRecord();
List<TargetRecord> findLatestTargetRecord(Integer ruser);
}

@ -0,0 +1,32 @@
package com.milotnt.pojo;
public class Admin {
private Integer adminAccount;
private String adminPassword;
public Integer getAdminAccount() {
return adminAccount;
}
public void setAdminAccount(Integer adminAccount) {
this.adminAccount = adminAccount;
}
public String getAdminPassword() {
return adminPassword;
}
public void setAdminPassword(String adminPassword) {
this.adminPassword = adminPassword;
}
@Override
public String toString() {
return "Admin{" +
"adminAccount=" + adminAccount +
", adminPassword='" + adminPassword + '\'' +
'}';
}
}

@ -0,0 +1,59 @@
package com.milotnt.pojo;
import org.springframework.data.relational.core.sql.In;
public class ClassTable {
private Integer cid;
private Integer classId;
private String className;
private String classBegin;
private String coach;
public Integer getCid() {return cid;}
public void setCid(Integer cid) {this.cid = cid;}
public Integer getClassId() {
return classId;
}
public void setClassId(Integer classId) {
this.classId = classId;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public String getClassBegin() {
return classBegin;
}
public void setClassBegin(String classBegin) {
this.classBegin = classBegin;
}
public String getCoach() {
return coach;
}
public void setCoach(String coach) {
this.coach = coach;
}
@Override
public String toString() {
return "ClassTable{" +
"cid=" + cid +
"classId=" + classId +
", className='" + className + '\'' +
", classBegin='" + classBegin + '\'' +
", coach='" + coach + '\'' +
'}';
}
}

@ -0,0 +1,76 @@
package com.milotnt.pojo;
/**
* @author
* @date
*/
public class Equipment {
private Integer equipmentId;
private String equipmentName;
private String equipmentLocation;
private String equipmentStatus;
private String equipmentMessage;
public Equipment() {
}
public Equipment(Integer equipmentId, String equipmentName, String equipmentLocation, String equipmentStatus, String equipmentMessage) {
this.equipmentId = equipmentId;
this.equipmentName = equipmentName;
this.equipmentLocation = equipmentLocation;
this.equipmentStatus = equipmentStatus;
this.equipmentMessage = equipmentMessage;
}
public Integer getEquipmentId() {
return equipmentId;
}
public void setEquipmentId(Integer equipmentId) {
this.equipmentId = equipmentId;
}
public String getEquipmentName() {
return equipmentName;
}
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
public String getEquipmentLocation() {
return equipmentLocation;
}
public void setEquipmentLocation(String equipmentLocation) {
this.equipmentLocation = equipmentLocation;
}
public String getEquipmentStatus() {
return equipmentStatus;
}
public void setEquipmentStatus(String equipmentStatus) {
this.equipmentStatus = equipmentStatus;
}
public String getEquipmentMessage() {
return equipmentMessage;
}
public void setEquipmentMessage(String equipmentMessage) {
this.equipmentMessage = equipmentMessage;
}
@Override
public String toString() {
return "Equipment{" +
"equipmentId=" + equipmentId +
", equipmentName='" + equipmentName + '\'' +
", equipmentLocation='" + equipmentLocation + '\'' +
", equipmentStatus='" + equipmentStatus + '\'' +
", equipmentMessage='" + equipmentMessage + '\'' +
'}';
}
}

@ -0,0 +1,125 @@
package com.milotnt.pojo;
/**
* @author
* @date
*/
public class Member {
private Integer memberAccount;
private String memberPassword;
private String memberName;
private String memberGender;
private Integer memberAge;
private Integer memberHeight;
private Integer memberWeight;
private Long memberPhone;
// private String cardTime;
// private Integer cardClass;
// private Integer cardNextClass;
public Integer getMemberAccount() {
return memberAccount;
}
public void setMemberAccount(Integer memberAccount) {
this.memberAccount = memberAccount;
}
public String getMemberPassword() {
return memberPassword;
}
public void setMemberPassword(String memberPassword) {
this.memberPassword = memberPassword;
}
public String getMemberName() {
return memberName;
}
public void setMemberName(String memberName) {
this.memberName = memberName;
}
public String getMemberGender() {
return memberGender;
}
public void setMemberGender(String memberGender) {
this.memberGender = memberGender;
}
public Integer getMemberAge() {
return memberAge;
}
public void setMemberAge(Integer memberAge) {
this.memberAge = memberAge;
}
public Integer getMemberHeight() {
return memberHeight;
}
public void setMemberHeight(Integer memberHeight) {
this.memberHeight = memberHeight;
}
public Integer getMemberWeight() {
return memberWeight;
}
public void setMemberWeight(Integer memberWeight) {
this.memberWeight = memberWeight;
}
public Long getMemberPhone() {
return memberPhone;
}
public void setMemberPhone(Long memberPhone) {
this.memberPhone = memberPhone;
}
//
// public String getCardTime() {
// return cardTime;
// }
//
// public void setCardTime(String cardTime) {
// this.cardTime = cardTime;
// }
//
// public Integer getCardClass() {
// return cardClass;
// }
//
// public void setCardClass(Integer cardClass) {
// this.cardClass = cardClass;
// }
//
// public Integer getCardNextClass() {
// return cardNextClass;
// }
//
// public void setCardNextClass(Integer cardNextClass) {
// this.cardNextClass = cardNextClass;
// }
@Override
public String toString() {
return "Member{" +
", memberAccount=" + memberAccount +
", memberPassword='" + memberPassword + '\'' +
", memberName='" + memberName + '\'' +
", memberGender='" + memberGender + '\'' +
", memberAge=" + memberAge +
", memberHeight=" + memberHeight +
", memberWeight=" + memberWeight +
", memberPhone=" + memberPhone +
// ", cardTime='" + cardTime + '\'' +
// ", cardClass=" + cardClass +
// ", cardNextClass=" + cardNextClass +
'}';
}
}

@ -0,0 +1,70 @@
package com.milotnt.pojo;
/**
* @author lhl
* @date 24/11
*/
public class RealRecord {
private Integer ruser;
private String rpName;
private String repName;
private String rrLocation;
private String rTime;
private String rDate;
public RealRecord() {}
public RealRecord(Integer ruser,String rpName,String repName, String rrLocation, String rTime, String rDate) {
this.ruser = ruser;
this.rpName = rpName;
this.repName = repName;
this.rrLocation = rrLocation;
this.rTime = rTime;
this.rDate = rDate;
}
public Integer getRuser() { return ruser; }
public void setRuser(Integer ruser) { this.ruser = ruser; }
public String getRpName() {return rpName;}
public void setTpName(String rpName) {
this.rpName = rpName;
}
public String getRepName() {return repName;}
public void setRepName(String repName){
this.repName = repName;
}
public String getRrLocation(){return rrLocation;}
public void setRrLocation(String rrLocation){
this.rrLocation = rrLocation;
}
public String getRTime(){return rTime;}
public void setRTime(String rTime){
this.rTime = rTime;
}
public String getRDate(){return rDate;}
public void settDate(String rDate){
this.rDate = rDate;
}
@Override
public String toString() {
return "RealRecord{" +
"rpName=" + rpName +
", repName=" + repName +
", rrLocation='" + rrLocation + '\'' +
", rTime='" + rTime + '\'' +
", rDate='" + rDate + '\'' +
'}';
}
}

@ -0,0 +1,74 @@
package com.milotnt.pojo;
import org.springframework.data.relational.core.sql.In;
/**
* @author lhl
* @date 24/11
*/
public class RecordTable {
private String date;
private Integer ruser;
private Integer recordId;
private String recordName;
private String recordBegin;
private String Location;
public RecordTable(){}
public RecordTable(String date,Integer ruser,Integer recordId, String recordName, String recordBegin, String location) {
this.ruser = ruser;
this.date = date;
this.recordId =recordId;
this.recordName = recordName;
this.recordBegin = recordBegin;
this.Location = location;
}
public String getDate() {return date;}
public void setDate(String date) { this.date = date; }
public Integer getRuser() {return ruser;}
public void setRuser(Integer ruser) {this.ruser = ruser;}
public Integer getRecordId() {
return recordId;
}
public void setRecordId(Integer recordId) {
this.recordId = recordId;
}
public String getRecordName() {
return recordName;
}
public void setRecordName(String recordName) {
this.recordName = recordName;
}
public String getRecordBegin() {
return recordBegin;
}
public void setRecordBegin(String recordBegin) {
this.recordBegin = recordBegin;
}
public String getLocation() {return Location;}
public void setLocation(String Location) {this.Location = Location;}
@Override
public String toString() {
return "RecordTable{" +
"date=" + date +
", ruser=" + ruser +
" recordId=" + recordId +
", recordName='" + recordName + '\'' +
", recordBegin='" + recordBegin + '\'' +
", Location='" + Location + '\'' +
'}';
}
}

@ -0,0 +1,74 @@
package com.milotnt.pojo;
/**
* @author lhl
* @date 24/11
*/
public class TargetRecord {
private Integer tuser ;
private String tpName;
private String tepName;
private String trLocation;
private String tTime;
private String tDate;
public TargetRecord() {}
public TargetRecord(Integer tuser,String tpName,String tepName, String trLocation, String tTime, String tDate) {
this.tuser = tuser;
this.tpName = tpName;
this.tepName =tepName;
this.trLocation = trLocation;
this.tTime = tTime;
this.tDate = tDate;
}
public Integer getTuser() {
return tuser;
}
public void setTuser(Integer tuser) {
this.tuser = tuser;
}
public String getTpName() {return tpName;}
public void setTpName(String tpName) {
this.tpName = tpName;
}
public String getTepName() {return tepName;}
public void setTepName(String tepName){
this.tepName = tepName;
}
public String getTrLocation(){return trLocation;}
public void setTrLocation(String trLocation){
this.trLocation = trLocation;
}
public String getTTime(){return tTime;}
public void settTime(String tTime){
this.tTime = tTime;
}
public String getTDate(){return tDate;}
public void settDate(String tDate){
this.tDate = tDate;
}
@Override
public String toString() {
return "TargetRecord{" +
"tuser=" + tuser +
"tpName=" + tpName +
", tepName=" + tepName +
", trLocation='" + trLocation + '\'' +
", tTime='" + tTime + '\'' +
", tDate='" + tDate + '\'' +
'}';
}
}

@ -0,0 +1,10 @@
package com.milotnt.service;
import com.milotnt.pojo.Admin;
public interface AdminService {
//管理员登录
Admin adminLogin(Admin admin);
}

@ -0,0 +1,24 @@
package com.milotnt.service;
import com.milotnt.pojo.ClassTable;
import java.util.List;
public interface ClassTableService {
//查询所有课程
List<ClassTable> findAll();
//根据id删除课程
Boolean deleteClassByClassId(Integer classId);
//添加课程
Boolean insertClass(ClassTable classTable);
//根据id查询课表
ClassTable selectByClassId(Integer classId);
//根据id删除已预约的课程
Boolean deleteOrderByClassId(Integer classId);
}

@ -0,0 +1,27 @@
package com.milotnt.service;
import com.milotnt.pojo.Equipment;
import java.util.List;
public interface EquipmentService {
//查询所有器械
List<Equipment> findAll();
//根据id删除器械
Boolean deleteByEquipmentId(Integer equipmentId);
//添加器材
Boolean insertEquipment(Equipment equipment);
//根据id修改器械信息
Boolean updateEquipmentByEquipmentId(Equipment equipment);
//根据id查询器械
List<Equipment> selectByEquipmentId(Integer equipmentId);
//查询器械总数
Integer selectTotalCount();
}

@ -0,0 +1,35 @@
package com.milotnt.service;
import com.milotnt.pojo.Member;
import java.util.List;
public interface MemberService {
//查询会员信息
List<Member> findAll();
//新增会员信息
Boolean insertMember(Member member);
//根据会员账号修改会员信息
Boolean updateMemberByMemberAccount(Member member);
//查询会员账号密码(登录)
Member userLogin(Member member);
Member selectByPhoneAndPassword(Member member);
//根据会员账号删除会员信息
Boolean deleteByMemberAccount(Integer memberAccount);
//查询会员数
Integer selectTotalCount();
//根据会员账号查询会员
List<Member> selectByMemberAccount(Integer memberAccount);
List<Member> selectByMemberPhone(Integer memberPhone);
}

@ -0,0 +1,26 @@
package com.milotnt.service;
import com.milotnt.pojo.RealRecord;
import com.milotnt.pojo.TargetRecord;
import java.util.List;
/**
* @author lhl
* @date 24/11
*/
public interface RealRecordService {
//查询所有课程
List<RealRecord> findAll(Integer ruser);
List<RealRecord> selectRealRecord(String rDate);
//根据id删除课程
Boolean deleteRealRecord(String rDate);
Boolean insertRealRecord(RealRecord realRecord);
List<RealRecord> findLatestRealRecord(Integer ruser);
}

@ -0,0 +1,24 @@
package com.milotnt.service;
import com.milotnt.pojo.RecordTable;
import java.util.List;
/**
* @author lhl
* @date 24/11
*/
public interface RecordTableService {
//查询所有课程
List<RecordTable> findAll(Integer ruser);
List<RecordTable> selectRecord(Integer recordId);
//根据id删除课程
Boolean deleteRecord(Integer recordId, Integer ruser);
//添加课程
Boolean insertRecord(RecordTable recordTable);
}

@ -0,0 +1,26 @@
package com.milotnt.service;
import com.milotnt.pojo.RecordTable;
import com.milotnt.pojo.TargetRecord;
import java.util.List;
/**
* @author lhl
* @date 24/11
*/
public interface TargetRecordService {
//查询所有课程
List<TargetRecord> findAll();
List<TargetRecord> selectTargetRecord(String tDate);
//根据id删除课程
Boolean deleteTargetRecord(String tDate);
Boolean insertTargetRecord(TargetRecord targetRecord);
List<TargetRecord> findLatestTargetRecord(Integer ruser);
}

@ -0,0 +1,19 @@
package com.milotnt.service.impl;
import com.milotnt.mapper.AdminMapper;
import com.milotnt.pojo.Admin;
import com.milotnt.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class AdminServiceImpl implements AdminService {
@Autowired
private AdminMapper adminMapper;
@Override
public Admin adminLogin(Admin admin) {
return adminMapper.selectByAccountAndPassword(admin);
}
}

@ -0,0 +1,41 @@
package com.milotnt.service.impl;
import com.milotnt.mapper.ClassTableMapper;
import com.milotnt.pojo.ClassTable;
import com.milotnt.service.ClassTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ClassTableServiceImpl implements ClassTableService {
@Autowired
private ClassTableMapper classTableMapper;
@Override
public List<ClassTable> findAll() {
return classTableMapper.findAll();
}
@Override
public Boolean deleteClassByClassId(Integer classId) {
return classTableMapper.deleteClassByClassId(classId);
}
@Override
public Boolean insertClass(ClassTable classTable) {
return classTableMapper.insertClass(classTable);
}
@Override
public ClassTable selectByClassId(Integer classId) {
return classTableMapper.selectByClassId(classId);
}
@Override
public Boolean deleteOrderByClassId(Integer classId) {
return classTableMapper.deleteOrderByClassId(classId);
}
}

@ -0,0 +1,46 @@
package com.milotnt.service.impl;
import com.milotnt.mapper.EquipmentMapper;
import com.milotnt.pojo.Equipment;
import com.milotnt.service.EquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class EquipmentServiceImpl implements EquipmentService {
@Autowired
private EquipmentMapper equipmentMapper;
@Override
public List<Equipment> findAll() {
return equipmentMapper.findAll();
}
@Override
public Boolean deleteByEquipmentId(Integer equipmentId) {
return equipmentMapper.deleteByEquipmentId(equipmentId);
}
@Override
public Boolean insertEquipment(Equipment equipment) {
return equipmentMapper.insertEquipment(equipment);
}
@Override
public Boolean updateEquipmentByEquipmentId(Equipment equipment) {
return equipmentMapper.updateEquipmentByEquipmentId(equipment);
}
@Override
public List<Equipment> selectByEquipmentId(Integer equipmentId) {
return equipmentMapper.selectByEquipmentId(equipmentId);
}
@Override
public Integer selectTotalCount() {
return equipmentMapper.selectTotalCount();
}
}

@ -0,0 +1,59 @@
package com.milotnt.service.impl;
import com.milotnt.mapper.MemberMapper;
import com.milotnt.pojo.Member;
import com.milotnt.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class MemberServiceImpl implements MemberService {
@Autowired
private MemberMapper memberMapper;
@Override
public List<Member> findAll() {
return memberMapper.findAll();
}
@Override
public Boolean insertMember(Member member) {
return memberMapper.insertMember(member);
}
@Override
public Boolean updateMemberByMemberAccount(Member member) {
return memberMapper.updateMemberByMemberAccount(member);
}
@Override
public Member userLogin(Member member) {
return memberMapper.selectByAccountAndPassword(member);
}
@Override
public Member selectByPhoneAndPassword(Member member) {return memberMapper.selectByPhoneAndPassword(member);}
@Override
public Boolean deleteByMemberAccount(Integer memberAccount) {
return memberMapper.deleteByMemberAccount(memberAccount);
}
@Override
public Integer selectTotalCount() {
return memberMapper.selectTotalCount();
}
@Override
public List<Member> selectByMemberAccount(Integer memberAccount) {
return memberMapper.selectByMemberAccount(memberAccount);
}
@Override
public List<Member> selectByMemberPhone(Integer memberPhone) {
return memberMapper.selectByMemberPhone(memberPhone);
}
}

@ -0,0 +1,49 @@
package com.milotnt.service.impl;
import com.milotnt.mapper.RealRecordMapper;
import com.milotnt.pojo.RealRecord;
import com.milotnt.pojo.TargetRecord;
import com.milotnt.service.RealRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
* @author lhl
* @date 24/11
*/
@Service
public class RealRecordServiceImpl implements RealRecordService {
@Autowired
private RealRecordMapper realRecordMapper;
@Override
public List<RealRecord> findAll(Integer ruser) {
return realRecordMapper.findAll(ruser);
}
@Override
public List<RealRecord> selectRealRecord(String rDate) {
return realRecordMapper.selectRealRecord(rDate);
}
@Override
public Boolean deleteRealRecord(String rDate) {
return realRecordMapper.deleteRealRecord(rDate);
}
@Override
public Boolean insertRealRecord(RealRecord realRecord) {
return realRecordMapper.insertRealRecord(realRecord);
}
@Override
public List<RealRecord> findLatestRealRecord(Integer ruser) {
return realRecordMapper.findLatestRealRecord(ruser);
}
}

@ -0,0 +1,42 @@
package com.milotnt.service.impl;
import com.milotnt.mapper.RecordTableMapper;
import com.milotnt.pojo.RecordTable;
import com.milotnt.service.RecordTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author lhl
* @date 24/11
*/
@Service
public class RecordTableServiceImpl implements RecordTableService {
@Autowired
private RecordTableMapper recordTableMapper;
@Override
public List<RecordTable> findAll(Integer ruser) {
return recordTableMapper.findAll(ruser);
}
@Override
public List<RecordTable> selectRecord(Integer recordId) {
return recordTableMapper.selectRecord(recordId);
}
@Override
public Boolean deleteRecord(Integer recordId, Integer ruser) {
return recordTableMapper.deleteRecord(recordId,ruser);
}
@Override
public Boolean insertRecord(RecordTable recordTable) {
return recordTableMapper.insertRecord(recordTable);
}
}

@ -0,0 +1,50 @@
package com.milotnt.service.impl;
import com.milotnt.mapper.TargetRecordMapper;
import com.milotnt.pojo.RecordTable;
import com.milotnt.pojo.TargetRecord;
import com.milotnt.service.TargetRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
* @author lhl
* @date 24/11
*/
@Service
public class TargetRecordServiceImpl implements TargetRecordService {
@Autowired
private TargetRecordMapper targetRecordMapper;
@Override
public List<TargetRecord> findAll() {
return targetRecordMapper.findAll();
}
@Override
public List<TargetRecord> selectTargetRecord(String tDate) {
return targetRecordMapper.selectTargetRecord(tDate);
}
@Override
public Boolean deleteTargetRecord(String tDate) {
return targetRecordMapper.deleteTargetRecord(tDate);
}
@Override
public Boolean insertTargetRecord(TargetRecord targetRecord) {
return targetRecordMapper.insertTargetRecord(targetRecord);
}
@Override
public List<TargetRecord> findLatestTargetRecord(Integer ruser) {
return targetRecordMapper.findLatestTargetRecord(ruser);
}
}

@ -0,0 +1,21 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/gym_management_system
username: root
password: 915919
driver-class-name: com.mysql.cj.jdbc.Driver
thymeleaf:
cache: false
server:
port: 8888
mybatis:
# config-location: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath:mybatis/mapper/*.xml
configuration:
map-underscore-to-camel-case: true
type-aliases-package: com.milotnt.pojo

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.milotnt.mapper.AdminMapper">
<select id="selectByAccountAndPassword" resultType="admin">
SELECT *
FROM admin
WHERE admin_account = #{adminAccount}
AND admin_password = #{adminPassword}
</select>
</mapper>

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.milotnt.mapper.ClassTableMapper">
<select id="findAll" resultType="classTable">
SELECT *
FROM class_table
</select>
<delete id="deleteClassByClassId" parameterType="java.lang.Integer">
DELETE
FROM class_table
WHERE class_id = #{classId}
</delete>
<insert id="insertClass" parameterType="classTable">
INSERT INTO class_table(c_id,class_id, class_name, class_begin, coach)
VALUES (#{cid},#{classId}, #{className}, #{classBegin}, #{coach})
</insert>
<select id="selectByClassId" parameterType="java.lang.Integer" resultType="classTable">
SELECT *
FROM class_table
WHERE class_id = #{classId}
</select>
</mapper>

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.milotnt.mapper.EquipmentMapper">
<select id="findAll" resultType="equipment">
SELECt *
FROM equipment
</select>
<delete id="deleteByEquipmentId" parameterType="java.lang.Integer">
DELETE
FROM equipment
WHERE equipment_id = #{equipmentId}
</delete>
<insert id="insertEquipment" parameterType="equipment">
INSERT INTO equipment (equipment_id, equipment_name, equipment_location, equipment_status, equipment_message)
VALUES (#{equipmentId}, #{equipmentName}, #{equipmentLocation}, #{equipmentStatus}, #{equipmentMessage})
</insert>
<update id="updateEquipmentByEquipmentId" parameterType="equipment">
UPDATE equipment
SET equipment_id = #{equipmentId},
equipment_name = #{equipmentName},
equipment_location = #{equipmentLocation},
equipment_status = #{equipmentStatus},
equipment_message = #{equipmentMessage}
WHERE equipment_id = #{equipmentId}
</update>
<select id="selectByEquipmentId" parameterType="java.lang.Integer" resultType="equipment">
SELECT *
FROM equipment
WHERE equipment_id = #{equipmentId}
</select>
<select id="selectTotalCount" resultType="java.lang.Integer">
SELECT count(*)
FROM equipment
</select>
</mapper>

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.milotnt.mapper.MemberMapper">
<select id="findAll" resultType="member">
SELECT *
FROM member
</select>
<insert id="insertMember" parameterType="member">
INSERT INTO member (member_account,member_password, member_name, member_gender, member_age, member_height,
member_weight, member_phone)
VALUES (#{memberAccount}, #{memberPassword}, #{memberName}, #{memberGender}, #{memberAge}, #{memberHeight},
#{memberWeight}, #{memberPhone})
</insert>
<update id="updateMemberByMemberAccount" parameterType="member">
UPDATE member
SET
member_account = #{memberAccount},
member_password = #{memberPassword},
member_name = #{memberName},
member_gender = #{memberGender},
member_age = #{memberAge},
member_height = #{memberHeight},
member_weight = #{memberWeight},
member_phone = #{memberPhone}
WHERE member_account = #{memberAccount}
</update>
<select id="selectByAccountAndPassword" resultType="member">
SELECT *
FROM member
WHERE member_account = #{memberAccount}
AND member_password = #{memberPassword}
</select>
<select id="selectByPhoneAndPassword" resultType="member">
SELECT *
FROM member
WHERE member_phone = #{memberPhone}
AND member_password = #{memberPassword}
</select>
<delete id="deleteByMemberAccount" parameterType="java.lang.Integer">
DELETE
FROM member
WHERE member_account = #{memberAccount}
</delete>
<select id="selectTotalCount" resultType="java.lang.Integer">
SELECT count(*)
FROM member
</select>
<select id="selectByMemberAccount" parameterType="java.lang.Integer" resultType="member">
SELECT *
FROM member
WHERE member_account = #{memberAccount}
</select>
<select id="selectByMemberPhone" parameterType="java.lang.Integer" resultType="member">
SELECT *
FROM member
WHERE member_phone = #{memberPhone}
</select>
</mapper>

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.milotnt.mapper.RealRecordMapper">
<select id="findAll" resultType="RealRecord">
SELECT *
FROM real_record
where ruser = #{ruser}
</select>
<select id="selectRealRecord" resultType="RealRecord">
SELECT *
FROM real_record
WHERE rdate= #{rDate} and ruser = {ruser}
</select>
<delete id="deleteRealRecord" parameterType="RealRecord">
DELETE
FROM real_record
WHERE rdate = #{rDate} and ruser = {ruser}
</delete>
<insert id="insertRealRecord" parameterType="RealRecord">
INSERT INTO real_record(ruser,rp_name,rep_name, rr_location, rtime, rdate)
VALUES (#{ruser},#{rpName},#{repName}, #{rrLocation}, #{rTime}, #{rDate})
</insert>
<select id="findLatestRealRecord" resultType="RealRecord">
SELECT *
FROM real_record
where ruser = #{ruser}
ORDER BY rdate DESC
LIMIT 1
</select>
</mapper>

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.milotnt.mapper.RecordTableMapper">
<select id="findAll" resultType="RecordTable">
SELECT *
FROM record_table
where ruser = #{ruser}
</select>
<select id="selectRecord" resultType="RecordTable">
SELECT *
FROM record_table
WHERE record_id= #{recordId} and ruser = #{ruser}
</select>
<delete id="deleteRecord" parameterType="RecordTable">
DELETE
FROM record_table
WHERE record_id = #{recordId} and ruser = #{ruser}
</delete>
<insert id="insertRecord" parameterType="RecordTable">
INSERT INTO record_table(date,ruser,record_id, record_name, record_begin, location)
VALUES (#{date},#{ruser},#{recordId}, #{recordName}, #{recordBegin}, #{Location})
</insert>
</mapper>

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.milotnt.mapper.TargetRecordMapper">
<select id="findAll" resultType="TargetRecord">
SELECT *
FROM target_record
where tuser=#{tuser}
</select>
<select id="selectTargetRecord" resultType="TargetRecord">
SELECT *
FROM target_record
WHERE tdate= #{tDate} and tuser=#{tuser}
</select>
<delete id="deleteTargetRecord" parameterType="TargetRecord">
DELETE
FROM target_record
WHERE tdate = #{tDate} and tuser=#{tuser}
</delete>
<insert id="insertTargetRecord" parameterType="TargetRecord">
INSERT INTO target_record(tuser,tp_name,tep_name, tr_location, ttime, tdate)
VALUES (#{tuser},#{tpName},#{tepName}, #{trLocation}, #{tTime}, #{tDate})
</insert>
<select id="findLatestTargetRecord" resultType="TargetRecord">
SELECT *
FROM target_record
where tuser = #{tuser}
ORDER BY tdate DESC
LIMIT 1
</select>
</mapper>

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<!--测试时使用-->
<!--
<configuration>
<typeAliases>
<package name="com.milotnt.pojo"/>
</typeAliases>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/gym_management_system"/>
<property name="username" value="root"/>
<property name="password" value="12345678"/>
</dataSource>
</environment>
</environments>
<mappers>
<package name="mybatis.mapper"/>
</mappers>
<settings>
<setting name="mapUnderscoreToCamelCase" value="true"/>
</settings>
</configuration>-->

@ -0,0 +1,54 @@
// Set new default font family and font color to mimic Bootstrap's default styling
Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
Chart.defaults.global.defaultFontColor = '#292b2c';
// Area Chart Example
var ctx = document.getElementById("myAreaChart");
var myLineChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Mar 1", "Mar 2", "Mar 3", "Mar 4", "Mar 5", "Mar 6", "Mar 7", "Mar 8", "Mar 9", "Mar 10", "Mar 11", "Mar 12", "Mar 13"],
datasets: [{
label: "Sessions",
lineTension: 0.3,
backgroundColor: "rgba(2,117,216,0.2)",
borderColor: "rgba(2,117,216,1)",
pointRadius: 5,
pointBackgroundColor: "rgba(2,117,216,1)",
pointBorderColor: "rgba(255,255,255,0.8)",
pointHoverRadius: 5,
pointHoverBackgroundColor: "rgba(2,117,216,1)",
pointHitRadius: 50,
pointBorderWidth: 2,
data: [10000, 30162, 26263, 18394, 18287, 28682, 31274, 33259, 25849, 24159, 32651, 31984, 38451],
}],
},
options: {
scales: {
xAxes: [{
time: {
unit: 'date'
},
gridLines: {
display: false
},
ticks: {
maxTicksLimit: 7
}
}],
yAxes: [{
ticks: {
min: 0,
max: 40000,
maxTicksLimit: 5
},
gridLines: {
color: "rgba(0, 0, 0, .125)",
}
}],
},
legend: {
display: false
}
}
});

@ -0,0 +1,46 @@
// Set new default font family and font color to mimic Bootstrap's default styling
Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
Chart.defaults.global.defaultFontColor = '#292b2c';
// Bar Chart Example
var ctx = document.getElementById("myBarChart");
var myLineChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["January", "February", "March", "April", "May", "June"],
datasets: [{
label: "Revenue",
backgroundColor: "rgba(2,117,216,1)",
borderColor: "rgba(2,117,216,1)",
data: [4215, 5312, 6251, 7841, 9821, 14984],
}],
},
options: {
scales: {
xAxes: [{
time: {
unit: 'month'
},
gridLines: {
display: false
},
ticks: {
maxTicksLimit: 6
}
}],
yAxes: [{
ticks: {
min: 0,
max: 15000,
maxTicksLimit: 5
},
gridLines: {
display: true
}
}],
},
legend: {
display: false
}
}
});

@ -0,0 +1,16 @@
// Set new default font family and font color to mimic Bootstrap's default styling
Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
Chart.defaults.global.defaultFontColor = '#292b2c';
// Pie Chart Example
var ctx = document.getElementById("myPieChart");
var myPieChart = new Chart(ctx, {
type: 'pie',
data: {
labels: ["Blue", "Red", "Yellow", "Green"],
datasets: [{
data: [12.21, 15.58, 11.25, 8.32],
backgroundColor: ['#007bff', '#dc3545', '#ffc107', '#28a745'],
}],
},
});

@ -0,0 +1,4 @@
// Call the dataTables jQuery plugin
$(document).ready(function() {
$('#dataTable').DataTable();
});

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 KiB

@ -0,0 +1,9 @@
window.addEventListener('DOMContentLoaded', event => {
// Simple-DataTables
// https://github.com/fiduswriter/Simple-DataTables/wiki
const datatablesSimple = document.getElementById('datatablesSimple');
if (datatablesSimple) {
new simpleDatatables.DataTable(datatablesSimple);
}
});

@ -0,0 +1,26 @@
/*!
* Start Bootstrap - SB Admin v7.0.2 (https://startbootstrap.com/template/sb-admin)
* Copyright 2013-2021 Start Bootstrap
* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-sb-admin/blob/master/LICENSE)
*/
//
// Scripts
//
window.addEventListener('DOMContentLoaded', event => {
// Toggle the side navigation
const sidebarToggle = document.body.querySelector('#sidebarToggle');
if (sidebarToggle) {
// Uncomment Below to persist sidebar toggle between refreshes
// if (localStorage.getItem('sb|sidebar-toggle') === 'true') {
// document.body.classList.toggle('sb-sidenav-toggled');
// }
sidebarToggle.addEventListener('click', event => {
event.preventDefault();
document.body.classList.toggle('sb-sidenav-toggled');
localStorage.setItem('sb|sidebar-toggle', document.body.classList.contains('sb-sidenav-toggled'));
});
}
});

@ -0,0 +1,80 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="adminCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="adminCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="adminCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">添加预约信息</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toAdminMain}">主页</a></li>
<li class="breadcrumb-item"><a th:href="@{/class/selClass}">预约管理</a></li>
<li class="breadcrumb-item active">添加预约信息</li>
</ol>
<div class="card mb-4">
<form th:action="@{/class/addClass}" method="post" name="addForm"
onsubmit="return beforeSubmit(this)">
<table class="table table-hover">
<tr>
<td text-align="center">编号:</td>
<td><input type="text" class="form-control" placeholder="4位编号" name="classId"></td>
</tr>
<tr>
<td text-align="center">名称:</td>
<td><input type="text" class="form-control" placeholder="器材名称" name="className">
</td>
</tr>
<tr>
<td text-align="center">时间:</td>
<td><input type="text" class="form-control" placeholder="xx:xx-xx:xx" name="classBegin">
</td>
</tr>
<tr>
<td text-align="center">地点:</td>
<td><input type="text" class="form-control" placeholder="地点" name="coach">
</td>
</tr>
</table>
<div style="text-align:center;margin-top:20px;margin-bottom:20px">
<input type="submit" class="btn btn-outline-success" value="添加">
</div>
</form>
</div>
</div>
</main>
<footer th:replace="adminCommon::common-footer"></footer>
</div>
</div>
<div th:include="adminCommon::common-scripts"></div>
<script type="text/javascript">
function beforeSubmit(addForm) {
if (addForm.classId.value == "") {
alert("请输入编号!")
return false;
}
if (addForm.recordName.value == "") {
alert("请输入器材名称!")
return false;
}
if (addForm.recordBegin.value == "") {
alert("请输入时间!")
return false;
}
if (addForm.coach.value == "") {
alert("请输入地点!")
return false;
}
return true;
}
</script>
</body>
</html>

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="adminCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="adminCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="adminCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">添加器材</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toAdminMain}">主页</a></li>
<li class="breadcrumb-item"><a th:href="@{/equipment/selEquipment}">器材管理</a></li>
<li class="breadcrumb-item active">添加器材</li>
</ol>
<div class="card mb-4">
<form th:action="@{/equipment/addEquipment}" method="post" name="addForm"
onsubmit="return beforeSubmit(this)">
<table class="table table-hover">
<tr>
<td text-align="center">器材名称:</td>
<td><input type="text" class="form-control" placeholder="名称" name="equipmentName"></td>
</tr>
<tr>
<td text-align="center">器材位置:</td>
<td><input type="text" class="form-control" placeholder="x号房间" name="equipmentLocation">
</td>
</tr>
<tr>
<td text-align="center">器材状态:</td>
<td><input type="text" class="form-control" placeholder="状态" name="equipmentStatus">
</td>
</tr>
<tr>
<td text-align="center">备注信息:</td>
<td><input type="text" class="form-control" placeholder="备注" name="equipmentMessage">
</td>
</tr>
</table>
<div style="text-align:center;margin-top:20px;margin-bottom:20px">
<input type="submit" class="btn btn-outline-success" value="添加">
</div>
</form>
</div>
</div>
</main>
<footer th:replace="adminCommon::common-footer"></footer>
</div>
</div>
<div th:include="adminCommon::common-scripts"></div>
<script type="text/javascript">
function beforeSubmit(addForm) {
if (addForm.equipmentName.value == "") {
alert("请输入器材名称!")
return false;
}
if (addForm.equipmentLocation.value == "") {
alert("请输入器材位置!")
return false;
}
if (addForm.equipmentStatus.value == "") {
alert("请输入器材状态!")
return false;
}
return true;
}
</script>
</body>
</html>

@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="adminCommon::common-header">
</head>
<body class="sb-nav-fixed">
<nav th:replace="adminCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="adminCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">添加用户</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toAdminMain}">主页</a></li>
<li class="breadcrumb-item"><a th:href="@{/member/selMember}">用户管理</a></li>
<li class="breadcrumb-item active">添加用户</li>
</ol>
<div class="card mb-4">
<form th:action="@{/member/addMember}" method="post" name="addForm"
onsubmit="return beforeSubmit(this)">
<table class="table table-hover">
<tr>
<td text-align="center">用户账号:</td>
<td><input type="text" class="form-control" placeholder="卡号由系统自动生成" name="memberAccount"
disabled="disabled">
</td>
</tr>
<tr>
<td text-align="center">密码:</td>
<td><input type="text" class="form-control" placeholder="输入8位包含字母以及数字的密码"
name="memberPassword">
</td>
</tr>
<tr>
<td text-align="center">姓名:</td>
<td><input type="text" class="form-control" placeholder="姓名" name="memberName">
</td>
</tr>
<tr>
<td text-align="center">性别:</td>
<td><input type="text" class="form-control" placeholder="性别" name="memberGender">
</td>
</tr>
<tr>
<td text-align="center">年龄:</td>
<td><input type="text" class="form-control" placeholder="年龄" name="memberAge">
</td>
</tr>
<tr>
<td text-align="center">身高:</td>
<td><input type="text" class="form-control" placeholder="cm" name="memberHeight">
</td>
</tr>
<tr>
<td text-align="center">体重:</td>
<td><input type="text" class="form-control" placeholder="kg" name="memberWeight">
</td>
</tr>
<tr>
<td text-align="center">联系方式:</td>
<td><input type="text" class="form-control" placeholder="11位手机号" name="memberPhone">
</td>
</tr>
</table>
<div style="text-align:center;margin-top:20px;margin-bottom:20px">
<input type="submit" class="btn btn-outline-success" value="添加">
</div>
</form>
</div>
</div>
</main>
<footer th:replace="adminCommon::common-footer"></footer>
</div>
</div>
<div th:include="adminCommon::common-scripts"></div>
<script type="text/javascript">
function beforeSubmit(addForm) {
let phone = /^[1][3,4,5,7,8,9][0-9]{9}$/;//设置手机号正则表达式
if (addForm.memberName.value == "") {
alert("请输入姓名!")
return false;
}
if (addForm.memberGender.value == "") {
alert("请输入性别!")
return false;
}
if (addForm.memberAge.value == "") {
alert("请输入年龄!")
return false;
}
if (!phone.test(addForm.memberPhone.value)) {
alert("手机号码错误!");
return false;
}
if (addForm.memberHeight.value == "") {
alert("请输入身高!")
return false;
}
if (addForm.memberWeight.value == "") {
alert("请输入体重!")
return false;
}
return true;
}
</script>
</body>
</html>

@ -0,0 +1,97 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="common-header">
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta name="description" content="gym-management-system"/>
<meta name="author" content=" "/>
<title>健身房管理系统-管理员</title>
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@latest/dist/style.css" rel="stylesheet"/>
<link href="/static/css/styles.css" th:href="@{/css/styles.css}" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js"
crossorigin="anonymous"></script>
</head>
<body>
<!--导航栏-->
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark" th:fragment="common-navbar">
<!-- Navbar Brand-->
<a class="navbar-brand ps-3">健身房管理系统</a>
<!-- Sidebar Toggle-->
<button class="btn btn-link btn-sm order-1 order-lg-0 me-4 me-lg-0" id="sidebarToggle" href="#!"><i
class="fas fa-bars"></i></button>
<!-- Navbar Search-->
<form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0">
<div class="input-group">
<input class="form-control" type="text" placeholder="搜索" aria-label="搜索"
aria-describedby="btnNavbarSearch"/>
<button class="btn btn-primary" id="btnNavbarSearch" type="button"><i class="fas fa-search"></i></button>
</div>
</form>
<!-- Navbar-->
<ul class="navbar-nav ms-auto ms-md-0 me-3 me-lg-4">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown"
aria-expanded="false"><i class="fas fa-user fa-fw"></i></a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" th:href="@{/}"><i class="fas fa-sign-out-alt"></i>&nbsp;退出登录</a></li>
</ul>
</li>
</ul>
</nav>
<!--侧边栏-->
<div id="layoutSidenav_nav" th:fragment="common-sidenav">
<nav class="sb-sidenav accordion sb-sidenav-light" id="sidenavAccordion">
<div class="sb-sidenav-menu">
<div class="nav">
<!--管理区域-->
<div class="sb-sidenav-menu-heading">管理</div>
<a class="nav-link" th:href="@{/member/selMember}">
<div class="sb-nav-link-icon"><i class="fas fa-user"></i></div>
用户管理
</a>
<a class="nav-link" th:href="@{/equipment/selEquipment}">
<div class="sb-nav-link-icon"><i class="fas fa-table-tennis"></i></div>
器材管理
</a>
<a class="nav-link" th:href="@{/class/selClass}">
<div class="sb-nav-link-icon"><i class="fas fa-calendar-alt"></i></div>
预约管理
</a>
</div>
</div>
<div class="sb-sidenav-footer">
<div class="small">你好!</div>
管理员
</div>
</nav>
</div>
<!--页脚-->
<footer class="py-4 bg-light mt-auto" th:fragment="common-footer">
<div class="container-fluid px-4">
<div class="d-flex align-items-center justify-content-between small">
<div class="text-muted"> </div>
</div>
</div>
</footer>
<div th:fragment="common-scripts">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
crossorigin="anonymous"></script>
<script src="/static/js/scripts.js" th:src="@{/js/scripts.js}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script>
<script src="/static/assets/demo/chart-area-demo.js" th:src="@{/assets/demo/chart-area-demo.js}"></script>
<script src="/static/assets/demo/chart-bar-demo.js" th:src="@{/assets/demo/chart-bar-demo.js}"></script>
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest" crossorigin="anonymous"></script>
<script src="/static/js/datatables-simple-demo.js" th:src="@{/js/datatables-simple-demo.js}"></script>
</div>
</body>
</html>

@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta name="description" content="gym-management-system"/>
<meta name="author" content=" "/>
<title>健身房管理系统-管理员登录</title>
<link href="/static/css/styles.css" th:href="@{css/styles.css}" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js"
crossorigin="anonymous"></script>
<script type="text/javascript">
function checkSubmit(loginForm) {
if (loginForm.adminAccount.value == '') {
alert("请输入账号");
loginForm.adminAccount.focus();
return false;
}
if (loginForm.adminPassword.value == '') {
alert("请输入密码");
loginForm.adminPassword.focus();
return false;
}
return true;
}
</script>
</head>
<body class="bg-primary" th:style="'background-image: url(/img/background.jpeg);background-size: 100%, 100%'">
<div id="layoutAuthentication">
<div id="layoutAuthentication_content">
<main>
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-5">
<div class="card shadow-lg border-0 rounded-lg mt-5">
<div class="card-header"><h3 class="text-center font-weight-light my-4">管理员登录</h3></div>
<div class="card-body">
<form th:action="@{/adminLogin}" method="post" name="loginForm"
onsubmit="return checkSubmit(this)">
<div class="form-floating mb-3">
<input class="form-control" id="inputAccount" name="adminAccount" type="account"
placeholder="Account"
onkeypress="return event.keyCode>=48&&event.keyCode<=57"/>
<label for="inputAccount">账号</label>
</div>
<div class="form-floating mb-3">
<input class="form-control" id="inputPassword" name="adminPassword"
type="password"
placeholder="Password"/>
<label for="inputPassword">密码</label>
</div>
<div class="form-check mb-3">
<input class="form-check-input" id="inputRememberPassword" type="checkbox"
value=""/>
<label class="form-check-label" for="inputRememberPassword">记住密码</label>
</div>
<div class="d-flex align-items-center justify-content-between mt-4 mb-0">
<input type="submit" class="btn btn-success" value="登录">
<a class="btn btn-primary" th:href="@{/toUserLogin}">用户登录</a>
</div>
</form>
<div th:text="${msg}" style="margin-top: 20px;text-align: center;color: red"></div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
crossorigin="anonymous"></script>
<script src="/static/js/scripts.js" th:src="@{js/scripts.js}"></script>
</body>
</html>

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="adminCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="adminCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="adminCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">管理员主页</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item active">主页</li>
</ol>
<div class="row">
<div class="col-xl-3 col-md-6">
<div class="card bg-primary text-white mb-4">
<div class="card-body">健身房总人数</div>
<div class="card-footer d-flex align-items-center justify-content-between">
<span class="small text-white" th:text="${humanTotal} + '人'"></span>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card bg-success text-white mb-4">
<div class="card-body">用户人数</div>
<div class="card-footer d-flex align-items-center justify-content-between">
<span class="small text-white" th:text="${memberTotal} + '人'"></span>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card bg-danger text-white mb-4">
<div class="card-body">器材数量</div>
<div class="card-footer d-flex align-items-center justify-content-between">
<span class="small text-white" th:text="${equipmentTotal} + '件'"></span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-6">
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-chart-area me-1"></i>
Area Chart Example
</div>
<div class="card-body">
<canvas id="myAreaChart" width="100%" height="40"></canvas>
</div>
</div>
</div>
<div class="col-xl-6">
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-chart-bar me-1"></i>
Bar Chart Example
</div>
<div class="card-body">
<canvas id="myBarChart" width="100%" height="40"></canvas>
</div>
</div>
</div>
</div>
</div>
</main>
<footer th:replace="adminCommon::common-footer"></footer>
</div>
</div>
<div th:include="adminCommon::common-scripts"></div>
</body>
</html>

@ -0,0 +1,185 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>锻炼结束</title>
<style>
/* 基础样式 */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
background-color: #f5f5f5;
}
/* 表格样式 */
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
th, td {
border: 1px solid #ddd;
padding: 10px;
text-align: left;
}
th {
background-color: #f0f0f0;
}
/* 建议区域样式 */
.suggestions {
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* 响应式设计 */
@media (max-width: 600px) {
.container {
flex-direction: column;
}
}
#returnButton {
padding: 10px 20px;
font-size: 16px;
background-color: #007BFF;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}
#returnButton:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<div style="position: absolute; top: 10px; right: 10px;">
<a th:href="@{/toUserMain}"
style="text-decoration: none">
<input type="button" id="returnButton" value="返回主页">
</a>
</div>
<!-- 左侧表格:预期锻炼目标 -->
<div class="left-table">
<h2>预期锻炼目标</h2>
<table>
<tr>
<th>项目</th>
<th>器材</th>
<th>地点</th>
<th>时长</th>
<th>时间</th>
</tr>
<!-- 添加 id 属性来标记时长数据 -->
<tr th:each="target:${targetRecord}">
<td th:text="${target.getTpName()}">项目</td>
<td th:text="${target.getTepName()}">器材</td>
<td th:text="${target.getTrLocation()}">地点</td>
<td th:id="target-time" th:text="${target.getTTime()}">时长</td> <!-- 预期时长 -->
<td th:text="${target.getTDate()}">时间</td>
</tr>
</table>
</div>
<!-- 右侧表格:真实锻炼记录 -->
<div class="right-table">
<h2>真实锻炼记录</h2>
<table>
<tr>
<th>项目</th>
<th>器材</th>
<th>地点</th>
<th>时长</th>
<th>时间</th>
</tr>
<!-- 添加 id 属性来标记时长数据 -->
<tr th:each="real:${realRecord}">
<td th:text="${real.getRpName()}">项目</td>
<td th:text="${real.getRepName()}">器材</td>
<td th:text="${real.getRrLocation()}">地点</td>
<td th:id="real-time" th:text="${real.getRTime()}">时长</td> <!-- 真实时长 -->
<td th:text="${real.getRDate()}">时间</td>
</tr>
</table>
</div>
</div>
<div class="suggestions">
<h2>建议</h2>
<p id="suggestionText">根据您的预期锻炼目标和真实锻炼记录,建议您:</p>
<ul id="suggestionList">
<!-- 动态建议会显示在这里 -->
</ul>
</div>
<script>
// 解析时间字符串,将"X小时Y分钟Z秒"转为秒数
function parseTimeToSeconds(timeStr) {
let totalSeconds = 0;
// 正则表达式匹配小时、分钟、秒
const hourMatch = timeStr.match(/(\d+)(小时)/);
const minuteMatch = timeStr.match(/(\d+)(分钟)/);
const secondMatch = timeStr.match(/(\d+)(秒)/);
if (hourMatch) {
totalSeconds += parseInt(hourMatch[1]) * 3600; // 小时转换为秒
}
if (minuteMatch) {
totalSeconds += parseInt(minuteMatch[1]) * 60; // 分钟转换为秒
}
if (secondMatch) {
totalSeconds += parseInt(secondMatch[1]); // 秒
}
return totalSeconds;
}
// 比较预期和实际锻炼时长,并给出建议
function generateSuggestions(expectedTimeStr, actualTimeStr) {
const expectedTimeInSeconds = parseTimeToSeconds(expectedTimeStr);
const actualTimeInSeconds = parseTimeToSeconds(actualTimeStr);
const suggestionList = document.getElementById('suggestionList');
const suggestionText = document.getElementById('suggestionText');
suggestionList.innerHTML = ''; // 清空当前建议内容
if (actualTimeInSeconds < expectedTimeInSeconds) {
const timeDifference = expectedTimeInSeconds - actualTimeInSeconds;
const minutesMissing = Math.floor(timeDifference / 60);
const secondsMissing = timeDifference % 60;
suggestionText.textContent = '根据您的锻炼记录,您今天的锻炼时间不足预期噢!';
suggestionList.innerHTML += `<li>建议增加锻炼时长,您还差 ${minutesMissing} 分 ${secondsMissing} 秒。</li>`;
suggestionList.innerHTML += `<li>继续加油!争取完成目标,做更自律的自己噢!</li>`;
} else if (actualTimeInSeconds === expectedTimeInSeconds) {
suggestionText.textContent = '您的锻炼时长符合预期,请继续保持!';
} else {
const timeExcess = actualTimeInSeconds - expectedTimeInSeconds;
const minutesExcess = Math.floor(timeExcess / 60);
const secondsExcess = timeExcess % 60;
suggestionText.textContent = '根据您的锻炼记录,您今天的锻炼时间超出预期啦!';
suggestionList.innerHTML += `<li>您的锻炼时长较长,超出预期 ${minutesExcess} 分 ${secondsExcess} 秒。</li>`;
suggestionList.innerHTML += `<li>您需要好好休息啦!锻炼要适当!</li>`;
}
}
const targetTime = document.querySelector('#target-time').textContent;
const realTime = document.querySelector('#real-time').textContent;
generateSuggestions(targetTime, realTime);
</script>
</body>
</html>

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="adminCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="adminCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="adminCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">预约管理</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toAdminMain}">主页</a></li>
</ol>
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-table me-1"></i>
预约信息表
</div>
<div class="card-body">
<table id="datatablesSimple">
<thead>
<tr>
<th>编号</th>
<th>名称</th>
<th>时间</th>
<th>地点</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr th:each="class:${classList}">
<td th:text="${class.classId}">编号</td>
<td th:text="${class.className}">名称</td>
<td th:text="${class.classBegin}">时间</td>
<td th:text="${class.coach}">地点</td>
<td>
<a th:href="@{/class/delClass(classId=${class.classId})}"
style="text-decoration: none">
<input type="button" class="btn btn-sm btn-outline-danger"
onclick="return del()" value="删除">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div style="text-align:center;margin-top:20px;margin-bottom:20px">
<a th:href="@{/class/toAddClass}">
<input type="button" class="btn btn-outline-success" value="添加预约信息">
</a>
</div>
</div>
</main>
<footer th:replace="adminCommon::common-footer"></footer>
</div>
</div>
<div th:include="adminCommon::common-scripts"></div>
<script>
function del() {
let msg = "确定要删除吗?";
if (confirm(msg) == true) {
return true;
} else {
return false;
}
}
</script>
</body>
</html>

@ -0,0 +1,83 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="adminCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="adminCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="adminCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">器材管理</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toAdminMain}">主页</a></li>
<li class="breadcrumb-item active">器材管理</li>
</ol>
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-table me-1"></i>
器材信息表
</div>
<div class="card-body">
<table id="datatablesSimple">
<thead>
<tr>
<th>器材id</th>
<th>名称</th>
<th>位置</th>
<th>状态</th>
<th>备注信息</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr th:each="equ:${equipmentList}">
<td th:text="${equ.equipmentId}">id</td>
<td th:text="${equ.equipmentName}">name</td>
<td th:text="${equ.equipmentLocation}">location</td>
<td th:text="${equ.equipmentStatus}">status</td>
<td th:text="${equ.equipmentMessage}">message</td>
<td>
<a th:href="@{/equipment/toUpdateEquipment(equipmentId=${equ.equipmentId})}"
style="text-decoration: none">
<input type="button" class="btn btn-sm btn-outline-primary" value="编辑">
</a>
<a th:href="@{/equipment/delEquipment(equipmentId=${equ.equipmentId})}"
style="text-decoration: none">
<input type="button" class="btn btn-sm btn-outline-danger"
onclick="return del()" value="删除">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div style="text-align:center;margin-top:20px;margin-bottom:20px">
<a th:href="@{/equipment/toAddEquipment}">
<input type="button" class="btn btn-outline-success" value="添加器材信息">
</a>
</div>
</div>
</main>
<footer th:replace="adminCommon::common-footer"></footer>
</div>
</div>
<div th:include="adminCommon::common-scripts"></div>
<script>
function del() {
let msg = "确定要删除吗?";
if (confirm(msg) == true) {
return true;
} else {
return false;
}
}
</script>
</body>
</html>

@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="adminCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="adminCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="adminCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">用户管理</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toAdminMain}">主页</a></li>
<li class="breadcrumb-item active">用户管理</li>
</ol>
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-table me-1"></i>
用户信息表
</div>
<div class="card-body">
<table id="datatablesSimple">
<thead>
<tr>
<th>用户账号</th>
<th>密码</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
<th>身高</th>
<th>体重</th>
<th>联系方式</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr th:each="mem:${memberList}">
<td th:text="${mem.memberAccount}">用户账号</td>
<td th:text="${mem.memberPassword}">密码</td>
<td th:text="${mem.memberName}">姓名</td>
<td th:text="${mem.memberGender}">性别</td>
<td th:text="${mem.memberAge}">年龄</td>
<td th:text="${mem.memberHeight}">身高</td>
<td th:text="${mem.memberWeight}">体重</td>
<td th:text="${mem.memberPhone}">联系方式</td>
<td>
<a th:href="@{/member/toUpdateMember(memberAccount=${mem.memberAccount})}"
style="text-decoration: none">
<input type="button" class="btn btn-sm btn-outline-primary" value="编辑">
</a>
<a th:href="@{/member/delMember(memberAccount=${mem.memberAccount})}"
style="text-decoration: none">
<input type="button" class="btn btn-sm btn-outline-danger"
onclick="return del()" value="删除">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div style="text-align:center;margin-top:20px;margin-bottom:20px">
<a th:href="@{/member/toAddMember}">
<input type="button" class="btn btn-outline-success" value="添加用户信息">
</a>
</div>
</div>
</main>
<footer th:replace="adminCommon::common-footer"></footer>
</div>
</div>
<div th:include="adminCommon::common-scripts"></div>
<script>
function del() {
let msg = "确定要删除吗?";
if (confirm(msg) == true) {
return true;
} else {
return false;
}
}
</script>
</body>
</html>

@ -0,0 +1,372 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>健身房管理系统-用户</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body, html {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-family: Arial, sans-serif;
background-color: #f5f5f5;
}
.container {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #fff;
transform-origin: center;
padding: 20px;
transform: scale(1);
}
.countdown-text {
font-size: 16px;
color: #666;
margin-bottom: 10px;
}
.countdown-time {
font-size: 32px;
font-weight: bold;
margin: 20px 0;
}
.button-group {
display: flex;
gap: 20px;
}
.button {
width: 60px;
height: 60px;
border-radius: 50%;
border: 2px solid #000;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 24px;
color: #000;
background-color: transparent;
}
/* 去掉点击或聚焦时的默认蓝色高亮 */
.button:focus {
outline: none;
}
.button:active {
background-color: transparent;
}
/* 样式调整针对input按钮 */
input[type="button"] {
width: 80px;
height: 60px;
font-size: 24px;
color: #000;
background-color: transparent;
border: 2px solid #000;
border-radius: 5px;
cursor: pointer;
}
input[type="button"]:hover {
background-color: #f0f0f0;
}
.center-bold {
text-align: center; /* 文本居中 */
font-size: 1.2em; /* 增大字体大小 */
font-weight: bold; /* 加粗字体 */
}
/* 模态弹窗样式优化 */
.modal {
display: none; /* 默认隐藏 */
position: fixed; /* 固定位置 */
z-index: 1000; /* 在最上层 */
left: 0;
top: 0;
width: 100%; /* 全宽 */
height: 100%; /* 全高 */
overflow: auto; /* 允许滚动 */
background-color: rgba(0, 0, 0, 0.6); /* 更深的半透明背景 */
}
.modal-content {
background-color: #ffffff;
margin: 15% auto; /* 上下15%自动居中 */
padding: 20px;
border-radius: 8px; /* 圆角边框 */
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); /* 阴影效果 */
width: 80%; /* 宽度 */
max-width: 600px; /* 最大宽度 */
transition: all 0.3s ease; /* 平滑过渡效果 */
}
.alert-title {
font-size: 28px;
color: #d9534f;
text-align: center;
margin-bottom: 20px;
}
.modal-body {
font-size: 18px; /* 增大字体大小 */
line-height: 1.6; /* 设置行高,使文本行间距更舒适 */
}
.modal-body span {
display: block; /* 使每个span元素单独成行 */
margin-bottom: 10px; /* 添加底部外边距,增加行间距 */
}
.btn {
background-color: #d9534f;
color: white;
padding: 14px 20px;
border: none;
border-radius: 4px; /* 圆角按钮 */
cursor: pointer;
width: 100%;
font-size: 16px;
}
.btn:hover {
background-color: #c9302c; /* 悬停时颜色加深 */
}
body, html {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-family: Arial, sans-serif;
background-color: #f5f5f5;
background-image: url('/static/img/background.jpeg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
</style>
</head>
<body>
<div class="record-list" style="position: absolute; top: 0; left: 0; width: 100%; font-weight: bold; z-index: 10; display: flex; flex-direction: column; padding: 10px;">
<div class="record-item" th:each="rel:${TargetRecord}" style="display: flex; flex-direction: column; margin-bottom: 10px; background-color: #fff; padding: 5px;">
<span class="center-bold">预期锻炼目标:</span>
<span class="center-bold">项目:<a class="record-cell" th:text="${rel.getTpName()}"></a></span>
<span class="center-bold">器材:<a class="record-cell" th:text="${rel.getTepName()}"></a></span>
<span class="center-bold">地点:<a class="record-cell" th:text="${rel.getTrLocation()}"></a></span>
<span class="center-bold">时长:<a class="record-cell" th:text="${rel.getTTime()}"></a></span>
<!-- <span class="center-bold">时间:<a class="record-cell" th:text="${rel.getTDate()}"></a></span>-->
</div>
</div>
<div class="container">
<div class="countdown-text">距离锻炼开始已经过</div>
<div class="countdown-time" id="countdown">00小时00分00秒</div>
<div class="button-group" th:each="rel:${TargetRecord}">
<input type="button" value="开始" id="playButton">
<a th:attr="data-rpName=${rel.getTpName()}, data-repName=${rel.getTepName()}, data-rrLocation=${rel.getTrLocation()}" id="endLink">
<input type="button" value="结束" id="endButton" th:action="@{/user/addTargetRecord}">
</a>
</div>
</div>
<!-- 模态弹窗内容 -->
<div id="myModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closeModal()">&times;</span>
<div class="alert-title">警报!</div>
<div class="modal-body" th:each="rel:${TargetRecord}">
<span>器材:<a th:text="${rel.getTepName()}"></a></span>
<span>地点:<a th:text="${rel.getTrLocation()}"></a></span>
</div>
<button class="btn" onclick="closeModal()">确认收到</button>
</div>
</div>
<script>
let countdownTime = 0; // 从0秒开始
let countdownInterval = null;
let isCounting = false; // 用于跟踪倒计时是否在进行中
let pausedTime = null; // 用于存储暂停时的时间
// 将秒数转换为"XX小时XX分XX秒"格式
function formatTime(seconds) {
const hrs = Math.floor(seconds / 3600);
const mins = Math.floor((seconds % 3600) / 60);
const secs = seconds % 60;
return `${String(hrs).padStart(2, '0')}小时${String(mins).padStart(2, '0')}分${String(secs).padStart(2, '0')}秒`;
}
// 更新倒计时显示
function updateCountdown() {
document.getElementById("countdown").textContent = formatTime(countdownTime);
}
// 启动或暂停计时
function toggleCountdown() {
const playButton = document.getElementById("playButton");
if (isCounting) {
// 暂停时记录当前时间
pausedTime = countdownTime; // 保存当前时间
clearInterval(countdownInterval); // 停止计时器
playButton.value = "开始"; // 切换回播放按钮
isCounting = false;
// 关闭语音识别
if (recognition) {
recognition.stop();
}
} else {
countdownInterval = setInterval(() => {
countdownTime++; // 每秒增加1
updateCountdown();
}, 1000);
playButton.value = "暂停"; // 切换为暂停按钮
isCounting = true;
// 开启语音识别
startVoiceRecognition();
}
}
// 结束计时并跳转页面
function endCountdown() {
if (confirm("确定要结束计时吗?")) {
clearInterval(countdownInterval); // 停止计时器
var endTime = countdownTime; // 获取结束时的时长
countdownTime = 0; // 重置计时器
updateCountdown(); // 更新显示为0
isCounting = false;
document.getElementById("playButton").value = "开始"; // 重置播放按钮
// 获取结束时的时长,并转换为格式化的时间字符串
var formattedEndTime = formatTime(endTime);
// 构建完整的URL并设置<a>标签的href属性
var endLink = document.getElementById("endLink");
var rpName = endLink.getAttribute("data-rpName");
var repName = endLink.getAttribute("data-repName");
var rrLocation = endLink.getAttribute("data-rrLocation");
var url = `/user/addRealRecord?rpName=${encodeURIComponent(rpName)}&repName=${encodeURIComponent(repName)}&rrLocation=${encodeURIComponent(rrLocation)}&rTime=${formattedEndTime}`;
endLink.href = url;
}
}
// 显示模态弹窗的函数
function showModal() {
var modal = document.getElementById("myModal");
modal.style.display = "block";
}
// 关闭模态弹窗的函数
function closeModal() {
var modal = document.getElementById("myModal");
modal.style.display = "none";
}
// 检查时间并显示弹窗的逻辑
function checkTimeAndAlert() {
if (countdownTime >= 10) { // 当时间达到10秒时
showModal(); // 显示弹窗
clearInterval(checkTimeAndAlertInterval); // 停止检查时间的间隔
}
}
// 设置检查时间的间隔
let checkTimeAndAlertInterval = setInterval(checkTimeAndAlert, 1000);
// 绑定结束按钮点击事件
document.getElementById("endButton").addEventListener("click", endCountdown);
// 绑定播放/暂停按钮点击事件
document.getElementById("playButton").addEventListener("click", toggleCountdown);
// 页面加载时初始化计时
updateCountdown();
let recognition;
function startVoiceRecognition() {
if (!('SpeechRecognition' in window) && !('webkitSpeechRecognition' in window)) {
alert("浏览器不支持语音识别功能,请使用支持该功能的浏览器!");
return;
}
// 在这里使用 Google Cloud Speech-to-Text API
const audioStream = new MediaStream();
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
const analyser = audioContext.createAnalyser();
// 使用 Web Audio API 获取麦克风音频流
navigator.mediaDevices.getUserMedia({ audio: true })
.then(function(stream) {
const mediaStreamSource = audioContext.createMediaStreamSource(stream);
mediaStreamSource.connect(analyser);
// 创建 Google Cloud API 需要的语音识别请求体
const request = {
config: {
encoding: 'LINEAR16',
sampleRateHertz: 16000,
languageCode: 'zh-CN',
},
audio: {
content: "" // 将要转换的音频数据
}
};
// 请求音频流,发送到 Google Cloud Speech-to-Text API
const reader = new FileReader();
reader.onloadend = function() {
request.audio.content = reader.result.split(',')[1]; // Base64 编码的音频数据
fetch('https://speech.googleapis.com/v1p1beta1/speech:recognize?key=YOUR_GOOGLE_API_KEY', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(request),
})
.then(response => response.json())
.then(data => {
if (data.results && data.results.length > 0) {
const transcript = data.results[0].alternatives[0].transcript;
console.log('识别结果:', transcript);
// 判断是否包含“救命”
if (transcript.includes("救命")) {
alert("紧急情况!请立即寻求帮助!");
}
}
})
.catch(error => console.error('语音识别失败:', error));
};
// 从音频流中获取数据
const audioChunks = [];
const mediaRecorder = new MediaRecorder(stream);
mediaRecorder.ondataavailable = event => audioChunks.push(event.data);
mediaRecorder.onstop = () => reader.readAsDataURL(new Blob(audioChunks));
mediaRecorder.start();
recognition = mediaRecorder;
})
.catch(error => {
console.error("无法获取麦克风权限:", error);
});
}
startVoiceRecognition();
</script>
</body>
</html>

@ -0,0 +1,69 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="adminCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="adminCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="adminCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">编辑器材</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toAdminMain}">主页</a></li>
<li class="breadcrumb-item"><a th:href="@{/equipment/selEquipment}">器材管理</a></li>
<li class="breadcrumb-item active">编辑器材</li>
</ol>
<div class="card mb-4">
<form th:action="@{/equipment/updateEquipment}" method="post">
<div th:each="equ:${equipmentList}">
<table class="table table-hover">
<tr>
<td text-align="center">器材id</td>
<td><input type="text" class="form-control" readonly="readonly"
th:value="${equ.equipmentId}" name="equipmentId">
</td>
</tr>
<tr>
<td text-align="center">器材名称:</td>
<td><input type="text" class="form-control" th:value="${equ.equipmentName}"
name="equipmentName"></td>
</tr>
<tr>
<td text-align="center">器材位置:</td>
<td><input type="text" class="form-control" th:value="${equ.equipmentLocation}"
name="equipmentLocation">
</td>
</tr>
<tr>
<td text-align="center">器材状态:</td>
<td><input type="text" class="form-control" th:value="${equ.equipmentStatus}"
name="equipmentStatus">
</td>
</tr>
<tr>
<td text-align="center">器材备注信息:</td>
<td><input type="text" class="form-control" th:value="${equ.equipmentMessage}"
name="equipmentMessage">
</td>
</tr>
</table>
<div style="text-align:center;margin-bottom:15px">
<input type="submit" class="btn btn-outline-success" value="确认修改">
</div>
</div>
</form>
</div>
</div>
</main>
<footer th:replace="adminCommon::common-footer"></footer>
</div>
</div>
<div th:include="adminCommon::common-scripts"></div>
</body>
</html>

@ -0,0 +1,98 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="adminCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="adminCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="adminCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">编辑用户</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toAdminMain}">主页</a></li>
<li class="breadcrumb-item"><a th:href="@{/member/selMember}">用户管理</a></li>
<li class="breadcrumb-item active">编辑用户</li>
</ol>
<div class="card mb-4">
<form th:action="@{/member/updateMember}" method="post" name="updateForm"
onsubmit="return beforeSubmit(this)">
<div th:each="mem:${memberList}">
<table class="table table-hover">
<tr>
<td text-align="center">用户账号:</td>
<td><input type="text" class="form-control" readonly="readonly"
th:value="${mem.memberAccount}" name="memberAccount">
</td>
</tr>
<tr>
<td text-align="center">姓名:</td>
<td><input type="text" class="form-control" th:value="${mem.memberName}"
name="memberName"></td>
</tr>
<tr>
<td text-align="center">密码:</td>
<td><input type="text" class="form-control"
th:value="${mem.memberPassword}" name="memberPassword">
</td>
</tr>
<tr>
<td text-align="center">性别:</td>
<td><input type="text" class="form-control" th:value="${mem.memberGender}"
name="memberGender">
</td>
</tr>
<tr>
<td text-align="center">年龄:</td>
<td><input type="text" class="form-control" th:value="${mem.memberAge}"
name="memberAge">
</td>
</tr>
<tr>
<td text-align="center">联系方式:</td>
<td><input type="text" class="form-control" th:value="${mem.memberPhone}"
name="memberPhone">
</td>
</tr>
<tr>
<td text-align="center">身高:</td>
<td><input type="text" class="form-control" th:value="${mem.memberHeight}"
name="memberHeight">
</td>
</tr>
<tr>
<td text-align="center">体重:</td>
<td><input type="text" class="form-control" th:value="${mem.memberWeight}"
name="memberWeight">
</td>
</tr>
</table>
<div style="text-align:center;margin-bottom:15px">
<input type="submit" class="btn btn-outline-success" value="确认修改">
</div>
</div>
</form>
</div>
</div>
</main>
<footer th:replace="adminCommon::common-footer"></footer>
</div>
</div>
<div th:include="adminCommon::common-scripts"></div>
<script type="text/javascript">
function beforeSubmit(updateForm) {
let phone = /^[1][3,4,5,7,8,9][0-9]{9}$/;//设置手机号正则表达式
if (!phone.test(updateForm.memberPhone.value)) {
alert("手机号码错误!");
return false;
}
return true;
}
</script>
</body>
</html>

@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="userCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="userCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="userCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">编辑个人信息</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toUserMain}">主页</a></li>
<li class="breadcrumb-item"><a th:href="@{/user/toUserInfo}">个人信息</a></li>
<li class="breadcrumb-item active">编辑个人信息</li>
</ol>
<div class="card mb-4">
<form th:action="@{/user/updateInfo}" method="post" name="updateForm"
onsubmit="return beforeSubmit(this)">
<table class="table table-hover">
<tr>
<td text-align="center">用户账号:</td>
<td><input type="text" class="form-control" readonly="readonly"
th:value="${member.memberAccount}" name="memberAccount">
</td>
</tr>
<tr>
<td text-align="center">姓名:</td>
<td><input type="text" class="form-control" th:value="${member.memberName}"
name="memberName"></td>
</tr>
<tr>
<td text-align="center">密码:</td>
<td><input type="text" class="form-control" th:value="${member.memberPassword}"
name="memberPassword">
</td>
</tr>
<tr>
<td text-align="center">性别:</td>
<td><input type="text" class="form-control" th:value="${member.memberGender}"
name="memberGender">
</td>
</tr>
<tr>
<td text-align="center">年龄:</td>
<td><input type="text" class="form-control" th:value="${member.memberAge}"
name="memberAge">
</td>
</tr>
<tr>
<td text-align="center">联系方式:</td>
<td><input type="text" class="form-control" th:value="${member.memberPhone}"
name="memberPhone">
</td>
</tr>
<tr>
<td text-align="center">身高cm</td>
<td><input type="text" class="form-control" th:value="${member.memberHeight}"
name="memberHeight">
</td>
</tr>
<tr>
<td text-align="center">体重kg</td>
<td><input type="text" class="form-control" th:value="${member.memberWeight}"
name="memberWeight">
</td>
</tr>
</table>
<div style="text-align:center;margin-bottom:15px">
<input type="submit" class="btn btn-outline-success" value="确认修改">
</div>
</form>
</div>
</div>
</main>
<footer th:replace="userCommon::common-footer"></footer>
</div>
</div>
<div th:include="userCommon::common-scripts"></div>
<script type="text/javascript">
function beforeSubmit(updateForm) {
let phone = /^[1][3,4,5,7,8,9][0-9]{9}$/;//设置手机号正则表达式
if (!phone.test(updateForm.memberPhone.value)) {
alert("手机号码错误!");
return false;
}
return true;
}
</script>
</body>
</html>

@ -0,0 +1,78 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="userCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="userCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="userCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">预期目标填写</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toUserMain}">主页</a></li>
<li class="breadcrumb-item active">开始锻炼</li>
</ol>
<div class="card mb-4">
<form th:action="@{/user/addTargetRecord}" method="post" name="addForm"
onsubmit="return beforeSubmit(this)">
<table class="table table-hover">
<tr>
<td text-align="center">项目名称:</td>
<td><input type="text" class="form-control" placeholder="项目名称" name="tpName"></td>
</tr>
<tr>
<td text-align="center">器材名称:</td>
<td><input type="text" class="form-control" placeholder="器材名称" name="tepName">
</td>
</tr>
<tr>
<td text-align="center">器材位置:</td>
<td><input type="text" class="form-control" placeholder="x号房间" name="trLocation">
</td>
</tr>
<tr>
<td text-align="center">锻炼时长:</td>
<td><input type="text" class="form-control" placeholder="时长" name="tTime">
</td>
</tr>
</table>
<div style="text-align:center;margin-top:20px;margin-bottom:20px">
<input type="submit" class="btn btn-outline-success" value="开始锻炼">
</div>
</form>
</div>
</div>
</main>
<footer th:replace="userCommon::common-footer"></footer>
</div>
</div>
<div th:include="userCommon::common-scripts"></div>
<script type="text/javascript">
function beforeSubmit(addForm) {
if (addForm.classId.value == "") {
alert("请输入项目名称!")
return false;
}
if (addForm.recordName.value == "") {
alert("请输入器材!")
return false;
}
if (addForm.recordBegin.value == "") {
alert("请输入器材位置!")
return false;
}
if (addForm.coach.value == "") {
alert("请输入锻炼时长!")
return false;
}
return true;
}
</script>
</body>
</html>

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="userCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="userCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="userCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">预约信息</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toUserMain}">主页</a></li>
</ol>
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-table me-1"></i>
预约信息表
</div>
<div class="card-body">
<table id="datatablesSimple">
<thead>
<tr>
<th>编号</th>
<th>预约号</th>
<th>名称</th>
<th>时间</th>
<th>地点</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr th:each="class:${classList}">
<td th:text="${class.cid}">编号</td>
<td th:text="${class.classId}">预约号</td>
<td th:text="${class.className}">名称</td>
<td th:text="${class.classBegin}">时间</td>
<td th:text="${class.coach}">地点</td>
<td>
<a th:href="@{/user/userBook(recordId=${class.classId},recordName=${class.className},recordBegin=${class.classBegin},Location=${class.coach})}"
style="text-decoration: none">
<input type="button" class="btn btn-sm btn-outline-primary" value="预约">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div style="text-align:center;margin-top:20px;margin-bottom:20px">
</div>
</div>
</main>
<footer th:replace="userCommon::common-footer"></footer>
</div>
</div>
<div th:include="userCommon::common-scripts"></div>
<script>
function del() {
let msg = "确定要删除吗?";
if (confirm(msg) == true) {
return true;
} else {
return false;
}
}
</script>
</body>
</html>

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="userCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="userCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="userCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">预约记录</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toUserMain}">主页</a></li>
<li class="breadcrumb-item"><a th:href="@{/user/toUserBook}">预约信息</a></li>
<li class="breadcrumb-item active">预约记录</li>
</ol>
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-table me-1"></i>
预约记录
</div>
<div class="card-body">
<table id="datatablesSimple">
<thead>
<tr>
<th>预约时间</th>
<th>预约号</th>
<th>器材</th>
<th>时间</th>
<th>地点</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr th:each="rec:${recordList}">
<td th:text="${rec.date}">编号</td>
<td th:text="${rec.recordId}">预约号</td>
<td th:text="${rec.recordName}">器材</td>
<td th:text="${rec.recordBegin}">时间</td>
<td th:text="${rec.Location}">地点</td>
<td>
<a th:href="@{/user/delUserRecord(recordId=${rec.recordId})}"
style="text-decoration: none">
<input type="button" class="btn btn-sm btn-outline-danger"
onclick="return del()" value="删除">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</main>
<footer th:replace="userCommon::common-footer"></footer>
</div>
</div>
<div th:include="userCommon::common-scripts"></div>
<script>
function del() {
let msg = "确定要删除吗?";
if (confirm(msg) == true) {
return true;
} else {
return false;
}
}
</script>
</body>
</html>

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="userCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="userCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="userCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">我的锻炼记录</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toUserMain}">主页</a></li>
<li class="breadcrumb-item active">历史记录</li>
</ol>
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-table me-1"></i>
锻炼历史记录
</div>
<div class="card-body">
<table id="datatablesSimple">
<thead>
<tr>
<th>项目</th>
<th>器材</th>
<th>地点</th>
<th>时长</th>
<th>时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr th:each="rel:${RealRecord}">
<td th:text="${rel.getRpName()}">项目</td>
<td th:text="${rel.getRepName()}">器材</td>
<td th:text="${rel.getRrLocation()}">地点</td>
<td th:text="${rel.getRTime()}">时长</td>
<td th:text="${rel.getRDate()}">时间</td>
<td>
<a th:href="@{/user/delRealRecord(rDate=${rel.getRDate()})}"
style="text-decoration: none">
<input type="button" class="btn btn-sm btn-outline-danger"
onclick="return del()" value="删除">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</main>
<footer th:replace="userCommon::common-footer"></footer>
</div>
</div>
<div th:include="userCommon::common-scripts"></div>
<script>
function del() {
let msg = "确定要删除吗?";
if (confirm(msg) == true) {
return true;
} else {
return false;
}
}
</script>
</body>
</html>

@ -0,0 +1,115 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="common-header">
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta name="description" content="gym-management-system"/>
<meta name="author" content=" "/>
<title>健身房管理系统-用户</title>
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@latest/dist/style.css" rel="stylesheet"/>
<link href="/static/css/styles.css" th:href="@{/css/styles.css}" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js"
crossorigin="anonymous"></script>
</head>
<body>
<!--导航栏-->
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark" th:fragment="common-navbar">
<!-- Navbar Brand-->
<a class="navbar-brand ps-3">健身房管理系统</a>
<!-- Sidebar Toggle-->
<button class="btn btn-link btn-sm order-1 order-lg-0 me-4 me-lg-0" id="sidebarToggle" href="#!"><i
class="fas fa-bars"></i></button>
<!-- Navbar Search-->
<form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0">
<div class="input-group">
<input class="form-control" type="text" placeholder="搜索" aria-label="搜索"
aria-describedby="btnNavbarSearch"/>
<button class="btn btn-primary" id="btnNavbarSearch" type="button"><i class="fas fa-search"></i></button>
</div>
</form>
<!-- Navbar-->
<ul class="navbar-nav ms-auto ms-md-0 me-3 me-lg-4">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown"
aria-expanded="false"><i class="fas fa-user fa-fw"></i></a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" th:href="@{/toUserLogin}"><i class="fas fa-sign-out-alt"></i>&nbsp;退出登录</a></li>
</ul>
</li>
</ul>
</nav>
<!--侧边栏-->
<div id="layoutSidenav_nav" th:fragment="common-sidenav">
<nav class="sb-sidenav accordion sb-sidenav-light" id="sidenavAccordion">
<div class="sb-sidenav-menu">
<div class="nav">
<!--管理区域-->
<div class="sb-sidenav-menu-heading">管理</div>
<a class="nav-link" th:href="@{/user/toUserInfo}">
<div class="sb-nav-link-icon"><i class="fas fa-user"></i></div>
个人信息
</a>
<!-- 记录锻炼 -->
<a class="nav-link collapsed" href="#" data-bs-toggle="collapse" data-bs-target="#exerciseCollapse" aria-expanded="false" aria-controls="exerciseCollapse">
<div class="sb-nav-link-icon"><i class="fas fa-dumbbell"></i></div>
记录锻炼
<div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
</a>
<div class="collapse exercise-collapse" id="exerciseCollapse" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
<nav class="sb-sidenav-menu-nested nav">
<a class="nav-link" th:href="@{/user/toApplyClass}">预期目标</a>
<a class="nav-link" th:href="@{/user/toUserRealRecord}">锻炼记录</a>
</nav>
</div>
<!-- 预约 -->
<a class="nav-link collapsed" href="#" data-bs-toggle="collapse" data-bs-target="#appointmentCollapse" aria-expanded="false" aria-controls="appointmentCollapse">
<div class="sb-nav-link-icon"><i class="fas fa-calendar-check"></i></div>
预约
<div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
</a>
<div class="collapse appointment-collapse" id="appointmentCollapse" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
<nav class="sb-sidenav-menu-nested nav">
<a class="nav-link" th:href="@{/user/toUserBook}">预约信息</a>
<a class="nav-link" th:href="@{/user/toUserBookRecord}">预约记录</a>
</nav>
</div>
</div>
</div>
<div class="sb-sidenav-footer">
<div class="small">你好!</div>
尊敬的用户
</div>
</nav>
</div>
<!--页脚-->
<footer class="py-4 bg-light mt-auto" th:fragment="common-footer">
<div class="container-fluid px-4">
<div class="d-flex align-items-center justify-content-between small">
<div class="text-muted"> </div>
</div>
</div>
</footer>
<div th:fragment="common-scripts">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
crossorigin="anonymous"></script>
<script src="/static/js/scripts.js" th:src="@{/js/scripts.js}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script>
<script src="/static/assets/demo/chart-area-demo.js" th:src="@{/assets/demo/chart-area-demo.js}"></script>
<script src="/static/assets/demo/chart-bar-demo.js" th:src="@{/assets/demo/chart-bar-demo.js}"></script>
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest" crossorigin="anonymous"></script>
<script src="/static/js/datatables-simple-demo.js" th:src="@{/js/datatables-simple-demo.js}"></script>
</div>
</body>
</html>

@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="userCommon::common-header"></head>
<body class="sb-nav-fixed">
<nav th:replace="userCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="userCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">个人信息</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a th:href="@{/toUserMain}">主页</a></li>
<li class="breadcrumb-item active">个人信息</li>
</ol>
<div class="card mb-4">
<table class="table table-hover">
<tr>
<td text-align="center">用户账号:</td>
<td th:text="${member.memberAccount}"></td>
</tr>
<tr>
<td text-align="center">姓名:</td>
<td th:text="${member.memberName}"></td>
</tr>
<tr>
<td text-align="center">性别:</td>
<td th:text="${member.memberGender}"></td>
</tr>
<tr>
<td text-align="center">年龄:</td>
<td th:text="${member.memberAge}"></td>
</tr>
<tr>
<td text-align="center">联系方式:</td>
<td th:text="${member.memberPhone}"></td>
</tr>
<tr>
<td text-align="center">身高:</td>
<td th:text="${member.memberHeight}"></td>
</tr>
<tr>
<td text-align="center">体重:</td>
<td th:text="${member.memberWeight}"></td>
</tr>
</table>
<div style="text-align:center;margin-bottom:15px">
<a th:href="@{/user/toUpdateInfo}">
<input type="button" class="btn btn-outline-primary" value="编辑个人信息">
</a>
</div>
</div>
</div>
</main>
<footer th:replace="userCommon::common-footer"></footer>
</div>
</div>
<div th:include="userCommon::common-scripts"></div>
</body>
</html>

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta name="description" content="gym-management-system"/>
<meta name="author" content=" "/>
<title>健身房管理系统-用户登录</title>
<link href="/static/css/styles.css" th:href="@{css/styles.css}" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js"
crossorigin="anonymous"></script>
<script type="text/javascript">
function checkSubmit(loginForm) {
if (loginForm.memberAccount.value == '' && loginForm.memberPhone.value =='') {
alert("请输入账号或手机号");
loginForm.memberAccount.focus();
return false;
}
if (loginForm.memberPassword.value == '') {
alert("请输入密码");
loginForm.memberPassword.focus();
return false;
}
return true;
}
</script>
</head>
<body class="bg-primary" th:style="'background-image: url(/img/background.jpeg);background-size: 100%, 100%'">
<div id="layoutAuthentication">
<div id="layoutAuthentication_content">
<main>
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-5">
<div class="card shadow-lg border-0 rounded-lg mt-5">
<div class="card-header"><h3 class="text-center font-weight-light my-4">用户登录</h3></div>
<div class="card-body">
<form th:action="@{/userLogin}" method="post" name="loginForm"
onsubmit="return checkSubmit(this)">
<div class="form-floating mb-3">
<input class="form-control" id="inputAccount" name="memberAccount" type="account"
placeholder="Account"
onkeypress="return event.keyCode>=48&&event.keyCode<=57"/>
<label for="inputAccount">账号</label>
</div>
<div class="form-floating mb-3">
<input class="form-control" id="inputPhone" name="memberPhone"
type="phone"
placeholder="Phone"/>
<label for="inputPhone">手机号</label>
</div>
<div class="form-floating mb-3">
<input class="form-control" id="inputPassword" name="memberPassword"
type="password"
placeholder="Password"/>
<label for="inputPassword">密码</label>
</div>
<div class="form-check mb-3">
<input class="form-check-input" id="inputRememberPassword" type="checkbox"
value=""/>
<label class="form-check-label" for="inputRememberPassword">记住密码</label>
</div>
<div class="d-flex align-items-center justify-content-between mt-4 mb-0">
<input type="submit" class="btn btn-success" value="登录">
<a class="btn btn-primary" th:href="@{/toUserRegist}">注册</a>
<a class="btn btn-primary" th:href="@{/}">管理员登录</a>
</div>
</form>
<div th:text="${msg}" style="margin-top: 20px;text-align: center;color: red"></div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
crossorigin="anonymous"></script>
<script src="/static/js/scripts.js" th:src="@{js/scripts.js}"></script>
</body>
</html>

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="userCommon::common-header"></head>
<body class="sb-nav-fixed bg-primary" th:style="'background-image: url(/img/个人主题.webp);background-size: 100%, 100%'">
<nav th:replace="userCommon::common-navbar"></nav>
<div id="layoutSidenav">
<div th:replace="userCommon::common-sidenav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4" th:text="${member.memberName} + '您好!'"></h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item active">主页</li>
</ol>
</div>
</main>
<footer th:replace="userCommon::common-footer"></footer>
</div>
</div>
<div th:include="userCommon::common-scripts"></div>
</body>
</html>

@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta name="description" content="gym-management-system"/>
<meta name="author" content=" "/>
<title>健身房管理系统-注册</title>
<link href="/static/css/styles.css" th:href="@{css/styles.css}" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js"
crossorigin="anonymous"></script>
<script type="text/javascript">
var count = 0;
function checkSubmit(registrationForm) {
// 检查姓名
if (registrationForm.memberName.value == '') {
alert("请输入姓名");
registrationForm.memberName.focus();
count++;
return false;
}
// 检查密码
var password = registrationForm.memberPassword.value;
if (password == '') {
alert("请输入密码");
registrationForm.memberPassword.focus();
count++;
return false;
}
// 检查密码强度必须包含字母和数字且长度必须为8个字符
var passwordPattern = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8}$/;
if (!passwordPattern.test(password)) {
alert("密码必须包含一个字母和一个数字并且长度为8个字符");
registrationForm.memberPassword.focus();
count++;
return false;
}
// 检查确认密码
var confirmPassword = registrationForm.confirmPassword.value;
if (confirmPassword == '') {
alert("请输入确认密码");
registrationForm.confirmPassword.focus();
count++;
return false;
}
if (password !== confirmPassword) {
alert("两次输入的密码不一致");
registrationForm.confirmPassword.focus();
count++;
return false;
}
// 检查性别
if (registrationForm.memberGender.value == '') {
alert("请选择性别");
registrationForm.memberGender.focus();
count++;
return false;
}
// 检查年龄范围
var age = registrationForm.memberAge.value;
if (age == '' || age < 16 || age > 80) {
alert("年龄必须在16到80岁之间");
registrationForm.memberAge.focus();
count++;
return false;
}
// 检查身高是否为负数
var height = registrationForm.memberHeight.value;
if (height == '' || height <= 0) {
alert("请输入有效的身高");
registrationForm.memberHeight.focus();
count++;
return false;
}
// 检查体重是否为负数
var weight = registrationForm.memberWeight.value;
if (weight == '' || weight <= 0) {
alert("请输入有效的体重");
registrationForm.memberWeight.focus();
count++;
return false;
}
// 检查手机号码
var phonePattern = /^1[3-9]\d{9}$/;
var memberPhone = registrationForm.memberPhone.value;
if (memberPhone == '') {
alert("请输入电话号码");
registrationForm.memberPhone.focus();
count++;
return false;
} else if (!phonePattern.test(memberPhone)) {
alert("请输入有效的手机号码");
registrationForm.memberPhone.focus();
count++;
return false;
}
return true;
}
function check(registrationForm) {
var result = checkSubmit(registrationForm);
if (result) {
alert("注册成功,即将进入用户界面!");
return true;
}
return false;
}
</script>
</head>
<body class="bg-primary" th:style="'background-image: url(/img/background.jpeg);background-size: 100%, 100%'">
<div id="layoutAuthentication">
<div id="layoutAuthentication_content">
<main>
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-7">
<div class="card shadow-lg border-0 rounded-lg mt-5">
<div class="card-header"><h3 class="text-center font-weight-light my-4">注册</h3></div>
<div class="card-body">
<form th:action="@{/addUser}" method="post" name="addForm" onsubmit="return check(this)">
<!-- 姓名输入框 -->
<div class="form-floating mb-3">
<input class="form-control" id="inputName" name="memberName" type="text" placeholder="姓名" required />
<label for="inputName">姓名</label>
</div>
<!-- 密码输入框 -->
<div class="form-floating mb-3">
<input class="form-control" id="inputPassword" name="memberPassword" type="password" placeholder="密码" required />
<label for="inputPassword">8位密码(必须包含字母跟数字)</label>
</div>
<!-- 确认密码输入框 -->
<div class="form-floating mb-3">
<input class="form-control" id="inputConfirmPassword" name="confirmPassword" type="password" placeholder="确认密码" required />
<label for="inputConfirmPassword">确认密码</label>
</div>
<!-- 性别选择 -->
<div class="form-floating mb-3">
<select class="form-select" id="inputGender" name="memberGender" required>
<option value="">选择性别</option>
<option value="男"></option>
<option value="女"></option>
</select>
<label for="inputGender">性别</label>
</div>
<!-- 年龄输入框 -->
<div class="form-floating mb-3">
<input class="form-control" id="inputAge" name="memberAge" type="number" placeholder="年龄" required />
<label for="inputAge">年龄18-80</label>
</div>
<!-- 身高输入框 -->
<div class="form-floating mb-3">
<input class="form-control" id="inputHeight" name="memberHeight" type="number" placeholder="身高(cm)" required />
<label for="inputHeight">身高cm</label>
</div>
<!-- 体重输入框 -->
<div class="form-floating mb-3">
<input class="form-control" id="inputWeight" name="memberWeight" type="number" placeholder="体重(kg)" required />
<label for="inputWeight">体重kg</label>
</div>
<!-- 电话号码输入框 -->
<div class="form-floating mb-3">
<input class="form-control" id="inputPhone" name="memberPhone" type="tel" placeholder="电话号码" required />
<label for="inputPhone">电话号码</label>
</div>
<!-- 提交按钮 -->
<div class="d-flex align-items-center justify-content-between mt-4 mb-0">
<input type="submit" class="btn btn-success" value="注册">
<a class="btn btn-primary" th:href="@{/}">返回</a>
</div>
</form>
<div th:text="${msg}" style="margin-top: 20px;text-align: center;color: red"></div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
crossorigin="anonymous"></script>
<script src="/static/js/scripts.js" th:src="@{js/scripts.js}"></script>
</body>
</html>

@ -0,0 +1,40 @@
package com.milotnt;
import com.milotnt.mapper.MemberMapper;
import com.milotnt.pojo.Member;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.List;
@SpringBootTest
class GymManagementSystemApplicationTests {
@Autowired
JdbcTemplate jdbcTemplate;
@Autowired
MemberMapper memberMapper;
@Test
void contextLoads() {
Long aLong = jdbcTemplate.queryForObject("select count(*) from admin", Long.class);
System.out.println("记录总数" + aLong);
}
@Test
public void run() throws Exception {
List<Member> list = memberMapper.findAll();
for (Member member : list) {
System.out.println(member);
}
Integer total = memberMapper.selectTotalCount();
System.out.println(total);
}
}
Loading…
Cancel
Save