使用vitejs+vue3+antdv重构swagger文档展示
This commit is contained in:
@@ -0,0 +1,183 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* swagger文档地址
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-10-15
|
||||
*/
|
||||
public class SwaggerDoc implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文档名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文档类型 1=url 2=swagger文档json
|
||||
*/
|
||||
private Integer docType;
|
||||
|
||||
/**
|
||||
* 文档URL地址
|
||||
*/
|
||||
private String docUrl;
|
||||
|
||||
/**
|
||||
* swagger文档json内容
|
||||
*/
|
||||
private String jsonContent;
|
||||
|
||||
/**
|
||||
* 重写的域名
|
||||
*/
|
||||
private String rewriteDomain;
|
||||
|
||||
/**
|
||||
* 是否开放访问 0=否 1=是
|
||||
*/
|
||||
private Integer openVisit;
|
||||
|
||||
/**
|
||||
* 状态 1=启用 2=禁用
|
||||
*/
|
||||
private Integer docStatus;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否有效 0=无效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public Integer getDocType() {
|
||||
return docType;
|
||||
}
|
||||
|
||||
public void setDocType(Integer docType) {
|
||||
this.docType = docType;
|
||||
}
|
||||
public String getDocUrl() {
|
||||
return docUrl;
|
||||
}
|
||||
|
||||
public void setDocUrl(String docUrl) {
|
||||
this.docUrl = docUrl;
|
||||
}
|
||||
public String getJsonContent() {
|
||||
return jsonContent;
|
||||
}
|
||||
|
||||
public void setJsonContent(String jsonContent) {
|
||||
this.jsonContent = jsonContent;
|
||||
}
|
||||
public String getRewriteDomain() {
|
||||
return rewriteDomain;
|
||||
}
|
||||
|
||||
public void setRewriteDomain(String rewriteDomain) {
|
||||
this.rewriteDomain = rewriteDomain;
|
||||
}
|
||||
public Integer getOpenVisit() {
|
||||
return openVisit;
|
||||
}
|
||||
|
||||
public void setOpenVisit(Integer openVisit) {
|
||||
this.openVisit = openVisit;
|
||||
}
|
||||
public Integer getDocStatus() {
|
||||
return docStatus;
|
||||
}
|
||||
|
||||
public void setDocStatus(Integer docStatus) {
|
||||
this.docStatus = docStatus;
|
||||
}
|
||||
public Long getCreateUserId() {
|
||||
return createUserId;
|
||||
}
|
||||
|
||||
public void setCreateUserId(Long createUserId) {
|
||||
this.createUserId = createUserId;
|
||||
}
|
||||
public String getCreateUserName() {
|
||||
return createUserName;
|
||||
}
|
||||
|
||||
public void setCreateUserName(String createUserName) {
|
||||
this.createUserName = createUserName;
|
||||
}
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
public Integer getYn() {
|
||||
return yn;
|
||||
}
|
||||
|
||||
public void setYn(Integer yn) {
|
||||
this.yn = yn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SwaggerDoc{" +
|
||||
"id=" + id +
|
||||
", name=" + name +
|
||||
", docType=" + docType +
|
||||
", docUrl=" + docUrl +
|
||||
", jsonContent=" + jsonContent +
|
||||
", rewriteDomain=" + rewriteDomain +
|
||||
", openVisit=" + openVisit +
|
||||
", docStatus=" + docStatus +
|
||||
", createUserId=" + createUserId +
|
||||
", createUserName=" + createUserName +
|
||||
", createTime=" + createTime +
|
||||
", yn=" + yn +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* swagger文档全局参数记录
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-10-15
|
||||
*/
|
||||
public class SwaggerGlobalParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 参数类型 1=form 2=header 3=cookie
|
||||
*/
|
||||
private Integer paramType;
|
||||
|
||||
/**
|
||||
* 参数名
|
||||
*/
|
||||
private String paramKey;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
private String paramValue;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否有效 0=无效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public Integer getParamType() {
|
||||
return paramType;
|
||||
}
|
||||
|
||||
public void setParamType(Integer paramType) {
|
||||
this.paramType = paramType;
|
||||
}
|
||||
public String getParamKey() {
|
||||
return paramKey;
|
||||
}
|
||||
|
||||
public void setParamKey(String paramKey) {
|
||||
this.paramKey = paramKey;
|
||||
}
|
||||
public String getParamValue() {
|
||||
return paramValue;
|
||||
}
|
||||
|
||||
public void setParamValue(String paramValue) {
|
||||
this.paramValue = paramValue;
|
||||
}
|
||||
public Long getCreateUserId() {
|
||||
return createUserId;
|
||||
}
|
||||
|
||||
public void setCreateUserId(Long createUserId) {
|
||||
this.createUserId = createUserId;
|
||||
}
|
||||
public String getCreateUserName() {
|
||||
return createUserName;
|
||||
}
|
||||
|
||||
public void setCreateUserName(String createUserName) {
|
||||
this.createUserName = createUserName;
|
||||
}
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
public Integer getYn() {
|
||||
return yn;
|
||||
}
|
||||
|
||||
public void setYn(Integer yn) {
|
||||
this.yn = yn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SwaggerGlobalParam{" +
|
||||
"id=" + id +
|
||||
", paramType=" + paramType +
|
||||
", paramKey=" + paramKey +
|
||||
", paramValue=" + paramValue +
|
||||
", createUserId=" + createUserId +
|
||||
", createUserName=" + createUserName +
|
||||
", createTime=" + createTime +
|
||||
", yn=" + yn +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.zyplayer.doc.data.repository.manage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* swagger文档请求参数记录
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-10-15
|
||||
*/
|
||||
public class SwaggerRequestParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键自增ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文档url
|
||||
*/
|
||||
private String docUrl;
|
||||
|
||||
/**
|
||||
* form参数
|
||||
*/
|
||||
private String formData;
|
||||
|
||||
/**
|
||||
* body参数
|
||||
*/
|
||||
private String bodyData;
|
||||
|
||||
/**
|
||||
* header参数
|
||||
*/
|
||||
private String headerData;
|
||||
|
||||
/**
|
||||
* cookie参数
|
||||
*/
|
||||
private String cookieData;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建人名字
|
||||
*/
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 是否有效 0=无效 1=有效
|
||||
*/
|
||||
private Integer yn;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getDocUrl() {
|
||||
return docUrl;
|
||||
}
|
||||
|
||||
public void setDocUrl(String docUrl) {
|
||||
this.docUrl = docUrl;
|
||||
}
|
||||
public String getFormData() {
|
||||
return formData;
|
||||
}
|
||||
|
||||
public void setFormData(String formData) {
|
||||
this.formData = formData;
|
||||
}
|
||||
public String getBodyData() {
|
||||
return bodyData;
|
||||
}
|
||||
|
||||
public void setBodyData(String bodyData) {
|
||||
this.bodyData = bodyData;
|
||||
}
|
||||
public String getHeaderData() {
|
||||
return headerData;
|
||||
}
|
||||
|
||||
public void setHeaderData(String headerData) {
|
||||
this.headerData = headerData;
|
||||
}
|
||||
public String getCookieData() {
|
||||
return cookieData;
|
||||
}
|
||||
|
||||
public void setCookieData(String cookieData) {
|
||||
this.cookieData = cookieData;
|
||||
}
|
||||
public Long getCreateUserId() {
|
||||
return createUserId;
|
||||
}
|
||||
|
||||
public void setCreateUserId(Long createUserId) {
|
||||
this.createUserId = createUserId;
|
||||
}
|
||||
public String getCreateUserName() {
|
||||
return createUserName;
|
||||
}
|
||||
|
||||
public void setCreateUserName(String createUserName) {
|
||||
this.createUserName = createUserName;
|
||||
}
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
public Integer getYn() {
|
||||
return yn;
|
||||
}
|
||||
|
||||
public void setYn(Integer yn) {
|
||||
this.yn = yn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SwaggerRequestParam{" +
|
||||
"id=" + id +
|
||||
", docUrl=" + docUrl +
|
||||
", formData=" + formData +
|
||||
", bodyData=" + bodyData +
|
||||
", headerData=" + headerData +
|
||||
", cookieData=" + cookieData +
|
||||
", createUserId=" + createUserId +
|
||||
", createUserName=" + createUserName +
|
||||
", createTime=" + createTime +
|
||||
", yn=" + yn +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.data.repository.manage.mapper;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.SwaggerDoc;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* swagger文档地址 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-10-15
|
||||
*/
|
||||
public interface SwaggerDocMapper extends BaseMapper<SwaggerDoc> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.data.repository.manage.mapper;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.SwaggerGlobalParam;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* swagger文档全局参数记录 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-10-15
|
||||
*/
|
||||
public interface SwaggerGlobalParamMapper extends BaseMapper<SwaggerGlobalParam> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.data.repository.manage.mapper;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.SwaggerRequestParam;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* swagger文档请求参数记录 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-10-15
|
||||
*/
|
||||
public interface SwaggerRequestParamMapper extends BaseMapper<SwaggerRequestParam> {
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class CodeGenerator {
|
||||
// final String[] tableName = { "zyplayer_storage", "auth_info", "user_auth", "user_info", "db_datasource" };
|
||||
// final String[] tableName = { "wiki_space", "wiki_page", "wiki_page_content", "wiki_page_file", "wiki_page_comment", "wiki_page_zan" };
|
||||
// final String[] tableName = { "db_datasource", "es_datasource", "db_favorite" };
|
||||
final String[] tableName = {"db_table_relation"};
|
||||
final String[] tableName = {"swagger_doc", "swagger_request_param", "swagger_global_param"};
|
||||
|
||||
// 代码生成器
|
||||
AutoGenerator mpg = new AutoGenerator();
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.zyplayer.doc.data.service.manage;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.SwaggerDoc;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* swagger文档地址 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-10-15
|
||||
*/
|
||||
public interface SwaggerDocService extends IService<SwaggerDoc> {
|
||||
public List<SwaggerDoc> getSwaggerDocList();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.zyplayer.doc.data.service.manage;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.SwaggerGlobalParam;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* swagger文档全局参数记录 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-10-15
|
||||
*/
|
||||
public interface SwaggerGlobalParamService extends IService<SwaggerGlobalParam> {
|
||||
public List<SwaggerGlobalParam> getGlobalParamList();
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zyplayer.doc.data.service.manage;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.SwaggerRequestParam;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* swagger文档请求参数记录 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-10-15
|
||||
*/
|
||||
public interface SwaggerRequestParamService extends IService<SwaggerRequestParam> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.zyplayer.doc.data.service.manage.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.SwaggerDoc;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.SwaggerDocMapper;
|
||||
import com.zyplayer.doc.data.service.manage.SwaggerDocService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* swagger文档地址 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-10-15
|
||||
*/
|
||||
@Service
|
||||
public class SwaggerDocServiceImpl extends ServiceImpl<SwaggerDocMapper, SwaggerDoc> implements SwaggerDocService {
|
||||
|
||||
@Override
|
||||
public List<SwaggerDoc> getSwaggerDocList() {
|
||||
QueryWrapper<SwaggerDoc> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("yn", 1);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.zyplayer.doc.data.service.manage.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.SwaggerGlobalParam;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.SwaggerGlobalParamMapper;
|
||||
import com.zyplayer.doc.data.service.manage.SwaggerGlobalParamService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* swagger文档全局参数记录 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-10-15
|
||||
*/
|
||||
@Service
|
||||
public class SwaggerGlobalParamServiceImpl extends ServiceImpl<SwaggerGlobalParamMapper, SwaggerGlobalParam> implements SwaggerGlobalParamService {
|
||||
|
||||
|
||||
@Override
|
||||
public List<SwaggerGlobalParam> getGlobalParamList() {
|
||||
QueryWrapper<SwaggerGlobalParam> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("yn", 1);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.zyplayer.doc.data.service.manage.impl;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.SwaggerRequestParam;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.SwaggerRequestParamMapper;
|
||||
import com.zyplayer.doc.data.service.manage.SwaggerRequestParamService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* swagger文档请求参数记录 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2021-10-15
|
||||
*/
|
||||
@Service
|
||||
public class SwaggerRequestParamServiceImpl extends ServiceImpl<SwaggerRequestParamMapper, SwaggerRequestParam> implements SwaggerRequestParamService {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user