package com.template.api;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.template.model.request.*;
import com.template.model.result.CommonResult;
import com.template.model.result.PageUtils;
import com.template.model.vo.UserDeleteVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author: binguo
 * @Date: 2023/3/30 星期四 17:28
 * @Description: com.video.api
 * @Version: 1.0
 */
@RequestMapping("/api/smartUser")
@Api(tags = {"SmartUserControllerAPI"}, value = "用户")
public interface SmartUserControllerAPI {
    /**
     * 注销账号
     */
    @PostMapping(value = "logoffAccount")
    @ApiOperation(value = "注销账号", notes = "注销账号", httpMethod = "POST")
    CommonResult logoffAccount(@Validated @RequestBody useridsRequest ur, BindingResult bindingResult);

    /**
     * 移动多个用户到其他部门
     */
    @PostMapping(value = "changeDepartment")
    @ApiOperation(value = "移动多个用户到其他部门", notes = "移动多个用户到其他部门", httpMethod = "POST")
    CommonResult changeDepartment(@Validated @RequestBody changeDepartmentRequest cdr, BindingResult bindingResult);

    /**
     * 导入用户的百胜编号
     *
     * @param excelFile excel文件
     * @return
     */
    @PostMapping(value = "importExcelUserBsno")
    @ApiOperation(value = "导入用户的百胜编号", notes = "导入用户的百胜编号", httpMethod = "POST")
    CommonResult importExcelUserBsno(@RequestParam("file") MultipartFile excelFile) throws IOException;

    /**
     * 批量导入用户信息
     *
     * @param excelFile excel文件
     * @return
     */
    @PostMapping(value = "importExcelUsers")
    @ApiOperation(value = "批量导入用户信息", notes = "批量导入用户信息", httpMethod = "POST")
    CommonResult importExcelUsers(@RequestParam("file") MultipartFile excelFile, @RequestParam String headImage) throws Exception;

    /**
     * 批量导入学生家长信息
     *
     * @param excelFile excel文件
     * @return
     */
    @PostMapping(value = "importExcelFamilys")
    @ApiOperation(value = "批量导入学生家长信息", notes = "批量导入学生家长信息", httpMethod = "POST")
    CommonResult importExcelFamilys(@RequestParam("file") MultipartFile excelFile) throws Exception;

    /**
     * 批量更新学生信息
     *
     * @param excelFile excel文件
     * @return
     */
    @PostMapping(value = "importExcelUpdateUsers")
    @ApiOperation(value = "批量更新学生信息", notes = "批量更新学生信息", httpMethod = "POST")
    CommonResult importExcelUpdateUsers(@RequestParam("file") MultipartFile excelFile) throws Exception;

    /**
     * 批量导入压缩包
     *
     * @param zipFile 附件文件
     * @return
     */
    @PostMapping(value = "importZipUsers")
    @ApiOperation(value = "批量导入", notes = "批量导入", httpMethod = "POST")
    CommonResult importZipUsers(@RequestParam("file") MultipartFile zipFile) throws IOException;

    @GetMapping(value = "/insertSmartUserPhoto")
    @ApiOperation(value = "添加学生照片", notes = "添加学生照片", httpMethod = "GET")
    CommonResult insertSmartUserPhoto() throws JsonProcessingException;


