mirror of
https://github.com/chillzhuang/blade-tool
synced 2024-11-15 06:59:29 +08:00
🎉 优化swagger配置逻辑
This commit is contained in:
parent
e2dceaef0f
commit
ff7cf290c5
@ -50,14 +50,14 @@ public class BaseEntity implements Serializable {
|
||||
* 创建人
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Schema(description = "创建人")
|
||||
@Schema(description = "创建人", hidden = true)
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 创建部门
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Schema(description = "创建部门")
|
||||
@Schema(description = "创建部门", hidden = true)
|
||||
private Long createDept;
|
||||
|
||||
/**
|
||||
@ -65,14 +65,14 @@ public class BaseEntity implements Serializable {
|
||||
*/
|
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
|
||||
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
|
||||
@Schema(description = "创建时间")
|
||||
@Schema(description = "创建时间", hidden = true)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Schema(description = "更新人")
|
||||
@Schema(description = "更新人", hidden = true)
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
@ -80,19 +80,19 @@ public class BaseEntity implements Serializable {
|
||||
*/
|
||||
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
|
||||
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
|
||||
@Schema(description = "更新时间")
|
||||
@Schema(description = "更新时间", hidden = true)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 状态[1:正常]
|
||||
*/
|
||||
@Schema(description = "业务状态")
|
||||
@Schema(description = "业务状态", hidden = true)
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 状态[0:未删除,1:删除]
|
||||
*/
|
||||
@TableLogic
|
||||
@Schema(description = "是否已删除")
|
||||
@Schema(description = "是否已删除", hidden = true)
|
||||
private Integer isDeleted;
|
||||
}
|
||||
|
@ -34,12 +34,16 @@ public class SwaggerLauncherServiceImpl implements LauncherService {
|
||||
public void launcher(SpringApplicationBuilder builder, String appName, String profile) {
|
||||
Properties props = System.getProperties();
|
||||
if (profile.equals(AppConstant.PROD_CODE)) {
|
||||
props.setProperty("knife4j.production", "true");
|
||||
props.setProperty("swagger.enabled", "false");
|
||||
}
|
||||
props.setProperty("knife4j.enable", "false");
|
||||
props.setProperty("knife4j.production", "true");
|
||||
} else {
|
||||
props.setProperty("swagger.enabled", "true");
|
||||
props.setProperty("knife4j.enable", "true");
|
||||
props.setProperty("knife4j.production", "false");
|
||||
props.setProperty("spring.mvc.pathmatch.matching-strategy", "ANT_PATH_MATCHER");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
|
@ -8,6 +8,8 @@ springdoc:
|
||||
api-docs:
|
||||
enabled: true
|
||||
path: /v3/api-docs
|
||||
# 默认是false,需要设置为true
|
||||
default-flat-param-object: true
|
||||
|
||||
#knife4j配置
|
||||
knife4j:
|
||||
|
Loading…
Reference in New Issue
Block a user