springboot心灵治愈交流平台源码和论文

本论文主要论述了如何使用JAVA语言开发一个心灵治愈交流平台 ,本系统将严格按照软件开发流程进行各个阶段的工作,采用B/S架构,面向对象编程思想进行项目开发。在引言中,作者将论述心灵治愈交流平台的当前背景以及系统开发的目的,后续章节将严格按照软件开发流程,对系统进行各个阶段分析设计。

心灵治愈交流平台的主要使用者分为管理员和用户、心理咨询师,实现功能包括管理员:首页、个人中心系统公告管理、用户管理心理咨询师管理、心灵专栏管理、压力测试管理、测试数据管理、咨询师预约管理、小纸条管理、系统管理用户首页、个人中心、测试数据管理、咨询师预约管理、小纸条管理,心理咨询师;首页、个人中心、咨询师预约管理、系统管理,前台首页;首页、系统公告、心理咨询师、心灵专栏、压力测试、小纸条、个人中心、后台管理、聊天等功能。由于本网站的功能模块设计比较全面,所以使得整个心灵治愈交流平台信息管理的过程得以实现。

本系统的使用可以实现本心灵治愈交流平台管理的信息化,可以方便管理员进行更加方便快捷的管理,可以提高管理人员工作效率。

关键词:心灵治愈交流平台 JAVA语言;MYSQL数据库;Spring Boot框架 

springboot心灵治愈交流平台源码和论文395

演示视频:

springboot心灵治愈交流平台源码和论文

Abstract

 This paper mainly discusses how to use java language to develop a communication platform. The system will strictly follow the software development process for each stage of the work, using B / S architecture, object-oriented programming ideas for project development. In the introduction, the author will discuss the current background of the platform and the purpose of the system development. The following chapters will analyze and design the system in each stage in strict accordance with the software development process.

The main users of the platform are administrators, users and counselors. The functions include administrators: home page, personal center, system announcement management, user management, counselor management, mind column management, stress test management, test data management, counselor appointment management, note management and system management. Users: home page, personal center Heart, test data management, counselor appointment management, note management, counselor; home page, personal center, counselor appointment management, system management, front page; home page, system announcement, counselor, mind column, stress test, note, personal center, background management, chat and other functions. Due to the comprehensive design of the functional modules of this website, the whole process of information management of the heart healing communication platform can be realized.

The use of the system can realize the information management of the communication platform, which can facilitate the administrator to manage more conveniently and quickly, and improve the work efficiency of the management personnel.

Key words: Healing communication platform, Java language, MySQL database, spring boot framework


package com.controller;import java.util.List;
import java.util.Arrays;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import com.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.UsersEntity;
import com.service.TokenService;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;/*** 登录相关*/
@RequestMapping("users")
@RestController
public class UsersController {@Autowiredprivate UsersService usersService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());R r = R.ok();r.put("token", token);r.put("role",user.getRole());r.put("userId",user.getId());return r;}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UsersEntity user){
//    	ValidatorUtils.validateEntity(user);if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}usersService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 修改密码*/@GetMapping(value = "/updatePassword")public R updatePassword(String  oldPassword, String  newPassword, HttpServletRequest request) {UsersEntity users = usersService.selectById((Integer)request.getSession().getAttribute("userId"));if(newPassword == null){return R.error("新密码不能为空") ;}if(!oldPassword.equals(users.getPassword())){return R.error("原密码输入错误");}if(newPassword.equals(users.getPassword())){return R.error("新密码不能和原密码一致") ;}users.setPassword(newPassword);usersService.updateById(users);return R.ok();}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));if(user==null) {return R.error("账号不存在");}user.setPassword("123456");usersService.update(user,null);return R.ok("密码已重置为:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UsersEntity user){EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();PageUtils page = usersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UsersEntity user){EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", usersService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UsersEntity user = usersService.selectById(id);return R.ok().put("data", user);}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Integer id = (Integer)request.getSession().getAttribute("userId");UsersEntity user = usersService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UsersEntity user){
//    	ValidatorUtils.validateEntity(user);if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}usersService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UsersEntity user){
//        ValidatorUtils.validateEntity(user);usersService.updateById(user);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){List<UsersEntity> user = usersService.selectList(null);if(user.size() > 1){usersService.deleteBatchIds(Arrays.asList(ids));}else{return R.error("管理员最少保留一个");}return R.ok();}
}

