<commit_before>package com.tacs.deathlist.endpoints;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

@Path("/users/{username}/lists/{listName}/items/{itemName}")
public class ItemsEndpoints {

	/**
	 * Crea un nuevo ítem en una lista.
	 * 
	 * @param userName
	 * @param listName
	 * @param itemName
	 * @return
	 */
	@POST
	@Consumes(MediaType.APPLICATION_JSON)
	@Produces(MediaType.APPLICATION_JSON)
	public Response createItem(@PathParam("userName") String userName,
			                   @PathParam("listName") String listName,
			                   @PathParam("itemName") String itemName) {
		return Response.status(Status.CREATED).build();
	}

	/**
	 * Votación de un ítem.
	 * 
	 * @param itemName
	 * @return
	 */
	@Path("vote")
	@PUT
	@Produces(MediaType.APPLICATION_JSON)
	public Response voteItem(@PathParam("userName") String userName,
			                 @PathParam("listName") String listName,
			                 @PathParam("itemName") String itemName) {
		return Response.status(Status.CREATED).build();
	}

	/**
	 * Elimina un item.
	 * 
	 * @param itemName
	 * @return
	 */
	@DELETE
	@Produces(MediaType.APPLICATION_JSON)
	public Response deleteItem(@PathParam("userName") String userName,
			                   @PathParam("listName") String listName,
			                   @PathParam("itemName") String itemName) {
		return Response.status(Status.OK).build();
	}

}
<commit_msg>Dao Item. Tuve un par de dudas que dejé comentadas, por favor fíjense<commit_after>package com.tacs.deathlist.endpoints;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.tacs.deathlist.dao.InMemoryItemDao;
import com.tacs.deathlist.domain.Item;
//import com.tacs.deathlist.domain.Usuario;
//import com.tacs.deathlist.endpoints.ListasEnpoints;
import com.tacs.deathlist.domain.Lista;

@Path("/users/{username}/lists/{listName}/items/{itemName}")
public class ItemsEndpoints {

    private Gson gsonParser = new Gson();
    private InMemoryItemDao dao = new InMemoryItemDao();	
	
	/**
	 * Crea un nuevo ítem en una lista.
	 * 
	 * @param userName
	 * @param listName
	 * @param itemName
	 * @return
	 */
	@POST
	@Consumes(MediaType.APPLICATION_JSON)
	@Produces(MediaType.APPLICATION_JSON)
	public Response createItem(@PathParam("userName") String userName,
			                   @PathParam("listName") String listName,
			                   @PathParam("itemName") String itemName) {
		//TODO: Acá habría que agregarlo a la lista??
		Item item = new Item(itemName);
		dao.createItem(itemName, item);
		return Response.status(Status.CREATED).build();
	}

	/**
	 * Votación de un ítem.
	 * 
	 * @param itemName
	 * @return
	 */
	@Path("vote")
	@PUT
	@Produces(MediaType.APPLICATION_JSON)
	public Response voteItem(@PathParam("userName") String userName,
			                 @PathParam("listName") String listName,
			                 @PathParam("itemName") String itemName) {
		//TODO: Acá habría que verificar que el item corresponda al usuario y lista, no?		
		dao.voteItem(itemName);
		return Response.status(Status.CREATED).build();
	}

	/**
	 * Elimina un item.
	 * 
	 * @param itemName
	 * @return
	 */
	@DELETE
	@Produces(MediaType.APPLICATION_JSON)
	public Response deleteItem(@PathParam("userName") String userName,
			                   @PathParam("listName") String listName,
			                   @PathParam("itemName") String itemName) {
		dao.deteleItem(itemName);
		return Response.status(Status.OK).build();
	}

}

{'fraction_non_alphanumeric': 0.12457831325301205, 'fraction_numerical': 0.0, 'mean_word_length': 2.953333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4891875', 'n_tokens_mistral': 1447, 'n_tokens_neox': 1339, 'n_words': 266}