package com.its.op.controller.its.management;

import com.its.op.dto.its.facility.FcltSttsCntDto;
import com.its.op.dto.its.facility.FcltSttsDto;
import com.its.op.service.its.common.CommonSttsService;
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 CommonSttsService service;


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

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