package com.yuchen.saas.park.service.controller.elevator;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yuchen.saas.park.api.request.ElevatorInOrOutRecordsRequest;
import com.yuchen.saas.park.api.request.ElevatorPermissionDownLoadListRequest;
import com.yuchen.saas.park.api.response.ElevatorInOrOutRecordsResponse;
import com.yuchen.saas.park.api.response.ElevatorPermissionDownLoadListResponse;
import com.yuchen.saas.park.service.service.elevator.ISaasParkElevatorRecordInoutRecordsService;
import com.yuchen.saas.park.service.service.elevator.ISaasParkElevatorRecordPermissionRecordsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nest.springwrap.core.mp.support.Query;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 梯控-记录事件 前端控制器
 * </p>
 *
 * @author baichaojie
 * @since 2024-06-21
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/saasParkElevatorOperationController")
@Api(value = "梯控记录事件控制器接口", tags = "梯控记录事件控制器接口")
public class SaasParkElevatorRecordEventController {

    private final ISaasParkElevatorRecordInoutRecordsService iSaasParkElevatorRecordInoutRecordsService;

    private final ISaasParkElevatorRecordPermissionRecordsService iSaasParkElevatorRecordPermissionRecordsService;


   //梯控-记录事件-权限下发-权限下发记录
    /**
     * 梯控-记录事件-权限下发-权限下发记录
     * @param reqDTO
     * @param query
     * @return
     */
    @GetMapping("/list/permissionDownLoadList")
    @ApiOperation(value = "梯控-记录事件-权限下发-权限下发记录", notes = "梯控-记录事件-权限下发-权限下发记录")
    public R<IPage<ElevatorPermissionDownLoadListResponse>> permissionDownLoadList(@Valid ElevatorPermissionDownLoadListRequest reqDTO, Query query) {
        return iSaasParkElevatorRecordPermissionRecordsService.permissionDownLoadList(reqDTO, query);
    }

   //梯控-记录事件-权限下发-通行事件记录
    /**
     * 梯控-记录事件-权限下发-通行事件记录
     * @param reqDTO
     * @param query
     * @return
     */
    @GetMapping("/list/elevatorInOrOutRecords")
    @ApiOperation(value = "梯控-记录事件-权限下发-通行事件记录", notes = "梯控-记录事件-权限下发-通行事件记录")
    public R<IPage<ElevatorInOrOutRecordsResponse>> elevatorInOrOutRecords(@Valid ElevatorInOrOutRecordsRequest reqDTO, Query query) {
        return iSaasParkElevatorRecordInoutRecordsService.elevatorInOrOutRecords(reqDTO, query);
    }
}