|
@@ -1,46 +1,47 @@
|
|
|
-package com.ruoyi.system.controller;
|
|
|
+package com.ruoyi.web.controller.cp;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import com.ruoyi.common.annotation.Anonymous;
|
|
|
+import com.ruoyi.common.annotation.Log;
|
|
|
+import com.ruoyi.common.core.controller.BaseController;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import com.ruoyi.common.enums.BusinessType;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
+import com.ruoyi.system.domain.CpsContentInfo;
|
|
|
+import com.ruoyi.system.service.ICpsContentInfoService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.CrossOrigin;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-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.RestController;
|
|
|
-import com.ruoyi.common.annotation.Log;
|
|
|
-import com.ruoyi.common.core.controller.BaseController;
|
|
|
-import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
-import com.ruoyi.common.enums.BusinessType;
|
|
|
-import com.ruoyi.system.domain.CpsContentInfo;
|
|
|
-import com.ruoyi.system.service.ICpsContentInfoService;
|
|
|
-import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
-import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 发布内容Controller
|
|
|
- *
|
|
|
+ *
|
|
|
* @author ruoyi
|
|
|
* @date 2024-08-14
|
|
|
*/
|
|
|
@RestController
|
|
|
-@RequestMapping("/cp/contentIfon")
|
|
|
-public class CpsContentInfoController extends BaseController
|
|
|
-{
|
|
|
+@CrossOrigin
|
|
|
+@RequestMapping("/cp/contentInfo")
|
|
|
+@Anonymous
|
|
|
+public class CpsContentInfoController extends BaseController {
|
|
|
@Autowired
|
|
|
private ICpsContentInfoService cpsContentInfoService;
|
|
|
|
|
|
/**
|
|
|
* 查询发布内容列表
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('cp:contentIfon:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(CpsContentInfo cpsContentInfo)
|
|
|
- {
|
|
|
+ public TableDataInfo list(CpsContentInfo cpsContentInfo) {
|
|
|
startPage();
|
|
|
List<CpsContentInfo> list = cpsContentInfoService.selectCpsContentInfoList(cpsContentInfo);
|
|
|
return getDataTable(list);
|
|
@@ -49,11 +50,9 @@ public class CpsContentInfoController extends BaseController
|
|
|
/**
|
|
|
* 导出发布内容列表
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('cp:contentIfon:export')")
|
|
|
@Log(title = "发布内容", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
- public void export(HttpServletResponse response, CpsContentInfo cpsContentInfo)
|
|
|
- {
|
|
|
+ public void export(HttpServletResponse response, CpsContentInfo cpsContentInfo) {
|
|
|
List<CpsContentInfo> list = cpsContentInfoService.selectCpsContentInfoList(cpsContentInfo);
|
|
|
ExcelUtil<CpsContentInfo> util = new ExcelUtil<CpsContentInfo>(CpsContentInfo.class);
|
|
|
util.exportExcel(response, list, "发布内容数据");
|
|
@@ -62,43 +61,35 @@ public class CpsContentInfoController extends BaseController
|
|
|
/**
|
|
|
* 获取发布内容详细信息
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('cp:contentIfon:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
return success(cpsContentInfoService.selectCpsContentInfoById(id));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新增发布内容
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('cp:contentIfon:add')")
|
|
|
@Log(title = "发布内容", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody CpsContentInfo cpsContentInfo)
|
|
|
- {
|
|
|
+ public AjaxResult add(@RequestBody CpsContentInfo cpsContentInfo) {
|
|
|
return toAjax(cpsContentInfoService.insertCpsContentInfo(cpsContentInfo));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改发布内容
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('cp:contentIfon:edit')")
|
|
|
@Log(title = "发布内容", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody CpsContentInfo cpsContentInfo)
|
|
|
- {
|
|
|
+ public AjaxResult edit(@RequestBody CpsContentInfo cpsContentInfo) {
|
|
|
return toAjax(cpsContentInfoService.updateCpsContentInfo(cpsContentInfo));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除发布内容
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('cp:contentIfon:remove')")
|
|
|
@Log(title = "发布内容", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
- {
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
return toAjax(cpsContentInfoService.deleteCpsContentInfoByIds(ids));
|
|
|
}
|
|
|
}
|