package com.honey.honey.controller;

import com.honey.honey.dto.AdminMasterDto;
import com.honey.honey.service.AdminMasterService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
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;

@RestController
@RequestMapping("/api/admin/masters")
@RequiredArgsConstructor
@PreAuthorize("hasRole('ADMIN')")
public class AdminMasterController {

    private final AdminMasterService adminMasterService;

    @GetMapping
    public ResponseEntity<List<AdminMasterDto>> getMasters() {
        return ResponseEntity.ok(adminMasterService.getMasters());
    }
}
