package com.yida.data.school.secondClass.controller.out;

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.school.secondClass.EduSecondClassBanner;
import com.yida.data.common.core.entity.school.secondClass.EduSecondClassConfig;
import com.yida.data.school.secondClass.service.EduSecondClassBannerService;
import com.yida.data.school.secondClass.service.EduSecondClassConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "第二课堂（不鉴权）")
@Slf4j
@RestController
@RequestMapping("/out/secondClass")
@RequiredArgsConstructor
public class OutEduSecondClassController {

    private final EduSecondClassBannerService eduSecondClassBannerService;
    private final EduSecondClassConfigService eduSecondClassConfigService;

    @ApiOperation("查询菜单")
    @GetMapping("/getMenu")
    public ResultBean<EduSecondClassConfig> getMenu(Long deptId) {
        return ResultBean.buildSuccess(eduSecondClassConfigService.getConfig(deptId));
    }

    @ApiOperation("查询banner")
    @GetMapping("/getBanner")
    public ResultBean<EduSecondClassBanner> getBanner(Long deptId, Integer type) {
        return ResultBean.buildSuccess(eduSecondClassBannerService.getBanner(deptId, type));
    }
}
