zjk
2026-09-29 54dcf0a82e7490fa58b1c056d5c0b9cb739c2931
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/app/home/controller/AppHomeLiveCourseController.java
@@ -5,6 +5,7 @@
import com.tcm.training.admin.common.ApiResponse;
import com.tcm.training.admin.live.dto.LiveCoursePasswordVerifyRequest;
import com.tcm.training.admin.live.service.LiveCourseAppService;
import com.tcm.training.admin.live.service.ProjectIntroductionPasswordService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -27,13 +28,17 @@
    private final LiveCourseAppService liveCourseAppService;
    private final ProjectIntroductionPasswordService projectIntroductionPasswordService;
    /**
     * 注入首页养生直播服务。
     */
    public AppHomeLiveCourseController(AppHomeLiveCourseService appHomeLiveCourseService,
                                       LiveCourseAppService liveCourseAppService) {
                                       LiveCourseAppService liveCourseAppService,
                                       ProjectIntroductionPasswordService projectIntroductionPasswordService) {
        this.appHomeLiveCourseService = appHomeLiveCourseService;
        this.liveCourseAppService = liveCourseAppService;
        this.projectIntroductionPasswordService = projectIntroductionPasswordService;
    }
    /**
@@ -51,4 +56,12 @@
    public ApiResponse<Boolean> verifyPassword(@Valid @RequestBody LiveCoursePasswordVerifyRequest req) {
        return ApiResponse.ok(liveCourseAppService.verifyPassword(req));
    }
    /**
     * 检查项目介绍是否启用密码访问。
     */
    @GetMapping("/project-introduction/password-enabled")
    public ApiResponse<Boolean> isProjectIntroductionPasswordEnabled() {
        return ApiResponse.ok(projectIntroductionPasswordService.isPasswordEnabled());
    }
}