|
@@ -0,0 +1,112 @@
|
|
|
+package cn.ezhizao.project.business.notification.controller;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import cn.ezhizao.common.utils.poi.ExcelUtil;
|
|
|
+import cn.ezhizao.framework.aspectj.lang.annotation.Log;
|
|
|
+import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
|
|
|
+import cn.ezhizao.framework.web.controller.BaseController;
|
|
|
+import cn.ezhizao.framework.web.domain.AjaxResult;
|
|
|
+import cn.ezhizao.framework.web.page.TableDataInfo;
|
|
|
+import cn.ezhizao.project.business.notification.domain.SysNotification;
|
|
|
+import cn.ezhizao.project.business.notification.service.ISysNotificationService;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+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;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 发版通知公告Controller
|
|
|
+ *
|
|
|
+ * @author ezhizao
|
|
|
+ * @date 2025-01-08
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/business/notification")
|
|
|
+public class SysNotificationController extends BaseController
|
|
|
+{
|
|
|
+ @Resource
|
|
|
+ private ISysNotificationService sysNotificationService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询发版通知公告列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:notification:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(SysNotification sysNotification) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ setTenantId(sysNotification);
|
|
|
+ startPage();
|
|
|
+ List<SysNotification> list = sysNotificationService.getList(sysNotification);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出发版通知公告列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:notification:export')")
|
|
|
+ @Log(title = "发版通知公告", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(HttpServletResponse response, SysNotification sysNotification) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ setTenantId(sysNotification);
|
|
|
+ List<SysNotification> list = sysNotificationService.getList(sysNotification);
|
|
|
+ ExcelUtil<SysNotification> util = new ExcelUtil<SysNotification>(SysNotification.class);
|
|
|
+ util.exportExcel(response, list, "发版通知公告数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取发版通知公告详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:notification:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
+ {
|
|
|
+ return success(sysNotificationService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增发版通知公告
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:notification:add')")
|
|
|
+ @Log(title = "发版通知公告", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody SysNotification sysNotification) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ setTenantId(sysNotification);
|
|
|
+ return toAjax(sysNotificationService.save(sysNotification));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改发版通知公告
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:notification:edit')")
|
|
|
+ @Log(title = "发版通知公告", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody SysNotification sysNotification) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ setTenantId(sysNotification);
|
|
|
+ return toAjax(sysNotificationService.updateById(sysNotification));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除发版通知公告
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:notification:remove')")
|
|
|
+ @Log(title = "发版通知公告", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable List<Long> ids)
|
|
|
+ {
|
|
|
+ return toAjax(sysNotificationService.removeBatchByIds(ids));
|
|
|
+ }
|
|
|
+}
|