package com.controller;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.text.ParseException;
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.transaction.annotation.Transactional;
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.WupinxinxiEntity;
import com.entity.view.WupinxinxiView;
import com.service.WupinxinxiService;
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;
import com.service.StoreupService;
import com.entity.StoreupEntity;
/**
* 物品信息
* 后端接口
* @author
* @email
* @date 2023-05-10 16:54:50
*/
@RestController
@RequestMapping("/wupinxinxi")
public class WupinxinxiController {
@Autowired
private WupinxinxiService wupinxinxiService;
@Autowired
private StoreupService storeupService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,WupinxinxiEntity wupinxinxi,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
wupinxinxi.setYonghuzhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<WupinxinxiEntity> ew = new EntityWrapper<WupinxinxiEntity>();
PageUtils page = wupinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wupinxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,WupinxinxiEntity wupinxinxi,
HttpServletRequest request){
EntityWrapper<WupinxinxiEntity> ew = new EntityWrapper<WupinxinxiEntity>();
PageUtils page = wupinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wupinxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( WupinxinxiEntity wupinxinxi){
EntityWrapper<WupinxinxiEntity> ew = new EntityWrapper<WupinxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( wupinxinxi, "wupinxinxi"));
return R.ok().put("data", wupinxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(WupinxinxiEntity wupinxinxi){
EntityWrapper< WupinxinxiEntity> ew = new EntityWrapper< WupinxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( wupinxinxi, "wupinxinxi"));
WupinxinxiView wupinxinxiView = wupinxinxiService.selectView(ew);
return R.ok("查询物品信息成功").put("data", wupinxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
WupinxinxiEntity wupinxinxi = wupinxinxiService.selectById(id);
wupinxinxi.setClicknum(wupinxinxi.getClicknum()+1);
wupinxinxi.setClicktime(new Date());
wupinxinxiService.updateById(wupinxinxi);
return R.ok().put("data", wupinxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
WupinxinxiEntity wupinxinxi = wupinxinxiService.selectById(id);
wupinxinxi.setClicknum(wupinxinxi.getClicknum()+1);
wupinxinxi.setClicktime(new Date());
wupinxinxiService.updateById(wupinxinxi);
return R.ok().put("data", wupinxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody WupinxinxiEntity wupinxinxi, HttpServletRequest request){
wupinxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(wupinxinxi);
wupinxinxiService.insert(wupinxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody WupinxinxiEntity wupinxinxi, HttpServletRequest request){
wupinxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(wupinxinxi);
wupinxinxiService.insert(wupinxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody WupinxinxiEntity wupinxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(wupinxinxi);
wupinxinxiService.updateById(wupinxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
wupinxinxiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,WupinxinxiEntity wupinxinxi, HttpServletRequest request,String pre){
EntityWrapper<WupinxinxiEntity> ew = new EntityWrapper<WupinxinxiEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicknum");
params.put("order", "desc");
PageUtils page = wupinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wupinxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 协同算法(按收藏推荐)
*/
@RequestMapping("/autoSort2")
public R autoSort2(@RequestParam Map<String, Object> params,WupinxinxiEntity wupinxinxi, HttpServletRequest request){
String userId = request.getSession().getAttribute("userId").toString();
String inteltypeColumn = "wupinleibie";
List<StoreupEntity> storeups = storeupService.selectList(new EntityWrapper<StoreupEntity>().eq("type", 1).eq("userid", userId).eq("tablename", "wupinxinxi").orderBy("addtime", false));
List<String> inteltypes = new ArrayList<String>();
Integer limit = params.get("limit")==null?10:Integer.parseInt(params.get("limit").toString());
List<WupinxinxiEntity> wupinxinxiList = new ArrayList<WupinxinxiEntity>();
//去重
if(storeups!=null && storeups.size()>0) {
for(StoreupEntity s : storeups) {
wupinxinxiList.ad
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
物品租赁系统代码 java物品租赁系统代码 基于springboot的物品租赁系统代码 1、物品租赁系统的技术栈、环境、工具、软件: ① 系统环境:Windows/Mac ② 开发语言:Java ③ 框架:SpringBoot ④ 架构:B/S、MVC ⑤ 开发环境:IDEA、JDK、Maven、Mysql ⑥ JDK版本:JDK1.8 ⑦ Maven包:Maven3.6 ⑧ 数据库:mysql 5.7 ⑨ 服务平台:Tomcat 8.0/9.0 ⑩ 数据库工具:SQLyog/Navicat ⑪ 开发软件:eclipse/myeclipse/idea ⑫ 浏览器:谷歌浏览器/微软edge/火狐 ⑬ 技术栈:Java、Mysql、Maven、Springboot、Mybatis、Ajax、Vue等 2、适用人群:计算机,电子信息工程等专业的学习者等, 高分毕业设计项目,也可作为课程设计和期末大作业。本资源仅是代码的压缩包,该代码适合毕业设计、课程设计作业,所有源码均经过严格测试,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! 3、解压说明:本资源需要电脑
资源推荐
资源详情
资源评论
收起资源包目录
基于springboot的物品租赁系统代码
(681个子文件)
update-password.vue.bak 3KB
main.js.bak 2KB
IndexMain.vue.bak 2KB
IndexAsideStatic.vue.bak 2KB
BreadCrumbs.vue.bak 2KB
IndexHeader.vue.bak 2KB
3-build.bat 15B
2-run.bat 14B
build.bat 14B
run.bat 14B
1-install.bat 12B
install.bat 12B
.classpath 2KB
mvnw.cmd 7KB
app.a8384770.css 365KB
chunk-vendors.f1cfb6f8.css 242KB
app.a97be9b0.css 167KB
chunk-vendors.a72b0961.css 37KB
swiper.min.css 13KB
swiper.min.css 13KB
iconfont.css 622B
canvas-bg-1.css 391B
canvas-bg-1.css 391B
canvas-bg-2.css 83B
canvas-bg-2.css 83B
canvas-bg-4.css 61B
canvas-bg-5.css 61B
canvas-bg-3.css 61B
canvas-bg-3.css 61B
必读推荐.docx 15KB
.factorypath 15KB
.gitignore 364B
index.html 1KB
index.html 1001B
index.html 827B
index.html 635B
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
maven-wrapper.jar 50KB
WupinxinxiController.java 16KB
YonghuController.java 13KB
WupinchuzuController.java 12KB
WupinzulinController.java 11KB
CommonController.java 8KB
WupinguihaiEntity.java 8KB
BaiduUtil.java 8KB
WupinguihaiModel.java 7KB
WupinguihaiVO.java 7KB
WupinzulinEntity.java 7KB
WupinxinxiEntity.java 7KB
HadoopTemplate.java 6KB
PingjiaxinxiController.java 6KB
PingjiaxinxiEntity.java 6KB
WupinguihaiController.java 6KB
DiscusswupinxinxiController.java 6KB
WupinzulinModel.java 6KB
WupinzulinVO.java 5KB
CommonUtil.java 5KB
GonggaoleixingController.java 5KB
WupinxinxiModel.java 5KB
ZulinxinxiController.java 5KB
GonggaoxinxiController.java 5KB
WupinxinxiVO.java 5KB
SystemintroController.java 5KB
WupinleibieController.java 5KB
StoreupController.java 5KB
UsersController.java 5KB
MPUtil.java 5KB
AboutusController.java 5KB
MavenWrapperDownloader.java 5KB
WupinchuzuEntity.java 5KB
NewsController.java 5KB
PingjiaxinxiModel.java 5KB
PingjiaxinxiVO.java 4KB
ZulinxinxiEntity.java 4KB
FileController.java 4KB
StoreupEntity.java 4KB
WupinchuzuModel.java 4KB
YonghuEntity.java 4KB
WupinchuzuVO.java 4KB
GonggaoxinxiEntity.java 3KB
AuthorizationInterceptor.java 3KB
DiscusswupinxinxiEntity.java 3KB
SystemintroEntity.java 3KB
AboutusEntity.java 3KB
ConfigController.java 3KB
ZulinxinxiModel.java 3KB
ZulinxinxiVO.java 3KB
NewsEntity.java 3KB
StoreupModel.java 3KB
Query.java 3KB
StoreupVO.java 3KB
WupinchuzuServiceImpl.java 2KB
WupinxinxiServiceImpl.java 2KB
WupinzulinServiceImpl.java 2KB
YonghuModel.java 2KB
TokenServiceImpl.java 2KB
YonghuServiceImpl.java 2KB
共 681 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
十五喵
- 粉丝: 3945
- 资源: 2545
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Anaconda3-2024.02-1-Windows-x86-64.exe
- stm32cubemx can通信 一个板子负责传感器采集 一个板子负责wifi传递到网页 网页可控制传感器板子.zip
- k8s集群搭建1.27.1版本(来源于图灵k8s笔记)
- 树莓派连接 DS18B20 温度传感器读取温度时监控客户端,服务器端连接状况,实现断线重连机制
- 小游戏-坦克大战,你认为的小游戏
- 最好用的富文本编辑器wangeditor
- jQuery 3.7.1
- 校园失物招领小程序源码可作毕业设计
- SAP客户端GUI740安装包(JAVA版本)
- winlibs-x86-64-posix-seh-gcc-13.2.0-llvm-16.0.6-mingw-w64msvcrt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功