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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.CurrentUser;
import com.yida.data.common.core.entity.classCall.EduClassCall;
import com.yida.data.common.core.entity.classCall.EduClassCallPushConfig;
import com.yida.data.common.core.utils.FebsUtil;
import com.yida.data.school.classCall.service.EduClassCallPushConfigService;
import com.yida.data.school.classCall.service.EduClassCallService;
import com.yida.data.school.dto.classCall.ClassCallAddDTO;
import com.yida.data.school.dto.classSchedule.ClassSchedulePageDTO;
import com.yida.data.school.vo.classSchedule.ClassSchedulePageInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "点名系统-消息推送配置")
@Slf4j
@Validated
@RestController
@RequestMapping("/classCall/config")
@RequiredArgsConstructor
public class EduClassCallPushConfigController {

    private final EduClassCallPushConfigService eduClassCallPushConfigService;

    @ApiOperation("获取配置信息")
    @GetMapping("/get")
    public ResultBean<EduClassCallPushConfig> getEduClassCallPushConfig() {
        return ResultBean.buildSuccess(eduClassCallPushConfigService.getBySchoolId());
    }

    @ApiOperation("保存配置信息")
    @PostMapping("/add")
    public ResultBean addEduClassCallPushConfig(@RequestBody EduClassCallPushConfig config) {
        eduClassCallPushConfigService.addConfig(config);
        return ResultBean.buildSuccess();
    }
}
