File tree Expand file tree Collapse file tree
common/src/main/java/ru/javaops/masterjava
common-ws/src/main/java/ru/javaops/web
mail-api/src/main/java/ru/javaops/masterjava/service/mail
mail-service/src/main/resources Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import lombok .AllArgsConstructor ;
44import lombok .Getter ;
55
6+ import javax .xml .bind .annotation .XmlType ;
7+
68@ Getter
79@ AllArgsConstructor
10+ @ XmlType (namespace = "http://common.javaops.ru/" )
811public enum ExceptionType {
912 SYSTEM ("Системная ошибка" ),
1013 DATA_BASE ("Ошибка базы данных" ),
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!-- http://stackoverflow.com/questions/17295588/xmlntns-and-targetnamespace-->
23<xs : schema xmlns : xs =" http://www.w3.org/2001/XMLSchema"
4+ xmlns : tns =" http://common.javaops.ru/"
35 targetNamespace =" http://common.javaops.ru/" >
46
5- <xs : element name =" webStateException" nillable =" true" type =" faultInfo" />
7+ <xs : element name =" webStateException" nillable =" true" type =" tns: faultInfo" />
68
79 <xs : complexType name =" faultInfo" >
810 <xs : sequence >
9- <xs : element name =" type" type =" exceptionType" minOccurs =" 0" maxOccurs =" 1" />
11+ <xs : element name =" type" type =" tns: exceptionType" minOccurs =" 0" maxOccurs =" 1" />
1012 </xs : sequence >
1113 </xs : complexType >
1214
Original file line number Diff line number Diff line change 66import lombok .RequiredArgsConstructor ;
77import ru .javaops .masterjava .ExceptionType ;
88
9+ import javax .xml .bind .annotation .XmlType ;
10+
911@ Data
1012@ RequiredArgsConstructor
1113@ NoArgsConstructor
14+ @ XmlType (namespace = "http://common.javaops.ru/" )
1215public class FaultInfo {
1316 private @ NonNull ExceptionType type ;
1417
Original file line number Diff line number Diff line change 22
33import lombok .*;
44
5- @ Data
5+ import javax .xml .bind .annotation .XmlAccessType ;
6+ import javax .xml .bind .annotation .XmlAccessorType ;
7+ import javax .xml .bind .annotation .XmlAttribute ;
8+ import javax .xml .bind .annotation .XmlValue ;
9+
610@ AllArgsConstructor
711@ NoArgsConstructor
812@ EqualsAndHashCode (of = "email" )
13+ @ XmlAccessorType (XmlAccessType .FIELD )
14+ @ Getter
915public class Addressee {
16+ @ XmlAttribute
1017 private @ NonNull String email ;
18+ @ XmlValue
1119 private String name ;
1220
1321 public Addressee (String email ) {
Original file line number Diff line number Diff line change 11package ru .javaops .masterjava .service .mail ;
22
33import lombok .AllArgsConstructor ;
4- import lombok .Data ;
4+ import lombok .Getter ;
55import lombok .NoArgsConstructor ;
66
7+ import javax .xml .bind .annotation .XmlAccessType ;
8+ import javax .xml .bind .annotation .XmlAccessorType ;
79import java .util .List ;
810
9- @ Data
1011@ AllArgsConstructor
1112@ NoArgsConstructor
13+ @ XmlAccessorType (XmlAccessType .FIELD )
14+ @ Getter
1215public class GroupResult {
1316 private int success ; // number of successfully sent email
1417 private List <MailResult > failed ; // failed emails with causes
Original file line number Diff line number Diff line change 11package ru .javaops .masterjava .service .mail ;
22
33import lombok .AllArgsConstructor ;
4- import lombok .Data ;
4+ import lombok .Getter ;
55import lombok .NoArgsConstructor ;
66import lombok .NonNull ;
77
8- @ Data
8+ import javax .xml .bind .annotation .XmlAccessType ;
9+ import javax .xml .bind .annotation .XmlAccessorType ;
10+ import javax .xml .bind .annotation .XmlAttribute ;
11+ import javax .xml .bind .annotation .XmlValue ;
12+
913@ AllArgsConstructor
1014@ NoArgsConstructor
15+ @ XmlAccessorType (XmlAccessType .FIELD )
16+ @ Getter
1117public class MailResult {
1218 public static final String OK = "OK" ;
1319
20+ @ XmlAttribute
1421 private @ NonNull String email ;
22+ @ XmlValue
1523 private String result ;
1624
1725 public boolean isOk () {
Original file line number Diff line number Diff line change 55 password: password
66 useSSL: true
77 useTLS: false
8- debug: true
8+ debug: false
99 fromName: MasterJava
1010}
1111
You can’t perform that action at this time.
0 commit comments