springboot/ssmHome F家居系统Java家居商城购物管理系统

springboot/ssmHome F家居系统Java家居商城购物管理系统

开发语言:Java

框架:springboot(可改ssm) + vue

JDK版本:JDK1.8(或11)

服务器:tomcat

数据库:mysql 5.7(或8.0)

数据库工具:Navicat

开发软件:eclipse//idea

依赖管理包:Maven

如需了解更多代码细节或修改代码功能界面,本人都能提供技术支持。(声音嘎嘎好听喔!)

祝你早日找到合适的代码哦~

注:主页千套源码&文档,文章最下方获取源码哦

package com.controller;import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
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.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;import com.entity.NewsEntity;
import com.entity.view.NewsView;import com.service.NewsService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;/*** 后端接口* @author * @email * @date 2023-03-25 14:13:13*/
@RestController
@RequestMapping("/news")
public class NewsController {@Autowiredprivate NewsService newsService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,NewsEntity news,HttpServletRequest request){EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));return R.ok().put("data", page);}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,NewsEntity news, HttpServletRequest request){EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( NewsEntity news){EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();ew.allEq(MPUtil.allEQMapPre( news, "news")); return R.ok().put("data", newsService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(NewsEntity news){EntityWrapper< NewsEntity> ew = new EntityWrapper< NewsEntity>();ew.allEq(MPUtil.allEQMapPre( news, "news")); NewsView newsView =  newsService.selectView(ew);return R.ok("查询食堂资讯成功").put("data", newsView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){NewsEntity news = newsService.selectById(id);return R.ok().put("data", news);}/*** 前端详情*/@IgnoreAuth@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){NewsEntity news = newsService.selectById(id);return R.ok().put("data", news);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody NewsEntity news, HttpServletRequest request){news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(news);newsService.insert(news);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody NewsEntity news, HttpServletRequest request){news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(news);newsService.insert(news);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody NewsEntity news, HttpServletRequest request){//ValidatorUtils.validateEntity(news);newsService.updateById(news);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){newsService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 提醒接口*/@RequestMapping("/remind/{columnName}/{type}")public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, @PathVariable("type") String type,@RequestParam Map<String, Object> map) {map.put("column", columnName);map.put("type", type);if(type.equals("2")) {SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");Calendar c = Calendar.getInstance();Date remindStartDate = null;Date remindEndDate = null;if(map.get("remindstart")!=null) {Integer remindStart = Integer.parseInt(map.get("remindstart").toString());c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindStart);remindStartDate = c.getTime();map.put("remindstart", sdf.format(remindStartDate));}if(map.get("remindend")!=null) {Integer remindEnd = Integer.parseInt(map.get("remindend").toString());c.setTime(new Date());c.add(Calendar.DAY_OF_MONTH,remindEnd);remindEndDate = c.getTime();map.put("remindend", sdf.format(remindEndDate));}}Wrapper<NewsEntity> wrapper = new EntityWrapper<NewsEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}int count = newsService.selectCount(wrapper);return R.ok().put("count", count);}}

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

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

相关文章

package.json文件详解

packages.json文件里面配置的属性的含义 name和version 以上两个是最重要的两个属性&#xff0c;否则模块无法被安装&#xff0c;一起形成了它的唯一标识符 模版中内容变化&#xff0c;版本也要随之一起变化 description 描述&#xff0c;方便别人理解模块作用 main 程序…

3、windows环境下vscode开发c/c++环境配置(二)

前言&#xff1a;上一篇文章写了windows环境下&#xff0c;配置vscode的c/c开发环境&#xff0c;这一篇讲vscode开发c/c的配置文件&#xff0c;包括c_cpp_propertues.json&#xff0c;task.json及launch.json。 一、总体流程 通过c/c插件我们就可以来编写c/c程序了&#xff0c…

【ArcGIS微课1000例】0104:二位面状数据转三维多面体(建筑物按高度拉伸)

文章目录 一、加载数据二、添加高度字段三、三维拉伸显示四、生成三维体数据五、注意事项一、加载数据 打开ArcScene,加载配套实验数据(0104.rar中的二维建筑物矢量数据,订阅专栏,获取专栏所有文章阅读权限及配套数据),如下图所示: 二、添加高度字段 本实验将二维数据…

3、电源管理入门之CPU热插拔详解

目录 简介 1. 省电技术概览 (1)、cpu hotplug和idle的区别? 2. 热插拔代码介绍 (1)、为什么以cpu1为例? 3. ATF中处理 简介 之前介绍了电源的开机和关机重启,本小节开始介绍省电的技术,其中最暴力的省电方法就是直接拔核hotplug处理,就像需要…

什么是 Wake-on-LAN?如何使用 Splashtop 远程喊醒电脑

在当今数字互联的世界里&#xff0c;远程访问电脑已不仅仅是一种便利&#xff0c;而是许多人的需要。无论是远程工作、IT 支持&#xff0c;还是管理整个网络中的计算机群&#xff0c;我们都必须掌握正确的工具和技术。 其中一项在远程访问中发挥关键作用的技术是 Wake-on-LAN …

带你了解SMTP,POP3,IMAP协议

电子邮件&#xff08;email&#xff09;是一种电子通信方式&#xff0c;可以通过网络传输文本、图像、音频和视频等信息。在发送和接收电子邮件时&#xff0c;需要使用一种称为“邮件协议”的标准化协议。常用的电子邮件协议有SMTP、POP3和IMAP。 SMTP&#xff08;Simple Mail…

【LeetCode周赛】第 384 场周赛

目录 3033. 修改矩阵 简单3034. 匹配模式数组的子数组数目 I 中等3035. 回文字符串的最大数量 中等3036. 匹配模式数组的子数组数目 II 困难 3033. 修改矩阵 简单 3033. 修改矩阵 分析&#xff1a; 获取每一列的最大元素&#xff0c;将矩阵中的 -1 替换成每一列的最大元素。 …

java开源xml工具类介绍

在Java中处理XML的常用开源工具有很多&#xff0c;以下是一些流行的库以及简单的示例代码&#xff1a; DOM4J DOM4J 是一个非常流行的Java库&#xff0c;用于处理XML&#xff0c;DOM4J 易于使用&#xff0c;并且提供了很好的性能。 Maven 依赖 …

游戏物理引擎+特效系统

原文链接&#xff1a;游戏开发入门&#xff08;六&#xff09;游戏物理引擎_游戏开发物理引擎-CSDN博客 游戏开发入门&#xff08;七&#xff09;特效系统_csdn 游戏效果开发-CSDN博客 1.游戏应用物理的目的就是为了真实 2.物理引擎&#xff1a; 可以认为属于游戏引擎的一个…

挑战杯 基于LSTM的天气预测 - 时间序列预测

0 前言 &#x1f525; 优质竞赛项目系列&#xff0c;今天要分享的是 机器学习大数据分析项目 该项目较为新颖&#xff0c;适合作为竞赛课题方向&#xff0c;学长非常推荐&#xff01; &#x1f9ff; 更多资料, 项目分享&#xff1a; https://gitee.com/dancheng-senior/po…

Stable Diffusion——基础模型、VAE、LORA、Embedding各个模型的介绍与使用方法

前言 Stable Diffusion&#xff08;稳定扩散&#xff09;是一种生成模型&#xff0c;基于扩散过程来生成高质量的图像。它通过一个渐进过程&#xff0c;从一个简单的噪声开始&#xff0c;逐步转变成目标图像&#xff0c;生成高保真度的图像。这个模型的基础版本是基于扩散过程…

论文精读--word2vec

word2vec从大量文本语料中以无监督方式学习语义知识&#xff0c;是用来生成词向量的工具 把文本分散嵌入到另一个离散空间&#xff0c;称作分布式表示&#xff0c;又称为词嵌入&#xff08;word embedding&#xff09;或词向量 Abstract We propose two novel model architec…

白银交易新手指南:怎样选择可靠的现货交易平台?

在投资市场上&#xff0c;白银作为一种贵金属&#xff0c;具有较高的投资价值和风险防范功能。对于白银交易新手来说&#xff0c;选择一个可靠的现货交易平台是至关重要的。那么&#xff0c;如何挑选一个适合自己的现货交易平台呢&#xff1f; 1. 平台资质 一个正规的现货交易…

Spring最新核心高频面试题(持续更新)

1 什么是Spring框架 Spring框架是一个开源的Java应用程序开发框架&#xff0c;它提供了很多工具和功能&#xff0c;可以帮助开发者更快地构建企业级应用程序。通过使用Spring框架&#xff0c;开发者可以更加轻松地开发Java应用程序&#xff0c;并且可以更加灵活地组织和管理应…

【软考高项】【英语知识】-- 单词积累

目录 一、常见计算机技术词汇 二、项目管理词汇 2.1 十大知识域 2.2 五大过程组 2.3 49个子过程 2.4 工具和技术汇总 2.5 输入和输出汇总 一、常见计算机技术词汇 序号中文英文1云计算Cloud computing2云存储Cloud storage3云服务Cloud service4软件即服务SaaS5平台即服…

[leetcode M] 105. 从前序与中序遍历序列构造二叉树

给定两个整数数组 preorder 和 inorder &#xff0c;其中 preorder 是二叉树的先序遍历&#xff0c; inorder 是同一棵树的中序遍历&#xff0c;请构造二叉树并返回其根节点。 示例 1: 输入: preorder [3,9,20,15,7], inorder [9,3,15,20,7] 输出: [3,9,20,null,null,15,7]…

【Azure 架构师学习笔记】- Azure Databricks (8) --UC架构简介

本文属于【Azure 架构师学习笔记】系列。 本文属于【Azure Databricks】系列。 接上文 【Azure 架构师学习笔记】- Azure Databricks (7) --Unity Catalog(UC) 基本概念和组件 前言 UC 简单来说&#xff0c;就是管理两样东西&#xff1a;用户和元存储。 用户管理 所有Databri…

C#,笛卡尔树(Cartesian Tree)的构造、遍历算法与源代码

Ren Descartes 一、笛卡尔&#xff08;Ren Descartes&#xff09; 勒内笛卡尔&#xff08;Ren Descartes&#xff0c;1596年3月31日-1650年2月11日&#xff09;&#xff0c;1596年3月31日生于法国安德尔-卢瓦尔省的图赖讷&#xff08;现笛卡尔&#xff0c;因笛卡尔得名&#…

Day 30 标准IO

文章目录 1.什么是标准IO1.1 概念1.2 特点1.3 操作 2.缓存区3.函数接口3.1 打开文件fopen3.2 关闭文件 fclose3.3 读写文件操作3.3.1 每次读写一个字符&#xff1a;fgetc()、fputc()每次读一个字符fgetc()每次写一个字符fputc()(1)针对文件(2)针对终端feof和ferror 3.3.2 每次一…

通过Docker Compose的方式在Docker中安装Maven环境

目前可以说 Docker 已经是在开发部署中成为主流&#xff0c;所以我们很多环境和工具都会安装在 Docker 容器中&#xff0c;Maven 环境是 SpringBoot 项目中最常用的依赖管理工具。当我们使用自动运维工具如 Ansible、Chef 、Puppet、Walle、Spug等&#xff09;管理和部署 Maven…