package cn.iocoder.yudao.module.base.controller.admin;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCoachCourseService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

/**
 * @Description: 教练与课程绑定
 * @Author: 86187
 * @Date: 2025/04/01 9:56
 * @Version: 1.0
 */
@Tag(name = "教练与课程绑定")
@RestController
@RequestMapping("/base/dl-drive-school-coach-course")
@Validated
@RequiredArgsConstructor
public class DlDriveSchoolCoachCourseController {

    private final DlDriveSchoolCoachCourseService coachCourseService;

    /**
     * 根据课程id获取教练信息
     * @param courseId 课程id
     * @return 教练信息
     */
    @GetMapping("/getCoachByCourseId")
    @Operation(summary = "根据课程id获取教练信息")
    public CommonResult<?> getCoachByCourseId(@RequestParam("courseId") String courseId) {
        return success(coachCourseService.queryByCourseId(courseId));
    }
}
