|
@@ -3,6 +3,7 @@ package com.hssx.website.controller;
|
|
|
import com.hssx.website.entity.Comment;
|
|
|
import com.hssx.website.service.ArticleService;
|
|
|
import com.hssx.website.service.CommentService;
|
|
|
+import com.hssx.website.service.UserService;
|
|
|
import com.hssx.website.until.HttpRespMsg;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -10,30 +11,20 @@ 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.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
@Controller
|
|
|
public class UserController {
|
|
|
|
|
|
@Autowired
|
|
|
- private ArticleService articleService;
|
|
|
- @Autowired
|
|
|
- private CommentService commentService;
|
|
|
+ private UserService userService;
|
|
|
|
|
|
- @ApiOperation("案例")
|
|
|
- @GetMapping("/index")
|
|
|
+ @ApiOperation("优势详情")
|
|
|
+ @GetMapping("/product")
|
|
|
public String index(Model model) {
|
|
|
- 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;
|
|
|
+ model = userService.getAdvantage(model);
|
|
|
+ return "product";
|
|
|
}
|
|
|
}
|
|
|
|