package com.its.api.utis.controller;

import com.its.api.its.model.dto.common.FcltSttsDto;
import com.its.api.its.model.dto.common.FcltSttsListDto;
import com.its.api.its.model.dto.common.FcltSttsSummaryDto;
import com.its.api.its.model.dto.common.SttsCommErrDto;
import com.its.api.utis.model.dto.RsemstDto;
import com.its.api.utis.service.RsemstService;
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 = "92.UTIS")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/utis")
public class UtisController {

    private final RsemstService service;

    @ApiOperation(value = "RSE 정보조회(목록)", response = RsemstDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/rse", produces = {"application/json; charset=utf8"})
    public List<RsemstDto> findAllRseList() {
        return service.findAllList();
    }

    @ApiOperation(value = "RSE 상태현황(Summary)", response = FcltSttsSummaryDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/stts/rse/summary", produces = {"application/json; charset=utf8"})
    public FcltSttsSummaryDto findAllRseSttsSummary() {
        return this.service.findAllSttsSummary();
    }
    @ApiOperation(value = "RSE 상태현황(Summary+List)", response = FcltSttsListDto.class)
    @GetMapping(value = "/stts/rse/total", produces = {"application/json; charset=utf8"})
    public FcltSttsListDto findAllRseSttsTotal() {
        return this.service.findAllListSttsTotal();
    }

    @ApiOperation(value = "RSE 통신상태(장애)", response = SttsCommErrDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/stts/rse/error", produces = {"application/json; charset=utf8"})
    public List<SttsCommErrDto> findAllRseCommError() {
        return this.service.findAllListCommError();
    }

    @ApiOperation(value = "RSE 상태현황(List)", response = FcltSttsDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/stts/rse", produces = {"application/json; charset=utf8"})
    public List<FcltSttsDto> findAllListRseCommStts() {
        return this.service.findAllListCommStts();
    }

}
