| | |
| | | this.projectIntroductionMapper = projectIntroductionMapper; |
| | | } |
| | | |
| | | /** 分页查询项目介绍。 */ |
| | | public PageResponse<ProjectIntroductionListItemVO> page(int page, |
| | | int pageSize, |
| | | String keyword, |
| | |
| | | return PageResponse.of(list, result.getTotal(), result.getCurrent(), result.getSize()); |
| | | } |
| | | |
| | | /** 查询项目介绍详情。 */ |
| | | public ProjectIntroductionDetailVO detail(Long id) { |
| | | 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); |