<commit_before>package br.ita.bditac.ws.client;

import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

import java.util.HashMap;
import java.util.Map;

import br.ita.bditac.ws.model.Crise;
import br.ita.bditac.ws.model.CriseResource;

public class CriseClient extends AbstractBaseService {

    private static final String SERVICE_URL = "/crise";

    private static final String ID_PARM = "/{id}";

    public CriseClient(String hostURL) {
        super(hostURL);
    }

    public Crise addCrise(Crise crise) {

        HttpEntity envio = new HttpEntity(crise, getRequestHeader());

        ResponseEntity<CriseResource> criseResponseEntity =  getRestTemplate().postForEntity(getHostURL() + SERVICE_URL, envio, CriseResource.class);

        if(criseResponseEntity.getStatusCode() == HttpStatus.CREATED) {
            return criseResponseEntity.getBody().getContent();
        }
        else {
            return null;
        }

    }

    public Crise getCriseById(int id) {

        Map<String, Integer> params = new HashMap<String, Integer>();
        params.put("id", id);

        try {
            HttpEntity envio = new HttpEntity(getResponseHeader());

            ResponseEntity<CriseResource> criseResponseEntity = getRestTemplate().exchange(getHostURL() + SERVICE_URL + ID_PARM, HttpMethod.GET, envio, CriseResource.class, params);

            if(criseResponseEntity.getStatusCode() == HttpStatus.OK) {
                return criseResponseEntity.getBody().getContent();
            }
        }
        catch(Exception ex) {

        }

        return null;
<commit_msg>Remoção de métodos em desuso<commit_after>package br.ita.bditac.ws.client;

import org.springframework.http.HttpEntity;
import org.springframework.http.ResponseEntity;

import br.ita.bditac.ws.model.Crise;
import br.ita.bditac.ws.model.MessageResource;

public class CriseClient extends AbstractBaseService {

    private static final String SERVICE_URL = "/crise";

    private static final String ID_PARM = "/{id}";

    public CriseClient(String hostURL) {
        super(hostURL);
    }

    public void addCrise(Crise crise) {

        HttpEntity envio = new HttpEntity(crise, getRequestHeader());

        ResponseEntity<MessageResource> criseResponseEntity =  getRestTemplate().postForEntity(getHostURL() + SERVICE_URL, envio, MessageResource.class);

{'fraction_non_alphanumeric': 0.1012965964343598, 'fraction_numerical': 0.0, 'mean_word_length': 3.4486486486486485, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '2499988', 'n_tokens_mistral': 728, 'n_tokens_neox': 707, 'n_words': 145}