@Override public MailTemplateListResponse getAllTemplates() { MailTemplateListResponse resp = new MailTemplateListResponse(ResponseStatus.SUCCESS); List<MailTemplateDto> allTemplates = tmplService.getAllTemplates(); if (allTemplates == null || allTemplates.isEmpty()) { resp.setStatus(ResponseStatus.FAILURE); } else { resp.setMailTemplateList(allTemplates); } return resp; }
@Override public MailTemplateResponse updateTemplate( @WebParam(name = "template", targetNamespace = "") MailTemplateDto template) { MailTemplateResponse resp = new MailTemplateResponse(ResponseStatus.SUCCESS); MailTemplateDto mailTemplate = tmplService.updateTemplate(template); if (mailTemplate.getTmplId() == null || mailTemplate.getTmplId().isEmpty()) { resp.setStatus(ResponseStatus.FAILURE); } else { resp.setMailTemplate(mailTemplate); } return resp; }
@Override public MailTemplateResponse getTemplateById( @WebParam(name = "id", targetNamespace = "") String id) { MailTemplateResponse resp = new MailTemplateResponse(ResponseStatus.SUCCESS); MailTemplateDto mailTemplateDto = tmplService.getTemplateById(id); if (mailTemplateDto.getTmplId() == null || mailTemplateDto.getTmplId().isEmpty()) { resp.setStatus(ResponseStatus.FAILURE); } else { resp.setMailTemplate(mailTemplateDto); } return resp; }
@Override public Response removeTemplate(@WebParam(name = "tmplId", targetNamespace = "") String tmplId) { Response resp = new Response(ResponseStatus.SUCCESS); tmplService.removeTemplate(tmplId); return resp; }