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.OrdersEntity;
import com.service.OrdersService;
import com.utils.UserBasedCollaborativeFiltering;
import com.entity.MeizhuangchanpinEntity;
import com.entity.view.MeizhuangchanpinView;
import com.service.MeizhuangchanpinService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.MapUtils;
import com.utils.CommonUtil;
import java.io.IOException;
import com.service.StoreupService;
import com.entity.StoreupEntity;
/**
* 美妆产品
* 后端接口
* @author
* @email
* @date 2024-04-24 20:58:07
*/
@RestController
@RequestMapping("/meizhuangchanpin")
public class MeizhuangchanpinController {
@Autowired
private MeizhuangchanpinService meizhuangchanpinService;
@Autowired
private StoreupService storeupService;
@Autowired
private OrdersService ordersService;
/**
* 后台列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,MeizhuangchanpinEntity meizhuangchanpin,
@RequestParam(required = false) Double pricestart,
@RequestParam(required = false) Double priceend,
HttpServletRequest request){
EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
if(pricestart!=null) ew.ge("price", pricestart);
if(priceend!=null) ew.le("price", priceend);
PageUtils page = meizhuangchanpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, meizhuangchanpin), params), params));
return R.ok().put("data", page);
}
/**
* 前台列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,MeizhuangchanpinEntity meizhuangchanpin,
@RequestParam(required = false) Double pricestart,
@RequestParam(required = false) Double priceend,
HttpServletRequest request){
EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
if(pricestart!=null) ew.ge("price", pricestart);
if(priceend!=null) ew.le("price", priceend);
PageUtils page = meizhuangchanpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, meizhuangchanpin), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( MeizhuangchanpinEntity meizhuangchanpin){
EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
ew.allEq(MPUtil.allEQMapPre( meizhuangchanpin, "meizhuangchanpin"));
return R.ok().put("data", meizhuangchanpinService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(MeizhuangchanpinEntity meizhuangchanpin){
EntityWrapper< MeizhuangchanpinEntity> ew = new EntityWrapper< MeizhuangchanpinEntity>();
ew.allEq(MPUtil.allEQMapPre( meizhuangchanpin, "meizhuangchanpin"));
MeizhuangchanpinView meizhuangchanpinView = meizhuangchanpinService.selectView(ew);
return R.ok("查询美妆产品成功").put("data", meizhuangchanpinView);
}
/**
* 后台详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
MeizhuangchanpinEntity meizhuangchanpin = meizhuangchanpinService.selectById(id);
meizhuangchanpin.setClicknum(meizhuangchanpin.getClicknum()+1);
meizhuangchanpinService.updateById(meizhuangchanpin);
meizhuangchanpin = meizhuangchanpinService.selectView(new EntityWrapper<MeizhuangchanpinEntity>().eq("id", id));
return R.ok().put("data", meizhuangchanpin);
}
/**
* 前台详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
MeizhuangchanpinEntity meizhuangchanpin = meizhuangchanpinService.selectById(id);
meizhuangchanpin.setClicknum(meizhuangchanpin.getClicknum()+1);
meizhuangchanpinService.updateById(meizhuangchanpin);
meizhuangchanpin = meizhuangchanpinService.selectView(new EntityWrapper<MeizhuangchanpinEntity>().eq("id", id));
return R.ok().put("data", meizhuangchanpin);
}
/**
* 赞或踩
*/
@RequestMapping("/thumbsup/{id}")
public R vote(@PathVariable("id") String id,String type){
MeizhuangchanpinEntity meizhuangchanpin = meizhuangchanpinService.selectById(id);
if(type.equals("1")) {
meizhuangchanpin.setThumbsupnum(meizhuangchanpin.getThumbsupnum()+1);
} else {
meizhuangchanpin.setCrazilynum(meizhuangchanpin.getCrazilynum()+1);
}
meizhuangchanpinService.updateById(meizhuangchanpin);
return R.ok("投票成功");
}
/**
* 后台保存
*/
@RequestMapping("/save")
public R save(@RequestBody MeizhuangchanpinEntity meizhuangchanpin, HttpServletRequest request){
//ValidatorUtils.validateEntity(meizhuangchanpin);
meizhuangchanpinService.insert(meizhuangchanpin);
return R.ok();
}
/**
* 前台保存
*/
@RequestMapping("/add")
public R add(@RequestBody MeizhuangchanpinEntity meizhuangchanpin, HttpServletRequest request){
//ValidatorUtils.validateEntity(meizhuangchanpin);
meizhuangchanpinService.insert(meizhuangchanpin);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody MeizhuangchanpinEntity meizhuangchanpin, HttpServletRequest request){
//ValidatorUtils.validateEntity(meizhuangchanpin);
meizhuangchanpinService.updateById(meizhuangchanpin);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
meizhuangchanpinService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 前台智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,MeizhuangchanpinEntity meizhuangchanpin, HttpServletRequest request,String pre){
EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
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
没有合适的资源?快使用搜索试试~ 我知道了~
Java-美妆神域_3rm1m18i_221-wx.zip
共707个文件
java:172个
svg:159个
vue:119个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 98 浏览量
2024-12-22
07:30:01
上传
评论
收藏 23.99MB ZIP 举报
温馨提示
Java-美妆神域_3rm1m18i_221-wx.zip
资源推荐
资源详情
资源评论
收起资源包目录
Java-美妆神域_3rm1m18i_221-wx.zip (707个子文件)
main.js.bak 2KB
3-build.bat 15B
2-run.bat 14B
build.bat 14B
run.bat 14B
1-install.bat 12B
install.bat 12B
.classpath 2KB
mvnw.cmd 7KB
app.98a6fb3a.css 468KB
chunk-vendors.1622b503.css 312KB
app.032ef562.css 200KB
chunk-vendors.1f0a25b2.css 37KB
swiper.min.css 13KB
swiper.min.css 13KB
iconfont.css 622B
canvas-bg-1.css 391B
canvas-bg-1.css 391B
canvas-bg-2.css 83B
canvas-bg-2.css 83B
canvas-bg-5.css 61B
canvas-bg-4.css 61B
canvas-bg-3.css 61B
canvas-bg-3.css 61B
springboot3rm1m18i数据库文档.doc 1.69MB
.factorypath 15KB
.gitignore 364B
index.html 1KB
index.html 1KB
index.html 1KB
index.html 948B
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
maven-wrapper.jar 50KB
MeizhuangchanpinController.java 17KB
OrdersController.java 12KB
MeizhuangfenxiangController.java 11KB
BaiduUtil.java 9KB
NewsController.java 9KB
EncryptUtil.java 8KB
YonghuController.java 8KB
AddressController.java 8KB
MeizhuangchanpinEntity.java 8KB
ChatController.java 7KB
DiscussmeizhuangfenxiangController.java 7KB
CommonController.java 7KB
DiscussmeizhuangchanpinController.java 7KB
MeizhuangchanpinModel.java 7KB
StoreupController.java 7KB
OrdersEntity.java 7KB
MessagesController.java 7KB
MeizhuangchanpinVO.java 6KB
NewstypeController.java 6KB
MPUtil.java 6KB
CartController.java 6KB
AboutusController.java 6KB
MeizhuangfenxiangEntity.java 6KB
OrdersModel.java 5KB
MeizhuangfenleiController.java 5KB
OrdersVO.java 5KB
UsersController.java 5KB
JinhuoxinxiController.java 5KB
NewsEntity.java 5KB
MeizhuangfenxiangModel.java 5KB
MavenWrapperDownloader.java 5KB
MeizhuangfenxiangVO.java 5KB
UserBasedCollaborativeFiltering.java 5KB
FileController.java 4KB
CommonUtil.java 4KB
NewsModel.java 4KB
YonghuEntity.java 4KB
StoreupEntity.java 4KB
NewsVO.java 4KB
JinhuoxinxiEntity.java 4KB
MessagesEntity.java 4KB
CartEntity.java 4KB
DiscussmeizhuangfenxiangEntity.java 3KB
DiscussmeizhuangchanpinEntity.java 3KB
AuthorizationInterceptor.java 3KB
AboutusEntity.java 3KB
ConfigController.java 3KB
AddressEntity.java 3KB
ChatEntity.java 3KB
HttpClientUtils.java 3KB
MeizhuangchanpinServiceImpl.java 3KB
Query.java 3KB
YonghuModel.java 3KB
StoreupModel.java 2KB
TokenServiceImpl.java 2KB
OrdersServiceImpl.java 2KB
JinhuoxinxiModel.java 2KB
MessagesModel.java 2KB
YonghuVO.java 2KB
MeizhuangfenleiEntity.java 2KB
StoreupVO.java 2KB
CartModel.java 2KB
DiscussmeizhuangfenxiangServiceImpl.java 2KB
DiscussmeizhuangchanpinServiceImpl.java 2KB
共 707 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
清水白石008
- 粉丝: 9925
- 资源: 1387
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功