Created crud opration for company api's
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
package net.gepafin.tendermanagement.dao;
|
||||
|
||||
import feign.FeignException;
|
||||
import net.gepafin.tendermanagement.config.Translator;
|
||||
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||
import net.gepafin.tendermanagement.service.feignClient.VatCheckService;
|
||||
import net.gepafin.tendermanagement.util.Utils;
|
||||
import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationException;
|
||||
import net.gepafin.tendermanagement.web.rest.api.errors.Status;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -67,8 +72,17 @@ public class VatCheckDao {
|
||||
}
|
||||
} catch (FeignException ex) {
|
||||
log.error("Exception occurred while checking vat number: {0}", ex);
|
||||
throw ex;
|
||||
Utils.callException(ex.status(), ex);
|
||||
}
|
||||
return responseBody;
|
||||
}
|
||||
|
||||
public Map<String, Object> checkVatNumber(String vatNumber) {
|
||||
try {
|
||||
return checkVatNumberApi(vatNumber);
|
||||
} catch (Exception e) {
|
||||
throw new CustomValidationException(Status.VALIDATION_ERROR,
|
||||
Translator.toLocale(GepafinConstant.INVALID_VATNUMBER));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user