package com.its.web.controller.common;

import com.its.web.dto.common.TbWebOrgDto;
import com.its.web.service.common.CommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/common")
@Api(tags = "00.공통")
public class CommonController {

    private final CommonService service;

    @ApiOperation(value = "공공기관 웹사이트 조회(TB_WEB_ORGAN)", response = TbWebOrgDto.class, responseContainer = "ArrayList")
    @PostMapping(value = "/web-organ", produces = {"application/json; charset=utf8"})
    @ResponseBody
    public List<TbWebOrgDto> findAllOrganization() { return service.findAllOrganization(); }
}
