package com.its.api.its.controller.vms;

import com.its.api.its.model.dto.vms.VwVmsDsplPrstDto;
import com.its.api.its.service.vms.VwVmsDsplPrstService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "12.VMS-0.시스템-2.모니터링-1.현시모니터링")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/vms/monitoring/dspl")
public class VwVmsDsplPrstController {

    private final VwVmsDsplPrstService service;

    @ApiOperation(value = " 전체조회(TB_VMS_DSPL_PRST)", response = VwVmsDsplPrstDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "", produces = {"application/json; charset=utf8"})
    public List<VwVmsDsplPrstDto> findAll() {
        return service.findAll();
    }

    @ApiOperation(value = " 개별조회(TB_VMS_DSPL_PRST)", response = VwVmsDsplPrstDto.class)
    @GetMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
    public List<VwVmsDsplPrstDto> findById(@PathVariable final Long id) {
        return this.service.findByIdList(id);
    }

}
