Compare commits
No commits in common. 'xiewei' and 'main' have entirely different histories.
@ -1,15 +0,0 @@
|
||||
package com.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 登录用户信息
|
||||
*/
|
||||
@Target(ElementType.PARAMETER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface APPLoginUser {
|
||||
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
package com.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 忽略Token验证
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface IgnoreAuth {
|
||||
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
package com.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 登录用户信息
|
||||
*/
|
||||
@Target(ElementType.PARAMETER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface LoginUser {
|
||||
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
|
||||
package com.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
|
||||
import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
|
||||
|
||||
/**
|
||||
* mybatis-plus配置
|
||||
*/
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
* 分页插件
|
||||
*/
|
||||
@Bean
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
return new PaginationInterceptor();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,216 +0,0 @@
|
||||
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.CaipindingdanEntity;
|
||||
import com.entity.view.CaipindingdanView;
|
||||
|
||||
import com.service.CaipindingdanService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品订单
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/caipindingdan")
|
||||
public class CaipindingdanController {
|
||||
@Autowired
|
||||
private CaipindingdanService caipindingdanService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,CaipindingdanEntity caipindingdan,
|
||||
HttpServletRequest request){
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("yonghu")) {
|
||||
caipindingdan.setYonghuming((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
if(tableName.equals("shangjia")) {
|
||||
caipindingdan.setShangjia((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
EntityWrapper<CaipindingdanEntity> ew = new EntityWrapper<CaipindingdanEntity>();
|
||||
PageUtils page = caipindingdanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipindingdan), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,CaipindingdanEntity caipindingdan, HttpServletRequest request){
|
||||
EntityWrapper<CaipindingdanEntity> ew = new EntityWrapper<CaipindingdanEntity>();
|
||||
PageUtils page = caipindingdanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipindingdan), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( CaipindingdanEntity caipindingdan){
|
||||
EntityWrapper<CaipindingdanEntity> ew = new EntityWrapper<CaipindingdanEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( caipindingdan, "caipindingdan"));
|
||||
return R.ok().put("data", caipindingdanService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(CaipindingdanEntity caipindingdan){
|
||||
EntityWrapper< CaipindingdanEntity> ew = new EntityWrapper< CaipindingdanEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( caipindingdan, "caipindingdan"));
|
||||
CaipindingdanView caipindingdanView = caipindingdanService.selectView(ew);
|
||||
return R.ok("查询菜品订单成功").put("data", caipindingdanView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
CaipindingdanEntity caipindingdan = caipindingdanService.selectById(id);
|
||||
return R.ok().put("data", caipindingdan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
CaipindingdanEntity caipindingdan = caipindingdanService.selectById(id);
|
||||
return R.ok().put("data", caipindingdan);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody CaipindingdanEntity caipindingdan, HttpServletRequest request){
|
||||
caipindingdan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(caipindingdan);
|
||||
caipindingdanService.insert(caipindingdan);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody CaipindingdanEntity caipindingdan, HttpServletRequest request){
|
||||
caipindingdan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(caipindingdan);
|
||||
caipindingdanService.insert(caipindingdan);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody CaipindingdanEntity caipindingdan, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(caipindingdan);
|
||||
caipindingdanService.updateById(caipindingdan);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
caipindingdanService.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<CaipindingdanEntity> wrapper = new EntityWrapper<CaipindingdanEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("yonghu")) {
|
||||
wrapper.eq("yonghuming", (String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
|
||||
int count = caipindingdanService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,221 +0,0 @@
|
||||
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.CaipinfenleiEntity;
|
||||
import com.entity.view.CaipinfenleiView;
|
||||
|
||||
import com.service.CaipinfenleiService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品分类
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/caipinfenlei")
|
||||
public class CaipinfenleiController {
|
||||
@Autowired
|
||||
private CaipinfenleiService caipinfenleiService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,CaipinfenleiEntity caipinfenlei,
|
||||
HttpServletRequest request){
|
||||
EntityWrapper<CaipinfenleiEntity> ew = new EntityWrapper<CaipinfenleiEntity>();
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("shangjia")) {
|
||||
caipinfenlei.setShangjia((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
PageUtils page = caipinfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinfenlei), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
|
||||
EntityWrapper<CaipinfenleiEntity> ew = new EntityWrapper<CaipinfenleiEntity>();
|
||||
PageUtils page = caipinfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinfenlei), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( CaipinfenleiEntity caipinfenlei){
|
||||
EntityWrapper<CaipinfenleiEntity> ew = new EntityWrapper<CaipinfenleiEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( caipinfenlei, "caipinfenlei"));
|
||||
return R.ok().put("data", caipinfenleiService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(CaipinfenleiEntity caipinfenlei){
|
||||
EntityWrapper< CaipinfenleiEntity> ew = new EntityWrapper< CaipinfenleiEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( caipinfenlei, "caipinfenlei"));
|
||||
CaipinfenleiView caipinfenleiView = caipinfenleiService.selectView(ew);
|
||||
return R.ok("查询菜品分类成功").put("data", caipinfenleiView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
CaipinfenleiEntity caipinfenlei = caipinfenleiService.selectById(id);
|
||||
return R.ok().put("data", caipinfenlei);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
CaipinfenleiEntity caipinfenlei = caipinfenleiService.selectById(id);
|
||||
return R.ok().put("data", caipinfenlei);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
|
||||
caipinfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("shangjia")) {
|
||||
caipinfenlei.setShangjia((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
//ValidatorUtils.validateEntity(caipinfenlei);
|
||||
caipinfenleiService.insert(caipinfenlei);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
|
||||
caipinfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(caipinfenlei);
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("shangjia")) {
|
||||
caipinfenlei.setShangjia((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
caipinfenleiService.insert(caipinfenlei);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(caipinfenlei);
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("shangjia")) {
|
||||
caipinfenlei.setShangjia((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
caipinfenleiService.updateById(caipinfenlei);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
caipinfenleiService.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<CaipinfenleiEntity> wrapper = new EntityWrapper<CaipinfenleiEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
|
||||
|
||||
int count = caipinfenleiService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,216 +0,0 @@
|
||||
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.CaipinpingjiaEntity;
|
||||
import com.entity.view.CaipinpingjiaView;
|
||||
|
||||
import com.service.CaipinpingjiaService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品评价
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/caipinpingjia")
|
||||
public class CaipinpingjiaController {
|
||||
@Autowired
|
||||
private CaipinpingjiaService caipinpingjiaService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,CaipinpingjiaEntity caipinpingjia,
|
||||
HttpServletRequest request){
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("yonghu")) {
|
||||
caipinpingjia.setYonghuming((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
if(tableName.equals("shangjia")) {
|
||||
caipinpingjia.setShangjia((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
EntityWrapper<CaipinpingjiaEntity> ew = new EntityWrapper<CaipinpingjiaEntity>();
|
||||
PageUtils page = caipinpingjiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinpingjia), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){
|
||||
EntityWrapper<CaipinpingjiaEntity> ew = new EntityWrapper<CaipinpingjiaEntity>();
|
||||
PageUtils page = caipinpingjiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinpingjia), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( CaipinpingjiaEntity caipinpingjia){
|
||||
EntityWrapper<CaipinpingjiaEntity> ew = new EntityWrapper<CaipinpingjiaEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( caipinpingjia, "caipinpingjia"));
|
||||
return R.ok().put("data", caipinpingjiaService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(CaipinpingjiaEntity caipinpingjia){
|
||||
EntityWrapper< CaipinpingjiaEntity> ew = new EntityWrapper< CaipinpingjiaEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( caipinpingjia, "caipinpingjia"));
|
||||
CaipinpingjiaView caipinpingjiaView = caipinpingjiaService.selectView(ew);
|
||||
return R.ok("查询菜品评价成功").put("data", caipinpingjiaView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
CaipinpingjiaEntity caipinpingjia = caipinpingjiaService.selectById(id);
|
||||
return R.ok().put("data", caipinpingjia);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
CaipinpingjiaEntity caipinpingjia = caipinpingjiaService.selectById(id);
|
||||
return R.ok().put("data", caipinpingjia);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){
|
||||
caipinpingjia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(caipinpingjia);
|
||||
caipinpingjiaService.insert(caipinpingjia);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){
|
||||
caipinpingjia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(caipinpingjia);
|
||||
caipinpingjiaService.insert(caipinpingjia);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(caipinpingjia);
|
||||
caipinpingjiaService.updateById(caipinpingjia);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
caipinpingjiaService.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<CaipinpingjiaEntity> wrapper = new EntityWrapper<CaipinpingjiaEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("yonghu")) {
|
||||
wrapper.eq("yonghuming", (String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
|
||||
int count = caipinpingjiaService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,256 +0,0 @@
|
||||
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.CaipinxinxiEntity;
|
||||
import com.entity.view.CaipinxinxiView;
|
||||
|
||||
import com.service.CaipinxinxiService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品信息
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/caipinxinxi")
|
||||
public class CaipinxinxiController {
|
||||
@Autowired
|
||||
private CaipinxinxiService caipinxinxiService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,CaipinxinxiEntity caipinxinxi,
|
||||
HttpServletRequest request){
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("shangjia")) {
|
||||
caipinxinxi.setShangjia((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
EntityWrapper<CaipinxinxiEntity> ew = new EntityWrapper<CaipinxinxiEntity>();
|
||||
PageUtils page = caipinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinxinxi), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,CaipinxinxiEntity caipinxinxi, HttpServletRequest request){
|
||||
EntityWrapper<CaipinxinxiEntity> ew = new EntityWrapper<CaipinxinxiEntity>();
|
||||
PageUtils page = caipinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinxinxi), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( CaipinxinxiEntity caipinxinxi){
|
||||
EntityWrapper<CaipinxinxiEntity> ew = new EntityWrapper<CaipinxinxiEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( caipinxinxi, "caipinxinxi"));
|
||||
return R.ok().put("data", caipinxinxiService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(CaipinxinxiEntity caipinxinxi){
|
||||
EntityWrapper< CaipinxinxiEntity> ew = new EntityWrapper< CaipinxinxiEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( caipinxinxi, "caipinxinxi"));
|
||||
CaipinxinxiView caipinxinxiView = caipinxinxiService.selectView(ew);
|
||||
return R.ok("查询菜品信息成功").put("data", caipinxinxiView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
CaipinxinxiEntity caipinxinxi = caipinxinxiService.selectById(id);
|
||||
caipinxinxi.setClicknum(caipinxinxi.getClicknum()+1);
|
||||
caipinxinxi.setClicktime(new Date());
|
||||
caipinxinxiService.updateById(caipinxinxi);
|
||||
return R.ok().put("data", caipinxinxi);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
CaipinxinxiEntity caipinxinxi = caipinxinxiService.selectById(id);
|
||||
caipinxinxi.setClicknum(caipinxinxi.getClicknum()+1);
|
||||
caipinxinxi.setClicktime(new Date());
|
||||
caipinxinxiService.updateById(caipinxinxi);
|
||||
return R.ok().put("data", caipinxinxi);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody CaipinxinxiEntity caipinxinxi, HttpServletRequest request){
|
||||
caipinxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("shangjia")) {
|
||||
caipinxinxi.setShangjia((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
//ValidatorUtils.validateEntity(caipinxinxi);
|
||||
caipinxinxiService.insert(caipinxinxi);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody CaipinxinxiEntity caipinxinxi, HttpServletRequest request){
|
||||
caipinxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(caipinxinxi);
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("shangjia")) {
|
||||
caipinxinxi.setShangjia((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
caipinxinxiService.insert(caipinxinxi);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody CaipinxinxiEntity caipinxinxi, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(caipinxinxi);
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("shangjia")) {
|
||||
caipinxinxi.setShangjia((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
caipinxinxiService.updateById(caipinxinxi);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
caipinxinxiService.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<CaipinxinxiEntity> wrapper = new EntityWrapper<CaipinxinxiEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
|
||||
|
||||
int count = caipinxinxiService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端智能排序
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/autoSort")
|
||||
public R autoSort(@RequestParam Map<String, Object> params,CaipinxinxiEntity caipinxinxi, HttpServletRequest request,String pre){
|
||||
EntityWrapper<CaipinxinxiEntity> ew = new EntityWrapper<CaipinxinxiEntity>();
|
||||
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 = caipinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinxinxi), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,213 +0,0 @@
|
||||
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.CanzhuoEntity;
|
||||
import com.entity.view.CanzhuoView;
|
||||
|
||||
import com.service.CanzhuoService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 餐桌
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/canzhuo")
|
||||
public class CanzhuoController {
|
||||
@Autowired
|
||||
private CanzhuoService canzhuoService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,CanzhuoEntity canzhuo,
|
||||
HttpServletRequest request){
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("shangjia")) {
|
||||
canzhuo.setShangjia((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
EntityWrapper<CanzhuoEntity> ew = new EntityWrapper<CanzhuoEntity>();
|
||||
PageUtils page = canzhuoService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, canzhuo), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,CanzhuoEntity canzhuo, HttpServletRequest request){
|
||||
EntityWrapper<CanzhuoEntity> ew = new EntityWrapper<CanzhuoEntity>();
|
||||
PageUtils page = canzhuoService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, canzhuo), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( CanzhuoEntity canzhuo){
|
||||
EntityWrapper<CanzhuoEntity> ew = new EntityWrapper<CanzhuoEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( canzhuo, "canzhuo"));
|
||||
return R.ok().put("data", canzhuoService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(CanzhuoEntity canzhuo){
|
||||
EntityWrapper< CanzhuoEntity> ew = new EntityWrapper< CanzhuoEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( canzhuo, "canzhuo"));
|
||||
CanzhuoView canzhuoView = canzhuoService.selectView(ew);
|
||||
return R.ok("查询餐桌成功").put("data", canzhuoView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
CanzhuoEntity canzhuo = canzhuoService.selectById(id);
|
||||
return R.ok().put("data", canzhuo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
CanzhuoEntity canzhuo = canzhuoService.selectById(id);
|
||||
return R.ok().put("data", canzhuo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody CanzhuoEntity canzhuo, HttpServletRequest request){
|
||||
canzhuo.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(canzhuo);
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("shangjia")) {
|
||||
canzhuo.setShangjia((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
canzhuoService.insert(canzhuo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody CanzhuoEntity canzhuo, HttpServletRequest request){
|
||||
canzhuo.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(canzhuo);
|
||||
canzhuoService.insert(canzhuo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody CanzhuoEntity canzhuo, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(canzhuo);
|
||||
canzhuoService.updateById(canzhuo);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
canzhuoService.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<CanzhuoEntity> wrapper = new EntityWrapper<CanzhuoEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
|
||||
|
||||
int count = canzhuoService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,111 +0,0 @@
|
||||
|
||||
package com.controller;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
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.annotation.IgnoreAuth;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.entity.ConfigEntity;
|
||||
import com.service.ConfigService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.ValidatorUtils;
|
||||
|
||||
/**
|
||||
* 登录相关
|
||||
*/
|
||||
@RequestMapping("config")
|
||||
@RestController
|
||||
public class ConfigController{
|
||||
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
|
||||
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
|
||||
PageUtils page = configService.queryPage(params);
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
|
||||
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
|
||||
PageUtils page = configService.queryPage(params);
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") String id){
|
||||
ConfigEntity config = configService.selectById(id);
|
||||
return R.ok().put("data", config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") String id){
|
||||
ConfigEntity config = configService.selectById(id);
|
||||
return R.ok().put("data", config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据name获取信息
|
||||
*/
|
||||
@RequestMapping("/info")
|
||||
public R infoByName(@RequestParam String name){
|
||||
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
|
||||
return R.ok().put("data", config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
public R save(@RequestBody ConfigEntity config){
|
||||
// ValidatorUtils.validateEntity(config);
|
||||
configService.insert(config);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody ConfigEntity config){
|
||||
// ValidatorUtils.validateEntity(config);
|
||||
configService.updateById(config);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
configService.deleteBatchIds(Arrays.asList(ids));
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@ -1,206 +0,0 @@
|
||||
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.DiscusscaipinxinxiEntity;
|
||||
import com.entity.view.DiscusscaipinxinxiView;
|
||||
|
||||
import com.service.DiscusscaipinxinxiService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品信息评论表
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:41
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/discusscaipinxinxi")
|
||||
public class DiscusscaipinxinxiController {
|
||||
@Autowired
|
||||
private DiscusscaipinxinxiService discusscaipinxinxiService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,DiscusscaipinxinxiEntity discusscaipinxinxi,
|
||||
HttpServletRequest request){
|
||||
EntityWrapper<DiscusscaipinxinxiEntity> ew = new EntityWrapper<DiscusscaipinxinxiEntity>();
|
||||
PageUtils page = discusscaipinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discusscaipinxinxi), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,DiscusscaipinxinxiEntity discusscaipinxinxi, HttpServletRequest request){
|
||||
EntityWrapper<DiscusscaipinxinxiEntity> ew = new EntityWrapper<DiscusscaipinxinxiEntity>();
|
||||
PageUtils page = discusscaipinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discusscaipinxinxi), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( DiscusscaipinxinxiEntity discusscaipinxinxi){
|
||||
EntityWrapper<DiscusscaipinxinxiEntity> ew = new EntityWrapper<DiscusscaipinxinxiEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( discusscaipinxinxi, "discusscaipinxinxi"));
|
||||
return R.ok().put("data", discusscaipinxinxiService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(DiscusscaipinxinxiEntity discusscaipinxinxi){
|
||||
EntityWrapper< DiscusscaipinxinxiEntity> ew = new EntityWrapper< DiscusscaipinxinxiEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( discusscaipinxinxi, "discusscaipinxinxi"));
|
||||
DiscusscaipinxinxiView discusscaipinxinxiView = discusscaipinxinxiService.selectView(ew);
|
||||
return R.ok("查询菜品信息评论表成功").put("data", discusscaipinxinxiView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
DiscusscaipinxinxiEntity discusscaipinxinxi = discusscaipinxinxiService.selectById(id);
|
||||
return R.ok().put("data", discusscaipinxinxi);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
DiscusscaipinxinxiEntity discusscaipinxinxi = discusscaipinxinxiService.selectById(id);
|
||||
return R.ok().put("data", discusscaipinxinxi);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody DiscusscaipinxinxiEntity discusscaipinxinxi, HttpServletRequest request){
|
||||
discusscaipinxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(discusscaipinxinxi);
|
||||
discusscaipinxinxiService.insert(discusscaipinxinxi);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody DiscusscaipinxinxiEntity discusscaipinxinxi, HttpServletRequest request){
|
||||
discusscaipinxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(discusscaipinxinxi);
|
||||
discusscaipinxinxiService.insert(discusscaipinxinxi);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody DiscusscaipinxinxiEntity discusscaipinxinxi, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(discusscaipinxinxi);
|
||||
discusscaipinxinxiService.updateById(discusscaipinxinxi);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
discusscaipinxinxiService.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<DiscusscaipinxinxiEntity> wrapper = new EntityWrapper<DiscusscaipinxinxiEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
|
||||
|
||||
int count = discusscaipinxinxiService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,111 +0,0 @@
|
||||
package com.controller;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
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 org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.annotation.IgnoreAuth;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.entity.ConfigEntity;
|
||||
import com.entity.EIException;
|
||||
import com.service.ConfigService;
|
||||
import com.utils.R;
|
||||
|
||||
/**
|
||||
* 上传文件映射表
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("file")
|
||||
@SuppressWarnings({"unchecked","rawtypes"})
|
||||
public class FileController{
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
/**
|
||||
* 上传文件
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/upload")
|
||||
public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
|
||||
if (file.isEmpty()) {
|
||||
throw new EIException("上传文件不能为空");
|
||||
}
|
||||
String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
|
||||
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
|
||||
if(!path.exists()) {
|
||||
path = new File("");
|
||||
}
|
||||
File upload = new File(path.getAbsolutePath(),"/upload/");
|
||||
if(!upload.exists()) {
|
||||
upload.mkdirs();
|
||||
}
|
||||
String fileName = new Date().getTime()+"."+fileExt;
|
||||
File dest = new File(upload.getAbsolutePath()+"/"+fileName);
|
||||
file.transferTo(dest);
|
||||
if(StringUtils.isNotBlank(type) && type.equals("1")) {
|
||||
ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
|
||||
if(configEntity==null) {
|
||||
configEntity = new ConfigEntity();
|
||||
configEntity.setName("faceFile");
|
||||
configEntity.setValue(fileName);
|
||||
} else {
|
||||
configEntity.setValue(fileName);
|
||||
}
|
||||
configService.insertOrUpdate(configEntity);
|
||||
}
|
||||
return R.ok().put("file", fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/download")
|
||||
public ResponseEntity<byte[]> download(@RequestParam String fileName) {
|
||||
try {
|
||||
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
|
||||
if(!path.exists()) {
|
||||
path = new File("");
|
||||
}
|
||||
File upload = new File(path.getAbsolutePath(),"/upload/");
|
||||
if(!upload.exists()) {
|
||||
upload.mkdirs();
|
||||
}
|
||||
File file = new File(upload.getAbsolutePath()+"/"+fileName);
|
||||
if(file.exists()){
|
||||
/*if(!fileService.canRead(file, SessionManager.getSessionUser())){
|
||||
getResponse().sendError(403);
|
||||
}*/
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
headers.setContentDispositionFormData("attachment", fileName);
|
||||
return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,207 +0,0 @@
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品资讯
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:41
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/news")
|
||||
public class NewsController {
|
||||
@Autowired
|
||||
private 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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,216 +0,0 @@
|
||||
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.StoreupEntity;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
import com.service.StoreupService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 收藏表
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:41
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/storeup")
|
||||
public class StoreupController {
|
||||
@Autowired
|
||||
private StoreupService storeupService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,StoreupEntity storeup,
|
||||
HttpServletRequest request){
|
||||
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
|
||||
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
|
||||
}
|
||||
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
|
||||
PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,StoreupEntity storeup, HttpServletRequest request){
|
||||
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
|
||||
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
|
||||
}
|
||||
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
|
||||
PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( StoreupEntity storeup){
|
||||
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( storeup, "storeup"));
|
||||
return R.ok().put("data", storeupService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(StoreupEntity storeup){
|
||||
EntityWrapper< StoreupEntity> ew = new EntityWrapper< StoreupEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( storeup, "storeup"));
|
||||
StoreupView storeupView = storeupService.selectView(ew);
|
||||
return R.ok("查询收藏表成功").put("data", storeupView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
StoreupEntity storeup = storeupService.selectById(id);
|
||||
return R.ok().put("data", storeup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
StoreupEntity storeup = storeupService.selectById(id);
|
||||
return R.ok().put("data", storeup);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody StoreupEntity storeup, HttpServletRequest request){
|
||||
storeup.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(storeup);
|
||||
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
|
||||
storeupService.insert(storeup);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody StoreupEntity storeup, HttpServletRequest request){
|
||||
storeup.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(storeup);
|
||||
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
|
||||
storeupService.insert(storeup);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody StoreupEntity storeup, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(storeup);
|
||||
storeupService.updateById(storeup);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
storeupService.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<StoreupEntity> wrapper = new EntityWrapper<StoreupEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
|
||||
wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));
|
||||
}
|
||||
|
||||
|
||||
int count = storeupService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.CaipindingdanEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.CaipindingdanVO;
|
||||
import com.entity.view.CaipindingdanView;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品订单
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
public interface CaipindingdanDao extends BaseMapper<CaipindingdanEntity> {
|
||||
|
||||
List<CaipindingdanVO> selectListVO(@Param("ew") Wrapper<CaipindingdanEntity> wrapper);
|
||||
|
||||
CaipindingdanVO selectVO(@Param("ew") Wrapper<CaipindingdanEntity> wrapper);
|
||||
|
||||
List<CaipindingdanView> selectListView(@Param("ew") Wrapper<CaipindingdanEntity> wrapper);
|
||||
|
||||
List<CaipindingdanView> selectListView(Pagination page,@Param("ew") Wrapper<CaipindingdanEntity> wrapper);
|
||||
|
||||
CaipindingdanView selectView(@Param("ew") Wrapper<CaipindingdanEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.CaipinfenleiEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.CaipinfenleiVO;
|
||||
import com.entity.view.CaipinfenleiView;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品分类
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
public interface CaipinfenleiDao extends BaseMapper<CaipinfenleiEntity> {
|
||||
|
||||
List<CaipinfenleiVO> selectListVO(@Param("ew") Wrapper<CaipinfenleiEntity> wrapper);
|
||||
|
||||
CaipinfenleiVO selectVO(@Param("ew") Wrapper<CaipinfenleiEntity> wrapper);
|
||||
|
||||
List<CaipinfenleiView> selectListView(@Param("ew") Wrapper<CaipinfenleiEntity> wrapper);
|
||||
|
||||
List<CaipinfenleiView> selectListView(Pagination page,@Param("ew") Wrapper<CaipinfenleiEntity> wrapper);
|
||||
|
||||
CaipinfenleiView selectView(@Param("ew") Wrapper<CaipinfenleiEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.CaipinpingjiaEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.CaipinpingjiaVO;
|
||||
import com.entity.view.CaipinpingjiaView;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品评价
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
public interface CaipinpingjiaDao extends BaseMapper<CaipinpingjiaEntity> {
|
||||
|
||||
List<CaipinpingjiaVO> selectListVO(@Param("ew") Wrapper<CaipinpingjiaEntity> wrapper);
|
||||
|
||||
CaipinpingjiaVO selectVO(@Param("ew") Wrapper<CaipinpingjiaEntity> wrapper);
|
||||
|
||||
List<CaipinpingjiaView> selectListView(@Param("ew") Wrapper<CaipinpingjiaEntity> wrapper);
|
||||
|
||||
List<CaipinpingjiaView> selectListView(Pagination page,@Param("ew") Wrapper<CaipinpingjiaEntity> wrapper);
|
||||
|
||||
CaipinpingjiaView selectView(@Param("ew") Wrapper<CaipinpingjiaEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.CaipinxinxiEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.CaipinxinxiVO;
|
||||
import com.entity.view.CaipinxinxiView;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品信息
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
public interface CaipinxinxiDao extends BaseMapper<CaipinxinxiEntity> {
|
||||
|
||||
List<CaipinxinxiVO> selectListVO(@Param("ew") Wrapper<CaipinxinxiEntity> wrapper);
|
||||
|
||||
CaipinxinxiVO selectVO(@Param("ew") Wrapper<CaipinxinxiEntity> wrapper);
|
||||
|
||||
List<CaipinxinxiView> selectListView(@Param("ew") Wrapper<CaipinxinxiEntity> wrapper);
|
||||
|
||||
List<CaipinxinxiView> selectListView(Pagination page,@Param("ew") Wrapper<CaipinxinxiEntity> wrapper);
|
||||
|
||||
CaipinxinxiView selectView(@Param("ew") Wrapper<CaipinxinxiEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.CanzhuoEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.CanzhuoVO;
|
||||
import com.entity.view.CanzhuoView;
|
||||
|
||||
|
||||
/**
|
||||
* 餐桌
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
public interface CanzhuoDao extends BaseMapper<CanzhuoEntity> {
|
||||
|
||||
List<CanzhuoVO> selectListVO(@Param("ew") Wrapper<CanzhuoEntity> wrapper);
|
||||
|
||||
CanzhuoVO selectVO(@Param("ew") Wrapper<CanzhuoEntity> wrapper);
|
||||
|
||||
List<CanzhuoView> selectListView(@Param("ew") Wrapper<CanzhuoEntity> wrapper);
|
||||
|
||||
List<CanzhuoView> selectListView(Pagination page,@Param("ew") Wrapper<CanzhuoEntity> wrapper);
|
||||
|
||||
CanzhuoView selectView(@Param("ew") Wrapper<CanzhuoEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
|
||||
package com.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 通用接口
|
||||
*/
|
||||
public interface CommonDao{
|
||||
List<String> getOption(Map<String, Object> params);
|
||||
|
||||
List<String> getzhuohaoOption(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> getFollowByOption(Map<String, Object> params);
|
||||
|
||||
List<String> getFollowByOption2(Map<String, Object> params);
|
||||
|
||||
void sh(Map<String, Object> params);
|
||||
|
||||
int remindCount(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> selectCal(Map<String, Object> params);
|
||||
|
||||
List<Map<String, Object>> selectGroup(Map<String, Object> params);
|
||||
|
||||
List<Map<String, Object>> selectValue(Map<String, Object> params);
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
|
||||
package com.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.entity.ConfigEntity;
|
||||
|
||||
/**
|
||||
* 配置
|
||||
*/
|
||||
public interface ConfigDao extends BaseMapper<ConfigEntity> {
|
||||
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.DiscusscaipinxinxiEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.DiscusscaipinxinxiVO;
|
||||
import com.entity.view.DiscusscaipinxinxiView;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品信息评论表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:41
|
||||
*/
|
||||
public interface DiscusscaipinxinxiDao extends BaseMapper<DiscusscaipinxinxiEntity> {
|
||||
|
||||
List<DiscusscaipinxinxiVO> selectListVO(@Param("ew") Wrapper<DiscusscaipinxinxiEntity> wrapper);
|
||||
|
||||
DiscusscaipinxinxiVO selectVO(@Param("ew") Wrapper<DiscusscaipinxinxiEntity> wrapper);
|
||||
|
||||
List<DiscusscaipinxinxiView> selectListView(@Param("ew") Wrapper<DiscusscaipinxinxiEntity> wrapper);
|
||||
|
||||
List<DiscusscaipinxinxiView> selectListView(Pagination page,@Param("ew") Wrapper<DiscusscaipinxinxiEntity> wrapper);
|
||||
|
||||
DiscusscaipinxinxiView selectView(@Param("ew") Wrapper<DiscusscaipinxinxiEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.NewsEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.NewsVO;
|
||||
import com.entity.view.NewsView;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品资讯
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:41
|
||||
*/
|
||||
public interface NewsDao extends BaseMapper<NewsEntity> {
|
||||
|
||||
List<NewsVO> selectListVO(@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
NewsVO selectVO(@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
List<NewsView> selectListView(@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
List<NewsView> selectListView(Pagination page,@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
NewsView selectView(@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
|
||||
package com.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
import com.entity.ShangjiaEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
public interface ShangjiaDao extends BaseMapper<ShangjiaEntity> {
|
||||
|
||||
List<ShangjiaEntity> selectListView(@Param("ew") Wrapper<ShangjiaEntity> wrapper);
|
||||
|
||||
List<ShangjiaEntity> selectListView(Pagination page,@Param("ew") Wrapper<ShangjiaEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.StoreupEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.StoreupVO;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
|
||||
/**
|
||||
* 收藏表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:41
|
||||
*/
|
||||
public interface StoreupDao extends BaseMapper<StoreupEntity> {
|
||||
|
||||
List<StoreupVO> selectListVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
List<StoreupView> selectListView(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
List<StoreupView> selectListView(Pagination page,@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
|
||||
package com.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
import com.entity.TokenEntity;
|
||||
|
||||
/**
|
||||
* token
|
||||
*/
|
||||
public interface TokenDao extends BaseMapper<TokenEntity> {
|
||||
|
||||
List<TokenEntity> selectListView(@Param("ew") Wrapper<TokenEntity> wrapper);
|
||||
|
||||
List<TokenEntity> selectListView(Pagination page,@Param("ew") Wrapper<TokenEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
|
||||
package com.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
import com.entity.UserEntity;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
public interface UserDao extends BaseMapper<UserEntity> {
|
||||
|
||||
List<UserEntity> selectListView(@Param("ew") Wrapper<UserEntity> wrapper);
|
||||
|
||||
List<UserEntity> selectListView(Pagination page,@Param("ew") Wrapper<UserEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.YonghuEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.YonghuVO;
|
||||
import com.entity.view.YonghuView;
|
||||
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
public interface YonghuDao extends BaseMapper<YonghuEntity> {
|
||||
|
||||
List<YonghuVO> selectListVO(@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
YonghuVO selectVO(@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
List<YonghuView> selectListView(@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
List<YonghuView> selectListView(Pagination page,@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
YonghuView selectView(@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
}
|
||||
Loading…
Reference in new issue