Compare commits

...

1 Commits

Author SHA1 Message Date
段志宇 dc24142591 1
2 days ago

@ -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,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.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,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,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,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,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="gym-management-system" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="gym-management-system" options="-parameters" />
</option>
</component>
</project>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="gym_management_system@localhost" uuid="89302d23-1b6e-46fb-966c-a9575f8a35a2">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<imported>true</imported>
<remarks>$PROJECT_DIR$/src/main/resources/application.yml</remarks>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://localhost:3306/gym_management_system</jdbc-url>
<jdbc-additional-properties>
<property name="com.intellij.clouds.kubernetes.db.host.port" />
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
<property name="com.intellij.clouds.kubernetes.db.container.port" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

@ -0,0 +1,10 @@
<component name="ProjectDictionaryState">
<dictionary name="李洪岚">
<words>
<w>rdate</w>
<w>rtime</w>
<w>ruser</w>
<w>tdate</w>
</words>
</dictionary>
</component>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SqlDialectMappings">
<file url="file://$PROJECT_DIR$/gym_management_system.sql" dialect="MySQL" />
</component>
</project>

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

@ -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,34 @@
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\controller\MemberController.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\pojo\Member.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\controller\UserController.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\mapper\ClassTableMapper.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\impl\ClassTableServiceImpl.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\GymManagementSystemApplication.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\ClassTableService.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\pojo\TargetRecord.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\mapper\RealRecordMapper.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\RealRecordService.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\mapper\RecordTableMapper.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\impl\RecordTableServiceImpl.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\pojo\RealRecord.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\MemberService.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\mapper\MemberMapper.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\EquipmentService.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\pojo\Admin.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\mapper\AdminMapper.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\AdminService.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\pojo\RecordTable.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\TargetRecordService.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\mapper\TargetRecordMapper.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\controller\ClassController.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\impl\EquipmentServiceImpl.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\controller\EquipmentController.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\pojo\ClassTable.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\impl\RealRecordServiceImpl.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\RecordTableService.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\mapper\EquipmentMapper.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\impl\AdminServiceImpl.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\pojo\Equipment.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\impl\MemberServiceImpl.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\service\impl\TargetRecordServiceImpl.java
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\main\java\com\milotnt\controller\LoginController.java

@ -0,0 +1 @@
C:\Users\李洪岚\Desktop\gym-management-system-master_test\src\test\java\com\milotnt\GymManagementSystemApplicationTests.java

@ -0,0 +1,4 @@
-------------------------------------------------------------------------------
Test set: com.milotnt.GymManagementSystemApplicationTests
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.841 s - in com.milotnt.GymManagementSystemApplicationTests
Loading…
Cancel
Save