|
|
@@ -0,0 +1,99 @@
|
|
|
+package com.xingxi.web.controller.business.newProd.controller;
|
|
|
+
|
|
|
+import com.xingxi.business.NewProd.domain.NewProd;
|
|
|
+import com.xingxi.business.NewProd.service.INewProdService;
|
|
|
+import com.xingxi.common.annotation.Log;
|
|
|
+import com.xingxi.common.core.controller.BaseController;
|
|
|
+import com.xingxi.common.core.domain.AjaxResult;
|
|
|
+import com.xingxi.common.core.page.TableDataInfo;
|
|
|
+import com.xingxi.common.enums.BusinessType;
|
|
|
+import com.xingxi.common.utils.poi.ExcelUtil;
|
|
|
+import com.xingxi.web.controller.business.newProd.domain.NewProdVo;
|
|
|
+import com.xingxi.web.controller.business.newProd.service.INewProdVoService;
|
|
|
+import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 今日热门Controller
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2025-05-15
|
|
|
+ */
|
|
|
+@Controller
|
|
|
+@RequestMapping("/business/newProd")
|
|
|
+public class NewProdController extends BaseController {
|
|
|
+ private String prefix = "business/newProd";
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private INewProdService newProdService;
|
|
|
+ @Resource
|
|
|
+ private INewProdVoService newProdVoService;
|
|
|
+
|
|
|
+ @RequiresPermissions("business:newProd:view")
|
|
|
+ @GetMapping()
|
|
|
+ public String newProd() {
|
|
|
+ return prefix + "/newProd";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询今日热门列表
|
|
|
+ */
|
|
|
+ @RequiresPermissions("business:newProd:list")
|
|
|
+ @PostMapping("/list")
|
|
|
+ @ResponseBody
|
|
|
+ public TableDataInfo list(NewProdVo newProdVo) {
|
|
|
+ startPage();
|
|
|
+ List<NewProdVo> list = newProdVoService.selectNewProdVoList(newProdVo);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出今日热门列表
|
|
|
+ */
|
|
|
+ @RequiresPermissions("business:newProd:export")
|
|
|
+ @Log(title = "今日热门", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult export(NewProd newProd) {
|
|
|
+ List<NewProd> list = newProdService.selectNewProdList(newProd);
|
|
|
+ ExcelUtil<NewProd> util = new ExcelUtil<>(NewProd.class);
|
|
|
+ return util.exportExcel(list, "今日热门数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增保存今日热门
|
|
|
+ */
|
|
|
+ @RequiresPermissions("business:newProd:add")
|
|
|
+ @Log(title = "今日热门", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping("/add")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult addSave(NewProd newProd) {
|
|
|
+ return toAjax(newProdService.insertNewProd(newProd));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增保存今日热门
|
|
|
+ */
|
|
|
+ @RequiresPermissions("business:newProd:edit")
|
|
|
+ @Log(title = "今日热门", businessType = BusinessType.UPDATE)
|
|
|
+ @PostMapping("/editSort")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult editSort(@RequestBody List<NewProd> newProdList) {
|
|
|
+ return toAjax(newProdVoService.updateSorts(newProdList));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除今日热门
|
|
|
+ */
|
|
|
+ @RequiresPermissions("business:newProd:remove")
|
|
|
+ @Log(title = "今日热门", businessType = BusinessType.DELETE)
|
|
|
+ @PostMapping("/remove")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult remove(String ids) {
|
|
|
+ return toAjax(newProdVoService.batchLogicDeleteNewProd(ids));
|
|
|
+ }
|
|
|
+}
|