鼠扑 发表于 2024-10-11 16:48:40

springboot基于Java Web的体脂健康管理系统

文末获取资源,收藏关注不迷路


项目先容

体脂健康管理系统采用了结构化开发的方法。这种开发方法的优点是控制性比力强,开发过程中采用了结构化和模块化的设计思想,自顶向下,从总体到部门,合理分别系统的结构和模块。结构化开发时使用模块式开发,各模块之间互不影响,方便系统的开发与管理。 网站总体功能如下图所示:
步伐上交给用户进行使用时,必要提供步伐的操作流程图,如许便于用户容易理解步伐的详细工作步骤,现现在步伐的操作流程都有一个大致的尺度,即先通过登录页面提交登录数据,通过步伐验证正确之后,用户才能在步伐功能操作区页面操尴尬刁难应的功能。
步伐操作流程图
技能先容

1、管理员账号:abo 密码:abo
2、开发情况为Eclipse/idea,数据库为mysql 使用java语言开发。
3.设置好Tomcat并点击启动按钮即可运行
4.数据库连接src\main\resources\application.yml中修改
5.maven包版本apache-maven-3.3.9.
开发语言:Java
框架:SSM
前端框架:vue.js
JDK版本:JDK1.8+
服务器:tomcat8+
数据库工具:Navicat
开发软件:idea 支持eclipse
支持定做:Java/PHP/Python/Android/小步伐/Vue/爬虫/C#/Asp.net
Springboot是当前最流向的一个框架,它的设置更加的简单,使开发变得更加的简单迅速。
Springboot的底子结构共三个文件,详细如下:
src/main/java:步伐开发以及主步伐入口;
src/main/resources:设置文件;
src/test/java:测试步伐。
ssm的数据库设置默认支持两种格式的设置文件
1,application.properties
2,application.yaml
项目界面

https://i-blog.csdnimg.cn/direct/595808169b9c4733827631a0099d5c6f.png#pic_center
https://i-blog.csdnimg.cn/direct/081dc1ff58d749f6a0157f659517922b.png#pic_center
https://i-blog.csdnimg.cn/direct/0287f574bcbe4123a2e37d088a56148f.png#pic_center
https://i-blog.csdnimg.cn/direct/ba5b6d710ce949abb72afa00ffcfdb90.png#pic_center
https://i-blog.csdnimg.cn/direct/4e38b69f3235428dad1477c879f58ba2.png#pic_center
https://i-blog.csdnimg.cn/direct/65099e2ee54e4f76b2709bf78ccd07c3.png#pic_center
https://i-blog.csdnimg.cn/direct/5fcb4e6e0d6845dc9ad2f3a4f6dc6be4.png#pic_center
https://i-blog.csdnimg.cn/direct/5864ff80d02f43709a3d90a9b4a5c87c.png#pic_center
https://i-blog.csdnimg.cn/direct/f7f242be1f5d4c9588fc5c0f38589f44.png#pic_center
https://i-blog.csdnimg.cn/direct/b9cd8b6781b14c8db610f06109a24390.png#pic_center
https://i-blog.csdnimg.cn/direct/811d57c9c4d14d3d9127b8a28d1a5227.png#pic_center
https://i-blog.csdnimg.cn/direct/10e8f11b49f5418ebb0e6d7d6d9667bd.png#pic_center
关键代码


package com.controller;


import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;

/**
* 登录相关
*/
@RequestMapping("users")
@RestController
public class UserController{
       
        @Autowired
        private UserService userService;
       
        @Autowired
        private TokenService tokenService;

        /**
       * 登录
       */
        @IgnoreAuth
        @PostMapping(value = "/login")
        public R login(String username, String password, String captcha, HttpServletRequest request) {
                UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
                if(user==null || !user.getPassword().equals(password)) {
                        return R.error("账号或密码不正确");
                }
                String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
                return R.ok().put("token", token);
        }
       
        /**
       * 注册
       */
        @IgnoreAuth
        @PostMapping(value = "/register")
        public R register(@RequestBody UserEntity user){
//            ValidatorUtils.validateEntity(user);
            if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
                    return R.error("用户已存在");
            }
      userService.insert(user);
      return R.ok();
    }

        /**
       * 退出
       */
        @GetMapping(value = "logout")
        public R logout(HttpServletRequest request) {
                request.getSession().invalidate();
                return R.ok("退出成功");
        }
       
        /**
   * 密码重置
   */
    @IgnoreAuth
        @RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
            UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
            if(user==null) {
                    return R.error("账号不存在");
            }
            user.setPassword("123456");
      userService.update(user,null);
      return R.ok("密码已重置为:123456");
    }
       
        /**
   * 列表
   */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,UserEntity user){
      EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
            PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
      return R.ok().put("data", page);
    }

        /**
   * 列表
   */
    @RequestMapping("/list")
    public R list( UserEntity user){
               EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
              ew.allEq(MPUtil.allEQMapPre( user, "user"));
      return R.ok().put("data", userService.selectListView(ew));
    }

    /**
   * 信息
   */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
      UserEntity user = userService.selectById(id);
      return R.ok().put("data", user);
    }
   
    /**
   * 获取用户的session用户信息
   */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
            Long id = (Long)request.getSession().getAttribute("userId");
      UserEntity user = userService.selectById(id);
      return R.ok().put("data", user);
    }

    /**
   * 保存
   */
    @PostMapping("/save")
    public R save(@RequestBody UserEntity user){
//            ValidatorUtils.validateEntity(user);
            if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
                    return R.error("用户已存在");
            }
      userService.insert(user);
      return R.ok();
    }

    /**
   * 修改
   */
    @RequestMapping("/update")
    public R update(@RequestBody UserEntity user){
//      ValidatorUtils.validateEntity(user);
            UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));
            if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
                    return R.error("用户名已存在。");
            }
      userService.updateById(user);//全部更新
      return R.ok();
    }

    /**
   * 删除
   */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
      userService.deleteBatchIds(Arrays.asList(ids));
      return R.ok();
    }
}

目录

目 录
目 录 III
1 绪论 1
1.1 研究背景 1
1.2 目标和意义 1
1.3 论文结构安排 2
2 相关技能 3
2.1 Springboot框架先容 3
2.2 B/S结构先容 3
2.3 Mysql数据库先容 4
3 系统分析 6
3.1 系统可行性分析 6
3.1.1 技能可行性分析 6
3.1.2 经济可行性分析 6
3.1.3 运行可行性分析 6
3.2 系统性能分析 7
3.2.1 易用性指标 7
3.2.2 可扩展性指标 7
3.2.3 健壮性指标 7
3.2.4 安全性指标 8
3.3 系统流程分析 8
3.3.1 操作流程分析 8
3.3.2 登录流程分析 9
3.3.3 信息添加流程分析 10
3.3.4 信息删除流程分析 11
4 系统设计 12
4.1 系统概要设计 12
4.2 系统功能结构设计 12
4.3 数据库设计 13
4.3.1 数据库E-R图设计 13
4.3.2 数据库表结构设计 14
5 系统实现 17
5.1用户部门功能17
5.2 管理员部门功能展示
6 系统测试
6.1 系统测试的特点 
6.2 系统功能测试
6.2.1 登录功能测试
6.2.2 添加类别功能测试
6.3 测试结果分析
结 论
致 谢
参考文献

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: springboot基于Java Web的体脂健康管理系统