    @PostMapping(value = "/insertSmartUser")
    @ApiOperation(value = "添加用户", notes = "添加用户数据", httpMethod = "POST")
    CommonResult insertSmartUser(@Validated @RequestBody insertSmartUserRequest isur, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/updateSmartUserById")
    @ApiOperation(value = "编辑用户数据", notes = "编辑用户数据", httpMethod = "POST")
    CommonResult updateSmartUserById(@Validated @RequestBody updateSmartUserRequest ra, BindingResult bindingResult) throws Exception;

    @GetMapping(value = "/queryPageSmartUser")
    @ApiOperation(value = "用户分页数据", notes = "用户分页数据", httpMethod = "GET")
    CommonResult queryPageSmartUser(@RequestParam int currentPage, @RequestParam int pageCount, Integer departmentId, String name, @RequestHeader("user_head") String userhead);

    @GetMapping(value = "/queryPageSmartUserNoAuth")
    @ApiOperation(value = "用户分页数据", notes = "用户分页数据", httpMethod = "GET")
    CommonResult queryPageSmartUserNoAuth(@RequestParam int currentPage, @RequestParam int pageCount, Integer departmentId, String name, @RequestHeader("user_head") String userhead);

    @GetMapping(value = "/testDeleteUserById")
    @ApiOperation(value = "测试删除用户", notes = "测试删除用户", httpMethod = "POST")
    CommonResult testDeleteUserById(@RequestParam int userId) throws Exception;

    /**
     * 导出用户数据
     */
    @GetMapping(value = "smartUserExport")
    @ApiOperation(value = "导出用户数据", notes = "导出用户数据", httpMethod = "GET")
    void smartUserExport(HttpServletResponse response, Integer departmentId, String name, @RequestHeader("user_head") String userhead);

    @PostMapping(value = "/deleteSmartUserByIdOld")
    @ApiOperation(value = "根据ID删除指定用户", notes = "根据ID删除指定用户", httpMethod = "POST")
    CommonResult deleteSmartUserByIdOld(@Validated @RequestBody useridsRequest ur, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/deleteSmartUserById")
    @ApiOperation(value = "根据ID删除指定用户", notes = "根据ID删除指定用户", httpMethod = "POST")
    CommonResult deleteSmartUserById(@Validated @RequestBody useridsRequest ur, BindingResult bindingResult) throws Exception;

    /**
     * 学生家长预约信息填写界面获取受访学生列表
     */
    @GetMapping(value = "/queryAffiliateUserById")
    @ApiOperation(value = "根据当前用户ID获取受访学生数据", notes = "根据当前用户ID获取受访学生数据", httpMethod = "GET")
    CommonResult queryAffiliateUserById(@RequestParam int id);

    /**
     * 时间组数据集合
     */
    @GetMapping(value = "/timeGroups")
    @ApiOperation(value = "时间组数据集合", notes = "时间组数据集合", httpMethod = "GET")
    CommonResult timeGroups() throws Exception;

    /**
     * 导出人员模板
     *
     * @return
     */
    @GetMapping(value = "/downloadUserExcel")
    @ApiOperation(value = "导出人员Excel模板", notes = "导出人员Excel模板", httpMethod = "GET")
    CommonResult downloadUserExcel();

    /**
     * 导出教师模板
     *
     * @return
     */
    @GetMapping(value = "/downloadTeacherExcel")
    @ApiOperation(value = "导出教师Excel模板", notes = "导出教师Excel模板", httpMethod = "GET")
    CommonResult downloadTeacherExcel();

    /**
     * 导出更新人员模板
     *
     * @return
     */
    @GetMapping(value = "/downloadUpdateUserExcel")
    @ApiOperation(value = "导出更新人员Excel模板", notes = "导出更新人员Excel模板", httpMethod = "GET")
    CommonResult downloadUpdateUserExcel();

    /**
     * 根据用户ID查询学生
     *
     * @return
     */
    @GetMapping(value = "/queryStudents")
    @ApiOperation(value = "根据用户ID查询学生", notes = "根据用户ID查询学生", httpMethod = "GET")
    CommonResult queryStudents(@RequestParam int userId);

    /**
     * 根据数据ID获取用户信息
     */
    @GetMapping(value = "/queryInfoData")
    @ApiOperation(value = "根据数据ID获取用户信息", notes = "根据数据ID获取用户信息", httpMethod = "GET")
    CommonResult queryInfoData(@RequestParam int id);

    /**
     * 绑定学生
     *
     * @param isur
     * @param bindingResult
     * @return
     */
    @PostMapping(value = "/bindStudent")
    @ApiOperation(value = "绑定学生", notes = "绑定学生", httpMethod = "POST")
    CommonResult bindStudent(@Validated @RequestBody bindStudentRequest isur, BindingResult bindingResult);


    /**
     * 根据数据ID获取用户信息
     */
    @GetMapping(value = "/queryUserData")
    @ApiOperation(value = "根据数据ID获取用户信息", notes = "根据数据ID获取用户信息", httpMethod = "GET")
    CommonResult queryUserData(@RequestParam int id);

    /**
     * 删除记录的分页数据
     *
     * @param currentPage 当前页数
     * @param pageCount   一页数据条数
     * @return
     */
    @GetMapping(value = "/queryUserDeletePage")
    @ApiOperation(value = "用户分页数据", notes = "用户分页数据", httpMethod = "GET")
    CommonResult queryUserDeletePage(@RequestParam int currentPage, @RequestParam int pageCount);




    /**
     * 获取班级下的学生
     */
    @GetMapping(value = "/queryClassUser")
    @ApiOperation(value = "获取班级下的学生", notes = "获取班级下的学生", httpMethod = "GET")
    CommonResult queryClassUser(@RequestParam int userId, String keyWord);


    /**
     * 批量设置学生时间组
     */
    @PostMapping(value = "/setUserTimeGroup")
    @ApiOperation(value = "批量设置学生时间组", notes = "批量设置学生时间组", httpMethod = "POST")
    CommonResult setUserTimeGroup(@Validated @RequestBody setUserTimeGroupRequest isur, BindingResult bindingResult) throws Exception;

}
