package com.repair.api;

import com.repair.model.request.insertRepairClassesRequest;
import com.repair.model.request.updateRepairClassesRequest;
import com.repair.model.result.CommonResult;
import com.repair.model.vo.UserScheduleVo;
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;
import java.lang.reflect.InvocationTargetException;
import java.text.ParseException;

@RequestMapping("/api/repairClassesSettings")
@Api(tags = {"RepairClassesSettingsController"}, value = "排班")
public interface RepairClassesSettingsControllerAPI {

    @PostMapping(value = "/insertRepairClassesSettings")
    @ApiOperation(value = "添加排班", notes = "添加排班数据", httpMethod = "POST")
    CommonResult InsertRepairClassesSettings(@Validated @RequestBody insertRepairClassesRequest ircr, BindingResult bindingResult) throws ParseException;

    @PostMapping(value = "/updateRepairClassesSettingsById")
    @ApiOperation(value = "编辑排班数据", notes = "编辑排班数据", httpMethod = "POST")
    CommonResult updateRepairClassesSettingsById(@Validated @RequestBody updateRepairClassesRequest ra, BindingResult bindingResult) throws ParseException;

    @GetMapping(value = "/queryPageRepairClassesSettings")
    @ApiOperation(value = "排班分页数据", notes = "排班分页数据", httpMethod = "GET")
    CommonResult queryPageRepairClassesSettingss(@RequestParam int currentPage, @RequestParam int pageCount, String startTime, String endTime);

    @GetMapping(value = "/downloadRepairClassesExcel")
    @ApiOperation(value = "导出排班数据", notes = "导出排班数据", httpMethod = "GET")
    void downloadRepairClassesExcel(String startTime, String endTime, HttpServletResponse response);

    @GetMapping(value = "/deleteRepairClassesSettingsById")
    @ApiOperation(value = "根据ID删除指定排班", notes = "根据ID删除指定排班", httpMethod = "GET")
    CommonResult deleteRepairClassesSettingsById(@RequestParam int id);

    @PostMapping(value = "/importRepairClassesSettingExcel")
    @ApiOperation(value = "导入排班数据", notes = "导入排班数据", httpMethod = "POST")
    CommonResult importRepairClassesSettingExcel(@RequestParam("file") MultipartFile file) throws IOException, ParseException;

    @GetMapping(value = "/downloadRepairClassesSettingExcel")
    @ApiOperation(value = "导出排班模板", notes = "导出排班模板", httpMethod = "GET")
    void downloadRepairClassesSettingExcel(HttpServletResponse response);

    @GetMapping(value = "/queryPageUserClasses")
    @ApiOperation(value = "移动端首页当天排班分页数据", notes = "移动端首页当天排班分页数据", httpMethod = "GET")
    CommonResult queryPageUserClasses(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int schoolId, Integer userId);

    @PostMapping(value = "/updateUserClasses")
    @ApiOperation(value = "移动端首页修改或新增当天排班数据", notes = "移动端首页修改或新增当天排班数据", httpMethod = "POST")
    CommonResult updateUserClasses(@Validated @RequestBody UserScheduleVo usv, BindingResult bindingResult) throws ParseException;
}
