一、前言

随着现代生活节奏的加速,人们对于健康和生活质量的关注越来越高。运动、饮食和记录成为了保持健康、管理体重、提高生活质量的重要手段。然而,这些过程往往繁琐且不易追踪,缺乏工具进行科学的管理和指导。因此,开发一款集运动项目管理、食品分析管理、食品信息管理、饭店时间管理、每日运动管理、运动推荐管理、记录本管理、肥胖分析管理等为一体的记录生活微信小程序/安卓APP,具有十分重要的意义。

当前市场上的健康管理应用大多只关注单一领域,如只提供运动跟踪或饮食分析,缺乏对多方面健康数据的综合管理和个性化建议。同时,这些应用的用户体验往往落后,不能满足用户在便捷性、实时性和个性化方面的需求。因此,开发一款全面、便捷、个性化的健康管理应用势在必行。

本课题旨在开发一款全面的健康管理工具,通过集成的运动项目管理、食品分析管理、食品信息管理、饭店时间管理、每日运动管理、运动推荐管理、记录本管理、肥胖分析管理等模块,为用户提供一站式的健康管理服务。

本课题的研究意义在于解决当前健康管理市场上的痛点,提供一款全面、便捷、个性化的健康管理工具。通过本课题的研究,可以帮助用户更好地了解自己的健康状况,提供个性化的健康建议,帮助用户改善生活质量、保持健康。同时,本课题的研究还可以为相关领域的研究提供新的思路和方法,推动健康管理领域的发展。

二、开发环境

  • 开发语言:Java
  • 数据库:MySQL
  • 系统架构:B/S
  • 后端:SpringBoot
  • 前端:微信小程序/Android+uniapp+Vue

三、系统界面展示

  • 记录生活微信小程序/安卓APP界面展示:
    计算机毕业设计选题推荐-记录生活微信小程序/安卓APP-项目实战-LMLPHP
    计算机毕业设计选题推荐-记录生活微信小程序/安卓APP-项目实战-LMLPHP
    计算机毕业设计选题推荐-记录生活微信小程序/安卓APP-项目实战-LMLPHP
    计算机毕业设计选题推荐-记录生活微信小程序/安卓APP-项目实战-LMLPHP
    计算机毕业设计选题推荐-记录生活微信小程序/安卓APP-项目实战-LMLPHP
    计算机毕业设计选题推荐-记录生活微信小程序/安卓APP-项目实战-LMLPHP

四、代码参考

  • 项目实战代码参考:
@Api(tags = "系统控制器")
@RestController
@RequestMapping("sms/system")
public class SystemController {

    @Autowired
    private AdminService adminService;
    @Autowired
    private StudentService studentService;
    @Autowired
    private TeacherService teacherService;

    /*
        * 修改密码的处理器
        * POST  /sms/system/updatePwd/123456/admin
        *       /sms/system/updatePwd/{oldPwd}/{newPwd}
        *       请求参数
                    oldpwd
                    newPwd
                    token 请求头
                响应的数据
                    Result OK data= null
     **/


    @ApiOperation("更新用户密码的处理器")
    @PostMapping("/updatePwd/{oldPwd}/{newPwd}")
    public Result updatePwd(@RequestHeader("token") String token,
                            @PathVariable("oldPwd") String oldPwd,
                            @PathVariable("newPwd") String newPwd) {

        boolean expiration = JwtHelper.isExpiration(token);
        if (expiration) {
            //token过期
            return Result.fail().message("token过期,请重新登录");
        }
        //获取用户ID和用户类型
        Long userId = JwtHelper.getUserId(token);
        Integer userType = JwtHelper.getUserType(token);

        oldPwd = MD5.encrypt(oldPwd);
        newPwd = MD5.encrypt(newPwd);

        switch (userType) {

            case 1:
                Admin admin = adminService.getAdminById(userId);
                if (admin != null) {
                    admin.setPassword(newPwd);
                    adminService.saveOrUpdate(admin);
                } else {
                    return Result.fail().message("原密码有误!");
                }
                break;
            case 2:
                Student student = studentService.getStudentById(userId);
                if (student != null) {
                    student.setPassword(newPwd);
                    studentService.saveOrUpdate(student);
                } else {
                    return Result.fail().message("原密码有误!");
                }
                break;
            case 3:
                Teacher teacher = teacherService.getTeacherById(userId);
                if (teacher != null) {
                    teacher.setPassword(newPwd);
                    teacherService.saveOrUpdate(teacher);
                } else {
                    return Result.fail().message("原密码有误!");
                }
                break;
            default:
                ;

        }


        return Result.ok();
    }


