当前位置:   article > 正文

(免费分享)基于springboot健康运动-带论文_基于springboot的运动仿真

基于springboot的运动仿真

源码获取:关注文末gongzhonghao,输入013领取下载链接

​开发工具:IDEA, mysql5.7

技术:springboot+mybatis-plus

健康管理包括:健康体检、健康评估、健康促进和健康服务四大部分。具体来说健康管理就是由健康管理顾问根据个人的性别、年龄、身体状况、居住环境、医疗服务的使用情况以及职业特性等综合因素,制定一些饮食保健以及营养学的建议,实施特定的干预措施和心理暗示,人体的健康状况进行合理的调整与休息,有效地改善亚健康出现的疲劳、头痛、失眠等不适症状。同时,健康管理机构根据个人在疾病的潜在危险因素,从而有效地对潜在的疾病实行预防、治疗及控制。

  1. package com.sports.controller;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.sports.common.Const;
  4. import com.sports.common.ServerResponse;
  5. import com.sports.entity.User;
  6. import com.sports.exception.UserException;
  7. import com.sports.service.AdminUserService;
  8. import com.sports.service.UserService;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.transaction.annotation.Transactional;
  11. import org.springframework.web.bind.annotation.CrossOrigin;
  12. import org.springframework.web.bind.annotation.RequestMapping;
  13. import org.springframework.web.bind.annotation.RequestMethod;
  14. import org.springframework.web.bind.annotation.RestController;
  15. import javax.servlet.http.HttpSession;
  16. import java.util.HashMap;
  17. import java.util.Map;
  18. @RestController
  19. @RequestMapping("/admin/")
  20. @CrossOrigin(origins="*",maxAge=3600)
  21. public class AdminController {
  22. @Autowired
  23. AdminUserService adminUserService;
  24. @Autowired
  25. private UserService userService;
  26. /**
  27. * 管理员登录
  28. */
  29. @RequestMapping(value = "login.do", method = RequestMethod.POST)
  30. @Transactional(rollbackFor = UserException.class)
  31. public ServerResponse login(String username, String password, HttpSession session) {
  32. ServerResponse response = adminUserService.login(username, password);
  33. if (response.isSuccess()) {
  34. session.setAttribute(Const.CURRENT_USER, response.getData());
  35. //以秒为单位,即在没有活动30分钟后,session将失效
  36. session.setMaxInactiveInterval(Const.SessionExtime.SESSION_EX_TIME);
  37. }
  38. return response;
  39. }
  40. /**
  41. * 登出
  42. *
  43. */
  44. @RequestMapping(value = "logout.do",method = RequestMethod.GET)
  45. @Transactional(rollbackFor = UserException.class)
  46. public ServerResponse logout(HttpSession session){
  47. session.removeAttribute(Const.CURRENT_USER);
  48. return ServerResponse.createBySuccess();
  49. }
  50. /**
  51. * 用户管理——删除用户
  52. */
  53. @RequestMapping(value = "deleteUser.do", method = RequestMethod.DELETE)
  54. @Transactional(rollbackFor = UserException.class)
  55. public Map<String,Object> deleteUser(String userId) {
  56. Map<String, Object> map=new HashMap<String, Object>();
  57. adminUserService.userDelete(userId);
  58. map.put("message", "删除成功");
  59. return map;
  60. }
  61. }

package com.sports.controller;


import com.alibaba.fastjson.JSONArray;
import com.sports.common.ServerResponse;
import com.sports.entity.Course;
import com.sports.service.impl.CourseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/course/")
@CrossOrigin(origins="*",maxAge=3600)
public class CourseController {

    @Autowired
    private CourseServiceImpl courseService;

    /**
     * 获取年龄段 进行回显
     * @return
     */
    @RequestMapping(value = "ageGroupList.do",method = RequestMethod.GET)
    @ResponseBody
    public JSONArray ageGroupList(){
        JSONArray jsonArray = courseService.ageGroupList();
        return jsonArray;
    }

    /**
     * 课程的添加
     * @param file
     * @param course
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "addCourse.do", method = RequestMethod.POST)
    public ServerResponse addCourse(@RequestParam(value = "file") MultipartFile file, Course course)throws Exception{
        return  courseService.addCourse(file, course);
    }

    /**
     * 课程的查询 根据name
     * @param course
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "selectCourseByName.do", method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse selectCourseByName(Course course)throws Exception{
        return courseService.selectByName(course);

    }

    @RequestMapping(value = "selectCourseByType.do",method =RequestMethod.POST )
    @ResponseBody
    public ServerResponse selectCourseByType(Course course) throws Exception{
        return courseService.selectByType(course);
    }
    /**
     *  根据id 获取视频url
     * @param course
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "getVideoUrl.do", method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse getVideoUrl(Course course)throws Exception{
        return courseService.getVideoUrl(course);
    }

    /**
     * 课程的删除
     * @param course
     * @return
     */
    @RequestMapping(value = "deleteCourseById.do",method = RequestMethod.POST)
    @ResponseBody
    public String deleteCourse (Course course){
        return courseService.deleteCourse(course);
    }
}
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/856428
推荐阅读
相关标签
  

闽ICP备14008679号