Commit e4061f0b authored by Roberto Loayza's avatar Roberto Loayza

Update File Deployment

parent 9d55bc5a
......@@ -17,7 +17,7 @@ public class FileValidationResponse {
private String status;
private String user;
private String uploadDate;
private String menssage;
private String message;
private FileValidationResult fileValidationResult;
}
......@@ -51,7 +51,7 @@ public class OrquestadorService {
//Modo de despliegue
Optional<BusinessParameter> deployment = businessParameterRepository.findByKey("Despliegue");
if (!deployment.isPresent()) {
response.setMenssage("NOT.FOUND.BUSINESS.PARAMETER");
response.setMessage("NOT.FOUND.BUSINESS.PARAMETER");
throw new NotFoundException();
}
//Valida y guarda en base de datos
......@@ -71,7 +71,7 @@ public class OrquestadorService {
//Carga archivo a bucket
step = bucketService.generate(file.getBytes(), response);
if (!step) {
response.setMenssage("NOT.FOUND.BUCKET");
response.setMessage("NOT.FOUND.BUCKET");
throw new NotFoundException();
}
step = false;
......@@ -82,15 +82,15 @@ public class OrquestadorService {
//Generacion del modelo
step = knowledgeService.generate(response);
if (!step) {
response.setMenssage("NOT.FOUND.KNOWLEDGE");
response.setMessage("NOT.FOUND.KNOWLEDGE");
throw new NotFoundException();
}
response.setStatus(FrequentQuestionStatusEnum.CORRECTO.getName());
model.setStatus(StatusBcdEnum.INDEXADO.getName());
model = bdcControlRepository.save(model);
}catch (Exception e) {
if (response.getMenssage() == null) {
response.setMenssage("ERROR.UPLOAD");
if (response.getMessage() == null) {
response.setMessage("ERROR.UPLOAD");
}
response.setStatus(FrequentQuestionStatusEnum.ERROR.getName());
}
......@@ -110,18 +110,18 @@ public class OrquestadorService {
try {
Optional<BusinessParameter> deployment = businessParameterRepository.findByKey("Despliegue");
if (!deployment.isPresent()) {
response.setMenssage("NOT.FOUND.BUSINESS.PARAMETER");
response.setMessage("NOT.FOUND.BUSINESS.PARAMETER");
throw new NotFoundException();
}
if (model.getStatus().equals(StatusBcdEnum.CARGADO.getName())) {
Optional<QuestionFile> questionFile = questionFileRepository.findByUuid(uuid);
if (!questionFile.isPresent()) {
response.setMenssage("NOT.FOUND.DATA");
response.setMessage("NOT.FOUND.DATA");
throw new NotFoundException();
}
step = bucketService.generate(questionFile.get().getData(), response);
if (!step) {
response.setMenssage("NOT.FOUND.BUCKET");
response.setMessage("NOT.FOUND.BUCKET");
throw new NotFoundException();
}
model.setStatus(StatusBcdEnum.INDEXANDO.getName());
......@@ -131,7 +131,7 @@ public class OrquestadorService {
if (model.getStatus().equals(StatusBcdEnum.INDEXANDO.getName())) {
step = knowledgeService.generate(response);
if (!step) {
response.setMenssage("NOT.FOUND.KNOWLEDGE");
response.setMessage("NOT.FOUND.KNOWLEDGE");
throw new NotFoundException();
}
}
......@@ -139,8 +139,8 @@ public class OrquestadorService {
model = bdcControlRepository.save(model);
response.setStatus(FrequentQuestionStatusEnum.CORRECTO.getName());
} catch (Exception e) {
if (response.getMenssage() == null) {
response.setMenssage("ERROR.UPLOAD");
if (response.getMessage() == null) {
response.setMessage("ERROR.UPLOAD");
}
response.setStatus(FrequentQuestionStatusEnum.ERROR.getName());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment