package com.its.api.its.controller.management;

import com.its.api.its.model.dto.view.VwFcltSttsCntDto;
import com.its.api.its.model.dto.view.VwFcltSttsDto;
import com.its.api.its.service.view.VwFcltSttsCntService;
import com.its.api.its.service.view.VwFcltSttsService;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "00.교통상황관리-0.메인-2.시설물")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/manage/main/fclt")
public class FacilityController {

    private final VwFcltSttsService fcltSttsService;
    private final VwFcltSttsCntService fcltSttsCntService;

    @ApiOperation(value = "시설물 상태(VW_FCLT_STTS)", response = VwFcltSttsDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/stts", produces = {"application/json; charset=utf8"})
    public List<VwFcltSttsDto> findFcltSttsAll() {
        return this.fcltSttsService.findAll();
    }

    @ApiOperation(value = "시설물 상태 현황(VW_FCLT_STTS_CNT)", response = VwFcltSttsCntDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/stts-cnt", produces = {"application/json; charset=utf8"})
    public List<VwFcltSttsCntDto> findFcltSttsCntAll() {
        return this.fcltSttsCntService.findAll();
    }
}
