🔥作者:雨晨源码🔥
💖简介:java、微信小程序、安卓;定制开发,远程调试,代码讲解,文档指导,ppt制作💖
精彩专栏推荐订阅:在下方专栏👇🏻👇🏻👇🏻👇🏻
Java精彩实战毕设项目案例
小程序精彩项目案例
Python实战项目案例

​💕💕文末获取源码


本次文章主要是介绍SpringBoot心理咨询系统的功能,系统分为三个角色,分别是大学生、心理老师和管理员

心理咨询系统-系统前言简介

在科技高速发展中,生活中科技力量得以持续显现,当下互联网的发展在任何一个角度来看都是发展十分的迅猛的,数字技术、智能技术为人们生活带来更多的便捷和想象空间。好的技术运用生活中能推动社会前进和发展,所以一个信息化、数字化、智能化的心理咨询系统使得高校心理健康问题处理更加便捷。随着高校学生增加,心理健康问题量大、也更加复杂多变,传统的心理咨询[5]室局限于地点、时间,甚至天气影响,而且面对面的交流,有的学生羞于健康问题,不敢去咨询,这样也会耽误学生的健康发展。
计算机应用对于心理健康管理系统,有人工模式无法比拟的优点,快速定位、强大存储安全保密、维护成本低、使用期限长等,健康管理师能在第一时间捕获学生健康问题,去解析问题,及时梳导学生帮助排除困难困惑,不受时间、区域、地点等影响。学生也能选择隐瞒自己身份,放开心扉去交流,随时在系统上读取最新心理健康相关信息,更好

心理咨询系统-开发环境

  • 开发语言:Java - 技术:SpringBoot+Vue
  • 数据库:MySQL - 架构:B/S - 源码类型: Web
  • 编译工具:Idea、Eclipse、MyEclipse (选其一)
  • 其他:jdk1.8、Tomcat8.5、Navicat

心理咨询系统-功能介绍

3个角色:大学生/心理老师/管理员

大学生:登录,问卷调查,心理老师,减压大本营,新闻资讯,专题辅导,等。
教师:减压大本营管理、资讯管理、问卷调查管理、专题辅导管理、心理资讯咨询等。
管理员:学生管理、心理老师管理、减压大本营管理,新闻资讯管理,问卷调查管理,专题辅导管理等。
​​​​​​在这里插入图片描述

心理咨询系统-演示图片

1.学生端页面:
☀️登录☀️在这里插入图片描述

☀️问卷调查☀️在这里插入图片描述

☀️新闻资讯☀️在这里插入图片描述

☀️专题辅导.☀️在这里插入图片描述

☀️减压大本营☀️在这里插入图片描述

☀️后台界面☀️在这里插入图片描述

2.管理员端、心理老师页面:
☀️减压大本营管理☀️在这里插入图片描述

☀️问卷调查管理☀️在这里插入图片描述

☀️心理老师管理☀️在这里插入图片描述

☀️学生管理☀️在这里插入图片描述

☀️专题辅导管理☀️在这里插入图片描述

☀️心理资讯管理☀️在这里插入图片描述

心理咨询系统-代码展示

1.通用接口【代码如下(示例):】

/**
 * 通用接口
 */
@RestController
public class CommonController{
	@Autowired
	private CommonService commonService;
	
	@Autowired
	private ConfigService configService;
	
	private static AipFace client = null;
	
	private static String BAIDU_DITU_AK = null;
	
	@RequestMapping("/location")
	public R location(String lng,String lat) {
		if(BAIDU_DITU_AK==null) {
			BAIDU_DITU_AK = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")).getValue();
			if(BAIDU_DITU_AK==null) {
				return R.error("请在配置管理中正确配置baidu_ditu_ak");
			}
		}
		Map<String, String> map = BaiduUtil.getCityByLonLat(BAIDU_DITU_AK, lng, lat);
		return R.ok().put("data", map);
	}
	
