package enea.lecservice.controllers;

import enea.lecservice.models.dto.ServiceResponse;
import enea.lecservice.services.PageService;
import enea.lecservice.services.PermissionsService;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/utils")
@RequiredArgsConstructor
public class UtilsController {
    @NonNull protected PageService pageService;
    @NonNull protected PermissionsService permissionsService;

    @GetMapping("/admin/create-initial-data")
    public ServiceResponse home() {
        return permissionsService.initData();
        //return pageService.createInitialData();
    }

    @GetMapping("/ping")
    public ServiceResponse ping() {
        return ServiceResponse.Success("Service is running;");
    }
}
