org.jlot.client.remote.LocalizationAddRestCommand Maven / Gradle / Ivy
package org.jlot.client.remote;
import org.jlot.api.JlotApiUrls;
import org.jlot.client.remote.rest.AbstractLoginRestCommand;
import org.jlot.core.dto.LocalizationDTO;
import org.jlot.core.form.LocalizationForm;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
@Component
public class LocalizationAddRestCommand extends AbstractLoginRestCommand
{
@Override
protected LocalizationDTO executeInternal ( LocalizationForm localizationForm )
{
String urlParam = localizationForm.getProjectName();
RestTemplate restTemplate = getRestTemplate();
return restTemplate.postForObject(getUrl(), localizationForm, LocalizationDTO.class, urlParam);
}
@Override
protected String getPath ( )
{
return JlotApiUrls.LOCALIZATIONS;
}
}