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

建站之星好吗莱芜规划

建站之星好吗,莱芜规划,上海市重点企业名单,永嘉县住房和城乡建设局网站文章目录 一、项目演示二、项目介绍三、运行截图四、主要代码1.保存宠物信息代码2.提交订单信息代码3.查询评论信息代码 一、项目演示 项目演示地址#xff1a; 视频地址 二、项目介绍 项目描述#xff1a;这是一个基于SpringBootuniApp框架开发的宠物领养微信小程序系统。… 文章目录 一、项目演示二、项目介绍三、运行截图四、主要代码1.保存宠物信息代码2.提交订单信息代码3.查询评论信息代码 一、项目演示 项目演示地址 视频地址 二、项目介绍 项目描述这是一个基于SpringBootuniApp框架开发的宠物领养微信小程序系统。首先这是一个前后端分离的项目前端分为用户端和管理端用户端使用微信小程序(uniApp开发)管理端使用Web页面(Vue开发)。然后这项目代码简洁规范注释说明详细易于理解和学习。其次这项目功能丰富具有一个宠物领养微信小程序系统该有的所有功能。 项目功能此项目分为两个角色普通用户和管理员。普通用户有登录注册、浏览宠物信息、浏览论坛帖子信息、管理自己发布的宠物信息、管理个人基本信息、管理自己发布的论坛帖子信息、评论帖子、收藏宠物、拍下宠物、管理自己的订单信息等等功能。管理员有管理所有用户信息、管理所有轮播图信息、管理所有首页板块信息、管理所有宠物分类信息、管理所有宠物信息、管理所有订单信息、管理所有论坛帖子信息、管理所有评论信息、查看收益数据图表等等功能。 应用技术SpringBoot uniApp Vue3 MySQL MyBatis Redis ElementUI-Plus uni-ui Vite TypeScript 运行环境IntelliJ IDEA2019.3.5 MySQL5.7项目压缩包中自带) Redis5.0.5项目压缩包中自带 JDK1.8 Maven3.6.3项目压缩包中自带 Node16.20.2项目压缩包中自带 微信开发者工具项目压缩包中自带 Visual Studio Code项目压缩包中自带 三、运行截图 四、主要代码 1.保存宠物信息代码 /*** 保存宠物信息* param petDTO* return*/Overridepublic ResponseDTOBoolean savePet(PetDTO petDTO) {// 进行统一表单验证CodeMsg validate ValidateEntityUtil.validate(petDTO);if (!validate.getCode().equals(CodeMsg.SUCCESS.getCode())) {return ResponseDTO.errorByMsg(validate);}Pet pet CopyUtil.copy(petDTO, Pet.class);if(CommonUtil.isEmpty(pet.getId())) {// 添加操作pet.setId(UuidUtil.getShortUuid());pet.setCreateTime(new Date());pet.setState(PetStateEnum.WAIT.getCode());batchInsertPicture(petDTO.getPhotoList(), pet.getId());if(petMapper.insertSelective(pet) 0) {return ResponseDTO.errorByMsg(CodeMsg.PET_ADD_ERROR);}} else {// 修改操作pet.setState(Optional.ofNullable(pet.getState()).orElse(PetStateEnum.WAIT.getCode()));PictureExample pictureExample new PictureExample();pictureExample.createCriteria().andRefIdEqualTo(pet.getId());pictureMapper.deleteByExample(pictureExample);batchInsertPicture(petDTO.getPhotoList(), pet.getId());if(petMapper.updateByPrimaryKeySelective(pet) 0) {return ResponseDTO.errorByMsg(CodeMsg.PET_EDIT_ERROR);}}return ResponseDTO.successByMsg(true, 保存成功);}2.提交订单信息代码 /*** 提交订单信息* param orderDTO* return*/Overridepublic ResponseDTOBoolean submitOrder(OrderDTO orderDTO) {// 进行统一表单验证CodeMsg validate ValidateEntityUtil.validate(orderDTO);if (!validate.getCode().equals(CodeMsg.SUCCESS.getCode())) {return ResponseDTO.errorByMsg(validate);}Order order CopyUtil.copy(orderDTO, Order.class);Pet pet petMapper.selectByPrimaryKey(order.getPetId());if(pet.getUserId().equals(order.getUserId())) {return ResponseDTO.errorByMsg(CodeMsg.ORDER_REPEAT_ERROR);}if(!PetStateEnum.SUCCESS.getCode().equals(pet.getState())) {return ResponseDTO.errorByMsg(CodeMsg.ORDER_PET_STATE_ERROR);}Category category categoryMapper.selectByPrimaryKey(pet.getCategoryId());order.setCategoryName(Optional.ofNullable(category.getName()).orElse());Plate plate plateMapper.selectByPrimaryKey(pet.getPlateId());order.setPlateName(Optional.ofNullable(plate.getName()).orElse());order.setId(UuidUtil.getShortUuid());order.setTotalPrice(pet.getPrice());order.setPetName(pet.getName());order.setPetInfo(pet.getInfo());PictureExample pictureExample new PictureExample();pictureExample.createCriteria().andTypeEqualTo(PictureTypeEnum.PET.getCode()).andRefIdEqualTo(pet.getId());pictureExample.setOrderByClause(sort asc);ListPicture pictureList pictureMapper.selectByExample(pictureExample);if(pictureList.size() 0) {order.setPetPhoto(pictureList.get(0).getPhoto());}order.setSellerId(pet.getUserId());order.setCreateTime(new Date());if(orderMapper.insertSelective(order) 0) {return ResponseDTO.errorByMsg(CodeMsg.ORDER_ADD_ERROR);}pet.setState(PetStateEnum.SELL.getCode());petMapper.updateByPrimaryKeySelective(pet);return ResponseDTO.successByMsg(true, 下单成功);}3.查询评论信息代码 /*** 查询评论信息* param commentDTO* return*/Overridepublic ResponseDTOListCommentDTO getCommentList(CommentDTO commentDTO) {CommentExample commentExample new CommentExample();CommentExample.Criteria criteria commentExample.createCriteria();int total 0;if(!CommonUtil.isEmpty(commentDTO.getPostId())) {criteria.andPostIdEqualTo(commentDTO.getPostId());total commentMapper.countByExample(commentExample);}// 先查所有父级评论criteria.andParentIdEqualTo();commentExample.setOrderByClause(create_time desc);ListComment commentList commentMapper.selectByExample(commentExample);ListCommentDTO commentDTOList CopyUtil.copyList(commentList, CommentDTO.class);for(CommentDTO comment : commentDTOList) {User user userMapper.selectByPrimaryKey(comment.getUserId());comment.setUserDTO(CopyUtil.copy(user, UserDTO.class));// 查询子评论CommentExample childCommentExample new CommentExample();childCommentExample.createCriteria().andParentIdEqualTo(comment.getId());childCommentExample.setOrderByClause(create_time desc);ListComment childCommentList commentMapper.selectByExample(childCommentExample);// 查询子评论ListCommentDTO childCommentDTOList CopyUtil.copyList(childCommentList, CommentDTO.class);for(CommentDTO childComment : childCommentDTOList) {childComment.setUserDTO(CopyUtil.copy(userMapper.selectByPrimaryKey(childComment.getUserId()), UserDTO.class));childComment.setReplyUserDTO(CopyUtil.copy(userMapper.selectByPrimaryKey(childComment.getReplyId()), UserDTO.class));}comment.setChildCommentDTOList(childCommentDTOList);}return ResponseDTO.successByMsg(commentDTOList, String.valueOf(total));}
http://www.pierceye.com/news/123486/

