package com.zioinfo.hrm.uiws.system.controller;

import com.zioinfo.hrm.common.ApiResponse;
import com.zioinfo.hrm.uiws.system.dto.PublicCompanyDto;
import com.zioinfo.hrm.uiws.system.dto.PublicDeptDto;
import com.zioinfo.hrm.uiws.system.service.PublicLookupService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/** 가입 화면(비인증) 공개 조회. base: /api/public/{depts,companies} */
@RestController
@RequestMapping("/api/public")
@RequiredArgsConstructor
public class PublicLookupController {

    private final PublicLookupService publicLookupService;

    @GetMapping("/depts")
    public ApiResponse<List<PublicDeptDto>> depts() {
        return ApiResponse.ok(publicLookupService.depts());
    }

    @GetMapping("/companies")
    public ApiResponse<List<PublicCompanyDto>> companies() {
        return ApiResponse.ok(publicLookupService.companies());
    }
}
