|
@@ -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;
|
|
|
+ }
|
|
|
}
|
|
|
|