package vs;

import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.FormParam;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.HEAD;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.Request;
import jakarta.ws.rs.core.UriInfo;

@Path("/hello")
public class HelloWorld {
	@Context UriInfo uriInfo;
	@Context Request request;


	@GET
	public String helloWorld(
			@QueryParam("year") String jahr,
			@QueryParam("month") String monat,
			@QueryParam("day") String tag
			) {
		return "hello: " + tag + "." + monat + "." + jahr;
	}
	
	@POST
	@Consumes("application/x-www-form-urlencoded")
	public String helloWorldNew(
			@FormParam("year") String jahr,
			@FormParam("month") String monat,
			@FormParam("day") String tag
			) {
		return "hello: " + tag + "." + monat + "." + jahr;
	}

	@PUT
	@Produces("text/plain")
	public String helloWorldPUT() {
		return "Hello World ändern";
	}

	@DELETE
	@Produces("text/plain")
	public String helloWorldDELETE() {
		return "Hello World löschen";
	}

	@HEAD
	@Produces("text/plain")
	public String helloWorldHEAD() {
		return "Hello World Metadaten";
	}

}
