| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | return R.data(articleService.selectArticlePage(Condition.getPage(query),article)); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 查询资讯分页信息(角色权限) |
| | | * @param response |
| | | * @param article 资讯对象 |
| | | * @param query 查询参数 |
| | | * @return |
| | | */ |
| | | @GetMapping("/pageDate") |
| | | public R<IPage<Article>> pageDate(HttpServletResponse response, ArticleVo article, Query query){ |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | return R.data(articleService.pageDate(Condition.getPage(query),article)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入article") |
| | | public R submit(@Valid @RequestBody Article article) { |
| | | if (null==article.getId()){ |
| | | article.setCreateTime(new Date()); |
| | | } |
| | | article.setUpdateTime(new Date()); |
| | | return R.status(articleService.saveOrUpdate(article)); |
| | | } |
| | | |