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

import com.its.op.dto.its.rse.TbRseObuClctPnstDto;
import com.its.op.service.its.rse.TbRseObuClctPnstService;
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 OBU 현재 수집")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/rse/tb_rse_obu_clct_pnst")
public class TbRseObuClctPnstController {

    private final TbRseObuClctPnstService service;

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

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


}
