package org.example.tampoposerverdtram.resources;
import java.util.*;
import jakarta.ws.rs.*;
import jakarta.ws.rs.client.*;
import jakarta.ws.rs.core.*;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.core.JsonProcessingException;
@Path("/chatReqId")
@Component
public class ChatReqId {
private String value = "0";
@Produces(MediaType.APPLICATION_JSON)
@GET
public String getValue() {
return new String(this.value);
}
@POST
public void updateFromChatRequests(@FormParam("chatRequests") String chatRequests_json) throws JsonProcessingException {
Map<String, Map<String, Object>> chatRequests = new HashMap<>();
{
Map<String, Map<String, Object>>i = new ObjectMapper().readValue(chatRequests_json, HashMap.class);
chatRequests = i;
}
String temp_if32;
if (chatRequests.containsKey(this.value)) {
temp_if32 = (this.value+"1");
} else {
temp_if32 = this.value;
}
this.value = temp_if32;
}
}