update spring samples

This commit is contained in:
wing328
2017-06-11 15:39:08 +08:00
parent c5335081ea
commit f163fdb980
9 changed files with 67 additions and 13 deletions

View File

@@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* OuterComposite
*/
@@ -31,6 +33,9 @@ public class OuterComposite {
* @return myNumber
**/
@ApiModelProperty(value = "")
@Valid
public BigDecimal getMyNumber() {
return myNumber;
}
@@ -49,6 +54,8 @@ public class OuterComposite {
* @return myString
**/
@ApiModelProperty(value = "")
public String getMyString() {
return myString;
}
@@ -67,6 +74,8 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
return myBoolean;
}

View File

@@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* OuterComposite
*/
@@ -31,6 +33,9 @@ public class OuterComposite {
* @return myNumber
**/
@ApiModelProperty(value = "")
@Valid
public BigDecimal getMyNumber() {
return myNumber;
}
@@ -49,6 +54,8 @@ public class OuterComposite {
* @return myString
**/
@ApiModelProperty(value = "")
public String getMyString() {
return myString;
}
@@ -67,6 +74,8 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
return myBoolean;
}

View File

@@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* OuterComposite
*/
@@ -31,6 +33,9 @@ public class OuterComposite {
* @return myNumber
**/
@ApiModelProperty(value = "")
@Valid
public BigDecimal getMyNumber() {
return myNumber;
}
@@ -49,6 +54,8 @@ public class OuterComposite {
* @return myString
**/
@ApiModelProperty(value = "")
public String getMyString() {
return myString;
}
@@ -67,6 +74,8 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
return myBoolean;
}

View File

@@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* OuterComposite
*/
@@ -31,6 +33,9 @@ public class OuterComposite {
* @return myNumber
**/
@ApiModelProperty(value = "")
@Valid
public BigDecimal getMyNumber() {
return myNumber;
}
@@ -49,6 +54,8 @@ public class OuterComposite {
* @return myString
**/
@ApiModelProperty(value = "")
public String getMyString() {
return myString;
}
@@ -67,6 +74,8 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
return myBoolean;
}

View File

@@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* OuterComposite
*/
@@ -31,6 +33,9 @@ public class OuterComposite {
* @return myNumber
**/
@ApiModelProperty(value = "")
@Valid
public BigDecimal getMyNumber() {
return myNumber;
}
@@ -49,6 +54,8 @@ public class OuterComposite {
* @return myString
**/
@ApiModelProperty(value = "")
public String getMyString() {
return myString;
}
@@ -67,6 +74,8 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
return myBoolean;
}

View File

@@ -64,8 +64,8 @@ public interface PetApi {
})
}, tags={ "pet", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
@ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) })
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid status value", response = Void.class) })
@ApiImplicitParams({
})
@@ -82,8 +82,8 @@ public interface PetApi {
})
}, tags={ "pet", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
@ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) })
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) })
@ApiImplicitParams({
})
@@ -98,8 +98,8 @@ public interface PetApi {
}, tags={ "pet", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class),
@ApiResponse(code = 404, message = "Pet not found", response = Pet.class) })
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
@ApiResponse(code = 404, message = "Pet not found", response = Void.class) })
@ApiImplicitParams({
})

View File

@@ -38,7 +38,7 @@ public interface StoreApi {
@Authorization(value = "api_key")
}, tags={ "store", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Integer.class) })
@ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") })
@ApiImplicitParams({
})
@@ -51,8 +51,8 @@ public interface StoreApi {
@ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
@ApiResponse(code = 404, message = "Order not found", response = Order.class) })
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
@ApiResponse(code = 404, message = "Order not found", response = Void.class) })
@ApiImplicitParams({
})
@@ -65,7 +65,7 @@ public interface StoreApi {
@ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid Order", response = Order.class) })
@ApiResponse(code = 400, message = "Invalid Order", response = Void.class) })
@ApiImplicitParams({
})

View File

@@ -73,8 +73,8 @@ public interface UserApi {
@ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = User.class),
@ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
@ApiResponse(code = 404, message = "User not found", response = User.class) })
@ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
@ApiResponse(code = 404, message = "User not found", response = Void.class) })
@ApiImplicitParams({
})
@@ -87,7 +87,7 @@ public interface UserApi {
@ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = String.class),
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) })
@ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) })
@ApiImplicitParams({
})

View File

@@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* OuterComposite
*/
@@ -31,6 +33,9 @@ public class OuterComposite {
* @return myNumber
**/
@ApiModelProperty(value = "")
@Valid
public BigDecimal getMyNumber() {
return myNumber;
}
@@ -49,6 +54,8 @@ public class OuterComposite {
* @return myString
**/
@ApiModelProperty(value = "")
public String getMyString() {
return myString;
}
@@ -67,6 +74,8 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
return myBoolean;
}