From 18f9c27e17a4bef2f1d6571bf113b9bb741046af Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 09 十一月 2020 15:09:31 +0800 Subject: [PATCH] 添加接口生成工具Swagger --- consumer-jdGiftCoupon/src/main/java/com/ks/consumerjdgiftcoupon/query/TestQuery.java | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/consumer-jdGiftCoupon/src/main/java/com/ks/consumerjdgiftcoupon/query/TestQuery.java b/consumer-jdGiftCoupon/src/main/java/com/ks/consumerjdgiftcoupon/query/TestQuery.java index 3afb795..b49cc1a 100644 --- a/consumer-jdGiftCoupon/src/main/java/com/ks/consumerjdgiftcoupon/query/TestQuery.java +++ b/consumer-jdGiftCoupon/src/main/java/com/ks/consumerjdgiftcoupon/query/TestQuery.java @@ -1,9 +1,13 @@ package com.ks.consumerjdgiftcoupon.query; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + import javax.validation.constraints.*; import java.math.BigDecimal; import java.util.Date; +@ApiModel(value = "娴嬭瘯鏌ヨ",description = "娴嬭瘯鏌ヨ") public class TestQuery { // @AssertFalse(message = "鎵�娉ㄨВ鐨勫厓绱犲繀椤绘槸Boolean绫诲瀷锛屼笖鍊间负false") @@ -14,24 +18,30 @@ // @Future(message = "鏃ユ湡鏄惁鍦ㄥ綋鍓嶆椂闂翠箣鍚�") + @ApiModelProperty(value = "鏄电О") @NotEmpty(message = "娉ㄥ唽澶辫触锛屽悕瀛椾笉鑳戒负绌�") private String name; + @ApiModelProperty(value = "骞撮緞") @Max(value = 19, message = "璇ュ瓧娈垫渶澶у�间负19") @Min(value = 0, message = "璇ュ瓧娈垫渶灏忓�间负0") private int age; + @ApiModelProperty(value = "韬珮") @DecimalMax(value = "3.00", message = "鎵�娉ㄨВ鐨勫厓绱犲繀椤绘槸鏁板瓧锛屼笖鍊煎皬浜庣瓑浜庣粰瀹氱殑鍊�") @DecimalMin(value = "0.00", message = "鎵�娉ㄨВ鐨勫厓绱犲繀椤绘槸鏁板瓧锛屼笖鍊煎ぇ浜庣瓑浜庣粰瀹氱殑鍊�") private BigDecimal height; + @ApiModelProperty(value = "鍑虹敓鏃ユ湡") @Past(message = "鍑虹敓鏃ユ湡涓嶈兘澶т簬褰撳墠鏃ユ湡") private Date birthday; + @ApiModelProperty(value = "閭") @Email(message = "閭欢鏍煎紡鏈夎") private String email;//閭欢 + @ApiModelProperty(value = "绛惧悕") @Pattern(regexp = "[abc]", message = "姝e垯涓嶅尮閰�") private String sign; -- Gitblit v1.8.0