当前位置: 首页 > news >正文

SpringBoot+Vue租房管理系统源码+论文

代码可以查看文章末尾⬇️联系方式获取,记得注明来意哦~🌹
分享万套开题报告+任务书+答辩PPT模板
作者完整代码目录供你选择:
《SpringBoot网站项目》1800套
《SSM网站项目》1500套
《小程序项目》1600套
《APP项目》1500套
《Python网站项目》1300套
⬇️文章末尾可以获取联系方式,需要源码或者演示视频可以联系⬇️
⚡感兴趣大家可以点点关注收藏,后续更新更多项目资料。⚡

采用技术:

编程语言:Java
后端框架:SpringBoot
前端框架:Vue
数据库:MySQL
数据表数量:14张表
运行软件:IDEA、Eclipse、VS Code都可以

系统功能:


本系统实现管理员、用户、房东模块。
管理员模块功能:公告栏、管理员、用户、房东、房屋类型、房源信息、房屋租赁、合同信息、操作日志等。
用户模块功能:房屋租赁、合同信息、我的收藏、公告栏、房源信息等。
房东模块功能:房东、房源信息、房屋租赁、合同信息、公告栏等。

运行截图:
























论文目录:




核心代码:

packagecom.controller;importjava.text.SimpleDateFormat;importcom.alibaba.fastjson.JSONObject;importjava.util.*;importorg.springframework.beans.BeanUtils;importjavax.servlet.http.HttpServletRequest;importorg.springframework.web.context.ContextLoader;importjavax.servlet.ServletContext;importcom.service.TokenService;importcom.utils.StringUtil;importjava.lang.reflect.InvocationTargetException;importcom.service.DictionaryService;importorg.apache.commons.lang3.StringUtils;importcom.annotation.IgnoreAuth;importorg.slf4j.Logger;importorg.slf4j.LoggerFactory;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.stereotype.Controller;importorg.springframework.web.bind.annotation.*;importcom.baomidou.mybatisplus.mapper.EntityWrapper;importcom.baomidou.mybatisplus.mapper.Wrapper;importcom.entity.YonghuEntity;importcom.service.YonghuService;importcom.entity.view.YonghuView;importcom.utils.PageUtils;importcom.utils.R;@RestController@Controller@RequestMapping("/yonghu")publicclassYonghuController{privatestaticfinalLoggerlogger=LoggerFactory.getLogger(YonghuController.class);@AutowiredprivateYonghuServiceyonghuService;@AutowiredprivateTokenServicetokenService;@AutowiredprivateDictionaryServicedictionaryService;//级联表service/** * 后端列表 */@RequestMapping("/page")publicRpage(@RequestParamMap<String,Object>params,HttpServletRequestrequest){logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));params.put("orderBy","id");PageUtilspage=yonghuService.queryPage(params);//字典表数据转换List<YonghuView>list=(List<YonghuView>)page.getList();for(YonghuViewc:list){//修改对应字典表字段dictionaryService.dictionaryConvert(c);}returnR.ok().put("data",page);}/** * 后端详情 */@RequestMapping("/info/{id}")publicRinfo(@PathVariable("id")Longid){logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);YonghuEntityyonghu=yonghuService.selectById(id);if(yonghu!=null){//entity转viewYonghuViewview=newYonghuView();BeanUtils.copyProperties(yonghu,view);//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view);returnR.ok().put("data",view);}else{returnR.error(511,"查不到数据");}}/** * 后端保存 */@RequestMapping("/save")publicRsave(@RequestBodyYonghuEntityyonghu,HttpServletRequestrequest){logger.debug("save方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());Wrapper<YonghuEntity>queryWrapper=newEntityWrapper<YonghuEntity>().eq("username",yonghu.getUsername()).or().eq("yonghu_phone",yonghu.getYonghuPhone()).or().eq("yonghu_id_number",yonghu.getYonghuIdNumber());;logger.info("sql语句:"+queryWrapper.getSqlSegment());YonghuEntityyonghuEntity=yonghuService.selectOne(queryWrapper);if(yonghuEntity==null){yonghu.setCreateTime(newDate());yonghu.setPassword("123456");// String role = String.valueOf(request.getSession().getAttribute("role"));// if("".equals(role)){// yonghu.set// }yonghuService.insert(yonghu);returnR.ok();}else{returnR.error(511,"账户或者身份证号或者手机号已经被使用");}}/** * 后端修改 */@RequestMapping("/update")publicRupdate(@RequestBodyYonghuEntityyonghu,HttpServletRequestrequest){logger.debug("update方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());//根据字段查询是否有相同数据Wrapper<YonghuEntity>queryWrapper=newEntityWrapper<YonghuEntity>().notIn("id",yonghu.getId()).andNew().eq("username",yonghu.getUsername()).or().eq("yonghu_phone",yonghu.getYonghuPhone()).or().eq("yonghu_id_number",yonghu.getYonghuIdNumber());;logger.info("sql语句:"+queryWrapper.getSqlSegment());YonghuEntityyonghuEntity=yonghuService.selectOne(queryWrapper);if("".equals(yonghu.getYonghuPhoto())||"null".equals(yonghu.getYonghuPhoto())){yonghu.setYonghuPhoto(null);}if(yonghuEntity==null){// String role = String.valueOf(request.getSession().getAttribute("role"));// if("".equals(role)){// yonghu.set// }yonghuService.updateById(yonghu);//根据id更新returnR.ok();}else{returnR.error(511,"账户或者身份证号或者手机号已经被使用");}}/** * 删除 */@RequestMapping("/delete")publicRdelete(@RequestBodyInteger[]ids){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());yonghuService.deleteBatchIds(Arrays.asList(ids));returnR.ok();}/** * 登录 */@IgnoreAuth@RequestMapping(value="/login")publicRlogin(Stringusername,Stringpassword,Stringcaptcha,HttpServletRequestrequest){YonghuEntityyonghu=yonghuService.selectOne(newEntityWrapper<YonghuEntity>().eq("username",username));if(yonghu==null||!yonghu.getPassword().equals(password)){returnR.error("账号或密码不正确");}Stringtoken=tokenService.generateToken(yonghu.getId(),username,"yonghu","用户");Rr=R.ok();r.put("token",token);r.put("role","用户");r.put("username",yonghu.getYonghuName());r.put("tableName","yonghu");r.put("userId",yonghu.getId());returnr;}/** * 注册 */@IgnoreAuth@PostMapping(value="/register")publicRregister(@RequestBodyYonghuEntityyonghu){// ValidatorUtils.validateEntity(user);if(yonghuService.selectOne(newEntityWrapper<YonghuEntity>().eq("username",yonghu.getUsername()).orNew().eq("yonghu_phone",yonghu.getYonghuPhone()).orNew().eq("yonghu_id_number",yonghu.getYonghuIdNumber()))!=null){returnR.error("账户已存在或手机号或身份证号已经被使用");}yonghuService.insert(yonghu);returnR.ok();}/** * 重置密码 */@GetMapping(value="/resetPassword")publicRresetPassword(Integerid){YonghuEntityyonghu=newYonghuEntity();yonghu.setPassword("123456");yonghu.setId(id);yonghuService.updateById(yonghu);returnR.ok();}/** * 获取用户的session用户信息 */@RequestMapping("/session")publicRgetCurrYonghu(HttpServletRequestrequest){Integerid=(Integer)request.getSession().getAttribute("userId");YonghuEntityyonghu=yonghuService.selectById(id);returnR.ok().put("data",yonghu);}/** * 退出 */@GetMapping(value="logout")publicRlogout(HttpServletRequestrequest){request.getSession().invalidate();returnR.ok("退出成功");}}t("data",yonghu);}/** * 退出 */@GetMapping(value="logout")publicRlogout(HttpServletRequestrequest){request.getSession().invalidate();returnR.ok("退出成功");}}getSession().invalidate();returnR.ok("退出成功");}}t("data",yonghu);}/** * 退出 */@GetMapping(value="logout")publicRlogout(HttpServletRequestrequest){request.getSession().invalidate();returnR.ok("退出成功");}}
http://www.cnnetsun.cn/news/2094179.html

相关文章:

  • AWS EC2深度学习训练:10个高效命令行技巧
  • 连续函数核心概念与应用解析
  • AI代理评估:超越准确率的五大关键指标解析
  • 金融算法调试失效真相(VSCode + PyTorch + Backtrader深度联调大揭秘)
  • Java JVM 垃圾回收调优指南
  • HEIF Utility:Windows平台HEIF图片查看与转换的完美解决方案
  • 解决 Leaflet 地图在移动端溢出导致导航栏不可见的问题
  • AI编程助手可视化评审工具Plannotator:提升代码审查与协作效率
  • 浅析Python数据处理
  • Java 微服务弹性模式实践 2027
  • 开源LLM私有化部署利器Kiln:从架构解析到实战部署指南
  • GPT-5.5震撼登场!编程、知识工作、科研全面超越,AI智能再攀高峰!
  • Hyperf + Swoole微服务实战,万级QPS轻松扛.txt
  • VSCode AI配置倒计时:微软即将弃用旧Token认证(2024 Q3强制升级),3类存量项目迁移清单紧急发布
  • 磨粉机设计(论文+DWG图纸)
  • 四博AI智能音响(4G S3版)方案设计:技术实现与代码解析
  • ShortcutsBench:基于真实快捷指令的大规模智能体API调用基准数据集
  • 开源智能合同分析平台OpenContracts:从NLP到企业级部署全解析
  • DXVK 2.7.1:如何实现Linux游戏性能的终极突破与Vulkan图形转换技术
  • 机器学习项目协作平台选型与实战指南
  • 【VSCode 2026跨端连接终极指南】:零配置打通Windows/macOS/iOS/Android/WSL五端协同开发,实测延迟<82ms
  • 深度学习过拟合解决方案与实战技巧
  • PySpur:可视化AI智能体工作流开发平台,10倍提升Agent迭代效率
  • 光伏组件封装产线自动化通讯方案:三菱A系列PLC以太网多节点互联案例
  • 华为光猫配置解密工具:3步快速上手完整指南
  • 5分钟终极指南:一键解密网易云NCM音乐文件,免费高效转换音频格式
  • 多智能体工作流落地难?VSCode原生支持的4种轻量级Agent调度方案,今天就能用
  • RepoAgent:基于LLM与AST的代码仓库智能文档生成与维护框架
  • 手动实现机器学习算法:从原理到工程实践
  • 为AI智能体提供安全浏览器自动化:dev-browser沙箱化执行环境详解