hejianhao
2026-08-20 fababb22599c8a4b3034bdfc98ee7502aa73bf4d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.tcm.training.admin.app.home.controller;
 
import com.tcm.training.admin.app.home.service.AppHomeLiveCourseService;
import com.tcm.training.admin.app.home.vo.AppHomeLiveCourseVO;
import com.tcm.training.admin.common.ApiResponse;
import com.tcm.training.admin.live.dto.LiveCoursePasswordVerifyRequest;
import com.tcm.training.admin.live.service.LiveCourseAppService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.validation.Valid;
import java.util.List;
 
/**
 * APP 首页养生直播接口。
 */
@Validated
@RestController
@RequestMapping({"/api/app/home", "/api/v1/app/home"})
public class AppHomeLiveCourseController {
 
    private final AppHomeLiveCourseService appHomeLiveCourseService;
 
    private final LiveCourseAppService liveCourseAppService;
 
    /**
     * 注入首页养生直播服务。
     */
    public AppHomeLiveCourseController(AppHomeLiveCourseService appHomeLiveCourseService,
                                       LiveCourseAppService liveCourseAppService) {
        this.appHomeLiveCourseService = appHomeLiveCourseService;
        this.liveCourseAppService = liveCourseAppService;
    }
 
    /**
     * 获取 APP 首页养生直播模块数据。
     */
    @GetMapping("/live-courses")
    public ApiResponse<List<AppHomeLiveCourseVO>> listHomeLiveCourses() {
        return ApiResponse.ok(appHomeLiveCourseService.listHomeLiveCourses());
    }
 
    /**
     * 校验 APP 首页直播课程访问密码。
     */
    @PostMapping("/live-courses/password/verify")
    public ApiResponse<Boolean> verifyPassword(@Valid @RequestBody LiveCoursePasswordVerifyRequest req) {
        return ApiResponse.ok(liveCourseAppService.verifyPassword(req));
    }
}