package com.template.api;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.template.model.pojo.SmartVisitor;
import com.template.model.request.otherAppointmentRequest;
import com.template.model.request.parentsAppointmentRequest;
import com.template.model.request.turnOnTheDeviceRequest;
import com.template.model.result.CommonResult;
import com.template.model.vo.TurnOnDeviceVo;
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.*;

/**
 * @Author: binguo
 * @Date: 2023/3/30 星期四 17:28
 * @Description: com.video.api
 * @Version: 1.0
 */
@RequestMapping("/api/smartVisitor")
@Api(tags = {"SmartVisitorControllerAPI"}, value = "访客预约")
public interface SmartVisitorControllerAPI {
    @PostMapping(value = "/insertSmartVisitor")
    @ApiOperation(value = "添加访客预约", notes = "添加访客预约数据", httpMethod = "POST")
    CommonResult insertSmartVisitor(@Validated @RequestBody SmartVisitor smartApply, BindingResult bindingResult);

    @PostMapping(value = "/updateSmartVisitorById")
    @ApiOperation(value = "编辑访客预约数据", notes = "编辑访客预约数据", httpMethod = "POST")
    CommonResult updateSmartVisitorById(@Validated @RequestBody SmartVisitor ra, BindingResult bindingResult);

    @GetMapping(value = "/queryPageSmartVisitor")
    @ApiOperation(value = "访客预约分页数据", notes = "访客预约分页数据", httpMethod = "GET")
    CommonResult queryPageSmartVisitor(@RequestParam int currentPage, @RequestParam int pageCount, String name);

    @GetMapping(value = "/deleteSmartVisitorById")
    @ApiOperation(value = "根据ID删除指定访客预约", notes = "根据ID删除指定访客预约", httpMethod = "GET")
    CommonResult deleteSmartVisitorById(@RequestParam int id);

    /**
     * 学生家长预约
     * 多个学生就多条访客数据 然后发送给对应老师审核
     */
    @PostMapping(value = "/parentsAppointment")
    @ApiOperation(value = "学生家长预约", notes = "学生家长预约", httpMethod = "POST")
    CommonResult parentsAppointment(@Validated @RequestBody parentsAppointmentRequest par, BindingResult bindingResult);

    /**
     * 其他访客预约
     * 其他访客预约数据就发给管理员审核
     */
    @PostMapping(value = "/otherAppointment")
    @ApiOperation(value = "其他访客预约", notes = "其他访客预约", httpMethod = "POST")
    CommonResult otherAppointment(@Validated @RequestBody otherAppointmentRequest oar, BindingResult bindingResult);

    /**
     * 当前用户的预约记录
     * @param userId 当前用户ID
     * @param type 类型
     *             全部：0
     *             待审核：1
     *             已拒绝：2
     *             已推送：3
     *
     * @return
     */

    /**
     * 预约记录分页数据
     * @param currentPage 当前页数
     * @param pageCount 一页数据条数
     * @param userId 用户ID
     * @param type 类型：
     *             全部：0
     *             待审核：1
     *             已拒绝：2
     *             已推送：3
     * @param createStartTime 创建起始时间
     * @param createEndTime 创建结束时间
     * @param keyWord 关键字
     * @param visitorStartTime 来访起始时间
     * @param visitorEndTime 来访结束时间
     * @return
     */
    @GetMapping(value = "/appointmentPageRecord")
    @ApiOperation(value = "当前用户的预约记录", notes = "当前用户的预约记录", httpMethod = "GET")
    CommonResult appointmentPageRecord(@RequestParam int currentPage, @RequestParam int pageCount, Integer userId, @RequestParam int type, String createStartTime, String createEndTime, String keyWord, String visitorStartTime,String visitorEndTime);

    /**
     * 访客记录审核
     * @param id   数据ID
     * @param type 操作类型：
     *             同意，并推送：1
     *             拒绝：2
     * @return
     */
    @GetMapping(value = "/examineRecord")
    @ApiOperation(value = "访客记录审核", notes = "访客记录审核", httpMethod = "GET")
    CommonResult examineRecord(@RequestParam int id,@RequestParam int type) throws Exception;

    /**
     *
     * @param currentPage 当前页
     * @param pageCount 一页数据条数
     * @param userId 用户ID
     * @param type 类型：待审核：1
     *                  已拒绝：2
     *                  已推送：3
     * @return
     */
    @GetMapping(value = "/visitingAgencys")
    @ApiOperation(value = "获取到访记录数据", notes = "获取到访记录数据", httpMethod = "GET")
    CommonResult visitingAgencys(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int userId, @RequestParam int type);

    /**
     * 其他访客预约
     * 其他访客预约数据就发给管理员审核
     */
    @PostMapping(value = "/turnOnTheDevice")
    @ApiOperation(value = "其他访客预约", notes = "其他访客预约", httpMethod = "POST")
    TurnOnDeviceVo turnOnTheDevice(@RequestBody turnOnTheDeviceRequest data) throws JsonProcessingException;

}
