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

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.smart.EduSmartWelcomeGuide;
import com.yida.data.common.core.entity.smart.EduSmartWelcomeGuideRoster;
import com.yida.data.common.core.entity.smart.EduSmartWelcomeGuideRosterRelation;
import com.yida.data.common.core.entity.smart.EduSmartWelcomeGuideStep;
import com.yida.data.common.core.enums.EnableStatusEnum;
import com.yida.data.school.dto.smart.GuideSaveDTO;
import com.yida.data.school.dto.smart.GuideSelectPageDTO;
import com.yida.data.school.smart.service.EduSmartWelcomeGuideRosterRelationService;
import com.yida.data.school.smart.service.EduSmartWelcomeGuideRosterService;
import com.yida.data.school.smart.service.EduSmartWelcomeGuideService;
import com.yida.data.school.smart.service.EduSmartWelcomeGuideStepService;
import com.yida.data.school.vo.smart.GuideInfoVO;
import com.yida.data.school.vo.smart.GuideSelectPageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Objects;

/**
 * 智慧迎新内部api(不鉴权)
 *
 * @author ZYJ
 * @date 2023-05-15 15:33:18
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@Api(tags = "智慧迎新内部api(不鉴权)")
@RequestMapping("/in/eduSmartWelcome")
public class InEduSmartWelcomeController {

    private final EduSmartWelcomeGuideStepService eduSmartWelcomeGuideStepService;
    private final EduSmartWelcomeGuideRosterRelationService eduSmartWelcomeGuideRosterRelationService;

    @GetMapping("/getOpenIdRelation")
    @ApiOperation("查询openId是否绑定了对应的信息")
    ResultBean<EduSmartWelcomeGuideRosterRelation> getOpenIdRelation(@RequestParam String openId, @RequestParam Long deptId) {
        EduSmartWelcomeGuideRosterRelation rosterRelation = eduSmartWelcomeGuideRosterRelationService.getOpenIdRelation(openId,deptId);
        return ResultBean.buildSuccess(rosterRelation);
    }

    @GetMapping("/listStepInfo")
    @ApiOperation("查询人员步骤信息")
    ResultBean<List<EduSmartWelcomeGuideStep>> listStepInfo(@RequestParam Long relationId, @RequestParam Long guideId) {
        List<EduSmartWelcomeGuideStep> list = eduSmartWelcomeGuideStepService.listStepInfo(relationId, guideId);
        return ResultBean.buildSuccess(list);
    }
}
