| | |
| | | |
| | | @Override |
| | | public Result updateWebSet(AdminUpdateWebSetDto adminUpdateWebSetDto) { |
| | | Long id = adminUpdateWebSetDto.getId() == null ? 0L : adminUpdateWebSetDto.getId(); |
| | | WebSetEntity webSetEntity = this.baseMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(webSetEntity)){ |
| | | return Result.fail("网页设置不存在"); |
| | | } |
| | | String webTitle = adminUpdateWebSetDto.getWebTitle(); |
| | | if(StrUtil.isEmpty(webTitle)){ |
| | | return Result.fail("请输入网页标题"); |
| | | } |
| | | webSetEntity.setWebTitle(webTitle); |
| | | String webKeyword = adminUpdateWebSetDto.getWebKeyword(); |
| | | if(StrUtil.isEmpty(webKeyword)){ |
| | | return Result.fail("请输入网页关键字"); |
| | | } |
| | | Long id = adminUpdateWebSetDto.getId() == null ? 0L : adminUpdateWebSetDto.getId(); |
| | | WebSetEntity webSetEntity = this.baseMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(webSetEntity)){ |
| | | WebSetEntity webSetEntityAdd = new WebSetEntity(); |
| | | webSetEntityAdd.setWebTitle(webTitle); |
| | | webSetEntityAdd.setWebKeyword(webKeyword); |
| | | String webRemark = adminUpdateWebSetDto.getWebRemark(); |
| | | if(StrUtil.isNotEmpty(webRemark)){ |
| | | webSetEntityAdd.setWebRemark(webRemark); |
| | | } |
| | | String webPic = adminUpdateWebSetDto.getWebPic(); |
| | | if(StrUtil.isNotEmpty(webPic)){ |
| | | webSetEntityAdd.setWebPic(webPic); |
| | | } |
| | | this.baseMapper.insert(webSetEntityAdd); |
| | | return Result.ok("保存成功"); |
| | | } |
| | | webSetEntity.setWebTitle(webTitle); |
| | | webSetEntity.setWebKeyword(webKeyword); |
| | | String webRemark = adminUpdateWebSetDto.getWebRemark(); |
| | | if(StrUtil.isNotEmpty(webRemark)){ |