优化: 增加Swagger注解

This commit is contained in:
TinyAnts 2023-03-15 15:14:00 +08:00
parent daf6ba26a4
commit c84b597032
6 changed files with 38 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package com.mdd.admin.validate.channel; package com.mdd.admin.validate.channel;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
@ -13,18 +14,23 @@ public class ChannelMpValidate implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Length(max = 100, message = "小程序名称不能超100个字符") @Length(max = 100, message = "小程序名称不能超100个字符")
@ApiModelProperty(value = "小程序名称")
private String name = ""; private String name = "";
@Length(max = 100, message = "原始ID不能超100个字符") @Length(max = 100, message = "原始ID不能超100个字符")
@ApiModelProperty(value = "原始ID")
private String primaryId = ""; private String primaryId = "";
@Length(max = 100, message = "appId不能超100个字符") @Length(max = 100, message = "appId不能超100个字符")
@ApiModelProperty(value = "appId")
private String appId = ""; private String appId = "";
@Length(max = 200, message = "appSecret不能超100个字符") @Length(max = 200, message = "appSecret不能超100个字符")
@ApiModelProperty(value = "appSecret")
private String appSecret = ""; private String appSecret = "";
@Length(max = 300, message = "小程序码不能超300个字符") @Length(max = 300, message = "小程序码不能超300个字符")
@ApiModelProperty(value = "二维码")
private String qrCode = ""; private String qrCode = "";
} }

View File

@ -2,6 +2,7 @@ package com.mdd.admin.validate.channel;
import com.mdd.common.validator.annotation.IntegerContains; import com.mdd.common.validator.annotation.IntegerContains;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
@ -14,30 +15,39 @@ public class ChannelOaValidate implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Length(max = 100, message = "小程序名称不能超100个字符") @Length(max = 100, message = "小程序名称不能超100个字符")
@ApiModelProperty(value = "公众号名称")
private String name = ""; private String name = "";
@Length(max = 100, message = "原始ID不能超100个字符") @Length(max = 100, message = "原始ID不能超100个字符")
@ApiModelProperty(value = "原始ID")
private String primaryId = ""; private String primaryId = "";
@Length(max = 100, message = "appId不能超100个字符") @Length(max = 100, message = "appId不能超100个字符")
@ApiModelProperty(value = "appId")
private String appId = ""; private String appId = "";
@Length(max = 200, message = "appSecret不能超100个字符") @Length(max = 200, message = "appSecret不能超100个字符")
@ApiModelProperty(value = "appSecret")
private String appSecret = ""; private String appSecret = "";
@Length(max = 300, message = "小程序码不能超300个字符") @Length(max = 300, message = "小程序码不能超300个字符")
@ApiModelProperty(value = "二维码")
private String qrCode = ""; private String qrCode = "";
@Length(max = 300, message = "URL不能超300个字符") @Length(max = 300, message = "URL不能超300个字符")
@ApiModelProperty(value = "URL")
private String url = ""; private String url = "";
@Length(max = 200, message = "Token不能超200个字符") @Length(max = 200, message = "Token不能超200个字符")
@ApiModelProperty(value = "Token")
private String token = ""; private String token = "";
@Length(max = 43, message = "EncodingAESKey不能超43个字符") @Length(max = 43, message = "EncodingAESKey不能超43个字符")
@ApiModelProperty(value = "EncodingAESKey")
private String encodingAesKey = ""; private String encodingAesKey = "";
@IntegerContains(values = {1, 2, 3}, message = "encryptionType不是合法值") @IntegerContains(values = {1, 2, 3}, message = "encryptionType不是合法值")
@ApiModelProperty(value = "消息加密方式")
private Integer encryptionType = 1; private Integer encryptionType = 1;
} }

View File

@ -1,6 +1,7 @@
package com.mdd.admin.validate.setting; package com.mdd.admin.validate.setting;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -11,14 +12,19 @@ public class SettingLoginValidate implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "登录方式")
private String loginWay = ""; private String loginWay = "";
@ApiModelProperty(value = "强制绑定手机")
private Integer forceBindMobile = 0; private Integer forceBindMobile = 0;
@ApiModelProperty(value = "政策协议")
private Integer openAgreement = 0; private Integer openAgreement = 0;
@ApiModelProperty(value = "第三方登录")
private Integer openOtherAuth = 0; private Integer openOtherAuth = 0;
@ApiModelProperty(value = "微信开放平台")
private String autoLoginAuth = ""; private String autoLoginAuth = "";
} }

View File

@ -1,6 +1,7 @@
package com.mdd.admin.validate.setting; package com.mdd.admin.validate.setting;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -11,6 +12,7 @@ public class SettingUserValidate implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "默认头像")
private String defaultAvatar = ""; private String defaultAvatar = "";
} }

View File

@ -1,6 +1,7 @@
package com.mdd.admin.validate.setting; package com.mdd.admin.validate.setting;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -11,17 +12,29 @@ public class SettingWebsiteValidate implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "网站名称")
private String name = ""; private String name = "";
@ApiModelProperty(value = "网站logo")
private String logo = ""; private String logo = "";
@ApiModelProperty(value = "网站图标")
private String favicon = ""; private String favicon = "";
@ApiModelProperty(value = "登录页广告图")
private String backdrop = ""; private String backdrop = "";
@ApiModelProperty(value = "商城名称")
private String shopName = ""; private String shopName = "";
@ApiModelProperty(value = "商城LOGO")
private String shopLogo = ""; private String shopLogo = "";
@ApiModelProperty(value = "PC端LOGO")
private String pcLogo = ""; private String pcLogo = "";
@ApiModelProperty(value = "网站标题")
private String pcTitle = ""; private String pcTitle = "";
@ApiModelProperty(value = "网站图标")
private String pcIco = ""; private String pcIco = "";
@ApiModelProperty(value = "网站描述")
private String pcDesc = ""; private String pcDesc = "";
@ApiModelProperty(value = "网站关键词")
private String pcKeywords = ""; private String pcKeywords = "";
} }

View File

@ -10,7 +10,7 @@ public enum ClientEnum {
H5(3, "手机H5"), H5(3, "手机H5"),
PC(4, "电脑PC"), PC(4, "电脑PC"),
IOS(5, "苹果APP"), IOS(5, "苹果APP"),
APK(5, "安卓APP"); APK(6, "安卓APP");
/** /**
* 构造方法 * 构造方法