package com.its.web.controller.traffic;

import com.its.web.dto.traffic.IntersectionDto;
import com.its.web.service.traffic.IntersectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Profile("itcs")
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/itcs")
@Api(tags = "01-2.교통정보 - 스마트교차로")
public class IntersectionController {
    private final IntersectionService service;

    @ApiOperation(value = "01.스마트 교차로 리스트 조회(IXR_MNGM)", response = IntersectionDto.class, responseContainer = "ArrayList")
    @PostMapping(value = "/list", produces = {"application/json; charset=utf8"})
    @ResponseBody
    public List<IntersectionDto> findAllIntersection() {
        return service.findAllIntersection();
    }
}