相关文章:

  • 创建企业营销网站包括哪些内容软考高项彻底没用了
  • 企业品牌网站建设方案无锡网站设计多少钱
  • 轻量级网站开发在线旅游网站平台有哪些
  • 怎么用vs做网站推广优化网站排名
  • 免费推广网站软件常宁网站建设常宁网站建设
  • 冀州市网站建设html编辑器安卓版手机版软件
  • 广州专业网站改版方案网站建设要做ui和什么
  • 做网站显示上次登录时间代码h5素材库
  • 比较有名的网站建设公司谷歌网站优化
  • 企业网站改版计划书中国制造网是做什么的
  • 非主营电子商务企业网站有哪些企业网项目建设实践
  • 颍东网站建设手机vi设计公司
  • 林哥seo网络营销seo培训
  • 如何面试网站开发网站制作交易流程
  • 绍兴网站建设冯炳良互联网营销
  • 制作企业网站怎么报价可以做我女朋友吗网站
  • 广西玉林网站建设正规公司建手机网站
  • 乐清网站制作公司招聘做私人网站 违法
  • 珠海电脑自己建网站电子商务排名
  • 怎样做网站的背景图片安卓原生开发
  • 现代电子商务网站建设技术wordpress采用的mvc
  • 台州网站建设团队如何申请建设网站域名
  • 资料查询网站建设桂林微代码网络科技有限公司
  • 做暖视频网站免费番禺网站制作技术
  • 如何做网站百度排名优化深圳市住房和建设网站
  • 汉沽做网站简单网站建设
  • 建信建设投资有限公司网站网站建设app小程序
  • wordpress文章所有图片seo中文含义
  • 免费网站建设开发个人 网站备案 幕布
  • 公司网站设计 优帮云网站开发合同注意事件有哪些