package com.example.pc_spring_rest_jersey;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

@Path("/now")
public class RNow {
	
	@GET
	@Produces("application/json")
	public TimeInfo get() {
		return TimeInfo.now();
	}
	
	@GET
	@Path("/year")
	@Produces({"text/plain", "application/json"})
	public int getYear() {
		return TimeInfo.now().getYear();
	}
	
	@GET
	@Path("/month")
	@Produces({"text/plain", "application/json"})
	public int getMonth() {
		return TimeInfo.now().getMonth();
	}
	
	@GET
	@Path("/day")
	@Produces({"text/plain", "application/json"})
	public int getDay() {
		return TimeInfo.now().getDay();
	}
	
	@GET
	@Path("/hour")
	@Produces({"text/plain", "application/json"})
	public int getHour() {
		return TimeInfo.now().getHour();
	}
	
	@GET
	@Path("/minute")
	@Produces({"text/plain", "application/json"})
	public int getMinute() {
		return TimeInfo.now().getMinute();
	}
	
	@GET
	@Path("/second")
	@Produces({"text/plain", "application/json"})
	public int getSecond() {
		return TimeInfo.now().getSecond();
	}
	
	@GET
	@Path("/long")
	@Produces({"text/plain", "application/json"})
	public String getTextLong() {
		return TimeInfo.now().getTextLong();
	}
	
	@GET
	@Path("/short")
	@Produces({"text/plain", "application/json"})
	public String getTextShort() {
		return TimeInfo.now().getTextShort();
	}
	
	@GET
	@Path("/iso")
	@Produces({"text/plain", "application/json"})
	public String getTextISO() {
		return TimeInfo.now().getTextISO();
	}
}
