Fix per il rilascio su DBCFX_RU_362
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* OpenAMDS REST API - OpenAPI 3.0
|
||||
* REST API per OpenAMDS
|
||||
*
|
||||
* OpenAPI spec version: 1.0.11
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package it.valueteam.gnp.ws.amds.model;
|
||||
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import java.io.IOException;
|
||||
/**
|
||||
* DynamicField
|
||||
*/
|
||||
|
||||
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2024-05-10T08:42:45.887229576Z[GMT]")
|
||||
|
||||
public class DynamicField {
|
||||
@SerializedName("fieldName")
|
||||
private String fieldName = null;
|
||||
|
||||
@SerializedName("value")
|
||||
private String value = null;
|
||||
|
||||
public DynamicField fieldName(String fieldName) {
|
||||
this.fieldName = fieldName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get fieldName
|
||||
* @return fieldName
|
||||
**/
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
|
||||
public void setFieldName(String fieldName) {
|
||||
this.fieldName = fieldName;
|
||||
}
|
||||
|
||||
public DynamicField value(String value) {
|
||||
this.value = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get value
|
||||
* @return value
|
||||
**/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DynamicField {\n");
|
||||
|
||||
sb.append(" fieldName: ").append(toIndentedString(fieldName)).append("\n");
|
||||
sb.append(" value: ").append(toIndentedString(value)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
package it.valueteam.gnp.ws.amds.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
@@ -40,15 +41,46 @@ public class NotifyMessage {
|
||||
@SerializedName("timestamp")
|
||||
private String timestamp = null;
|
||||
|
||||
@SerializedName("serviceNumber")
|
||||
private String serviceNumber = null;
|
||||
|
||||
@SerializedName("archive")
|
||||
private String archive = null;
|
||||
|
||||
@SerializedName("drNotify")
|
||||
private String drNotify = null;
|
||||
|
||||
@SerializedName("messageType")
|
||||
private String messageType = null;
|
||||
|
||||
@SerializedName("smsMessageList")
|
||||
private SmsMessage[] smsMessageList;
|
||||
|
||||
public String getServiceNumber() {
|
||||
return serviceNumber;
|
||||
}
|
||||
|
||||
public void setServiceNumber(String serviceNumber) {
|
||||
this.serviceNumber = serviceNumber;
|
||||
}
|
||||
|
||||
public SmsMessage[] getSmsMessageList() {
|
||||
return smsMessageList;
|
||||
}
|
||||
|
||||
public void setSmsMessageList(SmsMessage[] smsMessageList) {
|
||||
this.smsMessageList = smsMessageList;
|
||||
}
|
||||
|
||||
public NotifyMessage sourceNumber(String sourceNumber) {
|
||||
this.sourceNumber = sourceNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get sourceNumber
|
||||
* @return sourceNumber
|
||||
**/
|
||||
**/
|
||||
public String getSourceNumber() {
|
||||
return sourceNumber;
|
||||
}
|
||||
@@ -62,10 +94,10 @@ public class NotifyMessage {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get destinationNumber
|
||||
* @return destinationNumber
|
||||
**/
|
||||
**/
|
||||
public String getDestinationNumber() {
|
||||
return destinationNumber;
|
||||
}
|
||||
@@ -79,10 +111,10 @@ public class NotifyMessage {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get content
|
||||
* @return content
|
||||
**/
|
||||
**/
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
@@ -96,10 +128,10 @@ public class NotifyMessage {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get timestamp
|
||||
* @return timestamp
|
||||
**/
|
||||
**/
|
||||
public String getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
@@ -108,6 +140,29 @@ public class NotifyMessage {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public String getArchive() {
|
||||
return archive;
|
||||
}
|
||||
|
||||
public void setArchive(String archive) {
|
||||
this.archive = archive;
|
||||
}
|
||||
|
||||
public String getDrNotify() {
|
||||
return drNotify;
|
||||
}
|
||||
|
||||
public void setDrNotify(String drNotify) {
|
||||
this.drNotify = drNotify;
|
||||
}
|
||||
|
||||
public String getMessageType() {
|
||||
return messageType;
|
||||
}
|
||||
|
||||
public void setMessageType(String messageType) {
|
||||
this.messageType = messageType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
@@ -124,7 +179,7 @@ public class NotifyMessage {
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class NotifyMessage {\n");
|
||||
|
||||
|
||||
sb.append(" sourceNumber: ").append(toIndentedString(sourceNumber)).append("\n");
|
||||
sb.append(" destinationNumber: ").append(toIndentedString(destinationNumber)).append("\n");
|
||||
sb.append(" content: ").append(toIndentedString(content)).append("\n");
|
||||
|
||||
405
gnpdev/dbcfx/src/it/valueteam/gnp/ws/amds/model/SmsMessage.java
Normal file
405
gnpdev/dbcfx/src/it/valueteam/gnp/ws/amds/model/SmsMessage.java
Normal file
@@ -0,0 +1,405 @@
|
||||
/*
|
||||
* OpenAMDS REST API - OpenAPI 3.0
|
||||
* REST API per OpenAMDS
|
||||
*
|
||||
* OpenAPI spec version: 1.0.11
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package it.valueteam.gnp.ws.amds.model;
|
||||
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import it.valueteam.gnp.ws.amds.model.SmsTemplate;
|
||||
import java.io.IOException;
|
||||
/**
|
||||
* SmsMessage
|
||||
*/
|
||||
|
||||
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2024-05-10T08:42:45.887229576Z[GMT]")
|
||||
|
||||
public class SmsMessage {
|
||||
@SerializedName("destinationNumber")
|
||||
private String destinationNumber = null;
|
||||
|
||||
@SerializedName("sender")
|
||||
private String sender = null;
|
||||
|
||||
@SerializedName("content")
|
||||
private String content = null;
|
||||
|
||||
@SerializedName("validity")
|
||||
private String validity = null;
|
||||
|
||||
public SmsMessage(String destinationNumber, String content) {
|
||||
this.destinationNumber = destinationNumber;
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets or Sets archive
|
||||
*/
|
||||
@JsonAdapter(ArchiveEnum.Adapter.class)
|
||||
public enum ArchiveEnum {
|
||||
@SerializedName("Y")
|
||||
Y("Y"),
|
||||
@SerializedName("N")
|
||||
N("N");
|
||||
|
||||
private String value;
|
||||
|
||||
ArchiveEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
public static ArchiveEnum fromValue(String input) {
|
||||
for (ArchiveEnum b : ArchiveEnum.values()) {
|
||||
if (b.value.equals(input)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static class Adapter extends TypeAdapter<ArchiveEnum> {
|
||||
@Override
|
||||
public void write(final JsonWriter jsonWriter, final ArchiveEnum enumeration) throws IOException {
|
||||
jsonWriter.value(String.valueOf(enumeration.getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArchiveEnum read(final JsonReader jsonReader) throws IOException {
|
||||
Object value = jsonReader.nextString();
|
||||
return ArchiveEnum.fromValue((String)(value));
|
||||
}
|
||||
}
|
||||
} @SerializedName("archive")
|
||||
private ArchiveEnum archive = ArchiveEnum.N;
|
||||
|
||||
/**
|
||||
* Gets or Sets drNotify
|
||||
*/
|
||||
@JsonAdapter(DrNotifyEnum.Adapter.class)
|
||||
public enum DrNotifyEnum {
|
||||
@SerializedName("Y")
|
||||
Y("Y"),
|
||||
@SerializedName("N")
|
||||
N("N");
|
||||
|
||||
private String value;
|
||||
|
||||
DrNotifyEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
public static DrNotifyEnum fromValue(String input) {
|
||||
for (DrNotifyEnum b : DrNotifyEnum.values()) {
|
||||
if (b.value.equals(input)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static class Adapter extends TypeAdapter<DrNotifyEnum> {
|
||||
@Override
|
||||
public void write(final JsonWriter jsonWriter, final DrNotifyEnum enumeration) throws IOException {
|
||||
jsonWriter.value(String.valueOf(enumeration.getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public DrNotifyEnum read(final JsonReader jsonReader) throws IOException {
|
||||
Object value = jsonReader.nextString();
|
||||
return DrNotifyEnum.fromValue((String)(value));
|
||||
}
|
||||
}
|
||||
} @SerializedName("drNotify")
|
||||
private DrNotifyEnum drNotify = DrNotifyEnum.N;
|
||||
|
||||
@SerializedName("type")
|
||||
private String type = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets messageEncoding
|
||||
*/
|
||||
@JsonAdapter(MessageEncodingEnum.Adapter.class)
|
||||
public enum MessageEncodingEnum {
|
||||
@SerializedName("Text")
|
||||
TEXT("Text"),
|
||||
@SerializedName("Binary")
|
||||
BINARY("Binary");
|
||||
|
||||
private String value;
|
||||
|
||||
MessageEncodingEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
public static MessageEncodingEnum fromValue(String input) {
|
||||
for (MessageEncodingEnum b : MessageEncodingEnum.values()) {
|
||||
if (b.value.equals(input)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static class Adapter extends TypeAdapter<MessageEncodingEnum> {
|
||||
@Override
|
||||
public void write(final JsonWriter jsonWriter, final MessageEncodingEnum enumeration) throws IOException {
|
||||
jsonWriter.value(String.valueOf(enumeration.getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageEncodingEnum read(final JsonReader jsonReader) throws IOException {
|
||||
Object value = jsonReader.nextString();
|
||||
return MessageEncodingEnum.fromValue((String)(value));
|
||||
}
|
||||
}
|
||||
} @SerializedName("messageEncoding")
|
||||
private MessageEncodingEnum messageEncoding = null;
|
||||
|
||||
@SerializedName("uid")
|
||||
private String uid = null;
|
||||
|
||||
@SerializedName("smsTemplate")
|
||||
private SmsTemplate smsTemplate = null;
|
||||
|
||||
public SmsMessage destinationNumber(String destinationNumber) {
|
||||
this.destinationNumber = destinationNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get destinationNumber
|
||||
* @return destinationNumber
|
||||
**/
|
||||
public String getDestinationNumber() {
|
||||
return destinationNumber;
|
||||
}
|
||||
|
||||
public void setDestinationNumber(String destinationNumber) {
|
||||
this.destinationNumber = destinationNumber;
|
||||
}
|
||||
|
||||
public SmsMessage sender(String sender) {
|
||||
this.sender = sender;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sender
|
||||
* @return sender
|
||||
**/
|
||||
public String getSender() {
|
||||
return sender;
|
||||
}
|
||||
|
||||
public void setSender(String sender) {
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
public SmsMessage content(String content) {
|
||||
this.content = content;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get content
|
||||
* @return content
|
||||
**/
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public SmsMessage validity(String validity) {
|
||||
this.validity = validity;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get validity
|
||||
* @return validity
|
||||
**/
|
||||
public String getValidity() {
|
||||
return validity;
|
||||
}
|
||||
|
||||
public void setValidity(String validity) {
|
||||
this.validity = validity;
|
||||
}
|
||||
|
||||
public SmsMessage archive(ArchiveEnum archive) {
|
||||
this.archive = archive;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get archive
|
||||
* @return archive
|
||||
**/
|
||||
public ArchiveEnum getArchive() {
|
||||
return archive;
|
||||
}
|
||||
|
||||
public void setArchive(ArchiveEnum archive) {
|
||||
this.archive = archive;
|
||||
}
|
||||
|
||||
public SmsMessage drNotify(DrNotifyEnum drNotify) {
|
||||
this.drNotify = drNotify;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get drNotify
|
||||
* @return drNotify
|
||||
**/
|
||||
public DrNotifyEnum getDrNotify() {
|
||||
return drNotify;
|
||||
}
|
||||
|
||||
public void setDrNotify(DrNotifyEnum drNotify) {
|
||||
this.drNotify = drNotify;
|
||||
}
|
||||
|
||||
public SmsMessage type(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
* @return type
|
||||
**/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public SmsMessage messageEncoding(MessageEncodingEnum messageEncoding) {
|
||||
this.messageEncoding = messageEncoding;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get messageEncoding
|
||||
* @return messageEncoding
|
||||
**/
|
||||
public MessageEncodingEnum getMessageEncoding() {
|
||||
return messageEncoding;
|
||||
}
|
||||
|
||||
public void setMessageEncoding(MessageEncodingEnum messageEncoding) {
|
||||
this.messageEncoding = messageEncoding;
|
||||
}
|
||||
|
||||
public SmsMessage uid(String uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get uid
|
||||
* @return uid
|
||||
**/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public SmsMessage smsTemplate(SmsTemplate smsTemplate) {
|
||||
this.smsTemplate = smsTemplate;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get smsTemplate
|
||||
* @return smsTemplate
|
||||
**/
|
||||
public SmsTemplate getSmsTemplate() {
|
||||
return smsTemplate;
|
||||
}
|
||||
|
||||
public void setSmsTemplate(SmsTemplate smsTemplate) {
|
||||
this.smsTemplate = smsTemplate;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class SmsMessage {\n");
|
||||
|
||||
sb.append(" destinationNumber: ").append(toIndentedString(destinationNumber)).append("\n");
|
||||
sb.append(" sender: ").append(toIndentedString(sender)).append("\n");
|
||||
sb.append(" content: ").append(toIndentedString(content)).append("\n");
|
||||
sb.append(" validity: ").append(toIndentedString(validity)).append("\n");
|
||||
sb.append(" archive: ").append(toIndentedString(archive)).append("\n");
|
||||
sb.append(" drNotify: ").append(toIndentedString(drNotify)).append("\n");
|
||||
sb.append(" type: ").append(toIndentedString(type)).append("\n");
|
||||
sb.append(" messageEncoding: ").append(toIndentedString(messageEncoding)).append("\n");
|
||||
sb.append(" uid: ").append(toIndentedString(uid)).append("\n");
|
||||
sb.append(" smsTemplate: ").append(toIndentedString(smsTemplate)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String toJsonString(String destinationNumber, String content) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("{\n");
|
||||
|
||||
sb.append(" destinationNumber: ").append(toIndentedString(destinationNumber)).append(",\n");
|
||||
sb.append(" content: ").append(toIndentedString(content)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* OpenAMDS REST API - OpenAPI 3.0
|
||||
* REST API per OpenAMDS
|
||||
*
|
||||
* OpenAPI spec version: 1.0.11
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package it.valueteam.gnp.ws.amds.model;
|
||||
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import it.valueteam.gnp.ws.amds.model.SmsMessage;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
/**
|
||||
* SmsSendRequest
|
||||
*/
|
||||
|
||||
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2024-05-10T08:42:45.887229576Z[GMT]")
|
||||
|
||||
public class SmsSendRequest {
|
||||
@SerializedName("serviceNumber")
|
||||
private String serviceNumber = null;
|
||||
|
||||
@SerializedName("smsMessageList")
|
||||
private SmsMessage[] smsMessageList = new SmsMessage[1];
|
||||
|
||||
public SmsSendRequest serviceNumber(String serviceNumber) {
|
||||
this.serviceNumber = serviceNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get serviceNumber
|
||||
* @return serviceNumber
|
||||
**/
|
||||
public String getServiceNumber() {
|
||||
return serviceNumber;
|
||||
}
|
||||
|
||||
public void setServiceNumber(String serviceNumber) {
|
||||
this.serviceNumber = serviceNumber;
|
||||
}
|
||||
|
||||
public SmsSendRequest smsMessageList(SmsMessage[] smsMessageList) {
|
||||
this.smsMessageList = smsMessageList;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SmsSendRequest addSmsMessageListItem(SmsMessage smsMessageListItem) {
|
||||
this.smsMessageList[0] = smsMessageListItem;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get smsMessageList
|
||||
* @return smsMessageList
|
||||
**/
|
||||
public SmsMessage[] getSmsMessageList() {
|
||||
return smsMessageList;
|
||||
}
|
||||
|
||||
public void setSmsMessageList(SmsMessage[] smsMessageList) {
|
||||
this.smsMessageList = smsMessageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class SmsSendRequest {\n");
|
||||
|
||||
sb.append(" serviceNumber: ").append(toIndentedString(serviceNumber)).append("\n");
|
||||
sb.append(" smsMessageList: ").append(toIndentedString(smsMessageList)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
100
gnpdev/dbcfx/src/it/valueteam/gnp/ws/amds/model/SmsTemplate.java
Normal file
100
gnpdev/dbcfx/src/it/valueteam/gnp/ws/amds/model/SmsTemplate.java
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* OpenAMDS REST API - OpenAPI 3.0
|
||||
* REST API per OpenAMDS
|
||||
*
|
||||
* OpenAPI spec version: 1.0.11
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package it.valueteam.gnp.ws.amds.model;
|
||||
|
||||
import java.util.Arrays;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import it.valueteam.gnp.ws.amds.model.DynamicField;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
/**
|
||||
* SmsTemplate
|
||||
*/
|
||||
|
||||
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2024-05-10T08:42:45.887229576Z[GMT]")
|
||||
|
||||
public class SmsTemplate {
|
||||
@SerializedName("id")
|
||||
private String id = null;
|
||||
|
||||
@SerializedName("dynamicFieldList")
|
||||
private List<DynamicField> dynamicFieldList = new ArrayList<DynamicField>();
|
||||
|
||||
public SmsTemplate id(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public SmsTemplate dynamicFieldList(List<DynamicField> dynamicFieldList) {
|
||||
this.dynamicFieldList = dynamicFieldList;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SmsTemplate addDynamicFieldListItem(DynamicField dynamicFieldListItem) {
|
||||
this.dynamicFieldList.add(dynamicFieldListItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dynamicFieldList
|
||||
* @return dynamicFieldList
|
||||
**/
|
||||
public List<DynamicField> getDynamicFieldList() {
|
||||
return dynamicFieldList;
|
||||
}
|
||||
|
||||
public void setDynamicFieldList(List<DynamicField> dynamicFieldList) {
|
||||
this.dynamicFieldList = dynamicFieldList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class SmsTemplate {\n");
|
||||
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" dynamicFieldList: ").append(toIndentedString(dynamicFieldList)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,11 +12,11 @@ import it.valueteam.gnp.utility.Func;
|
||||
import it.valueteam.gnp.utility.Resources;
|
||||
import it.valueteam.gnp.ws.amds.model.DeliveryReport;
|
||||
import it.valueteam.gnp.ws.amds.model.NotifyMessage;
|
||||
import it.valueteam.gnp.ws.amds.model.SmsMessage;
|
||||
import it.valueteam.gnp.ws.amds.model.SmsSendRequest;
|
||||
import it.valueteam.gnp.ws.sdp.ErrorDTO;
|
||||
import it.valueteam.gnp.ws.sdp.model.*;
|
||||
import org.apache.http.Header;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.HttpRequest;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
@@ -28,12 +28,12 @@ import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.message.BasicHeader;
|
||||
import tim.infobus.data.TID;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -194,11 +194,9 @@ public class WSRestHandler {
|
||||
|
||||
public String createNotifyMessage(String sourceNumber, String destinationNumber, String content, Date timestamp) {
|
||||
NotifyMessage message = new NotifyMessage();
|
||||
message.setSourceNumber(sourceNumber);
|
||||
message.setDestinationNumber(destinationNumber);
|
||||
message.setContent(content);
|
||||
message.setTimestamp(DateUtils.toString(timestamp,"yyyy-MM-dd HH:mm:ss.SSS"));
|
||||
|
||||
message.setServiceNumber(sourceNumber);
|
||||
SmsMessage[] smsMessageList = new SmsMessage[1];
|
||||
message.setSmsMessageList(smsMessageList);
|
||||
return createPostRequest(new Gson(), message);
|
||||
}
|
||||
|
||||
@@ -211,16 +209,19 @@ public class WSRestHandler {
|
||||
CloseableHttpResponse response = null;
|
||||
StringBuilder jsonString = new StringBuilder();
|
||||
try {
|
||||
StringEntity postingString = new StringEntity(json);
|
||||
|
||||
SSLContext sslContext = WSUtils.createSSLContext("SSL"); //verificare WSUtils
|
||||
SSLConnectionSocketFactory scf = new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE);
|
||||
//client = HttpClients.custom().useSystemProperties().build();
|
||||
//client = HttpClients.custom().useSystemProperties().build();
|
||||
client = HttpClients.custom().useSystemProperties().setSSLSocketFactory(scf).build();
|
||||
StringEntity postingString = new StringEntity(json);
|
||||
|
||||
HttpPost post = new HttpPost(url);
|
||||
post.setEntity(postingString);
|
||||
post.setHeader("Content-type","application/json");
|
||||
post.setHeader("X-SourceSystem","DBCFX");
|
||||
post.setHeader("X-Business-ID", String.valueOf(new TID()));
|
||||
post.setHeader("sourceSystem","DBCFX");
|
||||
post.setHeader("businessId", String.valueOf(new TID()));
|
||||
post.setHeader("transactionId", String.valueOf(new TID()));
|
||||
|
||||
response = client.execute(post);
|
||||
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
|
||||
@@ -276,7 +277,8 @@ public class WSRestHandler {
|
||||
|
||||
//Header[] headers = setHeader("postSmsOut", log);
|
||||
|
||||
NotifyMessage sms = new NotifyMessage();
|
||||
SmsSendRequest request = new SmsSendRequest();
|
||||
SmsMessage sms = new SmsMessage("","");
|
||||
|
||||
if (smsOut.getDn() == null) { //Recipient standard
|
||||
sms.setContent(Resources.getSMS_MESSAGE());
|
||||
@@ -316,15 +318,36 @@ public class WSRestHandler {
|
||||
sms.setContent(MessageFormat.format(messageSMS, parametri));
|
||||
}
|
||||
sms.setDestinationNumber(smsOut.getRecapitoAlternativo());
|
||||
sms.setSourceNumber(Resources.getSMS_SOURCE());
|
||||
request.setServiceNumber(Resources.getSMS_SOURCE());
|
||||
|
||||
String notifyMessageString = createNotifyMessage(sms.getSourceNumber(), sms.getDestinationNumber(), sms.getContent(), new Date());
|
||||
log.write("9999", "request.getServiceNumber() = " + request.getServiceNumber());
|
||||
log.write("9999", "sms.getDestinationNumber() = " + sms.getDestinationNumber());
|
||||
log.write("9999", "sms.getServiceNumber() = " + sms.getContent());
|
||||
|
||||
String smsString = createSmsMessageStr(sms.getDestinationNumber(), sms.getContent());
|
||||
log.write("9999", "log smsString :" + smsString);
|
||||
|
||||
String smsMessageString = createNotifyMessage(request.getServiceNumber(), sms.getDestinationNumber(), sms.getContent(), smsOut.getDataInvio());
|
||||
String newString = smsMessageString.replace("[null]", "[" + smsString + "]");
|
||||
try {
|
||||
String restPost = restPost(Resources.getAMDS_REST_URL(), null, notifyMessageString, log);
|
||||
log.write("9999", "invio JSON verso SDP/AMDS :" + newString);
|
||||
String restPost = restPost(Resources.getAMDS_REST_URL(), null, newString, log);
|
||||
//logga la response
|
||||
log.debug(restPost);
|
||||
log.write("9999", "postSmsOut [AMDS]: CHIAMATA SERVIZIO REST inviata, response: " + restPost);
|
||||
}catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
log.write("9999", "postSmsOut [AMDS]: CHIAMATA SERVIZIO REST in ERRORE: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private String createSmsMessageStr(String destinationNumber, String content) {
|
||||
NotifyMessage message = new NotifyMessage();
|
||||
message.setDestinationNumber("+39" + destinationNumber);
|
||||
message.setContent(content);
|
||||
message.setArchive("N");
|
||||
message.setDrNotify("N");
|
||||
message.setMessageType("Text");
|
||||
Gson gson = new Gson();
|
||||
return createPostRequest(gson, message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user