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.JingdianxinxiEntity;
import com.entity.view.JingdianxinxiView;
import com.service.JingdianxinxiService;
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-03-09 18:31:55
*/
@RestController
@RequestMapping("/jingdianxinxi")
public class JingdianxinxiController {
@Autowired
private JingdianxinxiService jingdianxinxiService;
@Autowired
private StoreupService storeupService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,JingdianxinxiEntity jingdianxinxi,
HttpServletRequest request){
EntityWrapper<JingdianxinxiEntity> ew = new EntityWrapper<JingdianxinxiEntity>();
PageUtils page = jingdianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jingdianxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,JingdianxinxiEntity jingdianxinxi,
HttpServletRequest request){
EntityWrapper<JingdianxinxiEntity> ew = new EntityWrapper<JingdianxinxiEntity>();
PageUtils page = jingdianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jingdianxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( JingdianxinxiEntity jingdianxinxi){
EntityWrapper<JingdianxinxiEntity> ew = new EntityWrapper<JingdianxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( jingdianxinxi, "jingdianxinxi"));
return R.ok().put("data", jingdianxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(JingdianxinxiEntity jingdianxinxi){
EntityWrapper< JingdianxinxiEntity> ew = new EntityWrapper< JingdianxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( jingdianxinxi, "jingdianxinxi"));
JingdianxinxiView jingdianxinxiView = jingdianxinxiService.selectView(ew);
return R.ok("查询景点信息成功").put("data", jingdianxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
JingdianxinxiEntity jingdianxinxi = jingdianxinxiService.selectById(id);
jingdianxinxi.setClicknum(jingdianxinxi.getClicknum()+1);
jingdianxinxi.setClicktime(new Date());
jingdianxinxiService.updateById(jingdianxinxi);
return R.ok().put("data", jingdianxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
JingdianxinxiEntity jingdianxinxi = jingdianxinxiService.selectById(id);
jingdianxinxi.setClicknum(jingdianxinxi.getClicknum()+1);
jingdianxinxi.setClicktime(new Date());
jingdianxinxiService.updateById(jingdianxinxi);
return R.ok().put("data", jingdianxinxi);
}
/**
* 赞或踩
*/
@RequestMapping("/thumbsup/{id}")
public R vote(@PathVariable("id") String id,String type){
JingdianxinxiEntity jingdianxinxi = jingdianxinxiService.selectById(id);
if(type.equals("1")) {
jingdianxinxi.setThumbsupnum(jingdianxinxi.getThumbsupnum()+1);
} else {
jingdianxinxi.setCrazilynum(jingdianxinxi.getCrazilynum()+1);
}
jingdianxinxiService.updateById(jingdianxinxi);
return R.ok("投票成功");
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody JingdianxinxiEntity jingdianxinxi, HttpServletRequest request){
jingdianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jingdianxinxi);
jingdianxinxiService.insert(jingdianxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody JingdianxinxiEntity jingdianxinxi, HttpServletRequest request){
jingdianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jingdianxinxi);
jingdianxinxiService.insert(jingdianxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody JingdianxinxiEntity jingdianxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(jingdianxinxi);
jingdianxinxiService.updateById(jingdianxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
jingdianxinxiService.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<JingdianxinxiEntity> wrapper = new EntityWrapper<JingdianxinxiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = jingdianxinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,JingdianxinxiEntity jingdianxinxi, HttpServletRequest request,String pre){
EntityWrapper<JingdianxinxiEntity> ew = new EntityWrapper<JingdianxinxiEntity>();
Map<Str
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
基于Vue的导游系统.js+SpringBoot+MySQL开发,高分成品毕业设计,附带往 (725个子文件)
update-password.vue.bak 3KB
main.js.bak 2KB
IndexMain.vue.bak 2KB
IndexAsideStatic.vue.bak 2KB
BreadCrumbs.vue.bak 2KB
IndexHeader.vue.bak 1KB
3-build.bat 15B
2-run.bat 14B
build.bat 14B
run.bat 14B
1-install.bat 12B
install.bat 12B
mvnw.cmd 6KB
app.3902f7fc.css 384KB
chunk-vendors.717566f5.css 242KB
app.1f137bc3.css 184KB
chunk-vendors.0fdd4e14.css 37KB
swiper.min.css 13KB
swiper.min.css 13KB
iconfont.css 599B
canvas-bg-1.css 379B
canvas-bg-1.css 379B
canvas-bg-2.css 79B
canvas-bg-2.css 79B
canvas-bg-4.css 57B
canvas-bg-5.css 57B
canvas-bg-3.css 57B
canvas-bg-3.css 57B
springboot655ms数据库文档.doc 1.77MB
springboot基于springboot的旅游出行指南.docx 4.38MB
.gitignore 333B
index.html 1KB
index.html 987B
index.html 811B
index.html 621B
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
maven-wrapper.jar 50KB
JingdianxinxiController.java 9KB
JiudianxinxiController.java 9KB
CantingxinxiController.java 9KB
YonghuController.java 8KB
CommonController.java 7KB
LvxingrijiController.java 7KB
BaiduUtil.java 7KB
DiscussjiaotongluxianController.java 7KB
DiscussjingdianxinxiController.java 7KB
DiscusscantingxinxiController.java 7KB
DiscussjiudianxinxiController.java 7KB
JiudianyudingController.java 7KB
MenpiaoyudingController.java 7KB
CantingyudingController.java 7KB
DiscusslvxingrijiController.java 7KB
LvyouguihuaController.java 7KB
JiaotongluxianController.java 7KB
StoreupController.java 7KB
TianqiyubaoController.java 7KB
NewsController.java 6KB
JiudianxinxiEntity.java 5KB
UsersController.java 5KB
MPUtil.java 5KB
JingdianxinxiEntity.java 5KB
MavenWrapperDownloader.java 5KB
JiudianyudingEntity.java 5KB
CantingxinxiEntity.java 5KB
MenpiaoyudingEntity.java 4KB
TianqiyubaoEntity.java 4KB
CantingyudingEntity.java 4KB
FileController.java 4KB
LvxingrijiEntity.java 4KB
CommonUtil.java 4KB
JiudianxinxiModel.java 4KB
JiudianxinxiVO.java 4KB
JingdianxinxiModel.java 4KB
JiaotongluxianEntity.java 4KB
StoreupEntity.java 4KB
LvyouguihuaEntity.java 4KB
JingdianxinxiVO.java 4KB
JiudianyudingModel.java 3KB
JiudianyudingVO.java 3KB
AuthorizationInterceptor.java 3KB
CantingxinxiModel.java 3KB
YonghuEntity.java 3KB
CantingxinxiVO.java 3KB
MenpiaoyudingModel.java 3KB
DiscussjiaotongluxianEntity.java 3KB
DiscussjingdianxinxiEntity.java 3KB
DiscussjiudianxinxiEntity.java 3KB
DiscusscantingxinxiEntity.java 3KB
DiscusslvxingrijiEntity.java 3KB
ConfigController.java 3KB
TianqiyubaoModel.java 3KB
MenpiaoyudingVO.java 3KB
TianqiyubaoVO.java 3KB
CantingyudingModel.java 3KB
LvxingrijiModel.java 3KB
CantingyudingVO.java 3KB
LvxingrijiVO.java 3KB
共 725 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
普通网友
- 粉丝: 1127
- 资源: 5292
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Selenium页面爬取某东商品价格监控:自定义商品价格,降价邮件微信提醒资料齐全+详细文档+源码.zip
- 基于selenium爬取通过搜索关键词采用指定页数的商品信息资料齐全+详细文档+源码.zip
- 基于今日头条自动发文机器人,各大公众平台采集爬虫资料齐全+详细文档+源码.zip
- 基于集众多数据源于一身的爬虫工具箱,旨在安全快捷的帮助用户拿回自己的数据,工具代码开源,流程透明、资料齐全+详细文档+源码.zip
- 基于拼多多爬虫,爬取所有商品、评论等信息资料齐全+详细文档+源码.zip
- 基于爬虫从入门到入狱资料齐全+详细文档+源码.zip
- 基于爬虫学习仓库,适合零基础的人学习,对新手比较友好资料齐全+详细文档+源码.zip
- 基于天眼查爬虫资料齐全+详细文档+源码.zip
- 基于千万级图片爬虫、视频爬虫资料齐全+详细文档+源码.zip
- 基于支付宝账单爬虫资料齐全+详细文档+源码.zip
- 基于SpringBoot+Vue3实现的在线考试系统(三)代码
- 数组-.docx cccccccccccccccccccccc
- Ruby技巧中文最新版本
- Ruby袖珍参考手册pdf英文文字版最新版本
- 融合导航项目全套技术资料100%好用.zip
- 四足机器人技术进展与应用场景
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功