| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.tcm.training.admin.common.enums.EnabledStatusEnum; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | return PageResponse.of(list, p.getTotal(), p.getCurrent(), p.getSize()); |
| | | } |
| | | |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public LiveCourseDetailVO create(LiveCourseUpsertRequest req) { |
| | | throw new IllegalArgumentException("直播课程为初始化数据,禁止新增"); |
| | | /* |
| | |
| | | return vo; |
| | | } |
| | | |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public LiveCourseDetailVO update(Long id, LiveCourseUpsertRequest req) { |
| | | validateExpert(req.getExpertId()); |
| | | |
| | |
| | | return detail(id); |
| | | } |
| | | |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public LiveCourseStatusVO patchStatus(Long id, LiveCourseStatusRequest req) { |
| | | LiveCourse course = liveCourseMapper.selectById(id); |
| | | if (course == null) { |
| | |
| | | return new LiveCourseStatusVO(id, req.getStatus()); |
| | | } |
| | | |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updatePassword(Long id, LiveCoursePasswordRequest req) { |
| | | String password = req.getPassword(); |
| | | if (StrUtil.isNotBlank(password)) { |
| | |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delete(Long id) { |
| | | throw new IllegalArgumentException("直播课程为初始化数据,禁止删除"); |
| | | } |
| | |
| | | if (expert == null) { |
| | | throw new IllegalArgumentException("授课专家不存在"); |
| | | } |
| | | if (expert.getStatus() != null && expert.getStatus() != 1) { |
| | | if (expert.getStatus() != null && expert.getStatus() != EnabledStatusEnum.ENABLED.getValue()) { |
| | | throw new IllegalArgumentException("授课专家已禁用"); |
| | | } |
| | | } |