|
@@ -0,0 +1,74 @@
|
|
|
+package com.ruoyi.web.controller.matter;
|
|
|
+
|
|
|
+import com.ruoyi.common.core.controller.BaseController;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import com.sooka.jnb.matter.domin.Collect;
|
|
|
+import com.sooka.jnb.matter.domin.Matter;
|
|
|
+import com.sooka.jnb.matter.service.CollectService;
|
|
|
+
|
|
|
+import com.sooka.jnb.matter.service.MatterService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/system/collect")
|
|
|
+public class collectConller extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CollectService collectService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private MatterService matterService;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 是否展示
|
|
|
+ */
|
|
|
+ @GetMapping("list")
|
|
|
+ public TableDataInfo list( Matter matter)
|
|
|
+ {
|
|
|
+ List<Matter> list = matterService.selectSysrecommendVo(matter);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 收藏事项
|
|
|
+ */
|
|
|
+ @PostMapping("add")
|
|
|
+ public AjaxResult add(@RequestBody Collect collect)
|
|
|
+ {
|
|
|
+ return toAjax(collectService.insertcollect(collect));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取事项详细信息
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/lists/{id}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") String id)
|
|
|
+ {
|
|
|
+ return success(collectService.selectcollect(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取收藏详细信息
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/collectlist/{id}")
|
|
|
+ public TableDataInfo collectlist(@PathVariable("id") String id)
|
|
|
+ {
|
|
|
+ List<Matter> list = matterService.collectlist(id);
|
|
|
+ return getDataTable(list);
|
|
|
+
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 取消事项收藏
|
|
|
+ */
|
|
|
+ @DeleteMapping("/delete/{id}")
|
|
|
+ public AjaxResult remove(@PathVariable Long id)
|
|
|
+ {
|
|
|
+ return toAjax(collectService.deletecollect(id));
|
|
|
+ }
|
|
|
+}
|