package com.its.op.controller.its.rse;

import com.its.op.dto.its.rse.TbRseCtrlHsDto;
import com.its.op.service.its.rse.TbRseCtrlHsService;
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 = "14.RSE-1.RSE 관리-RSE 제어 이력")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/rse/tb_rse_ctrl_hs")
public class TbRseCtrlHsController {

    private final TbRseCtrlHsService service;

    @ApiOperation(value = "RSE 제어 이력 전체조회(TB_RSE_CTRL_HS)", response = TbRseCtrlHsDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "", produces = {"application/json; charset=utf8"})
    public List<TbRseCtrlHsDto> findAll() {
        return this.service.findAll();
    }

    @ApiOperation(value = "RSE 제어 이력 개별조회(TB_RSE_CTRL_HS)", response = TbRseCtrlHsDto.class)
    @GetMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
    public TbRseCtrlHsDto findById(@PathVariable final Long id) {
        return this.service.findById(id);
    }

}