package com.controller;import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;/*** 字典* 后端接口* @author* @email
*/
@RestController
@Controller
@RequestMapping("/dictionary")
public class DictionaryController {private static final Logger logger = LoggerFactory.getLogger(DictionaryController.class);private static final String TABLE_NAME = "dictionary";@Autowiredprivate DictionaryService dictionaryService;@Autowiredprivate TokenService tokenService;@Autowiredprivate ForumService forumService;//交流论坛@Autowiredprivate GonggaoService gonggaoService;//公告资讯@Autowiredprivate HanfuService hanfuService;//汉服信息@Autowiredprivate HanfuCollectionService hanfuCollectionService;//汉服收藏@Autowiredprivate HanfuCommentbackService hanfuCommentbackService;//汉服评价@Autowiredprivate HanfuOrderService hanfuOrderService;//汉服租赁@Autowiredprivate YonghuService yonghuService;//用户@Autowiredprivate UsersService usersService;//管理员/*** 后端列表*/@RequestMapping("/page")@IgnoreAuthpublic R page(@RequestParam Map<String, Object> params, HttpServletRequest request){logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));CommonUtil.checkMap(params);PageUtils page = dictionaryService.queryPage(params);//字典表数据转换List<DictionaryView> list =(List<DictionaryView>)page.getList();for(DictionaryView c:list){//修改对应字典表字段dictionaryService.dictionaryConvert(c, request);}return R.ok().put("data", page);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id, HttpServletRequest request){logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);DictionaryEntity dictionary = dictionaryService.selectById(id);if(dictionary !=null){//entity转viewDictionaryView view = new DictionaryView();BeanUtils.copyProperties( dictionary , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>().eq("dic_code", dictionary.getDicCode()).eq("index_name", dictionary.getIndexName());if(dictionary.getDicCode().contains("_erji_types")){queryWrapper.eq("super_id",dictionary.getSuperId());}logger.info("sql语句:"+queryWrapper.getSqlSegment());DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);if(dictionaryEntity==null){dictionary.setCreateTime(new Date());dictionaryService.insert(dictionary);//字典表新增数据,把数据再重新查出,放入监听器中List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());ServletContext servletContext = request.getServletContext();Map<String, Map<Integer,String>> map = new HashMap<>();for(DictionaryEntity d :dictionaryEntities){Map<Integer, String> m = map.get(d.getDicCode());if(m ==null || m.isEmpty()){m = new HashMap<>();}m.put(d.getCodeIndex(),d.getIndexName());map.put(d.getDicCode(),m);}servletContext.setAttribute("dictionaryMap",map);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody DictionaryEntity dictionary, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {logger.debug("update方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());DictionaryEntity oldDictionaryEntity = dictionaryService.selectById(dictionary.getId());//查询原先数据String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");dictionaryService.updateById(dictionary);//根据id更新//如果字典表修改数据的话,把数据再重新查出,放入监听器中List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());ServletContext servletContext = request.getServletContext();Map<String, Map<Integer,String>> map = new HashMap<>();for(DictionaryEntity d :dictionaryEntities){Map<Integer, String> m = map.get(d.getDicCode());if(m ==null || m.isEmpty()){m = new HashMap<>();}m.put(d.getCodeIndex(),d.getIndexName());map.put(d.getDicCode(),m);}servletContext.setAttribute("dictionaryMap",map);return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids, HttpServletRequest request){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());List<DictionaryEntity> oldDictionaryList =dictionaryService.selectBatchIds(Arrays.asList(ids));//要删除的数据dictionaryService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 最大值*/@RequestMapping("/maxCodeIndex")public R maxCodeIndex(@RequestBody DictionaryEntity dictionary){logger.debug("maxCodeIndex:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());List<String> descs = new ArrayList<>();descs.add("code_index");Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>().eq("dic_code", dictionary.getDicCode()).orderDesc(descs);logger.info("sql语句:"+queryWrapper.getSqlSegment());List<DictionaryEntity> dictionaryEntityList = dictionaryService.selectList(queryWrapper);if(dictionaryEntityList.size()>0 ){return R.ok().put("maxCodeIndex",dictionaryEntityList.get(0).getCodeIndex()+1);}else{return R.ok().put("maxCodeIndex",1);}}/*** 批量上传*/@RequestMapping("/batchInsert")public R save( String fileName, HttpServletRequest request){logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))try {List<DictionaryEntity> dictionaryList = new ArrayList<>();//上传的东西Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段Date date = new Date();int lastIndexOf = fileName.lastIndexOf(".");if(lastIndexOf == -1){return R.error(511,"该文件没有后缀");}else{String suffix = fileName.substring(lastIndexOf);if(!".xls".equals(suffix)){return R.error(511,"只支持后缀为xls的excel文件");}else{URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径File file = new File(resource.getFile());if(!file.exists()){return R.error(511,"找不到上传文件,请联系管理员");}else{List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件dataList.remove(0);//删除第一行,因为第一行是提示for(List<String> data:dataList){//循环DictionaryEntity dictionaryEntity = new DictionaryEntity();
//                            dictionaryEntity.setDicCode(data.get(0));                    //字段 要改的
//                            dictionaryEntity.setDicName(data.get(0));                    //字段名 要改的
//                            dictionaryEntity.setCodeIndex(Integer.valueOf(data.get(0)));   //编码 要改的
//                            dictionaryEntity.setIndexName(data.get(0));                    //编码名字 要改的
//                            dictionaryEntity.setSuperId(Integer.valueOf(data.get(0)));   //父字段id 要改的
//                            dictionaryEntity.setBeizhu(data.get(0));                    //备注 要改的
//                            dictionaryEntity.setCreateTime(date);//时间dictionaryList.add(dictionaryEntity);//把要查询是否重复的字段放入map中}//查询是否重复dictionaryService.insertBatch(dictionaryList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,"批量插入数据异常,请联系管理员");}}}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/716734.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

@Transactional--开启事物后换源报错

一、问题出现的场景 系统架构设计、每个企业一个企业库、通过数据源切在平台库、和企业库之间动态切换完成业务操作。 二、跨库事物失效的原因 1、SpringTransactional不支持跨数据源事物&#xff0c;Spring 事物控制是基于数据库链接进行的&#xff0c;当数据源切换后&#x…

SketchUp Pro 2023:颠覆传统,重塑设计世界mac/win版

SketchUp Pro 2023是一款强大的三维建模软件&#xff0c;专为设计师、建筑师和创意专业人士打造。这款软件以其直观易用的界面和强大的功能而著称&#xff0c;为用户提供了无限的创意空间。 SketchUp Pro 2023软件获取 SketchUp Pro 2023在用户体验方面进行了全面的优化&#…

SpringBoot整合rabbitmq-重复消费问题

说明&#xff1a;重复消费的原因大致是生产者将信息A发送到队列中&#xff0c;消费者监听到消息A后开始处理业务&#xff0c;业务处理完成后&#xff0c;监听在告知rabbitmq消息A已经被消费完成途中中断&#xff0c;也就时说我已经处理完业务&#xff0c;而队列中还存在当前消息…

Qt|QTreewidget类下函数qt助手详解说明示例(上)

该系列持续更新&#xff0c;喜欢请一键三连&#xff0c;感谢各位大佬。 QT5.14.2 参考官方QT助手 文章目录 QTreeWidget ClasspropertiesPublic Functions默认构造函数默认析构函数添加根节点void addTopLevelItem(QTreeWidgetItem *item)添加多个根节点void addTopLevelItems…

Linux下的权限

1. 操作系统的外壳 在理解Linux权限之前&#xff0c;我们先来吃点小菜。 1.大部分指令都是文件&#xff0c;如果把指令对应的文件删除了&#xff0c;那么这条指令就使用不了了。 2.用户执行某种功能的时候&#xff0c;不是直接让操作系统执行对应的指令的&#xff0c;而是先交…

Python开源项目月排行 2024年2月

Python 趋势月报&#xff0c;按月浏览往期 GitHub,Gitee 等最热门的Python开源项目&#xff0c;入选的项目主要参考GitHub Trending,部分参考了Gitee和其他。排名不分先后&#xff0c;都是当前月份内相对热门的项目。 入选公式&#xff1d;70%GitHub Trending20%Gitee10%其他 …

jvm面试题-背诵版

按照思维导图抽查和记忆&#xff0c;答案见&#xff1a;四、面试-多线程/并发_scheduledfuture释放-CSDN博客

Jmeter系列(4) 线程属性详解

线程属性 线程组是配置压测策略的一个重要环节线程组决定了测试执行的请求数量 线程数 在这里线程数相当于一个虚拟用户每个线程数大约占内存1M特别注意⚠️ 单台机器最大线程数不要超过1000&#xff0c;不然可能会造成内存溢出 Ramp-Up时间 所有线程在多长时间内全部启动…

计算机网络-第2章 物理层

本章内容&#xff1a;物理层和数据通信的概念、传输媒体特点&#xff08;不属于物理层&#xff09;、信道复用、数字传输系统、宽带接入 2.1-2.2 物理层和数据通信的概念 物理层解决的问题&#xff1a;如何在传输媒体上传输数据比特流&#xff0c;屏蔽掉传输媒体和通信手段的差…

文献阅读笔记《Spatial-temporal Forecasting for Regions without Observations》13页

目录 目录 目录 发行刊物 ABSTRACT 1 INTRODUCTION 2 RELATED WORK&#xff08;相关工作 2.1 Spatial-temporal Forecasting&#xff08;时空预测 2.2 Spatial-temporal Forecasting withIncomplete Data&#xff08;不完全数据的时空预测 2.3 Graph Contrastive Lear…

蓝桥杯集训·每日一题2024 (前缀和)

笔记&#xff1a; 例题&#xff1a; #include<bits/stdc.h> using namespace std; const int N 5000010; char str[N]; int s[N]; int main(){int t;cin>>t;for(int a1;a<t;a){int n;cin>>n;scanf("%s",str1);for(int i1;i<n;i){s[i]s[i-1]…

【MySQL】:约束全解析

&#x1f3a5; 屿小夏 &#xff1a; 个人主页 &#x1f525;个人专栏 &#xff1a; MySQL从入门到进阶 &#x1f304; 莫道桑榆晚&#xff0c;为霞尚满天&#xff01; 文章目录 &#x1f4d1;前言一. 约束概述二. 约束演示三. 外键约束3.1 介绍3.2 语法3.3 删除/更新行为 &…

Netty的InboundHandler 和OutboundHandler

一、InboundHandler 和OutboundHandler的区别 在Netty中&#xff0c;"inbound"表示来自外部来源&#xff08;如网络连接&#xff09;的数据&#xff0c;而"outbound"则表示从应用程序发送到外部目标&#xff08;如网络连接或其他服务&#xff09;的数据。…

Git——Upload your open store

0.default config ssh-keygen -t rsa #之后一路回车,当前目录.ssh/下产生公私钥 cat ~/.ssh/id_rsa.pub #复制公钥到账号 git config --global user.email account_email git config --global user.name account_name1. 上传一个公开仓库 查看当前分支&#xff1a; git branc…

MATLAB基于隐马尔可夫模型-高斯混合模型-期望最大化的MR图像分割

隐马尔可夫模型是一种统计模型&#xff0c;它描述了马尔可夫过程&#xff0c;隐马尔可夫过程中包含隐变量&#xff0c;语音识别和词性自动标注等一些领域常常使用隐马尔可夫模型方法来处理。马尔可夫过程是一类随机过程&#xff0c;马尔可夫链是它的原始模型&#xff0c;马尔可…

【C++那些事儿】深入理解C++类与对象:从概念到实践(中)| 默认构造函数 | 拷贝构造函数 | 析构函数 | 运算符重载 | const成员函数

&#x1f4f7; 江池俊&#xff1a; 个人主页 &#x1f525;个人专栏&#xff1a; ✅数据结构冒险记 ✅C那些事儿 &#x1f305; 有航道的人&#xff0c;再渺小也不会迷途。 文章目录 1. 类的6个默认成员函数2. 构造函数2.1 概念2.2 特性 3. 析构函数3.1 概念3.2 特性 4. 拷贝…

QT多语言切换功能

一.目的 在做项目时&#xff0c;有时希望我们的程序可以在不同的国家使用&#xff0c;这样最好的方式是一套程序能适应于多国语言。 Qt提供了这样的功能&#xff0c;使得一套程序可以呈现出不同的语言界面。本文将介绍QT如何实现多语言&#xff0c;以中文和英文为例。 QT开发…

过于老旧的pytorch_ssim包 请从github下载源码

有些冷门算法真的不要随便pip&#xff0c;有可能下载到史前版本…最好还是找源代码 汗 今天要用到SSIM损失函数&#xff0c;从网上简单看了一下原理就想测试一下&#xff0c;偷了一下懒就直接在命令行输入pip install pytorch_ssim了&#xff0c;结果报了一堆错误&#xff08;汗…

Mysql实战(1)之环境安装

1&#xff0c;进入&#xff1a;MySQL :: MySQL Downloads 2&#xff0c; 3&#xff0c; 4&#xff0c;

Python算法题集_单词搜索

Python算法题集_单词搜索 题22&#xff1a;单词搜索1. 示例说明2. 题目解析- 题意分解- 优化思路- 测量工具 3. 代码展开1) 标准求解【原始矩阵状态回溯】2) 改进版一【字典检测原始矩阵状态回溯】3) 改进版二【矩阵状态回溯】 4. 最优算法5. 相关资源 本文为Python算法题集之一…