| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/articlepage") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入survey") |
| | | public R<IPage<CommentVO>> articlepage(CommentVO comment, Query query) { |
| | | IPage<CommentVO> pages = commentService.articlepage(Condition.getPage(query), comment); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入survey") |
| | | public R submit(@Valid Comment comment) { |
| | | public R submit(@Valid @RequestBody Comment comment) { |
| | | if (null==comment.getTime()){ |
| | | comment.setTime(new Date()); |
| | | } |
| | | if (comment.getTopping()== null || comment.getIsexamine().equals("")){ |
| | | comment.setTopping("0"); |
| | | } |
| | | if (comment.getIsexamine() == null || comment.getIsexamine().equals("")){ |
| | | comment.setIsexamine("0"); |
| | | } |
| | | return R.status(commentService.saveOrUpdate(comment)); |
| | | } |
| | | |