| | |
| | | if(StrUtil.isNotEmpty(childTitle)){ |
| | | articleEntity.setChildTitle(childTitle); |
| | | } |
| | | String describe = adminAddArticleDto.getDescribe(); |
| | | if(StrUtil.isNotEmpty(describe)){ |
| | | articleEntity.setDescribe(describe); |
| | | String author = adminAddArticleDto.getAuthor(); |
| | | if(StrUtil.isNotEmpty(author)){ |
| | | articleEntity.setAuthor(author); |
| | | } |
| | | String remark = adminAddArticleDto.getRemark(); |
| | | if(StrUtil.isNotEmpty(remark)){ |
| | | articleEntity.setRemark(remark); |
| | | } |
| | | long columnId = adminAddArticleDto.getColumnId() == null ? 0L : adminAddArticleDto.getColumnId(); |
| | | if(columnId == 0L){ |
| | |
| | | if(ObjectUtil.isEmpty(articleEntity)){ |
| | | return Result.fail("文章不存在"); |
| | | } |
| | | articleEntity.getReleaseStatus(); |
| | | String title = adminUpdateArticleDto.getTitle(); |
| | | if(StrUtil.isEmpty(title)){ |
| | | return Result.fail("请输入文章标题"); |
| | |
| | | if(StrUtil.isNotEmpty(childTitle)){ |
| | | articleEntity.setChildTitle(childTitle); |
| | | } |
| | | String describe = adminUpdateArticleDto.getDescribe(); |
| | | if(StrUtil.isNotEmpty(describe)){ |
| | | articleEntity.setDescribe(describe); |
| | | String author = adminUpdateArticleDto.getAuthor(); |
| | | if(StrUtil.isNotEmpty(author)){ |
| | | articleEntity.setAuthor(author); |
| | | } |
| | | |
| | | String remark = adminUpdateArticleDto.getRemark(); |
| | | if(StrUtil.isNotEmpty(remark)){ |
| | | articleEntity.setRemark(remark); |
| | | } |
| | | long columnId = adminUpdateArticleDto.getColumnId() == null ? 0L : adminUpdateArticleDto.getColumnId(); |
| | | if(columnId == 0L){ |
| | |
| | | articleEntity.setReleaseTime(releaseTime); |
| | | } |
| | | Integer releaseStatus = adminUpdateArticleDto.getReleaseStatus(); |
| | | if(!ArticleEntity.RELEASE_STATUS_YES.equals(releaseStatus)){ |
| | | return Result.fail("请先取消文章的发布状态"); |
| | | } |
| | | articleEntity.setReleaseStatus(releaseStatus); |
| | | String articleDetails = adminUpdateArticleDto.getArticleDetails(); |
| | | if(StrUtil.isNotEmpty(articleDetails)){ |
| | |
| | | } |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result updateStatusOff(Long id) { |
| | | ArticleEntity articleEntity = this.baseMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(articleEntity)){ |
| | | return Result.fail("文章不存在"); |
| | | } |
| | | articleEntity.setReleaseStatus(ArticleEntity.RELEASE_STATUS_NO); |
| | | this.baseMapper.updateById(articleEntity); |
| | | return Result.ok("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result updateStatusOn(Long id) { |
| | | ArticleEntity articleEntity = this.baseMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(articleEntity)){ |
| | | return Result.fail("文章不存在"); |
| | | } |
| | | articleEntity.setReleaseStatus(ArticleEntity.RELEASE_STATUS_YES); |
| | | this.baseMapper.updateById(articleEntity); |
| | | return Result.ok("操作成功"); |
| | | } |
| | | } |