37 lines
845 B
Java
37 lines
845 B
Java
package dev.dinauer.settings;
|
|
|
|
import io.quarkus.security.Authenticated;
|
|
import jakarta.annotation.security.RolesAllowed;
|
|
import jakarta.enterprise.context.ApplicationScoped;
|
|
import jakarta.inject.Inject;
|
|
import jakarta.ws.rs.*;
|
|
import jakarta.ws.rs.core.MediaType;
|
|
import org.jboss.resteasy.reactive.common.NotImplementedYet;
|
|
|
|
import java.io.IOException;
|
|
|
|
@Path("/settings")
|
|
@ApplicationScoped
|
|
@Authenticated
|
|
public class SettingsResource
|
|
{
|
|
@Inject
|
|
SettingsRepo settingsRepo;
|
|
|
|
@GET
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
public Settings getSettings() throws IOException
|
|
{
|
|
return settingsRepo.find();
|
|
}
|
|
|
|
@PUT
|
|
@RolesAllowed("admin")
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
public void updateSettings()
|
|
{
|
|
throw new NotImplementedYet();
|
|
}
|
|
}
|