| | |
| | | return toDetailVO(requireItem(id)); |
| | | } |
| | | |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ProjectIntroductionDetailVO create(ProjectIntroductionSaveRequest req) { |
| | | ProjectIntroduction item = new ProjectIntroduction(); |
| | | fillEntity(item, req); |
| | |
| | | return detail(item.getId()); |
| | | } |
| | | |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ProjectIntroductionDetailVO update(Long id, ProjectIntroductionSaveRequest req) { |
| | | ProjectIntroduction item = requireItem(id); |
| | | fillEntity(item, req); |
| | |
| | | return detail(id); |
| | | } |
| | | |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delete(Long id) { |
| | | requireItem(id); |
| | | projectIntroductionMapper.deleteById(id); |
| | |
| | | item.setContent(content); |
| | | item.setVideoUrl(null); |
| | | item.setVideoFileName(null); |
| | | item.setVideoDescription(null); |
| | | return; |
| | | } |
| | | |
| | |
| | | if (videoUrl == null) { |
| | | throw new IllegalArgumentException("请填写视频地址或上传本地视频"); |
| | | } |
| | | String videoDescription = trimToNull(req.getVideoDescription()); |
| | | if (videoDescription == null) { |
| | | throw new IllegalArgumentException("请输入视频介绍"); |
| | | } |
| | | item.setContent(null); |
| | | item.setVideoUrl(videoUrl); |
| | | item.setVideoFileName(trimToNull(req.getVideoFileName())); |
| | | item.setVideoDescription(videoDescription); |
| | | } |
| | | |
| | | private int validateContentType(Integer contentType) { |
| | |
| | | vo.setContent(item.getContent()); |
| | | vo.setVideoUrl(item.getVideoUrl()); |
| | | vo.setVideoFileName(item.getVideoFileName()); |
| | | vo.setVideoDescription(item.getVideoDescription()); |
| | | vo.setStatus(item.getStatus()); |
| | | vo.setClickCount(defaultNumber(item.getClickCount())); |
| | | vo.setCreatedAt(item.getCreatedAt()); |