package com.yida.data.user.controller.out;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.yida.data.common.core.common.ModuleName;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.user.EduUserDept;
import com.yida.data.log.annotation.OperationLog;
import com.yida.data.user.service.EduParentService;
import com.yida.data.user.service.EduUserDeptService;
import com.yida.data.user.vo.StaParentDistributeVO;
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.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 java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * 家校部门外部Controller (不鉴权)
 *
 * @author ZYJ
 * @date 2023/4/25
 */
@Api(tags = "家校部门API")
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/out/userDept")
public class OutEduUserDeptController {

    private final EduUserDeptService eduUserDeptService;

    @ApiOperation("查询学校年级分布")
    @GetMapping("/getGradeDistribution")
    public ResultBean<JSONArray> getGradeDistribution(@ApiParam("学校id") @RequestParam Long schoolId) {
        return ResultBean.buildSuccess(eduUserDeptService.getGradeDistribution(schoolId));
    }
}
