From e09566039169bd1d9e70052fd2e6e609abb630e0 Mon Sep 17 00:00:00 2001 From: BenoƮt Verhaeghe Date: Sun, 5 Feb 2017 00:32:18 +0100 Subject: [PATCH] Raml with java.util.Date --- api.raml | 20 ++++++++++++-------- src/main/java/etunicorn/generated/TransactionController.java | 8 ++++---- src/main/java/etunicorn/generated/model/UpdateCreditRequest.java | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/etunicorn/generated/model/UpdateEvenementByIdRequest.java | 6 +++--- src/main/java/etunicorn/generated/model/UpdatePersonneByIdRequest.java | 6 +++--- src/main/java/etunicorn/generated/model/UpdatePersonneRequest.java | 12 ++++++------ 6 files changed, 148 insertions(+), 24 deletions(-) create mode 100644 src/main/java/etunicorn/generated/model/UpdateCreditRequest.java diff --git a/api.raml b/api.raml index f7fabd6..f319ba3 100644 --- a/api.raml +++ b/api.raml @@ -115,8 +115,9 @@ version: v1 "maxLength": 14 }, "naissance": { - "type": "date", - "required": false + "type": "string", + "required": false, + "format": "date" }, "login": { "type": "string", @@ -158,8 +159,9 @@ version: v1 "maxLength": 14 }, "naissance": { - "type": "date", - "required": false + "type": "string", + "required": false, + "format": "date" }, "login": { "type": "string", @@ -335,8 +337,9 @@ version: v1 "required": true }, "date": { - "type": "date", - "required": true + "type": "string", + "required": true, + "format": "date" } } } @@ -370,8 +373,9 @@ version: v1 "required": false }, "date": { - "type": "date", - "required": false + "type": "string", + "required": false, + "format": "date" } } } diff --git a/src/main/java/etunicorn/generated/TransactionController.java b/src/main/java/etunicorn/generated/TransactionController.java index 1985da5..47be235 100644 --- a/src/main/java/etunicorn/generated/TransactionController.java +++ b/src/main/java/etunicorn/generated/TransactionController.java @@ -2,7 +2,7 @@ package etunicorn.generated; import etunicorn.generated.model.UpdateConsommationRequest; -import etunicorn.generated.model.UpdateEvenementCreditRequest; +import etunicorn.generated.model.UpdateCreditRequest; import etunicorn.generated.model.UpdateEvenementRequest; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; @@ -52,11 +52,11 @@ public interface TransactionController { * Permet de recharger ou debiter un compte * */ - @RequestMapping(value = "/evenement/credit", method = RequestMethod.POST) - public ResponseEntity updateEvenementCredit( + @RequestMapping(value = "/credit", method = RequestMethod.POST) + public ResponseEntity updateCredit( @javax.validation.Valid @org.springframework.web.bind.annotation.RequestBody - UpdateEvenementCreditRequest updateEvenementCreditRequest); + UpdateCreditRequest updateCreditRequest); /** * Permet de recuperer la liste des transaction d'une personne diff --git a/src/main/java/etunicorn/generated/model/UpdateCreditRequest.java b/src/main/java/etunicorn/generated/model/UpdateCreditRequest.java new file mode 100644 index 0000000..3792c8f --- /dev/null +++ b/src/main/java/etunicorn/generated/model/UpdateCreditRequest.java @@ -0,0 +1,120 @@ + +package etunicorn.generated.model; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang.builder.ToStringBuilder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "participant", + "prix" +}) +public class UpdateCreditRequest { + + /** + * + * (Required) + * + */ + @JsonProperty("participant") + private Object participant; + /** + * + * (Required) + * + */ + @JsonProperty("prix") + private Float prix; + @JsonIgnore + private Map additionalProperties = new HashMap(); + + /** + * + * (Required) + * + * @return + * The participant + */ + @JsonProperty("participant") + public Object getParticipant() { + return participant; + } + + /** + * + * (Required) + * + * @param participant + * The participant + */ + @JsonProperty("participant") + public void setParticipant(Object participant) { + this.participant = participant; + } + + /** + * + * (Required) + * + * @return + * The prix + */ + @JsonProperty("prix") + public Float getPrix() { + return prix; + } + + /** + * + * (Required) + * + * @param prix + * The prix + */ + @JsonProperty("prix") + public void setPrix(Float prix) { + this.prix = prix; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(participant).append(prix).append(additionalProperties).toHashCode(); + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof UpdateCreditRequest) == false) { + return false; + } + UpdateCreditRequest rhs = ((UpdateCreditRequest) other); + return new EqualsBuilder().append(participant, rhs.participant).append(prix, rhs.prix).append(additionalProperties, rhs.additionalProperties).isEquals(); + } + +} diff --git a/src/main/java/etunicorn/generated/model/UpdateEvenementByIdRequest.java b/src/main/java/etunicorn/generated/model/UpdateEvenementByIdRequest.java index 2a3fbfd..c23d2b2 100644 --- a/src/main/java/etunicorn/generated/model/UpdateEvenementByIdRequest.java +++ b/src/main/java/etunicorn/generated/model/UpdateEvenementByIdRequest.java @@ -35,7 +35,7 @@ public class UpdateEvenementByIdRequest { * */ @JsonProperty("date") - private Object date; + private String date; @JsonIgnore private Map additionalProperties = new HashMap(); @@ -85,7 +85,7 @@ public class UpdateEvenementByIdRequest { * The date */ @JsonProperty("date") - public Object getDate() { + public String getDate() { return date; } @@ -95,7 +95,7 @@ public class UpdateEvenementByIdRequest { * The date */ @JsonProperty("date") - public void setDate(Object date) { + public void setDate(String date) { this.date = date; } diff --git a/src/main/java/etunicorn/generated/model/UpdatePersonneByIdRequest.java b/src/main/java/etunicorn/generated/model/UpdatePersonneByIdRequest.java index 3ce9745..83d3356 100644 --- a/src/main/java/etunicorn/generated/model/UpdatePersonneByIdRequest.java +++ b/src/main/java/etunicorn/generated/model/UpdatePersonneByIdRequest.java @@ -31,7 +31,7 @@ public class UpdatePersonneByIdRequest { * */ @JsonProperty("naissance") - private Object naissance; + private String naissance; /** * */ @@ -71,7 +71,7 @@ public class UpdatePersonneByIdRequest { * The naissance */ @JsonProperty("naissance") - public Object getNaissance() { + public String getNaissance() { return naissance; } @@ -81,7 +81,7 @@ public class UpdatePersonneByIdRequest { * The naissance */ @JsonProperty("naissance") - public void setNaissance(Object naissance) { + public void setNaissance(String naissance) { this.naissance = naissance; } diff --git a/src/main/java/etunicorn/generated/model/UpdatePersonneRequest.java b/src/main/java/etunicorn/generated/model/UpdatePersonneRequest.java index 4f404c6..ce0105b 100644 --- a/src/main/java/etunicorn/generated/model/UpdatePersonneRequest.java +++ b/src/main/java/etunicorn/generated/model/UpdatePersonneRequest.java @@ -31,12 +31,12 @@ public class UpdatePersonneRequest { * */ @JsonProperty("naissance") - private Object naissance; + private String naissance; /** * */ @JsonProperty("login") - private Object login; + private String login; /** * */ @@ -71,7 +71,7 @@ public class UpdatePersonneRequest { * The naissance */ @JsonProperty("naissance") - public Object getNaissance() { + public String getNaissance() { return naissance; } @@ -81,7 +81,7 @@ public class UpdatePersonneRequest { * The naissance */ @JsonProperty("naissance") - public void setNaissance(Object naissance) { + public void setNaissance(String naissance) { this.naissance = naissance; } @@ -91,7 +91,7 @@ public class UpdatePersonneRequest { * The login */ @JsonProperty("login") - public Object getLogin() { + public String getLogin() { return login; } @@ -101,7 +101,7 @@ public class UpdatePersonneRequest { * The login */ @JsonProperty("login") - public void setLogin(Object login) { + public void setLogin(String login) { this.login = login; } -- libgit2 0.21.2