hejianhao
2026-09-01 4b4d225c0f8456b8918dc79eec2e093485746d0f
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/live/service/LiveCourseAppService.java
@@ -27,6 +27,7 @@
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.EnabledStatus;
import java.util.ArrayList;
import java.util.List;
@@ -83,7 +84,7 @@
        return PageResponse.of(list, p.getTotal(), p.getCurrent(), p.getSize());
    }
    @Transactional
    @Transactional(rollbackFor = Exception.class)
    public LiveCourseDetailVO create(LiveCourseUpsertRequest req) {
        throw new IllegalArgumentException("直播课程为初始化数据,禁止新增");
        /*
@@ -134,7 +135,7 @@
        return vo;
    }
    @Transactional
    @Transactional(rollbackFor = Exception.class)
    public LiveCourseDetailVO update(Long id, LiveCourseUpsertRequest req) {
        validateExpert(req.getExpertId());
@@ -158,7 +159,7 @@
        return detail(id);
    }
    @Transactional
    @Transactional(rollbackFor = Exception.class)
    public LiveCourseStatusVO patchStatus(Long id, LiveCourseStatusRequest req) {
        LiveCourse course = liveCourseMapper.selectById(id);
        if (course == null) {
@@ -169,7 +170,7 @@
        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)) {
@@ -208,7 +209,7 @@
        }
    }
    @Transactional
    @Transactional(rollbackFor = Exception.class)
    public void delete(Long id) {
        throw new IllegalArgumentException("直播课程为初始化数据,禁止删除");
    }
@@ -218,7 +219,7 @@
        if (expert == null) {
            throw new IllegalArgumentException("授课专家不存在");
        }
        if (expert.getStatus() != null && expert.getStatus() != 1) {
        if (expert.getStatus() != null && expert.getStatus() != EnabledStatus.ENABLED.getValue()) {
            throw new IllegalArgumentException("授课专家已禁用");
        }
    }