springboot(ssm寝室小卖部系统 宿舍小商店网站Java(codeLW)

springboot(ssm寝室小卖部系统 宿舍小商店网站Java(code&LW)

开发语言:Java

框架:ssm/springboot + vue

JDK版本:JDK1.8(或11)

服务器:tomcat

数据库:mysql 5.7(或8.0)

数据库工具:Navicat

开发软件:eclipse//idea

依赖管理包:Maven

您是否想要一个与众不同的网站?我这提供精美的基于springboot(ssm)+vue框架的网站源码,涵盖多个领域,采用轻量级数据库mysql,适用于个人学习等。

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

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

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/208219.shtml

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

相关文章

【力扣100】7.无重复字符的最长子串

添加链接描述 class Solution:def lengthOfLongestSubstring(self, s: str) -> int:# 思路是使用队列&#xff0c;加入一次取一个最大值&#xff0c;然后如果重复&#xff0c;则队列出到没有重复值位置# 但是这个队列其实使用数组实现的strlist[]temp0result0if len(s)0:re…

字符串指令集

字符串指令的格式 例子1就成功发送了指令 例子2就是发送的字符串有误 查询当前位置就会在附加信息中返回当前座位的坐标 第一个指令的参数就是闪灯的两个参数 如第一个示例就是10ms On Time 第二个就是Off Time 使用标准库来接收字符串命令 字符串指令的接收 因为一个指令就是…

科技改变旅游,道观漫游可视化:智能化管理助力道观游览

道观漫游可视化是一种通过技术手段实现道观游览的可视化展示方式&#xff0c;让游客能够更加直观地了解道观的历史、文化和建筑特色。 随着旅游业的不断发展&#xff0c;道观漫游可视化已经成为了旅游行业中的一个重要方向&#xff0c;吸引了越来越多的游客前来体验。 道观漫游…

打死都不要进外包,看看我在阿里外包的2年...

我18年毕业于一个普通二本学校&#xff0c;是一个很不出名的小本科。大学期间专业知识也没有去认真的学习&#xff0c;所以毕业的时候就随便找了一份工作&#xff0c;在一个小公司做功能测试。 记得那时候薪资大概是6k左右&#xff0c;因为是在工厂&#xff0c;工作环境很差&a…

《Spring Cloud Alibaba 从入门到实战》理论知识篇

基础知识篇 理论篇 俗话说&#xff0c;没有最好的架构&#xff0c;只有最合适的架构。 微服务架构也是随着信息产业的发展而出现的最有普遍适用性的一套架构模式。 通常来说&#xff0c;我们认为架构发展历史经历了这样一个过程&#xff1a;单体架构 -> SOA 面向服务架构 …

springboot智慧导诊系统源码:根据患者症状匹配挂号科室

一、系统概述 医院智慧导诊系统是在医疗中使用的引导患者自助就诊挂号&#xff0c;在就诊的过程中有许多患者不知道需要挂什么号&#xff0c;要看什么病&#xff0c;通过智慧导诊系统&#xff0c;可输入自身疾病的症状表现&#xff0c;或选择身体部位&#xff0c;在经由智慧导诊…

微型5G智能网关助力打造智能清洁机器人

智能机器人不断融入我们的生活&#xff0c;提供了越来越多样化的服务&#xff0c;例如专用于卫生清洁的机器人&#xff0c;就已经广泛应用于酒店、体育馆、大型商场、写字楼、工地等各种场景&#xff0c;相较于人工&#xff0c;机器人在此类具有高度重复性、劳动量大的工作中具…

C++作业6

以下是一个简单的比喻&#xff0c;将多态概念与生活中的实际情况相联系&#xff1a; 比喻&#xff1a;动物园的讲解员和动物表演 想象一下你去了一家动物园&#xff0c;看到了许多不同种类的动物&#xff0c;如狮子、大象、猴子等。现在&#xff0c;动物园里有一位讲解员&…

用23种设计模式打造一个cocos creator的游戏框架----(五)工厂方法模式

1、模式标准 模式名称&#xff1a;工厂方法模式 模式分类&#xff1a;创建型 模式意图&#xff1a;定义一个用于创建对象的接口&#xff0c;让子类决定实例化哪一个类。工厂方法使一个类的实例化延迟到其子类。 结构图&#xff1a; 适用于&#xff1a; 1、当一个类不知道它…

failed to install plugin grafana 插件安装失败

升级时忽略plugins 权限问题&#xff0c;导致安装插件失败&#xff01;调整权限即可

042:el-table表格表头自定义高度(亲测好用)

第042个 查看专栏目录: VUE ------ element UI 专栏目标 在vue和element UI联合技术栈的操控下&#xff0c;本专栏提供行之有效的源代码示例和信息点介绍&#xff0c;做到灵活运用。 &#xff08;1&#xff09;提供vue2的一些基本操作&#xff1a;安装、引用&#xff0c;模板使…

Shrio 安全框架

目录 前言 1.介绍 2.整合 Shiro 到 Spring Boot 3.Shiro 相关配置 总结 前言 几乎所有涉及用户的系统都需要进行权限管理&#xff0c;权限管理涉及到一个系统的安全。Spring Boot 的安全框架整合方案中还有一个璀璨的明珠&#xff1a;Shrio。 1.介绍 Shiro是一款由Java 编…

信道复用技术

目录 一、频分复用FDM&#xff08;Frequency Division Multiplexing&#xff09; 二、波分复用 WDM&#xff08;Wavelength Division Multiplexing&#xff09; 三、时分复用TDM&#xff08;Time Division Multiplexing&#xff09; 四、统计时分复用 STDM&#xff08;Statisti…

双通道5V高细分步进电机驱动芯片应用于摇头机,X,Y控制,聚焦控制,CAMERA云台控制等产品上的芯片选型分析

双通道5V高细分步进电机驱动芯片GC6106&#xff0c;GC6107&#xff0c;GC6119&#xff0c;GC6151&#xff0c;GC6236&#xff0c;GC6225&#xff0c;GC6129&#xff0c;电压范围3~5.5V&#xff0c;最大持续电流可达0.6A左右。可应用于摇头机&#xff0c;X,Y控制&#xff0c;聚焦…

安装vue环境

1.Hello Vue.js <script src"https://cdn.staticfile.org/vue/2.7.0/vue.min.js"></script>/*引入js文件 */ <script> new Vue({ /* 创建一个对象&#xff0c;两个属性。 */ el: #app, data: { message: Hello Vue.js! }, methods: { details: f…

C++使用模板的注意事项

两点注意事项 自动推导类型&#xff0c;必须推导出一致的数据类型T&#xff0c;才可以使用模板必须要确定出T的数据类型&#xff0c;才可以使用 #include<iostream> using namespace std;//第一点必须一致的数据类型 template <class T> void myswap(T& a, T…

基于AIS数据的船舶密度计算与规律研究

参考文献&#xff1a;[1]陈晓. 基于AIS数据的船舶密度计算与规律研究[D].大连海事大学,2021.DOI:10.26989/d.cnki.gdlhu.2020.001129. 谢谢姐姐的文章&#xff01; 网格化AIS数据 网格化 AIS 数据是处理和分析船舶轨迹数据的一种有效方法&#xff0c;特别是当涉及到密度计算和…

C++_对C数据类型的扩展

结构体 c中定义结构体变量&#xff0c;可以省略struct关键字 c结构提重可以直接定义函数&#xff0c;谓之成员函数&#xff08;方法&#xff09; #include <iostream> using namespace std; struct stu {int num;char name[24];void price(void) {cout << "…

Vue3+Antd实现弹框显示内容并加入复制按钮

使用Vue3antd实现点击弹框出现内容并可复制内容的功能&#xff1a; HTML部分&#xff1a; <a-button type"primary" click"showModel">打开弹框 </a-button><!-- ok 是弹框中确定按钮的操作&#xff0c;cancel 是弹框中取消按钮的操作 --…

Redis数据已经删除了,为什么内存占用还是很高?

Redis数据已经删除了&#xff0c;为什么内存占用还是很高&#xff1f; Redis做了数据删除操作&#xff0c;为什么使用top命令时&#xff0c;还是显示Redis占了很多内存&#xff1f; 没做相关功课的人觉得这个问题有问题&#xff0c;删了数据还说占着内存&#xff0c;面试官不…