|
|
@@ -1,65 +1,64 @@
|
|
|
package lingtao.net.controller;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import javax.servlet.http.HttpSession;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
-
|
|
|
import lingtao.net.bean.Information;
|
|
|
import lingtao.net.bean.Msg;
|
|
|
+import lingtao.net.bean.StandardMemo;
|
|
|
import lingtao.net.service.InformationService;
|
|
|
+import lingtao.net.service.StandardMemoService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpSession;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@RestController
|
|
|
-public class InformationController {
|
|
|
+public class StandardMemoController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private InformationService informationService;
|
|
|
+ @Autowired
|
|
|
+ private StandardMemoService standardMemoService;
|
|
|
|
|
|
- /**
|
|
|
- * 产品知识列表
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- @RequestMapping("/getInformations")
|
|
|
- public Msg getInformations(@RequestParam(value = "page", defaultValue = "1") Integer page,
|
|
|
- @RequestParam(value = "limit", defaultValue = "10") Integer limit, Information information) {
|
|
|
- PageHelper.startPage(page, limit);
|
|
|
- List<Information> informationList = informationService.getInformations(information);
|
|
|
- PageInfo<Information> pageInfo = new PageInfo<Information>(informationList);
|
|
|
- return Msg.success().add("list", pageInfo);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 产品知识列表
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("/getStandard")
|
|
|
+ public Msg getStandard(@RequestParam(value = "page", defaultValue = "1") Integer page,
|
|
|
+ @RequestParam(value = "limit", defaultValue = "10") Integer limit, StandardMemo standardMemo) {
|
|
|
+ PageHelper.startPage(page, limit);
|
|
|
+ List<StandardMemo> standardMemoList = standardMemoService.getStandardMemos(standardMemo);
|
|
|
+ PageInfo<StandardMemo> pageInfo = new PageInfo<>(standardMemoList);
|
|
|
+ return Msg.success().add("list", pageInfo);
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 添加产品知识
|
|
|
- */
|
|
|
- @RequestMapping("/addInformation")
|
|
|
- public Msg addInformation(Information information, HttpSession session) {
|
|
|
- informationService.addInformation(information, session);
|
|
|
- return Msg.success();
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 添加产品知识
|
|
|
+ */
|
|
|
+ @RequestMapping("/addStandard")
|
|
|
+ public Msg addStandard(StandardMemo standardMemo, HttpSession session) {
|
|
|
+ standardMemoService.addStandardMemo(standardMemo, session);
|
|
|
+ return Msg.success();
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 修改产品知识
|
|
|
- */
|
|
|
- @RequestMapping("/updateInformation")
|
|
|
- public Msg updateInformation(Information information, HttpSession session) {
|
|
|
- informationService.updateInformationById(information, session);
|
|
|
- return Msg.success();
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 修改产品知识
|
|
|
+ */
|
|
|
+ @RequestMapping("/updateStandard")
|
|
|
+ public Msg updateStandard(StandardMemo standardMemo, HttpSession session) {
|
|
|
+ standardMemoService.updateStandardMemoById(standardMemo, session);
|
|
|
+ return Msg.success();
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 删除
|
|
|
- */
|
|
|
- @RequestMapping("/deleteInformation")
|
|
|
- public Msg deleteInformation(@RequestParam("id") Integer id) {
|
|
|
- informationService.deleteInformationById(id);
|
|
|
- return Msg.success();
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ */
|
|
|
+ @RequestMapping("/deleteStandard")
|
|
|
+ public Msg deleteStandard(@RequestParam("id") Integer id) {
|
|
|
+ standardMemoService.deleteStandardMemoById(id);
|
|
|
+ return Msg.success();
|
|
|
+ }
|
|
|
}
|