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

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.utils.FebsUtil;
import com.yida.data.school.secondClass.service.EduSecondClassSubjectService;
import com.yida.data.school.vo.secondClass.SubjectVO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * Controller
 *
 * @author zhanghaijun
 * @date 2022-04-11 14:44:56
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/secondClass/subject")
@RequiredArgsConstructor
public class EduSecondClassSubjectController {

    private final EduSecondClassSubjectService eduSecondClassSubjectService;

    @ApiOperation("查询主题列表")
    @GetMapping("/listSubject")
    public ResultBean<List<SubjectVO>> listSubject(@ApiParam("主题类型（0-首页，1-场馆，2-名师在线") Integer topicType,
        @RequestParam(required = false) @ApiParam("主题类型,0-信息流，1-排行榜") Integer type) {
        return ResultBean.buildSuccess(eduSecondClassSubjectService.listSubject(topicType,type, FebsUtil.getTopDeptId()));
    }
}
