Pārlūkot izejas kodu

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

# Conflicts:
#	website/src/main/resources/templates/index.html
5 gadi atpakaļ
vecāks
revīzija
2239c62c41

+ 15 - 1
website/src/main/java/com/hssx/website/controller/ArticleController.java

@@ -1,14 +1,19 @@
 package com.hssx.website.controller;
 
 
+import com.hssx.website.entity.Comment;
 import com.hssx.website.entity.Cooperations;
 import com.hssx.website.service.ArticleService;
+import com.hssx.website.service.CommentService;
 import com.hssx.website.service.CooperationsService;
+import com.hssx.website.until.HttpRespMsg;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
 
 /**
  * <p>
@@ -24,7 +29,7 @@ public class ArticleController {
     @Autowired
     private ArticleService articleService;
     @Autowired
-    private CooperationsService cooperationsService;
+    private CommentService commentService;
 
     @ApiOperation("案例")
     @GetMapping("/index")
@@ -32,5 +37,14 @@ public class ArticleController {
         model = articleService.getList(model);
         return "index";
     }
+
+    @ApiOperation("添加留言")
+    @PostMapping("/add")
+    @ResponseBody
+    public HttpRespMsg addComment(Comment comment) {
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.data = commentService.save(comment);
+        return msg;
+    }
 }
 

+ 1 - 0
website/src/main/resources/templates/about.html

@@ -281,5 +281,6 @@
         <script src="vendor/bootstrap-select/js/bootstrap-select.min.js"></script>
         <script src="vendor/jquery.scrollto/jquery.scrollTo.min.js"></script>
         <script src="js/front.js"></script>
+    <script></script>
     </body>
 </html>