    // POST /sms/system/headerImgUpload
    @ApiOperation("文件上传同意入口")
    @PostMapping("/headerImgUpload")
    public Result headerImgUpload(@RequestPart("multipartFile") MultipartFile multipartFile) {

        String uuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
        String originalFilename = multipartFile.getOriginalFilename();
        int index = originalFilename.lastIndexOf(".");
        //substring:截取字符串
        String newFileName = uuid.concat(originalFilename.substring(index));

        //保存文件

        String portraitPath = "D:/Java教程/Springboot_workplace002/zhxy/target/classes/public/upload".concat(newFileName);
        try {
            multipartFile.transferTo(new File(portraitPath));
        } catch (IOException e) {
            e.printStackTrace();
        }

        //响应图片的路径
        String path = "upload/".concat(newFileName);
        return Result.ok(path);
    }


    @GetMapping("/getInfo")
    public Result getInfoByToken(@RequestHeader("token") String token) {

        boolean isExpiration = JwtHelper.isExpiration(token);
        if (isExpiration) {
            return Result.build(null, ResultCodeEnum.TOKEN_ERROR);
        }

        Map<String, Object> map = new LinkedHashMap<>();

        //从token中获取用户ID和用户类型
        Long userId = JwtHelper.getUserId(token);
        Integer userType = JwtHelper.getUserType(token);

        switch (userType) {
            case 1:
                Admin admin = adminService.getAdminById(userId);
                map.put("userType", 1);
                map.put("user", admin);
                break;
            case 2:
                Student student = studentService.getStudentById(userId);
                map.put("userType", 2);
                map.put("user", student);
                break;
            case 3:
                Teacher teacher = teacherService.getTeacherById(userId);
                map.put("userType", 3);
                map.put("user", teacher);
                break;
        }

        return Result.ok(map);
    }

    @ApiOperation("获取验证码图片")
    @GetMapping("/getVerifiCodeImage")
    public void getVerifiCodeImage(HttpServletRequest request, HttpServletResponse response) {

        //获取图片
        BufferedImage verifiCodeImage = CreateVerifiCodeImage.getVerifiCodeImage();
        //获取图片上的验证码
        String verifiCode = new String(CreateVerifiCodeImage.getVerifiCode());
        //将验证码文本存入session域中,供下次使用
        HttpSession session = request.getSession();
        session.setAttribute("verifiCode", verifiCode);
        //将验证码图片响应给浏览器

        ServletOutputStream outputStream = null;
        try {
            outputStream = response.getOutputStream();
            ImageIO.write(verifiCodeImage, "JPEG", outputStream);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }


    @ApiOperation("登录控制器")
    @PostMapping("/login")
    public Result login(HttpServletRequest request, @RequestBody LoginForm loginForm) {

        //验证码校验
        String sessionVerifiCode = (String) request.getSession().getAttribute("verifiCode");
        String loginVerifiCode = loginForm.getVerifiCode();

        if ("".equals(sessionVerifiCode) || null == sessionVerifiCode) {
            return Result.fail().message("验证码失效,请刷新后重试");
        }
        if (!sessionVerifiCode.equalsIgnoreCase(loginVerifiCode)) {
            return Result.fail().message("验证码有误,请重新输入");
        }
        //从session域中移除现有验证码
        request.getSession().removeAttribute("verifiCode");

        Map map = new LinkedHashMap();

        //分用户类型进行校验
        Integer userType = loginForm.getUserType();
        switch (userType) {
            case 1:
                try {
                    Admin admin = adminService.login(loginForm);
                    if (null != admin) {
                        String token = JwtHelper.createToken(admin.getId().longValue(), 1);
                        map.put("token", token);
                    } else {
                        throw new RuntimeException("用户名或密码错误");
                    }
                    return Result.ok(map);
                } catch (RuntimeException e) {
                    e.printStackTrace();
                    return Result.fail().message(e.getMessage());
                }

            case 2:
                try {
                    Student student = studentService.login(loginForm);
                    if (null != student) {
                        String token = JwtHelper.createToken(student.getId().longValue(), 2);
                        map.put("token", token);
                    } else {
                        throw new RuntimeException("用户名或密码错误");
                    }
                    return Result.ok(map);
                } catch (RuntimeException e) {
                    e.printStackTrace();
                    return Result.fail().message(e.getMessage());
                }

            case 3:
                try {
                    Teacher teacher = teacherService.login(loginForm);
                    if (null != teacher) {
                        String token = JwtHelper.createToken(teacher.getId().longValue(), 3);
                        map.put("token", token);
                    } else {
                        throw new RuntimeException("用户名或密码错误");
                    }
                    return Result.ok(map);
                } catch (RuntimeException e) {
                    e.printStackTrace();
                    return Result.fail().message(e.getMessage());
                }


        }

        return Result.fail().message("查无此用户");
    }


}

五、论文参考

  • 计算机毕业设计选题推荐-记录生活微信小程序/安卓APP论文参考:
    计算机毕业设计选题推荐-记录生活微信小程序/安卓APP-项目实战-LMLPHP

六、系统视频

记录生活微信小程序/安卓APP项目视频:

计算机毕业设计选题推荐-记录生活微信小程序/安卓APP

结语

计算机毕业设计选题推荐-记录生活微信小程序/安卓APP-项目实战
大家可以帮忙点赞、收藏、关注、评论啦~
源码获取:私信我

11-15 05:09