	/**
	 * 人脸比对
	 * 
	 * @param face1 人脸1
	 * @param face2 人脸2
	 * @return
	 */
	@RequestMapping("/matchFace")
	public R matchFace(String face1, String face2) {
		if(client==null) {
			/*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/
			String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();
			String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();
			String token = BaiduUtil.getAuth(APIKey, SecretKey);
			if(token==null) {
				return R.error("请在配置管理中正确配置APIKey和SecretKey");
			}
			client = new AipFace(null, APIKey, SecretKey);
			client.setConnectionTimeoutInMillis(2000);
			client.setSocketTimeoutInMillis(60000);
		}
		JSONObject res = null;
		try {
			File file1 = new File(ResourceUtils.getFile("classpath:static/upload").getAbsolutePath()+"/"+face1);
			File file2 = new File(ResourceUtils.getFile("classpath:static/upload").getAbsolutePath()+"/"+face2);
			String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
			String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
			MatchRequest req1 = new MatchRequest(img1, "BASE64");
			MatchRequest req2 = new MatchRequest(img2, "BASE64");
			ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
			requests.add(req1);
			requests.add(req2);
			res = client.match(requests);
			System.out.println(res.get("result"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return R.error("文件不存在");
		} catch (IOException e) {
			e.printStackTrace();
		} 
		return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
	}
    
	/**
	 * 获取table表中的column列表(联动接口)
	 * @param table
	 * @param column
	 * @return
	 */
	@IgnoreAuth
	@RequestMapping("/option/{tableName}/{columnName}")
	public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		if(StringUtils.isNotBlank(level)) {
			params.put("level", level);
		}
		if(StringUtils.isNotBlank(parent)) {
			params.put("parent", parent);
		}
		List<String> data = commonService.getOption(params);
		return R.ok().put("data", data);
	}
	
	/**

2.文件上传【代码如下(示例):】

/**
    * 上传文件
    */
   @RequestMapping("/upload")
   public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
   	if (file.isEmpty()) {
   		throw new EIException("上传文件不能为空");
   	}
   	String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
   	File f = ResourceUtils.getFile("classpath:static/upload");
   	String fileName = new Date().getTime()+"."+fileExt;
   	File dest = new File(f.getAbsolutePath()+"/"+fileName);
   	file.transferTo(dest);
   	if(StringUtils.isNotBlank(type) && type.equals("1")) {
   		ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
   		if(configEntity==null) {
   			configEntity = new ConfigEntity();
   			configEntity.setName("faceFile");
   			configEntity.setValue(fileName);
   		} else {
   			configEntity.setValue(fileName);
   		}
   		configService.insertOrUpdate(configEntity);
   	}
   	return R.ok().put("file", fileName);
   }
   
   /**
    * 下载文件
    */
   @IgnoreAuth
   @RequestMapping("/download")
   public ResponseEntity<byte[]> download(@RequestParam String fileName) {
   	try {
   		File file = new File(ResourceUtils.getFile("classpath:static/upload").getAbsolutePath()+"/"+fileName);
   		if(file.exists()){
   			/*if(!fileService.canRead(file, SessionManager.getSessionUser())){
   				getResponse().sendError(403);
   			}*/
   			HttpHeaders headers = new HttpHeaders();
   		    headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    
   		    headers.setContentDispositionFormData("attachment", fileName);    
   		    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
   		}
   	} catch (IOException e) {
   		e.printStackTrace();
   	}
   	return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
   }

3.文件上传【代码如下(示例):】

/**
* 学生
* 后端接口
* @author 
* @email 
* @date 2022-04-03 15:40:15
*/
@RestController
@RequestMapping("/xuesheng")
public class XueshengController {
   @Autowired
   private XueshengService xueshengService;
   
   @Autowired
   private TokenService tokenService;
   
   /**
    * 登录
    */
   @IgnoreAuth
   @RequestMapping(value = "/login")
   public R login(String username, String password, String captcha, HttpServletRequest request) {
   	XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xuehao", username));
   	if(user==null || !user.getMima().equals(password)) {
   		return R.error("账号或密码不正确");
   	}
   	String token = tokenService.generateToken(user.getId(),username, "xuesheng", "学生");
   	return R.ok().put("token", token);
   }
   
   /**
    * 注册
    */
   @IgnoreAuth
   @RequestMapping("/register")
   public R register(@RequestBody XueshengEntity xuesheng){
   	//ValidatorUtils.validateEntity(xuesheng);
   	XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xuehao", xuesheng.getXuehao()));
   	if(user!=null) {
   		return R.error("注册用户已存在");
   	}
       xueshengService.insert(xuesheng);
       return R.ok();
   }
   
   /**
    * 退出
    */
   @RequestMapping("/logout")
   public R logout(HttpServletRequest request) {
   	request.getSession().invalidate();
   	return R.ok("退出成功");
   }
   
   /**
    * 获取用户的session用户信息
    */
   @RequestMapping("/session")
   public R getCurrUser(HttpServletRequest request){
   	Long id = (Long)request.getSession().getAttribute("userId");
       XueshengEntity user = xueshengService.selectById(id);
       return R.ok().put("data", user);
   }

心理咨询系统-结语(文末获取源码)

💕💕
Java精彩实战毕设项目案例
小程序精彩项目案例
Python实战项目集
💟💟如果大家有任何疑虑,欢迎在下方位置详细交流。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