项目导入初始化
This commit is contained in:
506
zyplayer-doc-swagger/src/main/resources/document.html
Normal file
506
zyplayer-doc-swagger/src/main/resources/document.html
Normal file
@@ -0,0 +1,506 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>swagger-mg-ui</title>
|
||||
<link rel="shortcut icon" href="webjars/mg-ui/img/api.ico"/>
|
||||
<link rel="stylesheet" href="webjars/zui/css/zui.min.css" />
|
||||
<link rel="stylesheet" href="webjars/zui/lib/dashboard/zui.dashboard.min.css" />
|
||||
<link rel="stylesheet" href="webjars/mg-ui/css/mg-ui.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="left-body" id="leftContent">
|
||||
<div class="left-header">
|
||||
<span class="logo" id="logoText">swagger-mg-ui</span>
|
||||
<i class="icon icon-bars" id="changeContentWidth"></i>
|
||||
</div>
|
||||
<div class="scrollbar-hover left-container">
|
||||
<!-- 样式类可选:tree-menu tree-folders tree-chevrons tree-angles -->
|
||||
<ul class="tree tree-lines tree-menu projects">
|
||||
<li>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="searchDocInput">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button" id="searchDocBt">搜索</button>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<li id="homePageLi"><a href="javascript:void(0)" path=""><i class="icon-home"></i> 控制台</a></li>
|
||||
<li id="onlineDebugLi" class="local-storage"><a href="javascript:void(0)" path=""><i class="icon-bug"></i> 在线调试管理</a></li>
|
||||
</ul>
|
||||
<div id="apiPathTree">
|
||||
<ul class="tree tree-lines projects"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="resizebleLeftRight" class="ui-resizable-handle mgresizebleW"></div>
|
||||
<div class="right-container" id="rightContent">
|
||||
<div class="tab-page tab-home-page">
|
||||
<div id="homePageDashboard" class="dashboard dashboard-draggable" data-height="320">
|
||||
<section class="row">
|
||||
<div class="col-md-6 col-sm-6">
|
||||
<div class="panel" data-id="1">
|
||||
<div class="panel-heading">
|
||||
<div class="title">配置中心</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="content">
|
||||
<table class="table table-bordered setting-table">
|
||||
<tr>
|
||||
<td class="info">目录展示方式</td>
|
||||
<td>
|
||||
<label><input type="radio" name="catalogShowType" value="1">分路径展示</label>
|
||||
<label><input type="radio" name="catalogShowType" value="2">分标签展示</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">树形菜单展示方式</td>
|
||||
<td>
|
||||
<label><input type="radio" name="treeShowType" value="1">直角</label>
|
||||
<label><input type="radio" name="treeShowType" value="2">导航</label>
|
||||
<label><input type="radio" name="treeShowType" value="3">加减</label>
|
||||
<label><input type="radio" name="treeShowType" value="4">文件夹</label>
|
||||
<label><input type="radio" name="treeShowType" value="5">V型</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">是否展示字段的类型</td>
|
||||
<td>
|
||||
<label><input type="radio" name="showParamType" value="1">是</label>
|
||||
<label><input type="radio" name="showParamType" value="0">否</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">仅使用上次请求参数<i class="icon icon-info-sign" title="每个接口都使用最后一次请求的header、form、body参数,参数列表有的字段但上一次请求没有使用的则不会展示在请求参数里面,从未请求过则展示所有参数"></i></td>
|
||||
<td>
|
||||
<label><input type="radio" name="onlyUseLastParam" value="1">是</label>
|
||||
<label><input type="radio" name="onlyUseLastParam" value="0">否</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">自动填充请求参数</td>
|
||||
<td>
|
||||
<label><input type="radio" name="autoFillParam" value="0">否</label>
|
||||
<label><input type="radio" name="autoFillParam" value="1">智能填充</label>
|
||||
<label><input type="radio" name="autoFillParam" value="2">全部填充</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">文档管理</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-sm" data-moveable="true" id="addNewDocument">增加文档</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" data-moveable="true" id="exportDocument">导出文档</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">配置管理</td>
|
||||
<td>
|
||||
<button class="btn btn-sm" type="button" data-moveable="true" id="exportSetting">导出配置</button>
|
||||
<button class="btn btn-sm" type="button" data-moveable="true" id="importSetting">导入配置</button>
|
||||
<button class="btn btn-sm" type="button" id="restoreDefault">恢复默认</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div align="center">简介</div>
|
||||
swagger-mg-ui是swagger-ui的一个前端实现,使用简单、解析速度快、走心的设计,
|
||||
支持多项目同时展示,多种文档目录的展示方案,多种自定义配置,满足各种使用习惯。
|
||||
本项目是完全从头写的,所以有任何属性未解析到、UI上有何建议都能及时处理得到。
|
||||
使用中您有任何的意见和建议都可到源码地址处反馈哦!<br/>
|
||||
源码地址:<a target="_blank" href="https://gitee.com/zyplayer/swagger-mg-ui">swagger-mg-ui</a>,
|
||||
前端框架:<a target="_blank" href="http://zui.sexy">zui</a>,
|
||||
我的网站:<a target="_blank" href="http://kongjianzhou.com">空间轴</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 在线调试配置 -->
|
||||
<div class="tab-page tab-online-debug-page hide">
|
||||
<div class="title-info">
|
||||
<div class="text">
|
||||
每次点击在线调试的发送请求后,都会默认保存一次请求的form、header、body数据到网页的本地存储中,以备下次使用,在此页面可以管理这些数据。
|
||||
一般浏览都有5M左右存储空间,如果存储过多有可能会导致部分功能异常,请随时清理一下不再使用的。
|
||||
</div>
|
||||
<button class="btn btn-primary refresh" type="button"><i class="icon icon-refresh"></i> 刷新</button>
|
||||
<button class="btn btn-primary expand-all" type="button"><i class="icon icon-expand-full"></i> 全部展开</button>
|
||||
<button class="btn btn-primary collapse-all" type="button"><i class="icon icon-collapse-full"></i> 全部收起</button>
|
||||
<button class="btn btn-danger del-all-param" type="button"><i class="icon icon-remove-sign"></i> 全部删除</button>
|
||||
</div>
|
||||
<table class="table table-bordered" id="onlineDebugParamTable">
|
||||
<thead>
|
||||
<tr><th>接口地址</th><th>参数配置</th><th>操作</th></tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-page tab-document hide">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-tab href="#tabDocInfo">接口说明</a></li>
|
||||
<li><a data-tab href="#tabOnlineDebug">在线调试</a></li>
|
||||
<li><a data-tab href="#tabSimulationResult">模拟返回</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane tab-document-pane active" id="tabDocInfo">
|
||||
<table class="table table-bordered doc-table">
|
||||
<tr>
|
||||
<td class="info">接口地址</td>
|
||||
<td><span id="docUrl" class="label label-warning"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">说明</td>
|
||||
<td id="docInfo"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">请求方式</td>
|
||||
<td><span id="docRequestMethod" class="label label-warning"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">consumes</td>
|
||||
<td><span id="docConsumes" class="label label-warning"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">produces</td>
|
||||
<td><span id="docProduces" class="label label-warning"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">test</td>
|
||||
<td><div id="htmlStrTemp"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">请求参数</td>
|
||||
<td>
|
||||
<ul class="nav nav-secondary gray">
|
||||
<li class="active"><a data-tab href="#docRequestParam">说明</a></li>
|
||||
<li><a data-tab href="#docRequestExample">例子</a></li>
|
||||
<!-- <i class="icon icon-info-sign" title='例:@ApiModelProperty(value="用户ID", example = "9527"),将example填入对象值里面'></i> -->
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane tab-param-type-pane active" id="docRequestParam">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr><th>参数名</th><th>说明</th><th>类型</th><th>参数位置</th><th>是否必填</th></tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane tab-param-type-pane" id="docRequestExample">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr><th>参数名</th><th>说明</th><th>类型</th><th>参数位置</th><th>是否必填</th></tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">响应Model</td>
|
||||
<td>
|
||||
<ul class="nav nav-secondary gray">
|
||||
<li class="active"><a data-tab href="#docResponseModel">说明</a></li>
|
||||
<li><a data-tab href="#docResponseExample">例子</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane tab-param-type-pane active" id="docResponseModel">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr><th>状态码</th><th>说明</th></tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane tab-param-type-pane" id="docResponseExample">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr><th>状态码</th><th>说明</th></tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane tab-document-pane" id="tabOnlineDebug">
|
||||
<div class="post-url-box">
|
||||
<div class="input-group">
|
||||
<!-- <div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="options">参数模板</span> <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-left" role="menu">
|
||||
<li><a href="javascript:void(0)">默认参数</a></li>
|
||||
<li><a href="javascript:void(0);" class="save-request-template">+保存模板</a></li>
|
||||
</ul>
|
||||
</div> -->
|
||||
<div class="input-group-btn" id="debugRequstType">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="options">GET</span> <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-left" role="menu">
|
||||
<li><a href="javascript:void(0);">GET</a></li>
|
||||
<li><a href="javascript:void(0);">POST</a></li>
|
||||
<li><a href="javascript:void(0);">PUT</a></li>
|
||||
<li><a href="javascript:void(0);">HEAD</a></li>
|
||||
<li><a href="javascript:void(0);">PATCH</a></li>
|
||||
<li><a href="javascript:void(0);">DELETE</a></li>
|
||||
<li><a href="javascript:void(0);">OPTIONS</a></li>
|
||||
<li><a href="javascript:void(0);">TRACE</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="postUrlInput" placeholder="请求的完整地址">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default send-request" type="button">发送请求 <i class="icon icon-spin icon-spinner-snake hide"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="param-response-box">
|
||||
<div class="param-box">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" id="headingOne">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" href="#tabParamHeader">请求头</a>
|
||||
<label><input type="checkbox" id="bulkEditHeaderCheck" value="1"> 批量编辑</label>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="tabParamHeader" class="panel-collapse collapse in">
|
||||
<form id="requestHeaderForm">
|
||||
<table class="table table-bordered param-table">
|
||||
<tbody>
|
||||
<tr class="base">
|
||||
<td><input type="text" class="form-control" name="paramName" placeholder=""></td>
|
||||
<td><input type="text" class="form-control" name="paramValue" placeholder=""></td>
|
||||
<td><i class="icon-times"></i></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<textarea class="hide form-control" id="bulkEditHeader" rows="6" placeholder="批量编辑请求头,使用英文冒号分隔,例: key:value key:value"></textarea>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" href="#tabParamBody">请求参数</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="tabParamBody" class="panel-collapse collapse in">
|
||||
<form id="requestParamForm">
|
||||
<ul class="nav nav-secondary">
|
||||
<li class="active"><a data-tab href="#tabParamTypeForm">表单</a></li>
|
||||
<li><a data-tab href="#tabParamTypeBody">数据流</a></li>
|
||||
<li class="form-to-url"><label><input type="checkbox" name="formToUrl" value="1"> 参数拼在URL后面发送</label></li>
|
||||
<li class="form-to-url"><label><input type="checkbox" id="bulkEditFormCheck" value="1"> 批量编辑</label></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane tab-param-type-pane active" id="tabParamTypeForm">
|
||||
<table class="table table-bordered param-table">
|
||||
<tbody>
|
||||
<tr class="base">
|
||||
<td><input type="text" class="form-control" name="paramName" placeholder=""></td>
|
||||
<td><input type="text" class="form-control" name="paramValue" placeholder=""></td>
|
||||
<td><i class="icon-times"></i></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<textarea class="hide form-control" id="bulkEditForm" rows="6" placeholder="批量编辑表单参数,使用英文冒号分隔,例: key:value key:value"></textarea>
|
||||
</div>
|
||||
<div class="tab-pane tab-param-type-pane" id="tabParamTypeBody">
|
||||
<textarea class="form-control" name="paramBody" rows="6" placeholder=""></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="response-box">
|
||||
<ul class="nav nav-secondary">
|
||||
<li class="info"><span>结果集</span></li>
|
||||
<li class="active"><a data-tab href="#tabResponseBody">Body</a></li>
|
||||
<li class="local-storage"><a data-tab href="#tabResponseCookie">Cookie</a></li>
|
||||
<li><a data-tab href="#tabResponseHeader">Header</a></li>
|
||||
<li class="right"><span>状态:<i id="httpRequestStatus">200</i>,耗时:<i id="httpRequestTime">0ms</i></span></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane tab-response-pane active" id="tabResponseBody">
|
||||
<!-- <textarea class="form-control" id="responseBodyTextArea" rows="20" placeholder=""></textarea> -->
|
||||
<div id="responseBodyJsonDiv"></div>
|
||||
</div>
|
||||
<div class="tab-pane tab-response-pane" id="tabResponseCookie">
|
||||
<table class="table table-bordered param-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>名字</th>
|
||||
<th>值</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane tab-response-pane" id="tabResponseHeader">
|
||||
<table class="table table-bordered param-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>名字</th>
|
||||
<th>值</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane tab-document-pane" id="tabSimulationResult">
|
||||
<table class="table table-bordered doc-table">
|
||||
<tr>
|
||||
<td class="info">接口地址</td>
|
||||
<td><span id="simulationResultUrl" class="label label-warning"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">测试地址</td>
|
||||
<td><a id="simulationResultUrlTest" href="" target="_blank"></a> <i class="icon icon-info-sign" title='需要被访问项目导入swagger-mg-ui包才能使用'></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">返回内容</td>
|
||||
<td><textarea id="simulationResultText" class="form-control" rows="10"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">操作</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary" id="simulationResultSubmit">提交模拟返回值</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 增加文档弹出框 -->
|
||||
<div class="modal fade" id="addNewDocumentModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
|
||||
</button>
|
||||
<h4 class="modal-title">输入文档地址</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input id="addNewDocumentInput" type="text" class="form-control" placeholder="例:http://192.168.0.172/swagger-resources">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" id="addNewDocumentBtn">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导出文档 -->
|
||||
<div class="modal fade" id="exportDocumentModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
|
||||
</button>
|
||||
<h4 class="modal-title">导出文档</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-danger hidden">
|
||||
1、请到 <a target="_blank" href="https://gitee.com/zyplayer/swagger-mg-ui">源码处下载</a>《对外文档模板.zip》解压<br/>
|
||||
2、复制以下文本内容覆盖至 /js/mg-ui-data.js 文件内<br/>
|
||||
3、然后双击打开目录下的:document.html 即可看到导出的文档
|
||||
</div>
|
||||
<div class="modal-table-box">
|
||||
<ul id="exportDocumentUl" class="choise"></ul>
|
||||
<textarea id="exportDocumentText" class="form-control hidden"></textarea>
|
||||
</div>
|
||||
<div align="center" class="bottom-box">
|
||||
<button class="btn btn-primary" type="button" id="doExportBtn">确认导出</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导出配置 -->
|
||||
<div class="modal fade" id="exportSettingModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
|
||||
</button>
|
||||
<h4 class="modal-title">导出配置</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<textarea id="exportSettingText" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导入配置 -->
|
||||
<div class="modal fade" id="importSettingModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
|
||||
</button>
|
||||
<h4 class="modal-title">导入配置</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<textarea id="importSettingText" class="form-control"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" id="importSettingBtn">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 选择展示的项目 -->
|
||||
<div class="modal fade" id="choiseDocModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">选择需要展示的文档</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-danger">不选择则展示全部,展示接口过多会影响效率,建议只展示想看的文档</div>
|
||||
<div class="modal-table-box">
|
||||
<ul id="choiseDocListUl" class="choise"></ul>
|
||||
</div>
|
||||
<div align="center" class="bottom-box">
|
||||
<button type="button" class="btn btn-primary" id="choiseDocBtn"> 确定 </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript" src="webjars/mg-ui/js/jquery-3.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="webjars/zui/js/zui.min.js"></script>
|
||||
<script type="text/javascript" src="webjars/zui/lib/dashboard/zui.dashboard.min.js"></script>
|
||||
|
||||
<!--
|
||||
<script type="text/javascript" src="webjars/mg-ui/js/mg-ui.min.js"></script>
|
||||
-->
|
||||
<script type="text/javascript" src="webjars/mg-ui/js/formatjson.js"></script>
|
||||
<script type="text/javascript" src="webjars/mg-ui/js/toast.js"></script>
|
||||
<script type="text/javascript" src="webjars/mg-ui/js/common.js"></script>
|
||||
<script type="text/javascript" src="webjars/mg-ui/js/mgResizeble.js"></script>
|
||||
<script type="text/javascript" src="webjars/mg-ui/js/mg-ui-tree.js"></script>
|
||||
<script type="text/javascript" src="webjars/mg-ui/js/mg-ui-tag.js"></script>
|
||||
<script type="text/javascript" src="webjars/mg-ui/js/mg-ui-debug.js"></script>
|
||||
<script type="text/javascript" src="webjars/mg-ui/js/mg-ui.js"></script>
|
||||
</html>
|
||||
|
||||
134
zyplayer-doc-swagger/src/main/resources/export/css/mg-ui.css
Normal file
134
zyplayer-doc-swagger/src/main/resources/export/css/mg-ui.css
Normal file
@@ -0,0 +1,134 @@
|
||||
body{width: 100%;height: 100%;margin: 0;padding: 0;}
|
||||
a:focus{outline:none;}
|
||||
ul{list-style: none;list-style-type: none;}
|
||||
.tree li a{white-space: nowrap;}
|
||||
.tree-menu li > ul{background-color: #f1f1f1;}
|
||||
.tree-menu li li li li a{padding-left: 68px;}
|
||||
.tree-menu li li li li li a{padding-left: 88px;}
|
||||
.tree-menu li li li li li li a{padding-left: 108px;}
|
||||
.tree-menu li li li li li li li a{padding-left: 128px;}
|
||||
.tree-menu li li li li li li li li a{padding-left: 148px;}
|
||||
.tree-menu li li li li li li li li li a{padding-left: 168px;}
|
||||
.tree-menu li li li li li li li li li li a{padding-left: 188px;}
|
||||
.table td, .table th {vertical-align: middle;}
|
||||
#tabDocInfo{position: absolute; bottom: 0;top: 60px;overflow-y: auto; right: 0; left: 10px;}
|
||||
#tabOnlineDebug .param-response-box{position: absolute; bottom: 0;top: 100px;overflow-y: auto; right: 0; left: 10px;}
|
||||
.tab-online-debug-page{overflow-y: auto;position: absolute; bottom: 0;top: 10px; right: 0; left: 10px;}
|
||||
.tab-online-debug-page .title-info{padding-bottom: 10px;}
|
||||
.tab-online-debug-page .title-info .btn{margin-right: 20px;}
|
||||
.tab-online-debug-page .title-info .text{padding-bottom: 10px;}
|
||||
|
||||
.local-storage{display: none;}
|
||||
|
||||
/**lable的覆盖样式*/
|
||||
.label{font-size: 100%;}
|
||||
.label-warning {background-color: #f9f5ee; color: #f1a325;}
|
||||
label{font-weight: normal;}
|
||||
|
||||
.nav.gray{background-color: #f1f1f1;margin-bottom: 10px;}
|
||||
|
||||
.doc-table tr .info{text-align: right; width: 100px;}
|
||||
.setting-table tr .info{text-align: right; max-width: 150px;}
|
||||
.show-doc span{color: #aaa;}
|
||||
|
||||
.mgresizebleW{z-index: 90;height: 100%; width: 10px; cursor: e-resize;}
|
||||
.ui-resizable-handle {display: block;font-size: 0.1px;position: absolute;}
|
||||
#resizebleLeftRight{left: 360px;}
|
||||
.unselect{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
|
||||
|
||||
#homePageDashboard{overflow-y: auto;bottom: 0;top: 0;right: 0;left: 0;position: absolute;overflow-x: hidden;padding: 10px;}
|
||||
#homePageDashboard .panel-body{padding: 10px;}
|
||||
|
||||
#homePageLi{margin-top: 5px;}
|
||||
|
||||
.left-body{
|
||||
width: 360px; height:100%; position: fixed; top: 0; bottom: 0; left: 0;
|
||||
}
|
||||
.left-header{
|
||||
background: #3280fc;width: 100%; height:60px;line-height:60px;
|
||||
position: absolute; top: 0; bottom: 0; left: 0;text-align: center;
|
||||
}
|
||||
.left-header .logo{
|
||||
font-size: 30px;color: #fff;
|
||||
}
|
||||
.left-header .icon-bars{
|
||||
font-size: 24px;float: right;margin: 18px 18px 0 0;color: #fff;cursor: pointer;
|
||||
}
|
||||
.left-container{
|
||||
width: 100%;position: absolute;background: #f1f1f1;color: rgba(163, 175, 183, .9);
|
||||
top: 60px; bottom: 0; left: 0; overflow-y: auto; padding: 10px;
|
||||
}
|
||||
.left-container .projects{border: 0px; border-radius: 0px;}
|
||||
|
||||
.right-container{
|
||||
position: fixed;top: 0px; bottom: 0; left: 360px; right: 0;padding: 10px;
|
||||
}
|
||||
|
||||
#docResponseModel td:first-child{width: 100px;}
|
||||
#docResponseExample td:first-child{width: 100px;}
|
||||
|
||||
.modal-table-box{margin-top: 10px; max-height: 500px;overflow-y: auto;}
|
||||
.modal-table-box{list-style: none;}
|
||||
.modal-table-box ul{padding-left: 10px;}
|
||||
.modal-table-box li{padding: 10px 15px; margin: 0 10px 10px 0; background-color: #f1f1f1;cursor: pointer;}
|
||||
.modal-table-box li.checked{background-color: #8666b8;color:#fff;}
|
||||
|
||||
#exportDocumentText{height: 350px;}
|
||||
|
||||
/* 在线调试框样式 */
|
||||
#tabParamBody .tab-content{padding-top: 10px;}
|
||||
|
||||
.post-url-box{padding: 10px 0;}
|
||||
.post-url-box .input-group-btn:nth-child(2) button{border-right: 0;border-radius: 0;}
|
||||
.post-url-box .send-request .hide{display: none;}
|
||||
|
||||
.param-box{}
|
||||
.param-box .panel-collapse{padding: 10px;}
|
||||
.param-box .nav{background-color: #f1f1f1;}
|
||||
/* .param-box .nav > li > *{padding: 8px 25px;} */
|
||||
.param-box .nav > li > span{position: relative; display: block;background-color: #ccc;padding: 9px 25px;}
|
||||
.param-box .nav > .form-to-url{position: relative; display: block;padding: 10px 0 0 25px;}
|
||||
.param-box .nav > .form-to-url label{margin: 0;}
|
||||
.param-box .nav > .form-to-url input{margin: 0;}
|
||||
.param-box .tab-content .tab-param-pane{padding: 10px 10px 0 10px;}
|
||||
.param-box .table.param-table td, .param-box .table.param-table th{padding: 4px 5px;}
|
||||
.param-box .param-table td:first-child{width: 250px;}
|
||||
.param-box .param-table tbody td:nth-child(2){border-right: 0;}
|
||||
.param-box .param-table tbody td:nth-child(3){border-left: 0;padding: 0 10px 0 0;width: 10px;}
|
||||
.param-box .param-table tbody td:nth-child(3) i{cursor: pointer;color: #ccc;}
|
||||
.param-box .param-table tbody td:nth-child(3) i:hover{color: #888;}
|
||||
.param-box .param-table tbody tr.base td:last-child{display: none;}
|
||||
#bulkEditHeaderCheck{margin-left: 10px;}
|
||||
#bulkEditHeader,#bulkEditForm{display: none;}
|
||||
|
||||
.response-box{margin-top: 20px;}
|
||||
.response-box .nav > li > *{padding: 8px 25px;}
|
||||
.response-box .nav > li span{position: relative; display: block;padding: 9px 25px;}
|
||||
.response-box .nav > li.info span{background-color: #ccc;}
|
||||
.response-box .nav > li.right{float: right;}
|
||||
.response-box .nav > li.right i{color: #3280fc;}
|
||||
.response-box .nav{background-color: #f1f1f1;}
|
||||
.response-box .tab-content .tab-response-pane{padding: 10px;}
|
||||
|
||||
#responseBodyJsonIframe{width: 100%;height: 300px;border: 0;}
|
||||
|
||||
/* S-模拟请求 */
|
||||
#tabSimulationResult{padding: 10px 0;}
|
||||
/* E-模拟请求 */
|
||||
|
||||
/* S-JSON展示的样式 */
|
||||
pre.json{margin-top:0px;margin-bottom:0px;}
|
||||
pre.json .canvas{font:10pt georgia;background-color:#ececec;color:#000000;border:1px solid #cecece;}
|
||||
pre.json .object-brace{color:#00aa00;font-weight:bold;}
|
||||
pre.json .array-brace{color:#0033ff;font-weight:bold;}
|
||||
pre.json .property-name{color:#cc0000;font-weight:bold;}
|
||||
pre.json .string{color:#007777;}
|
||||
pre.json .number{color:#aa00aa;}
|
||||
pre.json .boolean{color:#0000ff;}
|
||||
pre.json .function{color:#aa6633;text-decoration:italic;}
|
||||
pre.json .null{color:#0000ff;}
|
||||
pre.json .comma{color:#000000;font-weight:bold;}
|
||||
pre.json .annotation{color:#aaa;}
|
||||
pre img{cursor: pointer;}
|
||||
/* E-JSON展示的样式 */
|
||||
|
||||
6
zyplayer-doc-swagger/src/main/resources/export/css/zui-theme.min.css
vendored
Normal file
6
zyplayer-doc-swagger/src/main/resources/export/css/zui-theme.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
6
zyplayer-doc-swagger/src/main/resources/export/css/zui.dashboard.min.css
vendored
Normal file
6
zyplayer-doc-swagger/src/main/resources/export/css/zui.dashboard.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
6
zyplayer-doc-swagger/src/main/resources/export/css/zui.lite.min.css
vendored
Normal file
6
zyplayer-doc-swagger/src/main/resources/export/css/zui.lite.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
6
zyplayer-doc-swagger/src/main/resources/export/css/zui.min.css
vendored
Normal file
6
zyplayer-doc-swagger/src/main/resources/export/css/zui.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
204
zyplayer-doc-swagger/src/main/resources/export/document.html
Normal file
204
zyplayer-doc-swagger/src/main/resources/export/document.html
Normal file
@@ -0,0 +1,204 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>swagger-mg-ui</title>
|
||||
<link rel="shortcut icon" href="img/api.ico"/>
|
||||
<link rel="stylesheet" href="css/zui.min.css" />
|
||||
<link rel="stylesheet" href="css/zui.dashboard.min.css" />
|
||||
<link rel="stylesheet" href="css/mg-ui.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="left-body" id="leftContent">
|
||||
<div class="left-header">
|
||||
<span class="logo" id="logoText">swagger-mg-ui</span>
|
||||
<i class="icon icon-bars" id="changeContentWidth"></i>
|
||||
</div>
|
||||
<div class="scrollbar-hover left-container">
|
||||
<!-- 样式类可选:tree-menu tree-folders tree-chevrons tree-angles -->
|
||||
<ul class="tree tree-lines tree-menu projects">
|
||||
<li>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="searchDocInput">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button" id="searchDocBt">搜索</button>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<li id="homePageLi"><a href="javascript:void(0)" path=""><i class="icon-home"></i> 控制台</a></li>
|
||||
</ul>
|
||||
<div id="apiPathTree">
|
||||
<ul class="tree tree-lines projects"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="resizebleLeftRight" class="ui-resizable-handle mgresizebleW"></div>
|
||||
<div class="right-container" id="rightContent">
|
||||
<div class="tab-page tab-home-page">
|
||||
<div id="homePageDashboard" class="dashboard dashboard-draggable" data-height="290">
|
||||
<section class="row">
|
||||
<div class="col-md-6 col-sm-6">
|
||||
<div class="panel" data-id="1">
|
||||
<div class="panel-heading">
|
||||
<div class="title">配置中心</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="content">
|
||||
<table class="table table-bordered setting-table">
|
||||
<tr>
|
||||
<td class="info">目录展示方式</td>
|
||||
<td>
|
||||
<label><input type="radio" name="catalogShowType" value="1">分路径展示</label>
|
||||
<label><input type="radio" name="catalogShowType" value="2">分标签展示</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">树形菜单展示方式</td>
|
||||
<td>
|
||||
<label><input type="radio" name="treeShowType" value="1">直角</label>
|
||||
<label><input type="radio" name="treeShowType" value="2">导航</label>
|
||||
<label><input type="radio" name="treeShowType" value="3">加减</label>
|
||||
<label><input type="radio" name="treeShowType" value="4">文件夹</label>
|
||||
<label><input type="radio" name="treeShowType" value="5">V型</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">是否展示字段的类型</td>
|
||||
<td>
|
||||
<label><input type="radio" name="showParamType" value="1">是</label>
|
||||
<label><input type="radio" name="showParamType" value="0">否</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">自动填充请求参数</td>
|
||||
<td>
|
||||
<label><input type="radio" name="autoFillParam" value="0">否</label>
|
||||
<label><input type="radio" name="autoFillParam" value="1">智能填充</label>
|
||||
<label><input type="radio" name="autoFillParam" value="2">全部填充</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div align="center">简介</div>
|
||||
swagger-mg-ui是swagger-ui的一个前端实现,使用简单、解析速度快、走心的设计,
|
||||
支持多项目同时展示,多种文档目录的展示方案,多种自定义配置,满足各种使用习惯。
|
||||
本项目是完全从头写的,所以有任何属性未解析到、UI上有何建议都能及时处理得到。
|
||||
使用中您有任何的意见和建议都可到源码地址处反馈哦!<br/>
|
||||
源码地址:<a target="_blank" href="https://gitee.com/zyplayer/swagger-mg-ui">swagger-mg-ui</a>,
|
||||
前端框架:<a target="_blank" href="http://zui.sexy">zui</a>,
|
||||
我的网站:<a target="_blank" href="http://kongjianzhou.com">空间轴</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-page tab-document hide">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-tab href="#tabDocInfo">接口说明</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane tab-document-pane active" id="tabDocInfo">
|
||||
<table class="table table-bordered doc-table">
|
||||
<tr>
|
||||
<td class="info">接口地址</td>
|
||||
<td><span id="docUrl" class="label label-warning"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">说明</td>
|
||||
<td id="docInfo"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">请求方式</td>
|
||||
<td><span id="docRequestMethod" class="label label-warning"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">consumes</td>
|
||||
<td><span id="docConsumes" class="label label-warning"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">produces</td>
|
||||
<td><span id="docProduces" class="label label-warning"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">请求参数</td>
|
||||
<td>
|
||||
<ul class="nav nav-secondary gray">
|
||||
<li class="active"><a data-tab href="#docRequestParam">说明</a></li>
|
||||
<li><a data-tab href="#docRequestExample">例子</a></li>
|
||||
<!-- <i class="icon icon-info-sign" title='例:@ApiModelProperty(value="用户ID", example = "9527"),将example填入对象值里面'></i> -->
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane tab-param-type-pane active" id="docRequestParam">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr><th>参数名</th><th>说明</th><th>类型</th><th>参数位置</th><th>是否必填</th></tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane tab-param-type-pane" id="docRequestExample">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr><th>参数名</th><th>说明</th><th>类型</th><th>参数位置</th><th>是否必填</th></tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">响应Model</td>
|
||||
<td>
|
||||
<ul class="nav nav-secondary gray">
|
||||
<li class="active"><a data-tab href="#docResponseModel">说明</a></li>
|
||||
<li><a data-tab href="#docResponseExample">例子</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane tab-param-type-pane active" id="docResponseModel">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr><th>状态码</th><th>说明</th></tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane tab-param-type-pane" id="docResponseExample">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr><th>状态码</th><th>说明</th></tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript" src="js/jquery-3.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="js/zui.min.js"></script>
|
||||
<script type="text/javascript" src="js/zui.dashboard.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="js/mg-ui-data.js"></script>
|
||||
|
||||
<script type="text/javascript" src="js/formatjson.js"></script>
|
||||
<script type="text/javascript" src="js/toast.js"></script>
|
||||
<script type="text/javascript" src="js/common.js"></script>
|
||||
<script type="text/javascript" src="js/mgResizeble.js"></script>
|
||||
<script type="text/javascript" src="js/mg-ui-tree.js"></script>
|
||||
<script type="text/javascript" src="js/mg-ui-tag.js"></script>
|
||||
<script type="text/javascript" src="js/mg-ui-debug.js"></script>
|
||||
<script type="text/javascript" src="js/mg-ui.js"></script>
|
||||
</html>
|
||||
|
||||
BIN
zyplayer-doc-swagger/src/main/resources/export/fonts/zenicon.eot
Normal file
BIN
zyplayer-doc-swagger/src/main/resources/export/fonts/zenicon.eot
Normal file
Binary file not shown.
375
zyplayer-doc-swagger/src/main/resources/export/fonts/zenicon.svg
Normal file
375
zyplayer-doc-swagger/src/main/resources/export/fonts/zenicon.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 290 KiB |
BIN
zyplayer-doc-swagger/src/main/resources/export/fonts/zenicon.ttf
Normal file
BIN
zyplayer-doc-swagger/src/main/resources/export/fonts/zenicon.ttf
Normal file
Binary file not shown.
Binary file not shown.
BIN
zyplayer-doc-swagger/src/main/resources/export/img/collapsed.png
Normal file
BIN
zyplayer-doc-swagger/src/main/resources/export/img/collapsed.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 340 B |
BIN
zyplayer-doc-swagger/src/main/resources/export/img/expanded.png
Normal file
BIN
zyplayer-doc-swagger/src/main/resources/export/img/expanded.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 331 B |
269
zyplayer-doc-swagger/src/main/resources/export/js/common.js
Normal file
269
zyplayer-doc-swagger/src/main/resources/export/js/common.js
Normal file
@@ -0,0 +1,269 @@
|
||||
/**
|
||||
* 一些公用方法
|
||||
* @author 暮光:城中城
|
||||
* @since 2017年5月7日
|
||||
*/
|
||||
|
||||
function serialize(value) {
|
||||
if (typeof value === 'string') {
|
||||
return value;
|
||||
}
|
||||
return JSON.stringify(value);
|
||||
}
|
||||
|
||||
function deserialize(value) {
|
||||
if (typeof value !== 'string' || isEmpty(value)) {
|
||||
return undefined;
|
||||
}
|
||||
try {
|
||||
return JSON.parse(value);
|
||||
} catch (e) {
|
||||
try {
|
||||
return eval('(' + value + ')');// 处理变态的单双引号共存字符串
|
||||
} catch (e) {
|
||||
return value || undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function validateResult(result) {
|
||||
if(result.errCode == 200) {
|
||||
return true;
|
||||
} else {
|
||||
Toast.error(result.errMsg);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function getNowDate() {
|
||||
var date = new Date();
|
||||
var month = date.getMonth() + 1;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var currentdate = date.getFullYear() + "-" + month + "-" + strDate;
|
||||
return currentdate;
|
||||
}
|
||||
|
||||
function getNowTime() {
|
||||
var date = new Date();
|
||||
var hours = date.getHours();
|
||||
var minutes = date.getMinutes();
|
||||
var seconds = date.getSeconds();
|
||||
if (hours >= 1 && hours <= 9) {
|
||||
hours = "0" + hours;
|
||||
}
|
||||
if (minutes >= 0 && minutes <= 9) {
|
||||
minutes = "0" + minutes;
|
||||
}
|
||||
if (seconds >= 0 && seconds <= 9) {
|
||||
seconds = "0" + seconds;
|
||||
}
|
||||
var currentdate = hours + ":" + minutes + ":" + seconds;
|
||||
return currentdate;
|
||||
}
|
||||
|
||||
function getNowDateTime() {
|
||||
var currentdate = getNowDate() + " " + getNowTime();
|
||||
return currentdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回不为空的字符串,为空返回def
|
||||
*/
|
||||
function getNotEmptyStr(str, def) {
|
||||
if (isEmpty(str)) {
|
||||
return isEmpty(def) ? "" : def;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是空对象
|
||||
* @param obj
|
||||
* @returns
|
||||
*/
|
||||
function isEmptyObject(obj){
|
||||
return $.isEmptyObject(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是空字符串
|
||||
* @param str
|
||||
* @returns
|
||||
*/
|
||||
function isEmpty(str){
|
||||
return (str == "" || str == null || str == undefined);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否不是空字符串
|
||||
* @param str
|
||||
* @returns
|
||||
*/
|
||||
function isNotEmpty(str){
|
||||
return !isEmpty(str);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数组转字符串,使用空格分隔
|
||||
* @param array
|
||||
* @returns
|
||||
*/
|
||||
function arrToString(array){
|
||||
var temStr = "";
|
||||
if(isEmpty(array)){
|
||||
return temStr;
|
||||
}
|
||||
array.forEach(function(e){
|
||||
if(isNotEmpty(temStr)) {
|
||||
temStr += " ";
|
||||
}
|
||||
temStr += e;
|
||||
});
|
||||
return temStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数组array中是否包含str字符串
|
||||
* @param array
|
||||
* @param str
|
||||
* @returns
|
||||
*/
|
||||
function haveString(array, str){
|
||||
if(isEmpty(array)) {
|
||||
return false;
|
||||
}
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
if(array[i] == str) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 直接返回对象的第一个属性
|
||||
* @param data
|
||||
* @returns
|
||||
*/
|
||||
function getObjectFirstAttribute(data) {
|
||||
for ( var key in data) {
|
||||
return data[key];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果对象只有一个属性则返回第一个属性,否则返回null
|
||||
* @param data
|
||||
* @returns
|
||||
*/
|
||||
function getObjectFirstAttributeIfOnly(data) {
|
||||
var len = 0, value = "";
|
||||
for ( var key in data) {
|
||||
if (++len > 1) {
|
||||
return null;
|
||||
}
|
||||
value = data[key];
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* ajax处理事件模板
|
||||
*
|
||||
* @url 后台处理的url,即action
|
||||
* @dataSentType 数据发送的方式,有post,get方式
|
||||
* @dataReceiveType 数据接收格式,有html json text等
|
||||
* @paramsStr 传入后台的参数
|
||||
* @successFunction ajax成功后执行的函数名 ajaxTemp("", "GET", "html", {}, function(){},
|
||||
* function(){}, "");
|
||||
*/
|
||||
function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction, errorFunction, completeFunction, id) {
|
||||
$.ajax({
|
||||
url : url, // 后台处理程序
|
||||
sync : false,
|
||||
type : dataSentType, // 数据发送方式
|
||||
dataType : dataReceiveType, // 接受数据格式
|
||||
data : eval(paramsStr),
|
||||
contentType : "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
success : function(msg) {
|
||||
if(typeof successFunction == "function") {
|
||||
successFunction(msg,id);
|
||||
}
|
||||
},
|
||||
beforeSend : function() {
|
||||
|
||||
},
|
||||
complete : function(msg) {
|
||||
if(typeof completeFunction == "function") {
|
||||
completeFunction(msg,id);
|
||||
}
|
||||
},
|
||||
error : function(msg) {
|
||||
if(typeof errorFunction == "function") {
|
||||
errorFunction(msg,id);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取cookie
|
||||
* @param name
|
||||
* @returns
|
||||
*/
|
||||
function getCookie(name) {
|
||||
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
|
||||
if(arr=document.cookie.match(reg)){
|
||||
return unescape(arr[2]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串格式化
|
||||
*/
|
||||
String.prototype.format = function(args) {
|
||||
if (arguments.length > 0) {
|
||||
var result = this;
|
||||
if (arguments.length == 1 && typeof (args) == "object") {
|
||||
for ( var key in args) {
|
||||
var reg = new RegExp("({" + key + "})", "g");
|
||||
result = result.replace(reg, args[key]);
|
||||
}
|
||||
} else {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
if (arguments[i] == undefined) {
|
||||
return "";
|
||||
} else {
|
||||
var reg = new RegExp("({[" + i + "]})", "g");
|
||||
result = result.replace(reg, arguments[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
String.prototype.endWith = function(str) {
|
||||
if (str == null || str == "" || this.length == 0 || str.length > this.length) {
|
||||
return false;
|
||||
}
|
||||
return (this.substring(this.length - str.length) == str);
|
||||
};
|
||||
|
||||
String.prototype.startWith = function(str) {
|
||||
if (str == null || str == "" || this.length == 0 || str.length > this.length) {
|
||||
return false;
|
||||
}
|
||||
return (this.substr(0, str.length) == str);
|
||||
};
|
||||
|
||||
|
||||
125
zyplayer-doc-swagger/src/main/resources/export/js/formatjson.js
Normal file
125
zyplayer-doc-swagger/src/main/resources/export/js/formatjson.js
Normal file
@@ -0,0 +1,125 @@
|
||||
|
||||
/**
|
||||
* 将对象处理成json格式化和着色的html
|
||||
* @author 暮光:城中城
|
||||
* @since 2017年5月7日
|
||||
*/
|
||||
var Formatjson = {
|
||||
// 需要在对象或列表后面添加注释的对象,例:{userList: "用户列表"}
|
||||
// 那么在名字为userList的对象或列表后面都会加上:“用户列表” 这个注释
|
||||
annotationObject: {},
|
||||
tabStr: " ",
|
||||
isArray: function(obj) {
|
||||
return obj && typeof obj === 'object' && typeof obj.length === 'number'
|
||||
&& !(obj.propertyIsEnumerable('length'));
|
||||
},
|
||||
processObjectToHtmlPre: function(obj, indent, addComma, isArray, isPropertyContent, showAnnotation) {
|
||||
var htmlStr = this.processObject(obj, "", indent, addComma, isArray, isPropertyContent, showAnnotation);
|
||||
htmlStr = '<pre class="json">' + htmlStr + '</pre>';
|
||||
return htmlStr;
|
||||
},
|
||||
processObject: function(obj, keyName, indent, addComma, isArray, isPropertyContent, showAnnotation) {
|
||||
var html = "";
|
||||
var comma = (addComma) ? "<span class='comma'>,</span> " : "";
|
||||
var type = typeof obj;
|
||||
if (this.isArray(obj)) {
|
||||
if (obj.length == 0) {
|
||||
html += this.getRow(indent, "<span class='array-brace'>[ ]</span>" + comma, isPropertyContent);
|
||||
} else {
|
||||
var clpsHtml = '<span><img class="option-img" src="img/expanded.png" onClick="Formatjson.expImgClicked(this);" /></span><span class="collapsible">';
|
||||
var annotation = '';
|
||||
if(showAnnotation && isNotEmpty(keyName) && isNotEmpty(this.annotationObject[keyName])) {
|
||||
annotation = '<span class="annotation">// '+this.annotationObject[keyName]+'</span>';
|
||||
}
|
||||
html += this.getRow(indent, "<span class='array-brace'>[</span>"+clpsHtml+annotation, isPropertyContent);
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
html += this.processObject(obj[i], "", indent + 1, i < (obj.length - 1), true, false, showAnnotation);
|
||||
}
|
||||
clpsHtml = "</span>";
|
||||
html += this.getRow(indent, clpsHtml + "<span class='array-brace'>]</span>" + comma);
|
||||
}
|
||||
} else if (type == 'object' && obj == null) {
|
||||
html += this.formatLiteral("null", "", comma, indent, isArray, "null");
|
||||
} else if (type == 'object') {
|
||||
var numProps = 0;
|
||||
for ( var prop in obj) {
|
||||
numProps++;
|
||||
}
|
||||
if (numProps == 0) {
|
||||
html += this.getRow(indent, "<span class='object-brace'>{ }</span>" + comma, isPropertyContent);
|
||||
} else {
|
||||
var clpsHtml = '<span><img class="option-img" src="img/expanded.png" onClick="Formatjson.expImgClicked(this);" /></span><span class="collapsible">';
|
||||
var annotation = '';
|
||||
if(showAnnotation && isNotEmpty(keyName) && isNotEmpty(this.annotationObject[keyName])) {
|
||||
annotation = '<span class="annotation">// '+this.annotationObject[keyName]+'</span>';
|
||||
}
|
||||
html += this.getRow(indent, "<span class='object-brace'>{</span>"+clpsHtml+annotation, isPropertyContent);
|
||||
var j = 0;
|
||||
for ( var prop in obj) {
|
||||
var processStr = '<span class="property-name">"' + prop + '"</span>: ' + this.processObject(obj[prop], prop, indent + 1, ++j < numProps, false, true, showAnnotation);
|
||||
html += this.getRow(indent + 1, processStr);
|
||||
}
|
||||
clpsHtml = "</span>";
|
||||
html += this.getRow(indent, clpsHtml + "<span class='object-brace'>}</span>" + comma);
|
||||
}
|
||||
} else if (type == 'number') {
|
||||
html += this.formatLiteral(obj, "", comma, indent, isArray, "number");
|
||||
} else if (type == 'boolean') {
|
||||
html += this.formatLiteral(obj, "", comma, indent, isArray, "boolean");
|
||||
} else if (type == 'function') {
|
||||
obj = this.formatFunction(indent, obj);
|
||||
html += this.formatLiteral(obj, "", comma, indent, isArray, "function");
|
||||
} else if (type == 'undefined') {
|
||||
html += this.formatLiteral("undefined", "", comma, indent, isArray, "null");
|
||||
} else {
|
||||
html += this.formatLiteral(obj, "\"", comma, indent, isArray, "string");
|
||||
}
|
||||
return html;
|
||||
},
|
||||
expImgClicked: function(img){
|
||||
var container = img.parentNode.nextSibling;
|
||||
if(!container) return;
|
||||
var disp = "none";
|
||||
var src = "img/collapsed.png";
|
||||
if(container.style.display == "none"){
|
||||
disp = "inline";
|
||||
src = "img/expanded.png";
|
||||
}
|
||||
container.style.display = disp;
|
||||
img.src = src;
|
||||
},
|
||||
formatLiteral: function(literal, quote, comma, indent, isArray, style) {
|
||||
if (typeof literal == 'string') {
|
||||
literal = literal.split("<").join("<").split(">").join(">");
|
||||
}
|
||||
var str = "<span class='" + style + "'>" + quote + literal + quote + comma + "</span>";
|
||||
if (isArray) {
|
||||
str = this.getRow(indent, str);
|
||||
}
|
||||
return str;
|
||||
},
|
||||
formatFunction: function(indent, obj) {
|
||||
var tabs = "";
|
||||
for (var i = 0; i < indent; i++) {
|
||||
tabs += this.tabStr;
|
||||
}
|
||||
var funcStrArray = obj.toString().split("\n");
|
||||
var str = "";
|
||||
for (var i = 0; i < funcStrArray.length; i++) {
|
||||
str += ((i == 0) ? "" : tabs) + funcStrArray[i] + "\n";
|
||||
}
|
||||
return str;
|
||||
},
|
||||
getRow: function(indent, data, isPropertyContent) {
|
||||
var tabs = "";
|
||||
for (var i = 0; i < indent && !isPropertyContent; i++) {
|
||||
tabs += this.tabStr;
|
||||
}
|
||||
if (data != null && data.length > 0 && data.charAt(data.length - 1) != "\n") {
|
||||
data = data + "\n";
|
||||
}
|
||||
return tabs + data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
4
zyplayer-doc-swagger/src/main/resources/export/js/jquery-3.1.0.min.js
vendored
Normal file
4
zyplayer-doc-swagger/src/main/resources/export/js/jquery-3.1.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* 在线调试页面js
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年7月20日
|
||||
*/
|
||||
|
||||
/**
|
||||
* 获取自动填充的值
|
||||
* @param paramType
|
||||
* @returns
|
||||
*/
|
||||
function getAutoFillValue(paramType, paramName) {
|
||||
if(userSettings.autoFillParam == 0 || isEmpty(paramType)) {
|
||||
return "";
|
||||
}
|
||||
paramName = getNotEmptyStr(paramName).toLowerCase();
|
||||
var isTimeColumn = (paramType.indexOf("date-time") >= 0
|
||||
|| paramName.endWith("date") || paramName.endWith("time"));
|
||||
var isTypeColumn = (paramName.endWith("type") || paramName.endWith("status")
|
||||
|| paramName.endWith("level") || paramName.endWith("num"));
|
||||
var isPriceColumn = (paramName.endWith("money") || paramName.endWith("price")
|
||||
|| paramName.endWith("cash") || paramName.endWith("coin"));
|
||||
var isBooleanColumn = (paramName.startWith("is"));
|
||||
var resultValue = "";
|
||||
if(paramType.indexOf("int") >= 0){
|
||||
if(isTypeColumn) {
|
||||
resultValue = Math.ceil(Math.random() * 5);
|
||||
} else if(paramName.endWith("age")) {
|
||||
resultValue = Math.ceil(Math.random() * 100);
|
||||
} else {
|
||||
resultValue = Math.ceil(Math.random() * 100);
|
||||
}
|
||||
} else if(paramType.indexOf("double") >= 0){
|
||||
resultValue = Math.ceil(Math.random() * 1000);
|
||||
} else if(paramType.indexOf("float") >= 0){
|
||||
resultValue = parseFloat(Math.random() * 1000).toFixed(2);
|
||||
} else if(paramType.indexOf("byte") >= 0){
|
||||
if(isTypeColumn) {
|
||||
resultValue = Math.ceil(Math.random() * 5);
|
||||
} else {
|
||||
resultValue = Math.ceil(Math.random() * 127);
|
||||
}
|
||||
} else if(paramType.indexOf("boolean") >= 0){
|
||||
resultValue = Math.random() > 0.5;
|
||||
} else if(isTimeColumn){
|
||||
resultValue = getNowDateTime();
|
||||
} else {
|
||||
if(paramName.endWith("id")) {
|
||||
resultValue = Math.ceil(Math.random() * 1000);
|
||||
} else if(paramName.endWith("age")) {
|
||||
resultValue = Math.ceil(Math.random() * 100);
|
||||
} else if(isPriceColumn){
|
||||
resultValue = parseFloat(Math.random() * 1000).toFixed(2);
|
||||
} else if(isTypeColumn){
|
||||
resultValue = Math.ceil(Math.random() * 5);
|
||||
} else if(isBooleanColumn){
|
||||
resultValue = (Math.random() > 0.5) ? 0 : 1;
|
||||
} else if(paramName.endWith("phone") || paramName.endWith("mobile")){
|
||||
var arr = ["15226645814", "15226645815", "15226645816", "15226645817", "15226645818"];
|
||||
resultValue = arr[Math.ceil(Math.random() * 5) - 1];
|
||||
} else if(paramName.endWith("md5")){
|
||||
resultValue = "5082079d92a8ef985f59e001d445ff20";
|
||||
} else if(paramName.endWith("photo")){
|
||||
resultValue = "http://www.zyplayer.com/freeplay/img/headIcon/myhead.jpg";
|
||||
} else if(paramName.endWith("url")){
|
||||
var arr = ["http://www.zyplayer.com", "http://www.kongjianzhou.com"];
|
||||
resultValue = arr[Math.ceil(Math.random() * 2) - 1];
|
||||
} else if(paramName.endWith("username")){
|
||||
var arr = ["张三", "李四", "王二", "暮光:城中城", "海贼王"];
|
||||
resultValue = arr[Math.ceil(Math.random() * 5) - 1];
|
||||
} else if(userSettings.autoFillParam == 2){
|
||||
//var arr = ["您好!","请!","对不起。","谢谢!","再见!","您早!","晚安!","请问您贵姓?","请原谅!","不用谢!","没关系!","欢迎您光临!","请坐!","请喝茶!","请多关照!","请多指教!","谢谢您的合作!","对不起,让您久等了。","没关系,我刚到。","给您添麻烦了。","我能为您做什么?","您好,请问您需要帮助吗?","您走好。","请慢走!"];
|
||||
//resultValue = arr[Math.ceil(Math.random() * 24) - 1];
|
||||
resultValue = "我是默认字符串";
|
||||
}
|
||||
//console.log(paramType);
|
||||
}
|
||||
return resultValue;
|
||||
}
|
||||
128
zyplayer-doc-swagger/src/main/resources/export/js/mg-ui-tag.js
Normal file
128
zyplayer-doc-swagger/src/main/resources/export/js/mg-ui-tag.js
Normal file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* 以每个Tag方式生成并展示:
|
||||
* 核心信息控制器
|
||||
* /api/data/getDataList
|
||||
* /api/data/getDataDetail
|
||||
* 跟进控制器
|
||||
* /api/track/getTrackList
|
||||
* /api/track/getTrackDetail
|
||||
*
|
||||
* 先把树形的写完了再写这个,,
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年5月26日
|
||||
*/
|
||||
|
||||
function createTreeViewByTag(json, keywords) {
|
||||
var pathIndex = {};
|
||||
var paths = json.paths;
|
||||
var domain = json.domainUrl;// 服务器代理会返回此属性
|
||||
if(isEmpty(domain)) {
|
||||
domain = "http://" + json.host + json.basePath;
|
||||
}
|
||||
if(domain.endWith("/")) {
|
||||
domain = domain.substring(0, domain.length - 1);
|
||||
}
|
||||
if (isEmptyObject(paths)) {
|
||||
return;
|
||||
}
|
||||
//console.log(paths);
|
||||
Object.keys(paths).forEach(function(key){
|
||||
//console.log(key, paths[key]);
|
||||
if(!findInPathsValue(key, paths[key], keywords)) {
|
||||
return;
|
||||
}
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "get");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "head");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "post");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "put");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "patch");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "delete");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "options");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "trace");
|
||||
});
|
||||
//console.log(pathIndex);
|
||||
var htmlStr = '<li>';
|
||||
htmlStr += '<a href="#">'+json.info.title+'</a>';
|
||||
htmlStr += '<ul>';
|
||||
htmlStr += getTreeHtmlForTag(pathIndex, projectTreeIdIndex);
|
||||
htmlStr += '</ul>';
|
||||
htmlStr += '</li>';
|
||||
$('#apiPathTree .projects').append(htmlStr);
|
||||
projectTreeIdIndex++;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置对象的各种请求方式,存在则复制
|
||||
* @param source 资源,原始json的paths的指定对象
|
||||
* @param pathObj 当前的待赋值对象
|
||||
* @param url url绝对路径
|
||||
* @param method 请求方式,post、get...
|
||||
* @returns
|
||||
*/
|
||||
function setRequestMethodForTag(domain, source, pathObj, url, method) {
|
||||
if (isEmpty(source[method])) {
|
||||
return;
|
||||
}
|
||||
source[method].tags.forEach(function(val, index) {
|
||||
var tempObj = pathObj[val];
|
||||
if(isEmpty(tempObj)) {
|
||||
tempObj = pathObj[val] = {};
|
||||
}
|
||||
var tempUrlObj = tempObj[url];
|
||||
if(isEmpty(tempUrlObj)) {
|
||||
tempUrlObj = tempObj[url] = {};
|
||||
}
|
||||
var tempPath = projectTreeIdIndex + url + "." + method;
|
||||
tempUrlObj[method] = source[method];
|
||||
tempUrlObj[method].path = tempPath;
|
||||
tempUrlObj[method].url = url;
|
||||
tempUrlObj[method].method = method;
|
||||
tempUrlObj[method].domain = domain;
|
||||
treePathDataMap.set(tempPath, source[method]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 将对象列表递归的方式转换成文档格式html字符串
|
||||
* @param pathData 处理后的对象列表
|
||||
* @returns 生成的html字符串
|
||||
*/
|
||||
function getTreeHtmlForTag(pathData, treeIdStr) {
|
||||
var tempStr = "";
|
||||
var indexNow = 1;
|
||||
// get, head, post, put, patch, delete, options, trace
|
||||
var actionArrays = ["get", "head", "post", "put", "patch", "delete", "options", "trace"];
|
||||
Object.keys(pathData).forEach(function(key){
|
||||
var tempNode = pathData[key];
|
||||
var tempTreeId = treeIdStr + "_" + indexNow;
|
||||
// 只有一个子元素,而且有method元素,说明是只有一个节点
|
||||
var nodeSub = getObjectFirstAttributeIfOnly(tempNode);
|
||||
if(nodeSub != null && isNotEmpty(nodeSub.method)) {
|
||||
var summary = isEmpty(nodeSub.summary) ? "" : "(" + nodeSub.summary + ")";
|
||||
if(summary.length > 10){
|
||||
summary = summary.substring(0, 10)+"...)";// 防止被撑得太长,只显示10个字
|
||||
}
|
||||
nodeSub.treeId = tempTreeId;
|
||||
tempStr += '<li m-id="'+tempTreeId+'"><a href="#" class="show-doc" path="'+nodeSub.path+'">'+key+'<span>'+summary+'</span></a></li>';
|
||||
} else if(haveString(actionArrays, key)) {
|
||||
//console.log(tempTreeId);
|
||||
tempNode.treeId = tempTreeId;
|
||||
var summary = isEmpty(tempNode.summary) ? "" : "("+tempNode.summary+")";
|
||||
if(summary.length > 10){
|
||||
summary = summary.substring(0, 10)+"...)";// 防止被撑得太长,只显示10个字
|
||||
}
|
||||
tempStr += '<li m-id="'+tempTreeId+'"><a href="#" class="show-doc" path="'+tempNode.path+'">'+key+'<span>'+summary+'</span></a></li>';
|
||||
} else {
|
||||
tempStr += '<li>';
|
||||
tempStr += '<a href="#">'+key+'</a>';
|
||||
tempStr += '<ul>';
|
||||
tempStr += getTreeHtmlForTag(tempNode, tempTreeId);
|
||||
tempStr += '</ul>';
|
||||
tempStr += '</li>';
|
||||
}
|
||||
indexNow++;
|
||||
});
|
||||
return tempStr;
|
||||
}
|
||||
|
||||
141
zyplayer-doc-swagger/src/main/resources/export/js/mg-ui-tree.js
Normal file
141
zyplayer-doc-swagger/src/main/resources/export/js/mg-ui-tree.js
Normal file
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
* 以树形方式生成并展示:
|
||||
* /api
|
||||
* /data
|
||||
* /getDateList
|
||||
* post
|
||||
* get
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年5月26日
|
||||
*/
|
||||
|
||||
/**
|
||||
* 把原始的json字符串转换成对象列表的方式,方便后续使用
|
||||
* @param json swagger的原始对象
|
||||
* @returns
|
||||
*/
|
||||
function createTreeViewByTree(json, keywords) {
|
||||
var pathIndex = {};
|
||||
var paths = json.paths;
|
||||
var domain = json.domainUrl;// 服务器代理会返回此属性
|
||||
if(isEmpty(domain)) {
|
||||
domain = "http://" + json.host + json.basePath;
|
||||
}
|
||||
if(domain.endWith("/")) {
|
||||
domain = domain.substring(0, domain.length - 1);
|
||||
}
|
||||
if (isEmptyObject(paths)) {
|
||||
return;
|
||||
}
|
||||
//console.log(paths);
|
||||
Object.keys(paths).forEach(function(key){
|
||||
//console.log(key, paths[key]);
|
||||
if(!findInPathsValue(key, paths[key], keywords)) {
|
||||
return;
|
||||
}
|
||||
var keyArr = key.split("/");
|
||||
var nowPathObj = null;
|
||||
keyArr.forEach(function(val, index) {
|
||||
//console.log(val, index);
|
||||
if(isEmpty(val) && index == 0) {
|
||||
return;
|
||||
}
|
||||
var nowPath = "/" + val;
|
||||
if(nowPathObj == null) {
|
||||
nowPathObj = {};
|
||||
nowPathObj[nowPath] = pathIndex[nowPath];
|
||||
if(nowPathObj[nowPath] == null) {
|
||||
nowPathObj[nowPath] = {};
|
||||
pathIndex[nowPath] = nowPathObj[nowPath];
|
||||
}
|
||||
}
|
||||
var tempPathObj = nowPathObj[nowPath];
|
||||
if(isEmpty(tempPathObj)) {
|
||||
tempPathObj = nowPathObj[nowPath] = {};
|
||||
}
|
||||
nowPathObj = tempPathObj;
|
||||
if(index == keyArr.length - 1) {
|
||||
//get, head, post, put, patch, delete, options, trace
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "get");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "head");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "post");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "put");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "patch");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "delete");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "options");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "trace");
|
||||
}
|
||||
});
|
||||
});
|
||||
var htmlStr = '<li>';
|
||||
htmlStr += '<a href="#">'+json.info.title+'</a>';
|
||||
htmlStr += '<ul>';
|
||||
htmlStr += getTreeHtmlForTree(pathIndex, projectTreeIdIndex);
|
||||
htmlStr += '</ul>';
|
||||
htmlStr += '</li>';
|
||||
$('#apiPathTree .projects').append(htmlStr);
|
||||
projectTreeIdIndex++;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置对象的各种请求方式,存在则复制
|
||||
* @param source 资源,原始json的paths的指定对象
|
||||
* @param pathObj 当前的待赋值对象
|
||||
* @param url url绝对路径
|
||||
* @param method 请求方式,post、get...
|
||||
* @returns
|
||||
*/
|
||||
function setRequestMethodForTree(domain, source, pathObj, url, method) {
|
||||
if (isEmpty(source[method])) {
|
||||
return;
|
||||
}
|
||||
var tempPath = projectTreeIdIndex + url + "." + method;
|
||||
pathObj[method] = source[method];
|
||||
pathObj[method].path = tempPath;
|
||||
pathObj[method].url = url;
|
||||
pathObj[method].method = method;
|
||||
pathObj[method].domain = domain;
|
||||
treePathDataMap.set(tempPath, source[method]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将对象列表递归的方式转换成文档格式html字符串
|
||||
* @param pathData 处理后的对象列表
|
||||
* @returns 生成的html字符串
|
||||
*/
|
||||
function getTreeHtmlForTree(pathData, treeIdStr) {
|
||||
var tempStr = "";
|
||||
var indexNow = 1;
|
||||
Object.keys(pathData).forEach(function(key){
|
||||
var tempNode = pathData[key];
|
||||
var tempTreeId = treeIdStr + "_" + indexNow;
|
||||
var nodeSub = getObjectFirstAttributeIfOnly(tempNode);
|
||||
if(nodeSub != null && isNotEmpty(nodeSub.method)) {
|
||||
//console.log(nodeSub);
|
||||
nodeSub.treeId = tempTreeId;
|
||||
var summary = isEmpty(nodeSub.summary) ? "" : "("+nodeSub.summary+")";
|
||||
if(summary.length > 10){
|
||||
summary = summary.substring(0, 10)+"...)";// 防止被撑得太长,只显示10个字
|
||||
}
|
||||
tempStr += '<li m-id="'+tempTreeId+'"><a href="#" class="show-doc" path="'+nodeSub.path+'">'+key+'<span>'+summary+'</span></a></li>';
|
||||
} else if(key.indexOf("/") < 0) {
|
||||
//console.log(tempTreeId);
|
||||
tempNode.treeId = tempTreeId;
|
||||
var summary = isEmpty(tempNode.summary) ? "" : "("+tempNode.summary+")";
|
||||
if(summary.length > 10){
|
||||
summary = summary.substring(0, 10)+"...)";// 防止被撑得太长,只显示10个字
|
||||
}
|
||||
tempStr += '<li m-id="'+tempTreeId+'"><a href="#" class="show-doc" path="'+tempNode.path+'">'+key+'<span>'+summary+'</span></a></li>';
|
||||
} else {
|
||||
tempStr += '<li>';
|
||||
tempStr += '<a href="#">'+key+'</a>';
|
||||
tempStr += '<ul>';
|
||||
tempStr += getTreeHtmlForTree(tempNode, tempTreeId);
|
||||
tempStr += '</ul>';
|
||||
tempStr += '</li>';
|
||||
}
|
||||
indexNow++;
|
||||
});
|
||||
return tempStr;
|
||||
}
|
||||
|
||||
708
zyplayer-doc-swagger/src/main/resources/export/js/mg-ui.js
Normal file
708
zyplayer-doc-swagger/src/main/resources/export/js/mg-ui.js
Normal file
@@ -0,0 +1,708 @@
|
||||
/**
|
||||
* swagger-mg-ui是swagger-ui的一个前端实现,使用简单、解析速度快、走心的设计
|
||||
* 支持多项目同时展示,多种文档目录的展示方案,多种自定义配置,满足各种使用习惯。
|
||||
* 使用中您有任何的意见和建议都可到源码地址处反馈哦!
|
||||
* git地址:https://gitee.com/zyplayer/swagger-mg-ui
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年5月20日
|
||||
*/
|
||||
|
||||
// 参数说明对于的map全局对象
|
||||
var definitionsDataMap = new Map();
|
||||
// 依据目录树存储的map全局对象
|
||||
var treePathDataMap = new Map();
|
||||
|
||||
var globalLoadingMessager;
|
||||
// 树的下表
|
||||
var projectTreeIdIndex = 1;
|
||||
// 文档url加载的下标
|
||||
var projectLoadingIndex = 0;
|
||||
// 请求到的文档列表
|
||||
var documentJsonArr = [];
|
||||
// 用户的配置对象
|
||||
var userSettings = {};
|
||||
// 默认用户的配置对象
|
||||
var defaultUserSettings = {
|
||||
autoFillParam : 1,// 自动填充参数
|
||||
onlyUseLastParam : 0,// 是否仅使用上次请求参数
|
||||
showParamType : 1,// 是否展示字段的类型
|
||||
catalogShowType : 2,// 目录的展示方式,1=url分成一层一层的展示、2=整个url显示为一层展示
|
||||
treeShowType : 1,// 树形菜单展示方式,1=tree-angles、2=tree-menu、3=默认,4=tree-folders、5=tree-chevrons
|
||||
projects : [],// 所有的项目列表
|
||||
removedProjects : [],// 被移除的项目列表
|
||||
prevWNow : 360
|
||||
};
|
||||
|
||||
var swaggerApiDocsArr = [];
|
||||
|
||||
/**
|
||||
* 网页加载完毕后的处理
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
userSettings = defaultUserSettings;
|
||||
changeContentWidth(userSettings.prevWNow);
|
||||
updateTreeShowType();
|
||||
updateUserSettingsUi();
|
||||
|
||||
globalLoadingMessager = new $.zui.Messager({type: 'primary', close: false, time: 0}).show();
|
||||
showGlobalLoadingMessage('文档解析中,请稍候...', true);
|
||||
if(isEmptyObject(mgUiDataArr)) {
|
||||
Toast.error("文档数据错误,请检查!");
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < mgUiDataArr.length; i++) {
|
||||
showGlobalLoadingMessage('解析第'+(i+1)+'份文档,请稍候...', true);
|
||||
var tempDoc = mgUiDataArr[i];
|
||||
console.log(tempDoc);
|
||||
documentJsonArr.push(tempDoc);// 加到所有文档
|
||||
addHomePageDashboard(tempDoc, tempDoc.fullUrl);
|
||||
createDefinitionsMapByJson(tempDoc);
|
||||
if(userSettings.catalogShowType == 1) {
|
||||
createTreeViewByTree(tempDoc);// url分成一层一层的展示
|
||||
} else if(userSettings.catalogShowType == 2){
|
||||
createTreeViewByTag(tempDoc);// tag方式,整个url显示为一层
|
||||
} else {
|
||||
createTreeViewByTree(tempDoc);// url分成一层一层的展示
|
||||
}
|
||||
}
|
||||
documentLoadFinish();
|
||||
});
|
||||
|
||||
/**
|
||||
* 自由拖动改变左右框架的宽度
|
||||
*/
|
||||
$("#resizebleLeftRight").mgResizebleWidth({
|
||||
prev:"#leftContent",
|
||||
prevWtMin: 120, prevWtMax: 999999,
|
||||
nextWtMin: 360, nextWtMax: 999999,
|
||||
onresize:function(prevWNow, nextWNow){
|
||||
changeContentWidth(prevWNow);
|
||||
},
|
||||
onstart:function(){
|
||||
$("body").addClass("unselect");
|
||||
},
|
||||
onfinish:function(){
|
||||
$("body").removeClass("unselect");
|
||||
storeUserSettings();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 切换导航栏的宽度到最小或最大
|
||||
*/
|
||||
$("#changeContentWidth").click(function(){
|
||||
var isMinWidth = ($("#leftContent").width() == 120);
|
||||
changeContentWidth(isMinWidth ? 360 : 120);
|
||||
});
|
||||
|
||||
/**
|
||||
* 修改tree的class
|
||||
*/
|
||||
$("input[name='treeShowType']").change(function() {
|
||||
userSettings.treeShowType = $("input[name='treeShowType']:checked").val();
|
||||
updateTreeShowType();
|
||||
storeUserSettings();
|
||||
});
|
||||
|
||||
/**
|
||||
* 切换url分成一层一层的展示、整个url显示为一层展示
|
||||
*/
|
||||
$("input[name='catalogShowType']").change(function() {
|
||||
userSettings.catalogShowType = $("input[name='catalogShowType']:checked").val();
|
||||
regeneratePathTree();
|
||||
storeUserSettings();
|
||||
});
|
||||
|
||||
/**
|
||||
* 是否展示参数类型
|
||||
*/
|
||||
$("input[name='showParamType']").change(function() {
|
||||
userSettings.showParamType = $("input[name='showParamType']:checked").val();
|
||||
storeUserSettings();
|
||||
});
|
||||
|
||||
/**
|
||||
* 是否自动填充请求参数
|
||||
*/
|
||||
$("input[name='autoFillParam']").change(function() {
|
||||
userSettings.autoFillParam = $("input[name='autoFillParam']:checked").val();
|
||||
storeUserSettings();
|
||||
});
|
||||
|
||||
/**
|
||||
* 搜索框回车事件
|
||||
*/
|
||||
$("#searchDocInput").keyup(function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
searchDoc();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 搜索按钮点击
|
||||
*/
|
||||
$("#searchDocBt").click(function(){
|
||||
searchDoc();
|
||||
});
|
||||
|
||||
/**
|
||||
* 主页li点击事件,展示主页
|
||||
*/
|
||||
$("#homePageLi").click(function(){
|
||||
$(".tab-page").hide();
|
||||
$(".tab-home-page").show();
|
||||
});
|
||||
|
||||
/**
|
||||
* api文档最后的节点点击,展示文档页面
|
||||
*/
|
||||
$("#apiPathTree").on("click", ".show-doc", function(){
|
||||
$(".tab-page").hide();
|
||||
$(".tab-document").show();
|
||||
var path = $(this).attr("path");
|
||||
var data = treePathDataMap.get(path);
|
||||
var docInfo = getNotEmptyStr(data.description);
|
||||
var docUrl = getNotEmptyStr(data.url);
|
||||
if(isEmpty(docInfo)) {
|
||||
docInfo = getNotEmptyStr(data.summary);
|
||||
}
|
||||
// 处理在线文档
|
||||
$("#docUrl").text(docUrl);
|
||||
$("#docRequestMethod").text(getNotEmptyStr(data.method));
|
||||
$("#docInfo").text(docInfo);
|
||||
$("#docConsumes").text(arrToString(data.consumes));
|
||||
$("#docProduces").text(arrToString(data.produces));
|
||||
// 遍历参数列表
|
||||
$("#docRequestParam table tbody").empty();
|
||||
$("#docRequestExample table tbody").empty();
|
||||
Formatjson.annotationObject = {};
|
||||
if(isNotEmpty(data.parameters)) {
|
||||
Object.keys(data.parameters).forEach(function(key){
|
||||
var tempParameters = data.parameters[key];
|
||||
var htmlStr = "", htmlStrExample = "";
|
||||
var responsesJson = [];
|
||||
var responsesExample = [];
|
||||
var required = tempParameters.required;
|
||||
var paramName = getNotEmptyStr(tempParameters.name);
|
||||
var paramType = getNotEmptyStr(tempParameters.type);
|
||||
var paramDesc = getNotEmptyStr(tempParameters.description);
|
||||
var paramIn = getNotEmptyStr(tempParameters.in);
|
||||
var example = getNotEmptyStr(tempParameters.example, tempParameters.default);
|
||||
if(isNotEmpty(tempParameters.items)) {
|
||||
htmlStr = paramName + "[0]";
|
||||
htmlStrExample = paramName + "[0]";
|
||||
} else if(isNotEmpty(tempParameters.schema)) {
|
||||
if("array" == tempParameters.schema.type) {
|
||||
var responsesObj = definitionsDataMap.get(tempParameters.schema.items.$ref);
|
||||
if(responsesObj != null) {
|
||||
responsesJson[0] = getResponsesJson(responsesObj, "", false, 1);
|
||||
responsesExample[0] = getResponsesJson(responsesObj, "", true, 1);
|
||||
} else {
|
||||
responsesJson = [""];
|
||||
responsesExample = [""];
|
||||
if(tempParameters.schema.items.type == "boolean") {
|
||||
responsesJson = [true];
|
||||
responsesExample = [true];
|
||||
} else if(tempParameters.schema.items.type == "integer") {
|
||||
responsesJson = [0];
|
||||
responsesExample = [0];
|
||||
}
|
||||
}
|
||||
var arrTmp = tempParameters.schema.$ref.split("/");
|
||||
paramType = arrTmp[arrTmp.length - 1];
|
||||
htmlStr = Formatjson.processObjectToHtmlPre(responsesJson, 0, false, false, false, true);
|
||||
htmlStrExample = Formatjson.processObjectToHtmlPre(responsesExample, 0, false, false, false, false);
|
||||
} else if(isNotEmpty(tempParameters.schema.$ref)){
|
||||
var responsesObj = definitionsDataMap.get(tempParameters.schema.$ref);
|
||||
var arrTmp = tempParameters.schema.$ref.split("/");
|
||||
paramType = arrTmp[arrTmp.length - 1];
|
||||
if(isNotEmpty(responsesObj)) {
|
||||
responsesJson = getResponsesJson(responsesObj, "", false, 1);
|
||||
responsesExample = getResponsesJson(responsesObj, "", true, 1);
|
||||
htmlStr = Formatjson.processObjectToHtmlPre(responsesJson, 0, false, false, false, true);
|
||||
htmlStrExample = Formatjson.processObjectToHtmlPre(responsesExample, 0, false, false, false, false);
|
||||
} else {
|
||||
htmlStr = paramName;
|
||||
htmlStrExample = paramName;
|
||||
}
|
||||
} else if("string" == tempParameters.schema.type) {
|
||||
htmlStr = paramName;
|
||||
htmlStrExample = paramName;
|
||||
} else {
|
||||
htmlStr = paramName;
|
||||
htmlStrExample = paramName;
|
||||
}
|
||||
} else {
|
||||
htmlStr = paramName;
|
||||
htmlStrExample = paramName;
|
||||
}
|
||||
$("#docRequestParam table tbody").append(
|
||||
'<tr>'
|
||||
+'<td>' + htmlStr + '</td>'
|
||||
+'<td>' + paramDesc + '</td>'
|
||||
+'<td>' + paramType + '</td>'
|
||||
+'<td>' + paramIn + '</td>'
|
||||
+'<td>' + required + '</td>'
|
||||
+'</tr>'
|
||||
);
|
||||
$("#docRequestExample table tbody").append(
|
||||
'<tr>'
|
||||
+'<td>' + htmlStrExample + '</td>'
|
||||
+'<td>' + paramDesc + '</td>'
|
||||
+'<td>' + paramType + '</td>'
|
||||
+'<td>' + paramIn + '</td>'
|
||||
+'<td>' + required + '</td>'
|
||||
+'</tr>'
|
||||
);
|
||||
});
|
||||
}
|
||||
// 遍历结果集列表
|
||||
$("#docResponseModel table tbody").empty();
|
||||
$("#docResponseExample table tbody").empty();
|
||||
Formatjson.annotationObject = {};
|
||||
if(isNotEmpty(data.responses)) {
|
||||
Object.keys(data.responses).forEach(function(key){
|
||||
var tempRespones = data.responses[key];
|
||||
if(isNotEmpty(tempRespones.schema)) {
|
||||
var responsesJson, responsesExample;
|
||||
if("array" == tempRespones.schema.type) {
|
||||
responsesJson = [];
|
||||
responsesExample = [];
|
||||
var responsesObj = definitionsDataMap.get(tempRespones.schema.items.$ref);
|
||||
if(responsesObj != null) {
|
||||
responsesJson[0] = getResponsesJson(responsesObj, "", false, 1);
|
||||
responsesExample[0] = getResponsesJson(responsesObj, "", true, 1);
|
||||
} else {
|
||||
responsesJson = [""];
|
||||
responsesExample = [""];
|
||||
if(tempParameters.schema.items.type == "boolean") {
|
||||
responsesJson = [true];
|
||||
responsesExample = [true];
|
||||
} else if(tempParameters.schema.items.type == "integer") {
|
||||
responsesJson = [0];
|
||||
responsesExample = [0];
|
||||
}
|
||||
}
|
||||
} else if(isNotEmpty(tempRespones.schema.$ref)){
|
||||
var responsesObj = definitionsDataMap.get(tempRespones.schema.$ref);
|
||||
if(isEmptyObject(responsesObj)) {
|
||||
var arrTmp = tempRespones.schema.$ref.split("/");
|
||||
var lastObjName = arrTmp[arrTmp.length - 1];
|
||||
responsesJson = lastObjName;
|
||||
responsesExample = lastObjName;
|
||||
} else {
|
||||
responsesJson = getResponsesJson(responsesObj, "", false, 1);
|
||||
responsesExample = getResponsesJson(responsesObj, "", true, 1);
|
||||
}
|
||||
} else {
|
||||
responsesJson = "";
|
||||
responsesExample = "";
|
||||
}
|
||||
if(isEmptyObject(responsesJson)) {
|
||||
return;
|
||||
}
|
||||
//console.log(Formatjson.annotationObject);
|
||||
var htmlStr = Formatjson.processObjectToHtmlPre(responsesJson, 0, false, false, false, true);
|
||||
$("#docResponseModel table tbody").append(
|
||||
'<tr>'
|
||||
+'<td>' + key + '</td>'
|
||||
+'<td>' + htmlStr + '</td>'
|
||||
+'</tr>'
|
||||
);
|
||||
htmlStr = Formatjson.processObjectToHtmlPre(responsesExample, 0, false, false, false, false);
|
||||
$("#docResponseExample table tbody").append(
|
||||
'<tr>'
|
||||
+'<td>' + key + '</td>'
|
||||
+'<td>' + htmlStr + '</td>'
|
||||
+'</tr>'
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 搜索文档
|
||||
* @returns
|
||||
*/
|
||||
function searchDoc() {
|
||||
var keywords = $("#searchDocInput").val();
|
||||
// 重新生成
|
||||
regeneratePathTree(keywords);
|
||||
if (isEmpty(keywords)){
|
||||
return;
|
||||
}
|
||||
$('#apiPathTree .projects').tree('expand');
|
||||
}
|
||||
|
||||
// 重新生成文档
|
||||
function regeneratePathTree(keywords){
|
||||
projectTreeIdIndex = 1;
|
||||
treePathDataMap = new Map();
|
||||
$('#apiPathTree').empty();
|
||||
$('#apiPathTree').append('<ul class="tree tree-lines projects"></ul>');
|
||||
for (var i = 0; i < documentJsonArr.length; i++) {
|
||||
var json = documentJsonArr[i];
|
||||
if(userSettings.catalogShowType == 1) {
|
||||
createTreeViewByTree(json, keywords);// url分成一层一层的展示
|
||||
} else if(userSettings.catalogShowType == 2){
|
||||
createTreeViewByTag(json, keywords);// tag方式,整个url显示为一层
|
||||
} else {
|
||||
createTreeViewByTree(json, keywords);// url分成一层一层的展示
|
||||
}
|
||||
}
|
||||
$('#apiPathTree .projects').tree();
|
||||
updateTreeShowType();
|
||||
}
|
||||
|
||||
function findInPathsValue(key, pathsValue, keywords) {
|
||||
if(isEmpty(keywords) || isEmpty(key)) {
|
||||
return true;
|
||||
}
|
||||
key = key.toLowerCase();
|
||||
keywords = keywords.toLowerCase();
|
||||
// 路径中有就不用再去找了
|
||||
if(key.indexOf(keywords) >= 0) {
|
||||
return true;
|
||||
}
|
||||
for ( var subKey in pathsValue) {
|
||||
// 找路径和说明里面包含关键字的
|
||||
var tagsTmp = pathsValue[subKey].tags;
|
||||
var pathTmp = pathsValue[subKey].path;
|
||||
var summaryTmp = pathsValue[subKey].summary;
|
||||
var descriptionTmp = pathsValue[subKey].description;
|
||||
if(isNotEmpty(pathTmp) && pathTmp.toLowerCase().indexOf(keywords) >= 0) {
|
||||
return true;
|
||||
}
|
||||
if(isNotEmpty(summaryTmp) && summaryTmp.toLowerCase().indexOf(keywords) >= 0) {
|
||||
return true;
|
||||
}
|
||||
if(isNotEmpty(descriptionTmp) && descriptionTmp.toLowerCase().indexOf(keywords) >= 0) {
|
||||
return true;
|
||||
}
|
||||
if(isNotEmpty(tagsTmp) && arrToString(tagsTmp).toLowerCase().indexOf(keywords) >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function getResponsesJson(responsesObj, prevRef, isExample, recursiveCount) {
|
||||
var responsesJson = {};
|
||||
recursiveCount++;// 多层递归,最多递归10层,防止无限递归
|
||||
if(isEmpty(responsesObj) || isEmpty(responsesObj.properties) || recursiveCount > 10) {
|
||||
return responsesJson;
|
||||
}
|
||||
var requiredArr = responsesObj.required;
|
||||
Object.keys(responsesObj.properties).forEach(function(prop){
|
||||
var tmpData = responsesObj.properties[prop];
|
||||
if("array" == tmpData.type) {// 数组
|
||||
Formatjson.annotationObject[prop] = getNotEmptyStr(tmpData.description);
|
||||
if(prevRef != tmpData.items.$ref) {
|
||||
var tempObj = definitionsDataMap.get(tmpData.items.$ref);
|
||||
if(tempObj != null) {
|
||||
var tempArr = responsesJson[prop] = [];
|
||||
tempArr[0] = getResponsesJson(tempObj, tmpData.items.$ref, isExample, recursiveCount);
|
||||
} else {
|
||||
var responsesJsonSub = [];
|
||||
var bodyFor = responsesJsonSub;
|
||||
var items = tmpData.items;
|
||||
for (var i = 0; i < 10; i++) {
|
||||
if("array" == items.type) {
|
||||
bodyFor = bodyFor[0] = [];
|
||||
items = items.items;
|
||||
} else {
|
||||
tempObj = definitionsDataMap.get(items.$ref);
|
||||
if(tempObj != null) {
|
||||
bodyFor[0] = getResponsesJson(tempObj, items.$ref, isExample, recursiveCount);
|
||||
} else {
|
||||
if(items.type == "boolean") {
|
||||
bodyFor[0] = true;
|
||||
} else if(items.type == "integer") {
|
||||
bodyFor[0] = 0;
|
||||
} else {
|
||||
bodyFor[0] = "";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
responsesJson[prop] = responsesJsonSub;
|
||||
}
|
||||
} else {
|
||||
responsesJson[prop] = "{}" + getNotEmptyStr(tmpData.description);
|
||||
}
|
||||
} else if(isNotEmpty(tmpData.$ref)) {// 对象
|
||||
Formatjson.annotationObject[prop] = getNotEmptyStr(tmpData.description);
|
||||
if(prevRef != tmpData.$ref) {
|
||||
var tempObj = definitionsDataMap.get(tmpData.$ref);
|
||||
responsesJson[prop] = getResponsesJson(tempObj, tmpData.$ref, isExample, recursiveCount);
|
||||
} else {
|
||||
responsesJson[prop] = "{}" + getNotEmptyStr(tmpData.description);
|
||||
}
|
||||
} else {// 字段
|
||||
var enumExample = "";
|
||||
var enumObj = tmpData["enum"];
|
||||
if(!isEmptyObject(enumObj) && enumObj.length > 0) {
|
||||
enumExample = "枚举值:";
|
||||
for (var i = 0; i < enumObj.length; i++) {
|
||||
if(i > 0) {enumExample += "、";}
|
||||
enumExample += enumObj[i];
|
||||
}
|
||||
}
|
||||
var typeStr = getNotEmptyStr(tmpData.format);
|
||||
if(isEmpty(typeStr)) {
|
||||
typeStr = getNotEmptyStr(tmpData.type);
|
||||
}
|
||||
if(isExample) {
|
||||
var tempVal = getNotEmptyStr(tmpData.example);
|
||||
if(isEmpty(tempVal)) {
|
||||
tempVal = getAutoFillValue(typeStr, prop);
|
||||
}
|
||||
if(isNotEmpty(tempVal) && isNotEmpty(enumExample)) {
|
||||
tempVal = tempVal + "," + enumExample;
|
||||
}
|
||||
responsesJson[prop] = tempVal;
|
||||
} else {
|
||||
if(userSettings.showParamType == 1) {
|
||||
if(haveString(requiredArr, prop)) {
|
||||
typeStr = (isNotEmpty(typeStr) ? typeStr + "," : "") + "required";
|
||||
}
|
||||
if(isNotEmpty(typeStr)) {
|
||||
typeStr = "(" + typeStr + ")";
|
||||
}
|
||||
}
|
||||
var descriptionStr = typeStr + getNotEmptyStr(tmpData.description);
|
||||
if(isNotEmpty(descriptionStr) && isNotEmpty(enumExample)) {
|
||||
descriptionStr = descriptionStr + "," + enumExample;
|
||||
}
|
||||
responsesJson[prop] = descriptionStr;
|
||||
}
|
||||
}
|
||||
});
|
||||
return responsesJson;
|
||||
}
|
||||
|
||||
function getRequestParamObj(responsesObj, prevRef) {
|
||||
var responsesJson = {};
|
||||
if(isEmpty(responsesObj) || isEmpty(responsesObj.properties)) {
|
||||
return responsesJson;
|
||||
}
|
||||
var requiredArr = responsesObj.required;
|
||||
Object.keys(responsesObj.properties).forEach(function(prop){
|
||||
var tmpData = responsesObj.properties[prop];
|
||||
if("array" == tmpData.type) {// 数组
|
||||
if(prevRef != tmpData.items.$ref) {
|
||||
var tempObj = definitionsDataMap.get(tmpData.items.$ref);
|
||||
if(tempObj != null) {
|
||||
var tempArr = responsesJson[prop] = [];
|
||||
tempArr[0] = getRequestParamObj(tempObj, tmpData.items.$ref);
|
||||
} else {
|
||||
var responsesJsonSub = [];
|
||||
var bodyFor = responsesJsonSub;
|
||||
var items = tmpData.items;
|
||||
for (var i = 0; i < 10; i++) {
|
||||
if("array" == items.type) {
|
||||
bodyFor = bodyFor[0] = [];
|
||||
items = items.items;
|
||||
} else {
|
||||
tempObj = definitionsDataMap.get(items.$ref);
|
||||
if(tempObj != null) {
|
||||
bodyFor[0] = getRequestParamObj(tempObj, items.$ref);
|
||||
} else {
|
||||
if(items.type == "boolean") {
|
||||
bodyFor[0] = true;
|
||||
} else if(items.type == "integer") {
|
||||
bodyFor[0] = 0;
|
||||
} else {
|
||||
bodyFor[0] = "";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
responsesJson[prop] = responsesJsonSub;
|
||||
}
|
||||
} else {
|
||||
var required = haveString(requiredArr, prop);
|
||||
var paramType = getNotEmptyStr(tmpData.format);
|
||||
var paramDesc = getNotEmptyStr(tmpData.description);
|
||||
var example = getNotEmptyStr(tmpData.example, tmpData.default);
|
||||
if(isEmpty(paramType)) {
|
||||
paramType = getNotEmptyStr(tmpData.type);
|
||||
}
|
||||
addRequestParamObj(responsesJson, prop, paramType, "", required, paramDesc, example);
|
||||
}
|
||||
} else if(isNotEmpty(tmpData.$ref)) {// 对象
|
||||
if(prevRef != tmpData.$ref) {
|
||||
var tempObj = definitionsDataMap.get(tmpData.$ref);
|
||||
responsesJson[prop] = getRequestParamObj(tempObj, tmpData.$ref);
|
||||
} else {
|
||||
var required = haveString(requiredArr, prop);
|
||||
var paramType = getNotEmptyStr(tmpData.format);
|
||||
var paramDesc = getNotEmptyStr(tmpData.description);
|
||||
var example = getNotEmptyStr(tmpData.example, tmpData.default);
|
||||
if(isEmpty(paramType)) {
|
||||
paramType = getNotEmptyStr(tmpData.type);
|
||||
}
|
||||
addRequestParamObj(responsesJson, prop, paramType, "", required, paramDesc, example);
|
||||
}
|
||||
} else {// 字段
|
||||
var required = haveString(requiredArr, prop);
|
||||
var paramType = getNotEmptyStr(tmpData.format);
|
||||
var paramDesc = getNotEmptyStr(tmpData.description);
|
||||
var example = getNotEmptyStr(tmpData.example, tmpData.default);
|
||||
if(isEmpty(paramType)) {
|
||||
paramType = getNotEmptyStr(tmpData.type);
|
||||
}
|
||||
addRequestParamObj(responsesJson, prop, paramType, "", required, paramDesc, example);
|
||||
}
|
||||
});
|
||||
return responsesJson;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过原始json生成引用的字典Map
|
||||
* @param json swagger的原始json
|
||||
* @returns
|
||||
*/
|
||||
function createDefinitionsMapByJson(json) {
|
||||
var pathIndex = {};
|
||||
var definitions = json.definitions;
|
||||
//console.log(paths);
|
||||
if(isNotEmpty(definitions)) {
|
||||
Object.keys(definitions).forEach(function(key){
|
||||
//console.log(key);
|
||||
definitionsDataMap.set("#/definitions/" + key, definitions[key]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改左右框架的宽度
|
||||
* @param width 左侧导航栏的宽度
|
||||
* @returns
|
||||
*/
|
||||
function changeContentWidth(width) {
|
||||
$("#leftContent").css("width", width + 'px');
|
||||
$("#resizebleLeftRight").css("left", width + 'px');
|
||||
$("#rightContent").css("left", width + 'px');
|
||||
var logoText = "swagger-mg-ui";
|
||||
if(width < 270 && width > 140){
|
||||
logoText = "mg-ui";
|
||||
} else if(width < 140){
|
||||
logoText = "mui";
|
||||
}
|
||||
$("#logoText").text(logoText);
|
||||
userSettings.prevWNow = width;
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加项目文档
|
||||
* @param json
|
||||
* @returns
|
||||
*/
|
||||
function addHomePageDashboard(json, fullUrl) {
|
||||
var info = json.info||{};
|
||||
var contactName = "";
|
||||
if(isNotEmpty(info.contact)) {
|
||||
contactName = "昵称:" + getNotEmptyStr(info.contact.name, "-");
|
||||
contactName += "<br/>邮箱:" + getNotEmptyStr(info.contact.email, "-");
|
||||
contactName += "<br/>网站:" + getNotEmptyStr(info.contact.url, "-");
|
||||
}
|
||||
$("#homePageDashboard section").append(
|
||||
'<div class="col-md-6 col-sm-6">'
|
||||
+'<div class="panel" data-id="'+fullUrl+'">'
|
||||
+'<div class="panel-heading">'
|
||||
+'<div class="title">'+info.title+'</div>'
|
||||
+'<div class="panel-actions"></div>'
|
||||
+'</div>'
|
||||
+'<div class="panel-body">'
|
||||
+'<div class="content">'
|
||||
+'<table class="table table-bordered setting-table">'
|
||||
+'<tr>'
|
||||
+'<td class="info">简介</td>'
|
||||
+'<td>'+info.description+'</td>'
|
||||
+'</tr>'
|
||||
+'<tr>'
|
||||
+'<td class="info">作者</td>'
|
||||
+'<td>'+contactName+'</td>'
|
||||
+'</tr>'
|
||||
+'<tr>'
|
||||
+'<td class="info">版本</td>'
|
||||
+'<td>'+info.version+'</td>'
|
||||
+'</tr>'
|
||||
//+'<tr>'
|
||||
// +'<td class="info">地址</td>'
|
||||
// +'<td>'+fullUrl+'</td>'
|
||||
//+'</tr>'
|
||||
+'</table>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化用户的设置
|
||||
* @param
|
||||
* @returns
|
||||
*/
|
||||
function documentLoadFinish() {
|
||||
showGlobalLoadingMessage('文档解析完成!', false);
|
||||
setTimeout(function() {
|
||||
globalLoadingMessager.hide();
|
||||
}, 1000);
|
||||
$('#apiPathTree .projects').tree();
|
||||
$('#homePageDashboard').dashboard({draggable: true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户的选项的显示
|
||||
* @param
|
||||
* @returns
|
||||
*/
|
||||
function updateUserSettingsUi() {
|
||||
$("input[name='treeShowType'][value='"+userSettings.treeShowType+"']").prop("checked",true);
|
||||
$("input[name='catalogShowType'][value='"+userSettings.catalogShowType+"']").prop("checked",true);
|
||||
$("input[name='showParamType'][value='"+userSettings.showParamType+"']").prop("checked",true);
|
||||
$("input[name='onlyUseLastParam'][value='"+userSettings.onlyUseLastParam+"']").prop("checked",true);
|
||||
$("input[name='autoFillParam'][value='"+userSettings.autoFillParam+"']").prop("checked",true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改树形菜单展示类型
|
||||
* @param
|
||||
* @returns
|
||||
*/
|
||||
function updateTreeShowType() {
|
||||
$('#apiPathTree .projects').removeClass("tree-angles tree-menu tree-folders tree-chevrons");
|
||||
//tree-angles、2=tree-menu、3=默认,4=tree-folders、5=tree-chevrons
|
||||
$('#apiPathTree .projects').addClass("tree-lines");
|
||||
var treeShowType = "tree-angles";
|
||||
if(userSettings.treeShowType == 1) {
|
||||
treeShowType = "tree-angles";
|
||||
} else if(userSettings.treeShowType == 2) {
|
||||
treeShowType = "tree-menu";
|
||||
$('#apiPathTree .projects').removeClass("tree-lines");
|
||||
} else if(userSettings.treeShowType == 3) {
|
||||
treeShowType = "";
|
||||
} else if(userSettings.treeShowType == 4) {
|
||||
treeShowType = "tree-folders";
|
||||
} else if(userSettings.treeShowType == 5) {
|
||||
treeShowType = "tree-chevrons";
|
||||
} else {
|
||||
userSettings.treeShowType = 1;
|
||||
}
|
||||
if(isNotEmpty(treeShowType)) {
|
||||
$('#apiPathTree .projects').addClass(treeShowType);
|
||||
}
|
||||
}
|
||||
|
||||
function showGlobalLoadingMessage(text, loading) {
|
||||
if(loading) {
|
||||
text += '<i class="icon icon-spin icon-spinner-snake hide"></i>';
|
||||
}
|
||||
globalLoadingMessager.$.find(".messager-content").html(text);
|
||||
}
|
||||
106
zyplayer-doc-swagger/src/main/resources/export/js/mgResizeble.js
Normal file
106
zyplayer-doc-swagger/src/main/resources/export/js/mgResizeble.js
Normal file
@@ -0,0 +1,106 @@
|
||||
|
||||
/**
|
||||
* 两个元素上下、左右拖动动态改变大小
|
||||
* @author 暮光:城中城
|
||||
* @since 2017年5月7日
|
||||
*/
|
||||
(function($){
|
||||
$.fn.mgResizebleHeight = function(options) {
|
||||
var defaults = {prev:this,next:this, prevHtMin:0, prevHtMax:999, nextHtMin:0, nextHtMax:999};
|
||||
var opts = $.extend(defaults, options);
|
||||
var disY = 0, prevH = 0, nextH = 0, isStart = false;
|
||||
var prev, next, thisObj = this;
|
||||
$(document).mousemove(function(ev){
|
||||
if(!isStart){return;}
|
||||
var ev = ev || window.event;
|
||||
var H = ev.clientY - disY;
|
||||
var prevHNow = prevH+H, nextHNow = nextH-H;
|
||||
if(opts.prevHtMin >= prevHNow) {
|
||||
prevHNow = opts.prevHtMin;
|
||||
nextHNow = next.outerHeight();
|
||||
}
|
||||
if(opts.nextHtMin >= nextHNow) {
|
||||
nextHNow = opts.nextHtMin;
|
||||
prevHNow = prev.outerHeight();
|
||||
}
|
||||
if(opts.prevHtMax <= prevHNow) {
|
||||
prevHNow = opts.prevHtMax;
|
||||
nextHNow = next.outerHeight();
|
||||
}
|
||||
if(opts.nextHtMax <= nextHNow) {
|
||||
nextHNow = opts.nextHtMax;
|
||||
prevHNow = prev.outerHeight();
|
||||
}
|
||||
//prev.css("height", prevHNow + 'px');
|
||||
//next.css("height", nextHNow + 'px');
|
||||
if(typeof opts.onresize == 'function') {
|
||||
opts.onresize(prevHNow, nextHNow);
|
||||
}
|
||||
}).mouseup(function(ev){
|
||||
isStart = false;
|
||||
});
|
||||
$(this).mousedown(function(ev){
|
||||
var ev = ev || window.event;
|
||||
disY = ev.clientY;
|
||||
prev = (opts.prev == thisObj)?$(opts.prev).prev():$(opts.prev);
|
||||
next = (opts.next == thisObj)?$(opts.next).next():$(opts.next);
|
||||
prevH = prev.outerHeight();
|
||||
nextH = next.outerHeight();
|
||||
isStart = true;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 改变宽度的功能,只是实现各种消息的通知,实际改变大小需要在回调里面自己操作
|
||||
*/
|
||||
$.fn.mgResizebleWidth = function(options) {
|
||||
var defaults = {prev:this,next:this, prevWtMin:0, prevWtMax:999, nextWtMin:0, nextWtMax:999};
|
||||
var opts = $.extend(defaults, options);
|
||||
var disX = 0, prevW = 0, nextW = 0, isStart = false;
|
||||
var prev, next, thisObj = this;
|
||||
$(document).mousemove(function(ev){
|
||||
if(!isStart){return;}
|
||||
var ev = ev || window.event;
|
||||
var W = ev.clientX - disX;
|
||||
var prevWNow = prevW+W, nextWNow = nextW-W;
|
||||
if(opts.prevWtMin >= prevWNow) {
|
||||
prevWNow = opts.prevWtMin;
|
||||
nextWNow = next.outerWidth();
|
||||
}
|
||||
if(opts.nextWtMin >= nextWNow) {
|
||||
nextWNow = opts.nextWtMin;
|
||||
prevWNow = prev.outerWidth();
|
||||
}
|
||||
if(opts.prevWtMax <= prevWNow) {
|
||||
prevWNow = opts.prevWtMax;
|
||||
nextWNow = next.outerWidth();
|
||||
}
|
||||
if(opts.nextWtMax <= nextWNow) {
|
||||
nextWNow = opts.nextWtMax;
|
||||
prevWNow = prev.outerWidth();
|
||||
}
|
||||
//prev.css("width", prevWNow + 'px');
|
||||
//next.css("width", nextWNow + 'px');
|
||||
if(typeof opts.onresize == 'function') {
|
||||
opts.onresize(prevWNow, nextWNow);
|
||||
}
|
||||
}).mouseup(function(ev){
|
||||
if(!isStart){return;}
|
||||
isStart = false;
|
||||
if(typeof opts.onfinish == 'function') {
|
||||
opts.onfinish();
|
||||
}
|
||||
});
|
||||
$(this).mousedown(function(ev){
|
||||
var ev = ev || window.event;
|
||||
disX = ev.clientX;
|
||||
prev = (opts.prev == thisObj)?$(opts.prev).prev():$(opts.prev);
|
||||
next = (opts.next == thisObj)?$(opts.next).next():$(opts.next);
|
||||
prevW = prev.outerWidth();
|
||||
nextW = next.outerWidth();
|
||||
isStart = true;
|
||||
if(typeof opts.onstart == 'function') {
|
||||
opts.onstart();
|
||||
}
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
||||
33
zyplayer-doc-swagger/src/main/resources/export/js/toast.js
Normal file
33
zyplayer-doc-swagger/src/main/resources/export/js/toast.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* 提示工具类
|
||||
* @author 暮光:城中城
|
||||
* @since 2017年5月7日
|
||||
*/
|
||||
var Toast = {
|
||||
notOpen:function(){
|
||||
var data = {
|
||||
message:"该功能暂未开放,敬请期待!",
|
||||
icon: 'heart',type:"warning",
|
||||
};
|
||||
this.show(data);
|
||||
},
|
||||
warn:function(msg, time){
|
||||
var data = {
|
||||
message:msg,time:time,
|
||||
icon: 'heart',type:'warning',
|
||||
};
|
||||
this.show(data);
|
||||
},
|
||||
error:function(msg, time){
|
||||
var data = {
|
||||
message:msg,time:time,
|
||||
icon: 'exclamation-sign',type:'danger',
|
||||
};
|
||||
this.show(data);
|
||||
},
|
||||
show:function(data){
|
||||
data.time = isEmpty(data.time)?2000:data.time;
|
||||
data.placement = isEmpty(data.placement)?'top':data.placement;
|
||||
new $.zui.Messager(data.message, data).show();
|
||||
}
|
||||
}
|
||||
7
zyplayer-doc-swagger/src/main/resources/export/js/zui.dashboard.min.js
vendored
Normal file
7
zyplayer-doc-swagger/src/main/resources/export/js/zui.dashboard.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
15
zyplayer-doc-swagger/src/main/resources/export/js/zui.lite.min.js
vendored
Normal file
15
zyplayer-doc-swagger/src/main/resources/export/js/zui.lite.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
16
zyplayer-doc-swagger/src/main/resources/export/js/zui.min.js
vendored
Normal file
16
zyplayer-doc-swagger/src/main/resources/export/js/zui.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,134 @@
|
||||
body{width: 100%;height: 100%;margin: 0;padding: 0;}
|
||||
a:focus{outline:none;}
|
||||
ul{list-style: none;list-style-type: none;}
|
||||
.tree li a{white-space: nowrap;}
|
||||
.tree-menu li > ul{background-color: #f1f1f1;}
|
||||
.tree-menu li li li li a{padding-left: 68px;}
|
||||
.tree-menu li li li li li a{padding-left: 88px;}
|
||||
.tree-menu li li li li li li a{padding-left: 108px;}
|
||||
.tree-menu li li li li li li li a{padding-left: 128px;}
|
||||
.tree-menu li li li li li li li li a{padding-left: 148px;}
|
||||
.tree-menu li li li li li li li li li a{padding-left: 168px;}
|
||||
.tree-menu li li li li li li li li li li a{padding-left: 188px;}
|
||||
.table td, .table th {vertical-align: middle;}
|
||||
#tabDocInfo{position: absolute; bottom: 0;top: 60px;overflow-y: auto; right: 0; left: 10px;}
|
||||
#tabOnlineDebug .param-response-box{position: absolute; bottom: 0;top: 100px;overflow-y: auto; right: 0; left: 10px;}
|
||||
.tab-online-debug-page{overflow-y: auto;position: absolute; bottom: 0;top: 10px; right: 0; left: 10px;}
|
||||
.tab-online-debug-page .title-info{padding-bottom: 10px;}
|
||||
.tab-online-debug-page .title-info .btn{margin-right: 20px;}
|
||||
.tab-online-debug-page .title-info .text{padding-bottom: 10px;}
|
||||
|
||||
.local-storage{display: none;}
|
||||
|
||||
/**lable的覆盖样式*/
|
||||
.label{font-size: 100%;}
|
||||
.label-warning {background-color: #f9f5ee; color: #f1a325;}
|
||||
label{font-weight: normal;}
|
||||
|
||||
.nav.gray{background-color: #f1f1f1;margin-bottom: 10px;}
|
||||
|
||||
.doc-table tr .info{text-align: right; width: 100px;}
|
||||
.setting-table tr .info{text-align: right; max-width: 150px;}
|
||||
.show-doc span{color: #aaa;}
|
||||
|
||||
.mgresizebleW{z-index: 90;height: 100%; width: 10px; cursor: e-resize;}
|
||||
.ui-resizable-handle {display: block;font-size: 0.1px;position: absolute;}
|
||||
#resizebleLeftRight{left: 360px;}
|
||||
.unselect{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
|
||||
|
||||
#homePageDashboard{overflow-y: auto;bottom: 0;top: 0;right: 0;left: 0;position: absolute;overflow-x: hidden;padding: 10px;}
|
||||
#homePageDashboard .panel-body{padding: 10px;}
|
||||
|
||||
#homePageLi{margin-top: 5px;}
|
||||
|
||||
.left-body{
|
||||
width: 360px; height:100%; position: fixed; top: 0; bottom: 0; left: 0;
|
||||
}
|
||||
.left-header{
|
||||
background: #3280fc;width: 100%; height:60px;line-height:60px;
|
||||
position: absolute; top: 0; bottom: 0; left: 0;text-align: center;
|
||||
}
|
||||
.left-header .logo{
|
||||
font-size: 30px;color: #fff;
|
||||
}
|
||||
.left-header .icon-bars{
|
||||
font-size: 24px;float: right;margin: 18px 18px 0 0;color: #fff;cursor: pointer;
|
||||
}
|
||||
.left-container{
|
||||
width: 100%;position: absolute;background: #f1f1f1;color: rgba(163, 175, 183, .9);
|
||||
top: 60px; bottom: 0; left: 0; overflow-y: auto; padding: 10px;
|
||||
}
|
||||
.left-container .projects{border: 0px; border-radius: 0px;}
|
||||
|
||||
.right-container{
|
||||
position: fixed;top: 0px; bottom: 0; left: 360px; right: 0;padding: 10px;
|
||||
}
|
||||
|
||||
#docResponseModel td:first-child{width: 100px;}
|
||||
#docResponseExample td:first-child{width: 100px;}
|
||||
|
||||
.modal-table-box{margin-top: 10px; max-height: 500px;overflow-y: auto;}
|
||||
.modal-table-box{list-style: none;}
|
||||
.modal-table-box ul{padding-left: 10px;}
|
||||
.modal-table-box li{padding: 10px 15px; margin: 0 10px 10px 0; background-color: #f1f1f1;cursor: pointer;}
|
||||
.modal-table-box li.checked{background-color: #8666b8;color:#fff;}
|
||||
|
||||
#exportDocumentText{height: 350px;}
|
||||
|
||||
/* 在线调试框样式 */
|
||||
#tabParamBody .tab-content{padding-top: 10px;}
|
||||
|
||||
.post-url-box{padding: 10px 0;}
|
||||
.post-url-box .input-group-btn:nth-child(2) button{border-right: 0;border-radius: 0;}
|
||||
.post-url-box .send-request .hide{display: none;}
|
||||
|
||||
.param-box{}
|
||||
.param-box .panel-collapse{padding: 10px;}
|
||||
.param-box .nav{background-color: #f1f1f1;}
|
||||
/* .param-box .nav > li > *{padding: 8px 25px;} */
|
||||
.param-box .nav > li > span{position: relative; display: block;background-color: #ccc;padding: 9px 25px;}
|
||||
.param-box .nav > .form-to-url{position: relative; display: block;padding: 10px 0 0 25px;}
|
||||
.param-box .nav > .form-to-url label{margin: 0;}
|
||||
.param-box .nav > .form-to-url input{margin: 0;}
|
||||
.param-box .tab-content .tab-param-pane{padding: 10px 10px 0 10px;}
|
||||
.param-box .table.param-table td, .param-box .table.param-table th{padding: 4px 5px;}
|
||||
.param-box .param-table td:first-child{width: 250px;}
|
||||
.param-box .param-table tbody td:nth-child(2){border-right: 0;}
|
||||
.param-box .param-table tbody td:nth-child(3){border-left: 0;padding: 0 10px 0 0;width: 10px;}
|
||||
.param-box .param-table tbody td:nth-child(3) i{cursor: pointer;color: #ccc;}
|
||||
.param-box .param-table tbody td:nth-child(3) i:hover{color: #888;}
|
||||
.param-box .param-table tbody tr.base td:last-child{display: none;}
|
||||
#bulkEditHeaderCheck{margin-left: 10px;}
|
||||
#bulkEditHeader,#bulkEditForm{display: none;}
|
||||
|
||||
.response-box{margin-top: 20px;}
|
||||
.response-box .nav > li > *{padding: 8px 25px;}
|
||||
.response-box .nav > li span{position: relative; display: block;padding: 9px 25px;}
|
||||
.response-box .nav > li.info span{background-color: #ccc;}
|
||||
.response-box .nav > li.right{float: right;}
|
||||
.response-box .nav > li.right i{color: #3280fc;}
|
||||
.response-box .nav{background-color: #f1f1f1;}
|
||||
.response-box .tab-content .tab-response-pane{padding: 10px;}
|
||||
|
||||
#responseBodyJsonIframe{width: 100%;height: 300px;border: 0;}
|
||||
|
||||
/* S-模拟请求 */
|
||||
#tabSimulationResult{padding: 10px 0;}
|
||||
/* E-模拟请求 */
|
||||
|
||||
/* S-JSON展示的样式 */
|
||||
pre.json{margin-top:0px;margin-bottom:0px;}
|
||||
pre.json .canvas{font:10pt georgia;background-color:#ececec;color:#000000;border:1px solid #cecece;}
|
||||
pre.json .object-brace{color:#00aa00;font-weight:bold;}
|
||||
pre.json .array-brace{color:#0033ff;font-weight:bold;}
|
||||
pre.json .property-name{color:#cc0000;font-weight:bold;}
|
||||
pre.json .string{color:#007777;}
|
||||
pre.json .number{color:#aa00aa;}
|
||||
pre.json .boolean{color:#0000ff;}
|
||||
pre.json .function{color:#aa6633;text-decoration:italic;}
|
||||
pre.json .null{color:#0000ff;}
|
||||
pre.json .comma{color:#000000;font-weight:bold;}
|
||||
pre.json .annotation{color:#aaa;}
|
||||
pre img{cursor: pointer;}
|
||||
/* E-JSON展示的样式 */
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 340 B |
Binary file not shown.
|
After Width: | Height: | Size: 331 B |
@@ -0,0 +1,269 @@
|
||||
/**
|
||||
* 一些公用方法
|
||||
* @author 暮光:城中城
|
||||
* @since 2017年5月7日
|
||||
*/
|
||||
|
||||
function serialize(value) {
|
||||
if (typeof value === 'string') {
|
||||
return value;
|
||||
}
|
||||
return JSON.stringify(value);
|
||||
}
|
||||
|
||||
function deserialize(value) {
|
||||
if (typeof value !== 'string' || isEmpty(value)) {
|
||||
return undefined;
|
||||
}
|
||||
try {
|
||||
return JSON.parse(value);
|
||||
} catch (e) {
|
||||
try {
|
||||
return eval('(' + value + ')');// 处理变态的单双引号共存字符串
|
||||
} catch (e) {
|
||||
return value || undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function validateResult(result) {
|
||||
if(result.errCode == 200) {
|
||||
return true;
|
||||
} else {
|
||||
Toast.error(result.errMsg);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function getNowDate() {
|
||||
var date = new Date();
|
||||
var month = date.getMonth() + 1;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var currentdate = date.getFullYear() + "-" + month + "-" + strDate;
|
||||
return currentdate;
|
||||
}
|
||||
|
||||
function getNowTime() {
|
||||
var date = new Date();
|
||||
var hours = date.getHours();
|
||||
var minutes = date.getMinutes();
|
||||
var seconds = date.getSeconds();
|
||||
if (hours >= 1 && hours <= 9) {
|
||||
hours = "0" + hours;
|
||||
}
|
||||
if (minutes >= 0 && minutes <= 9) {
|
||||
minutes = "0" + minutes;
|
||||
}
|
||||
if (seconds >= 0 && seconds <= 9) {
|
||||
seconds = "0" + seconds;
|
||||
}
|
||||
var currentdate = hours + ":" + minutes + ":" + seconds;
|
||||
return currentdate;
|
||||
}
|
||||
|
||||
function getNowDateTime() {
|
||||
var currentdate = getNowDate() + " " + getNowTime();
|
||||
return currentdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回不为空的字符串,为空返回def
|
||||
*/
|
||||
function getNotEmptyStr(str, def) {
|
||||
if (isEmpty(str)) {
|
||||
return isEmpty(def) ? "" : def;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是空对象
|
||||
* @param obj
|
||||
* @returns
|
||||
*/
|
||||
function isEmptyObject(obj){
|
||||
return $.isEmptyObject(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是空字符串
|
||||
* @param str
|
||||
* @returns
|
||||
*/
|
||||
function isEmpty(str){
|
||||
return (str == "" || str == null || str == undefined);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否不是空字符串
|
||||
* @param str
|
||||
* @returns
|
||||
*/
|
||||
function isNotEmpty(str){
|
||||
return !isEmpty(str);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数组转字符串,使用空格分隔
|
||||
* @param array
|
||||
* @returns
|
||||
*/
|
||||
function arrToString(array){
|
||||
var temStr = "";
|
||||
if(isEmpty(array)){
|
||||
return temStr;
|
||||
}
|
||||
array.forEach(function(e){
|
||||
if(isNotEmpty(temStr)) {
|
||||
temStr += " ";
|
||||
}
|
||||
temStr += e;
|
||||
});
|
||||
return temStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数组array中是否包含str字符串
|
||||
* @param array
|
||||
* @param str
|
||||
* @returns
|
||||
*/
|
||||
function haveString(array, str){
|
||||
if(isEmpty(array)) {
|
||||
return false;
|
||||
}
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
if(array[i] == str) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 直接返回对象的第一个属性
|
||||
* @param data
|
||||
* @returns
|
||||
*/
|
||||
function getObjectFirstAttribute(data) {
|
||||
for ( var key in data) {
|
||||
return data[key];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果对象只有一个属性则返回第一个属性,否则返回null
|
||||
* @param data
|
||||
* @returns
|
||||
*/
|
||||
function getObjectFirstAttributeIfOnly(data) {
|
||||
var len = 0, value = "";
|
||||
for ( var key in data) {
|
||||
if (++len > 1) {
|
||||
return null;
|
||||
}
|
||||
value = data[key];
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* ajax处理事件模板
|
||||
*
|
||||
* @url 后台处理的url,即action
|
||||
* @dataSentType 数据发送的方式,有post,get方式
|
||||
* @dataReceiveType 数据接收格式,有html json text等
|
||||
* @paramsStr 传入后台的参数
|
||||
* @successFunction ajax成功后执行的函数名 ajaxTemp("", "GET", "html", {}, function(){},
|
||||
* function(){}, "");
|
||||
*/
|
||||
function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction, errorFunction, completeFunction, id) {
|
||||
$.ajax({
|
||||
url : url, // 后台处理程序
|
||||
sync : false,
|
||||
type : dataSentType, // 数据发送方式
|
||||
dataType : dataReceiveType, // 接受数据格式
|
||||
data : eval(paramsStr),
|
||||
contentType : "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
success : function(msg) {
|
||||
if(typeof successFunction == "function") {
|
||||
successFunction(msg,id);
|
||||
}
|
||||
},
|
||||
beforeSend : function() {
|
||||
|
||||
},
|
||||
complete : function(msg) {
|
||||
if(typeof completeFunction == "function") {
|
||||
completeFunction(msg,id);
|
||||
}
|
||||
},
|
||||
error : function(msg) {
|
||||
if(typeof errorFunction == "function") {
|
||||
errorFunction(msg,id);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取cookie
|
||||
* @param name
|
||||
* @returns
|
||||
*/
|
||||
function getCookie(name) {
|
||||
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
|
||||
if(arr=document.cookie.match(reg)){
|
||||
return unescape(arr[2]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串格式化
|
||||
*/
|
||||
String.prototype.format = function(args) {
|
||||
if (arguments.length > 0) {
|
||||
var result = this;
|
||||
if (arguments.length == 1 && typeof (args) == "object") {
|
||||
for ( var key in args) {
|
||||
var reg = new RegExp("({" + key + "})", "g");
|
||||
result = result.replace(reg, args[key]);
|
||||
}
|
||||
} else {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
if (arguments[i] == undefined) {
|
||||
return "";
|
||||
} else {
|
||||
var reg = new RegExp("({[" + i + "]})", "g");
|
||||
result = result.replace(reg, arguments[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
String.prototype.endWith = function(str) {
|
||||
if (str == null || str == "" || this.length == 0 || str.length > this.length) {
|
||||
return false;
|
||||
}
|
||||
return (this.substring(this.length - str.length) == str);
|
||||
};
|
||||
|
||||
String.prototype.startWith = function(str) {
|
||||
if (str == null || str == "" || this.length == 0 || str.length > this.length) {
|
||||
return false;
|
||||
}
|
||||
return (this.substr(0, str.length) == str);
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
|
||||
/**
|
||||
* 将对象处理成json格式化和着色的html
|
||||
* @author 暮光:城中城
|
||||
* @since 2017年5月7日
|
||||
*/
|
||||
var Formatjson = {
|
||||
// 需要在对象或列表后面添加注释的对象,例:{userList: "用户列表"}
|
||||
// 那么在名字为userList的对象或列表后面都会加上:“用户列表” 这个注释
|
||||
annotationObject: {},
|
||||
tabStr: " ",
|
||||
isArray: function(obj) {
|
||||
return obj && typeof obj === 'object' && typeof obj.length === 'number'
|
||||
&& !(obj.propertyIsEnumerable('length'));
|
||||
},
|
||||
processObjectToHtmlPre: function(obj, indent, addComma, isArray, isPropertyContent, showAnnotation) {
|
||||
var htmlStr = this.processObject(obj, "", indent, addComma, isArray, isPropertyContent, showAnnotation);
|
||||
htmlStr = '<pre class="json">' + htmlStr + '</pre>';
|
||||
return htmlStr;
|
||||
},
|
||||
processObject: function(obj, keyName, indent, addComma, isArray, isPropertyContent, showAnnotation) {
|
||||
var html = "";
|
||||
var comma = (addComma) ? "<span class='comma'>,</span> " : "";
|
||||
var type = typeof obj;
|
||||
if (this.isArray(obj)) {
|
||||
if (obj.length == 0) {
|
||||
html += this.getRow(indent, "<span class='array-brace'>[ ]</span>" + comma, isPropertyContent);
|
||||
} else {
|
||||
var clpsHtml = '<span><img class="option-img" src="webjars/mg-ui/img/expanded.png" onClick="Formatjson.expImgClicked(this);" /></span><span class="collapsible">';
|
||||
var annotation = '';
|
||||
if(showAnnotation && isNotEmpty(keyName) && isNotEmpty(this.annotationObject[keyName])) {
|
||||
annotation = '<span class="annotation">// '+this.annotationObject[keyName]+'</span>';
|
||||
}
|
||||
html += this.getRow(indent, "<span class='array-brace'>[</span>"+clpsHtml+annotation, isPropertyContent);
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
html += this.processObject(obj[i], "", indent + 1, i < (obj.length - 1), true, false, showAnnotation);
|
||||
}
|
||||
clpsHtml = "</span>";
|
||||
html += this.getRow(indent, clpsHtml + "<span class='array-brace'>]</span>" + comma);
|
||||
}
|
||||
} else if (type == 'object' && obj == null) {
|
||||
html += this.formatLiteral("null", "", comma, indent, isArray, "null");
|
||||
} else if (type == 'object') {
|
||||
var numProps = 0;
|
||||
for ( var prop in obj) {
|
||||
numProps++;
|
||||
}
|
||||
if (numProps == 0) {
|
||||
html += this.getRow(indent, "<span class='object-brace'>{ }</span>" + comma, isPropertyContent);
|
||||
} else {
|
||||
var clpsHtml = '<span><img class="option-img" src="webjars/mg-ui/img/expanded.png" onClick="Formatjson.expImgClicked(this);" /></span><span class="collapsible">';
|
||||
var annotation = '';
|
||||
if(showAnnotation && isNotEmpty(keyName) && isNotEmpty(this.annotationObject[keyName])) {
|
||||
annotation = '<span class="annotation">// '+this.annotationObject[keyName]+'</span>';
|
||||
}
|
||||
html += this.getRow(indent, "<span class='object-brace'>{</span>"+clpsHtml+annotation, isPropertyContent);
|
||||
var j = 0;
|
||||
for ( var prop in obj) {
|
||||
var processStr = '<span class="property-name">"' + prop + '"</span>: ' + this.processObject(obj[prop], prop, indent + 1, ++j < numProps, false, true, showAnnotation);
|
||||
html += this.getRow(indent + 1, processStr);
|
||||
}
|
||||
clpsHtml = "</span>";
|
||||
html += this.getRow(indent, clpsHtml + "<span class='object-brace'>}</span>" + comma);
|
||||
}
|
||||
} else if (type == 'number') {
|
||||
html += this.formatLiteral(obj, "", comma, indent, isArray, "number");
|
||||
} else if (type == 'boolean') {
|
||||
html += this.formatLiteral(obj, "", comma, indent, isArray, "boolean");
|
||||
} else if (type == 'function') {
|
||||
obj = this.formatFunction(indent, obj);
|
||||
html += this.formatLiteral(obj, "", comma, indent, isArray, "function");
|
||||
} else if (type == 'undefined') {
|
||||
html += this.formatLiteral("undefined", "", comma, indent, isArray, "null");
|
||||
} else {
|
||||
html += this.formatLiteral(obj, "\"", comma, indent, isArray, "string");
|
||||
}
|
||||
return html;
|
||||
},
|
||||
expImgClicked: function(img){
|
||||
var container = img.parentNode.nextSibling;
|
||||
if(!container) return;
|
||||
var disp = "none";
|
||||
var src = "webjars/mg-ui/img/collapsed.png";
|
||||
if(container.style.display == "none"){
|
||||
disp = "inline";
|
||||
src = "webjars/mg-ui/img/expanded.png";
|
||||
}
|
||||
container.style.display = disp;
|
||||
img.src = src;
|
||||
},
|
||||
formatLiteral: function(literal, quote, comma, indent, isArray, style) {
|
||||
if (typeof literal == 'string') {
|
||||
literal = literal.split("<").join("<").split(">").join(">");
|
||||
}
|
||||
var str = "<span class='" + style + "'>" + quote + literal + quote + comma + "</span>";
|
||||
if (isArray) {
|
||||
str = this.getRow(indent, str);
|
||||
}
|
||||
return str;
|
||||
},
|
||||
formatFunction: function(indent, obj) {
|
||||
var tabs = "";
|
||||
for (var i = 0; i < indent; i++) {
|
||||
tabs += this.tabStr;
|
||||
}
|
||||
var funcStrArray = obj.toString().split("\n");
|
||||
var str = "";
|
||||
for (var i = 0; i < funcStrArray.length; i++) {
|
||||
str += ((i == 0) ? "" : tabs) + funcStrArray[i] + "\n";
|
||||
}
|
||||
return str;
|
||||
},
|
||||
getRow: function(indent, data, isPropertyContent) {
|
||||
var tabs = "";
|
||||
for (var i = 0; i < indent && !isPropertyContent; i++) {
|
||||
tabs += this.tabStr;
|
||||
}
|
||||
if (data != null && data.length > 0 && data.charAt(data.length - 1) != "\n") {
|
||||
data = data + "\n";
|
||||
}
|
||||
return tabs + data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
4
zyplayer-doc-swagger/src/main/resources/webjars/mg-ui/js/jquery-3.1.0.min.js
vendored
Normal file
4
zyplayer-doc-swagger/src/main/resources/webjars/mg-ui/js/jquery-3.1.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,646 @@
|
||||
/**
|
||||
* 在线调试页面js
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年7月20日
|
||||
*/
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#debugRequstType .dropdown-menu li").click(function(){
|
||||
var text = $(this).find("a").text();
|
||||
$("#debugRequstType .options").text(text);
|
||||
});
|
||||
/**
|
||||
* 保存参数模板
|
||||
* @returns
|
||||
*/
|
||||
$(".save-request-template").click(function(){
|
||||
Toast.notOpen();
|
||||
});
|
||||
/**
|
||||
* 发送请求
|
||||
* @returns
|
||||
*/
|
||||
$(".send-request").click(function(){
|
||||
// 多行编辑状态下转成表单,下面读取表单内容
|
||||
if($("#bulkEditFormCheck").prop('checked')) {
|
||||
var bulkEdit = $("#bulkEditForm").val();
|
||||
bulkEditToTable("#tabParamTypeForm", bulkEdit);
|
||||
}
|
||||
if($("#bulkEditHeaderCheck").prop('checked')) {
|
||||
var bulkEdit = $("#bulkEditHeader").val();
|
||||
bulkEditToTable("#tabParamHeader", bulkEdit);
|
||||
}
|
||||
$("#tabResponseHeader table tbody").empty();
|
||||
$("#tabResponseCookie table tbody").empty();
|
||||
$("#responseBodyTextArea").val("");
|
||||
$("#responseBodyJsonDiv").html("暂无数据");
|
||||
|
||||
var storeRequestParam = {};
|
||||
var docUrl = $("#docUrl").text();
|
||||
var options = $("#debugRequstType .btn .options").text();
|
||||
var postUrl = $("#postUrlInput").val();
|
||||
var requestHeaderForm = $("#requestHeaderForm").serializeArray();
|
||||
var requestParamForm = $("#requestParamForm").serializeArray();
|
||||
var paramBodySend = $("[name=paramBody]").val();
|
||||
var formToUrl = $("[name=formToUrl]").prop('checked') ? 1 : 0;
|
||||
var paramSendToServer = {};
|
||||
requestHeaderForm = serializeArrayToObj(requestHeaderForm);
|
||||
requestParamForm = serializeArrayToObj(requestParamForm);
|
||||
storeRequestParam.formToUrl = formToUrl;
|
||||
paramSendToServer.formToUrl = formToUrl;
|
||||
if(isNotEmpty(paramBodySend)) {
|
||||
try {
|
||||
paramBodySend = JSON.stringify(JSON.parse(paramBodySend));
|
||||
} catch (e) {
|
||||
// e
|
||||
}
|
||||
storeRequestParam.body = paramBodySend;
|
||||
paramSendToServer.body = paramBodySend;
|
||||
// 替换path参数
|
||||
Object.keys(requestParamForm).forEach(function(key){
|
||||
postUrl = postUrl.replace("{"+key+"}", requestParamForm[key]);
|
||||
});
|
||||
} else {
|
||||
var reqParamStr = "";
|
||||
paramBodySend = {};
|
||||
Object.keys(requestParamForm).forEach(function(key){
|
||||
var value = requestParamForm[key];
|
||||
if(isNotEmpty(key) && isNotEmpty(value)) {
|
||||
if(isNotEmpty(reqParamStr)) {
|
||||
reqParamStr += "&";
|
||||
}
|
||||
reqParamStr += key + "=" + value;
|
||||
paramBodySend[key] = value;
|
||||
// 替换path参数
|
||||
postUrl = postUrl.replace("{"+key+"}", value);
|
||||
}
|
||||
});
|
||||
storeRequestParam.form = paramBodySend;
|
||||
if(formToUrl == 1) {
|
||||
postUrl += "?" + reqParamStr;
|
||||
paramBodySend = "";
|
||||
} else {
|
||||
paramSendToServer.form = JSON.stringify(paramBodySend);
|
||||
}
|
||||
}
|
||||
$(".send-request .icon").removeClass("hide");
|
||||
// 获取header
|
||||
var requestHeaderStore = {};
|
||||
Object.keys(requestHeaderForm).forEach(function(key){
|
||||
var value = requestHeaderForm[key];
|
||||
if(isNotEmpty(key) && isNotEmpty(value)) {
|
||||
requestHeaderStore[key] = value;
|
||||
}
|
||||
});
|
||||
storeRequestParam.header = requestHeaderStore;
|
||||
paramSendToServer.header = JSON.stringify(requestHeaderStore);
|
||||
//console.log(paramBodySend);
|
||||
var beforSendTime = new Date().getTime();
|
||||
if(serverStorage) {
|
||||
paramSendToServer.url = postUrl;
|
||||
paramSendToServer.method = options;
|
||||
ajaxTemp("swagger-mg-ui/http/request", "post", "json", paramSendToServer, function(result){
|
||||
//console.log(result);
|
||||
setStorage('p-request-obj-' + docUrl, storeRequestParam);
|
||||
var afterSendTime = new Date().getTime();
|
||||
$("#httpRequestStatus").text(result.status);
|
||||
$("#httpRequestTime").text((afterSendTime - beforSendTime) + "ms");
|
||||
try {
|
||||
var htmlStr = Formatjson.processObjectToHtmlPre(JSON.parse(result.data), 0, false, false, false, false);
|
||||
$("#responseBodyJsonDiv").html(htmlStr);
|
||||
} catch (e) {
|
||||
$("#responseBodyJsonDiv").html("<iframe id='responseBodyJsonIframe'></iframe>");
|
||||
setTimeout(function(){
|
||||
$("#responseBodyJsonIframe").contents().find("body").html(result.data);
|
||||
}, 300);
|
||||
}
|
||||
$("#tabResponseHeader table tbody").empty();
|
||||
$("#tabResponseCookie table tbody").empty();
|
||||
var headers = result.header||[];
|
||||
for (var i = 0; i < headers.length; i++) {
|
||||
var name = getNotEmptyStr(headers[i].name);
|
||||
var value = getNotEmptyStr(headers[i].value);
|
||||
$("#tabResponseHeader table tbody").append(
|
||||
'<tr>'+'<td>'+name+'</td>' + '<td>'+value+'</td>'+'</tr>'
|
||||
);
|
||||
}
|
||||
var cookies = result.cookie||[];
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
var name = getNotEmptyStr(cookies[i].name);
|
||||
var value = getNotEmptyStr(cookies[i].value);
|
||||
$("#tabResponseCookie table tbody").append(
|
||||
'<tr>'+'<td>'+name+'</td>' + '<td>'+value+'</td>'+'</tr>'
|
||||
);
|
||||
}
|
||||
}, function(){
|
||||
Toast.error("请求失败!");
|
||||
}, function(){
|
||||
$(".send-request .icon").addClass("hide");
|
||||
});
|
||||
} else {
|
||||
$.ajax({
|
||||
url : postUrl,
|
||||
sync : false,
|
||||
type : options, // 数据发送方式
|
||||
dataType : "JSON", // 接受数据格式
|
||||
data : paramBodySend,//requestParamForm,
|
||||
contentType : "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
beforeSend : function(request) {
|
||||
Object.keys(requestHeaderStore).forEach(function(key){
|
||||
request.setRequestHeader(key, requestHeaderStore[key]);
|
||||
});
|
||||
},
|
||||
success : function(data, status, xhr) {
|
||||
},
|
||||
complete : function(xhr) {
|
||||
//console.log(xhr);
|
||||
setStorage('p-request-obj-' + docUrl, storeRequestParam);
|
||||
$(".send-request .icon").addClass("hide");
|
||||
var afterSendTime = new Date().getTime();
|
||||
$("#httpRequestStatus").text(xhr.status + "-" + xhr.statusText);
|
||||
$("#httpRequestTime").text((afterSendTime - beforSendTime) + "ms");
|
||||
try {
|
||||
var htmlStr = Formatjson.processObjectToHtmlPre(JSON.parse(xhr.responseText), 0, false, false, false, false);
|
||||
$("#responseBodyJsonDiv").html(htmlStr);
|
||||
} catch (e) {
|
||||
$("#responseBodyJsonDiv").html("<iframe id='responseBodyJsonIframe'></iframe>");
|
||||
setTimeout(function(){
|
||||
$("#responseBodyJsonIframe").contents().find("body").html(xhr.responseText);
|
||||
}, 300);
|
||||
}
|
||||
var allHeaders = xhr.getAllResponseHeaders();
|
||||
var headers = allHeaders.split("\r\n");
|
||||
$("#tabResponseHeader table tbody").empty();
|
||||
$("#tabResponseCookie table tbody").empty();
|
||||
for (var i = 0; i < headers.length; i++) {
|
||||
if(isEmpty(headers[i])){
|
||||
continue;
|
||||
}
|
||||
var headerArr = headers[i].split(":");
|
||||
$("#tabResponseHeader table tbody").append(
|
||||
'<tr>'+'<td>'+headerArr[0]+'</td>' + '<td>'+headerArr[1]+'</td>'+'</tr>'
|
||||
);
|
||||
}
|
||||
},
|
||||
error : function(data) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
/**
|
||||
* 输入框输入之后,如果是最后一行则在增加一行
|
||||
* @returns
|
||||
*/
|
||||
$(".param-table").on("keyup", "input[name=paramName]", function(){
|
||||
var nextTr = $(this).parents("tr").next();
|
||||
if(nextTr.length <= 0) {
|
||||
$(this).parents(".param-table").append(getParamTableTr());
|
||||
}
|
||||
});
|
||||
/**
|
||||
* 参数删除一行
|
||||
* @returns
|
||||
*/
|
||||
$(".param-table").on("click", ".icon-times", function(){
|
||||
$(this).parents("tr").remove();
|
||||
});
|
||||
/**
|
||||
* 在线调试管理
|
||||
*/
|
||||
$("#onlineDebugLi").click(function(){
|
||||
$(".tab-page").hide();
|
||||
$(".tab-online-debug-page").show();
|
||||
createOnlineDebugParamTable();
|
||||
});
|
||||
/**
|
||||
* 在线调试管理-刷新
|
||||
*/
|
||||
$(".tab-online-debug-page .refresh").click(function(){
|
||||
createOnlineDebugParamTable();
|
||||
});
|
||||
/**
|
||||
* 在线调试管理-展开所有
|
||||
*/
|
||||
$(".tab-online-debug-page .expand-all").click(function(){
|
||||
$("#onlineDebugParamTable .option-img").attr("src", "webjars/mg-ui/img/expanded.png")
|
||||
$("#onlineDebugParamTable .option-img").parent().next().show();
|
||||
});
|
||||
/**
|
||||
* 在线调试管理-收起所有
|
||||
*/
|
||||
$(".tab-online-debug-page .collapse-all").click(function(){
|
||||
$("#onlineDebugParamTable .option-img").attr("src", "webjars/mg-ui/img/collapsed.png")
|
||||
$("#onlineDebugParamTable .option-img").parent().next().hide();
|
||||
});
|
||||
/**
|
||||
* 在线调试-删除所有参数
|
||||
*/
|
||||
$(".tab-online-debug-page").on("click", ".del-all-param", function(){
|
||||
$.zui.store.forEach(function(key, value) {// 遍历所有本地存储的条目
|
||||
if(!key.startWith('p-request-obj-')) {
|
||||
return;
|
||||
}
|
||||
$.zui.store.remove(key);
|
||||
});
|
||||
createOnlineDebugParamTable();
|
||||
});
|
||||
/**
|
||||
* 在线调试-删除参数
|
||||
*/
|
||||
$(".tab-online-debug-page").on("click", ".del-param", function(){
|
||||
var key = $(this).attr("key");
|
||||
if(isNotEmpty(key)) {
|
||||
$.zui.store.remove(key);
|
||||
$(this).parents("tr").remove();
|
||||
}
|
||||
});
|
||||
/**
|
||||
* 提交模拟返回值
|
||||
*/
|
||||
$("#simulationResultSubmit").click(function(){
|
||||
if(!serverStorage) {
|
||||
Toast.error("没有开启服务器端存储模拟返回是无效的");
|
||||
return;
|
||||
}
|
||||
var value = $("#simulationResultText").val();
|
||||
value = getNotEmptyStr(value, "");
|
||||
var docUrl = $("#simulationResultUrl").text();
|
||||
setStorage('p-simulation-response-' + docUrl, value, function() {
|
||||
Toast.warn("提交成功!");
|
||||
}, function(msg) {
|
||||
Toast.error("提交失败!" + msg);
|
||||
});
|
||||
});
|
||||
/**
|
||||
* 获取模拟返回值
|
||||
*/
|
||||
$("#simulationResultGet").click(function(){
|
||||
if(!serverStorage) {
|
||||
Toast.error("没有开启服务器端存储模拟返回是无效的");
|
||||
return;
|
||||
}
|
||||
var docUrl = $("#simulationResultUrl").text();
|
||||
getStorage('p-simulation-response-' + docUrl, function(data){
|
||||
$("#simulationResultText").val(data);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 生成在线调试管理页面
|
||||
* @returns
|
||||
*/
|
||||
function createOnlineDebugParamTable() {
|
||||
$("#onlineDebugParamTable tbody").empty();
|
||||
$.zui.store.forEach(function(key, value) {// 遍历所有本地存储的条目
|
||||
if(!key.startWith('p-request-obj-')) {
|
||||
return;
|
||||
}
|
||||
var newKey = key.substring(14, key.length);
|
||||
var htmlStr = Formatjson.processObjectToHtmlPre(value, 0, false, false, false, false);
|
||||
$("#onlineDebugParamTable tbody").append(
|
||||
'<tr>'
|
||||
+'<td>'+newKey+'</td>'
|
||||
+'<td>'+htmlStr+'</td>'
|
||||
+'<td><button class="btn btn-danger del-param" type="button" key="'+key+'">删除</button></td>'
|
||||
+'</tr>'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成在线调试相关数据
|
||||
* @param requestParamObj
|
||||
* @returns
|
||||
*/
|
||||
function createOnlineDebugRequestParam(requestParamObj, url) {
|
||||
getStorage('p-request-obj-' + url, function(data) {
|
||||
createOnlineDebugRequestParamFun(data, requestParamObj, url);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成在线调试相关数据
|
||||
* @param requestParamObj
|
||||
* @returns
|
||||
*/
|
||||
function createOnlineDebugRequestParamFun(pRequestObj, requestParamObj, url) {
|
||||
if(isEmptyObject(pRequestObj)) {
|
||||
pRequestObj = {};
|
||||
}
|
||||
// 清空参数列表
|
||||
$("#tabParamHeader table tbody .new").remove();
|
||||
$("#tabParamTypeForm table tbody .new").remove();
|
||||
$("#tabResponseHeader table tbody").empty();
|
||||
$("#tabResponseCookie table tbody").empty();
|
||||
$("#tabParamHeader .form-control").val("");
|
||||
$("#tabParamTypeForm .form-control").val("");
|
||||
$("#responseBodyTextArea").val("");
|
||||
$("#responseBodyJsonDiv").html("暂无数据");
|
||||
$("#bulkEditHeaderCheck").prop("checked", false);
|
||||
$("#bulkEditFormCheck").prop("checked", false);
|
||||
$("#bulkEditHeader,#bulkEditForm").hide();
|
||||
$("#tabParamTypeForm table").show();
|
||||
$("#requestHeaderForm table").show();
|
||||
|
||||
var options = $("#debugRequstType .btn .options").text();
|
||||
var formToUrl = pRequestObj.formToUrl || 0;
|
||||
var formToUrlChecked = (options != "GET" && formToUrl == 1);
|
||||
$("input[name='formToUrl']").prop("checked", formToUrlChecked);
|
||||
|
||||
var onlyUseLastParam = (userSettings.onlyUseLastParam == 1);
|
||||
var onlyUseLastHeader = onlyUseLastParam && !isEmptyObject(pRequestObj.header);
|
||||
var onlyUseLastForm = onlyUseLastParam && !isEmptyObject(pRequestObj.form);
|
||||
var onlyUseLastBody = onlyUseLastParam && !isEmptyObject(pRequestObj.body);
|
||||
var headerValueCount = 0, formValueCount = 0;
|
||||
Object.keys(requestParamObj).forEach(function(key){
|
||||
var tempParam = requestParamObj[key];
|
||||
if (key == "p-body-obj") {
|
||||
//console.log(tempParam);
|
||||
var paramObj = onlyUseLastBody ? {} : getParamBodyTransObj(tempParam);
|
||||
var bodyObj = pRequestObj.body;
|
||||
try {
|
||||
bodyObj = JSON.parse(bodyObj);
|
||||
if(!isEmptyObject(bodyObj)) {
|
||||
paramObj = $.extend(true, paramObj, bodyObj);
|
||||
}
|
||||
$("#tabParamTypeBody textarea").val(JSON.stringify(paramObj, null, 4));
|
||||
} catch (e) {
|
||||
var tempText = isEmpty(bodyObj) ? JSON.stringify(paramObj, null, 4) : bodyObj;
|
||||
$("#tabParamTypeBody textarea").val(tempText);
|
||||
}
|
||||
$("#tabParamBody .nav li").eq(1).find("a").click();
|
||||
} else {
|
||||
if (tempParam.paramIn == "header" && !onlyUseLastHeader) {
|
||||
//console.log(tempParam);
|
||||
var headerVal = getNotEmptyStr(tempParam.value);
|
||||
var headerObj = pRequestObj.header;
|
||||
if(!isEmptyObject(headerObj) && isNotEmpty(headerObj[key])) {
|
||||
headerVal = headerObj[key];
|
||||
headerObj[key] = "";// 赋值为空,后面不再使用
|
||||
}
|
||||
if(isEmpty(headerVal)) {
|
||||
headerVal = getAutoFillValue(tempParam.paramType, key);
|
||||
}
|
||||
if(headerValueCount > 0) {
|
||||
$("#tabParamHeader table tbody").append(getParamTableTr(key, headerVal, "", tempParam.paramDesc));
|
||||
} else {
|
||||
$("#tabParamHeader table tbody .base input[name=paramName]").val(key);
|
||||
$("#tabParamHeader table tbody .base input[name=paramValue]").val(headerVal);
|
||||
$("#tabParamHeader table tbody .base input[name=paramValue]").attr("placeholder", getNotEmptyStr(tempParam.paramDesc));
|
||||
}
|
||||
headerValueCount++;
|
||||
} else {
|
||||
// 只有这几种类型,列出来后面看单独处理不
|
||||
var paramInForm = (tempParam.paramIn == "query")
|
||||
|| (tempParam.paramIn == "path")
|
||||
|| (tempParam.paramIn == "body")
|
||||
|| (tempParam.paramIn == "form")
|
||||
|| isNotEmpty(tempParam.paramIn);
|
||||
if (paramInForm && !onlyUseLastForm) {
|
||||
//console.log(tempParam);
|
||||
var formVal = getNotEmptyStr(tempParam.value);
|
||||
var formObj = pRequestObj.form;
|
||||
if(!isEmptyObject(formObj) && isNotEmpty(formObj[key])) {
|
||||
formVal = formObj[key];
|
||||
formObj[key] = "";// 赋值为空,后面不再使用
|
||||
}
|
||||
if(isEmpty(formVal)) {
|
||||
formVal = getAutoFillValue(tempParam.paramType, key);
|
||||
}
|
||||
if(formValueCount > 0) {
|
||||
$("#tabParamTypeForm table tbody").append(getParamTableTr(key, formVal, "", tempParam.paramDesc));
|
||||
} else {
|
||||
$("#tabParamTypeForm table tbody .base input[name=paramName]").val(key);
|
||||
$("#tabParamTypeForm table tbody .base input[name=paramValue]").val(formVal);
|
||||
$("#tabParamTypeForm table tbody .base input[name=paramValue]").attr("placeholder", getNotEmptyStr(tempParam.paramDesc));
|
||||
}
|
||||
$("#tabParamBody .nav li").eq(0).find("a").click();
|
||||
formValueCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// 处理参数外的header
|
||||
var headerObj = pRequestObj.header;
|
||||
if(!isEmptyObject(headerObj)) {
|
||||
Object.keys(headerObj).forEach(function(key){
|
||||
if(isNotEmpty(headerObj[key])) {
|
||||
if(headerValueCount > 0) {
|
||||
$("#tabParamHeader table tbody").append(getParamTableTr(key, headerObj[key], "", ""));
|
||||
} else {
|
||||
$("#tabParamHeader table tbody .base input[name=paramName]").val(key);
|
||||
$("#tabParamHeader table tbody .base input[name=paramValue]").val(headerObj[key]);
|
||||
}
|
||||
headerValueCount++;
|
||||
}
|
||||
});
|
||||
}
|
||||
// 处理参数外的form
|
||||
var formObj = pRequestObj.form;
|
||||
if(!isEmptyObject(formObj)) {
|
||||
Object.keys(formObj).forEach(function(key){
|
||||
if(isNotEmpty(formObj[key])) {
|
||||
if(formValueCount > 0) {
|
||||
$("#tabParamTypeForm table tbody").append(getParamTableTr(key, formObj[key], "", ""));
|
||||
} else {
|
||||
$("#tabParamTypeForm table tbody .base input[name=paramName]").val(key);
|
||||
$("#tabParamTypeForm table tbody .base input[name=paramValue]").val(formObj[key]);
|
||||
}
|
||||
formValueCount++;
|
||||
}
|
||||
});
|
||||
}
|
||||
if(headerValueCount > 0) {
|
||||
$("#tabParamHeader table tbody").append(getParamTableTr("", "", "", ""));
|
||||
}
|
||||
if(formValueCount > 0) {
|
||||
$("#tabParamTypeForm table tbody").append(getParamTableTr("", "", "", ""));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取测试的对象
|
||||
*/
|
||||
function getParamBodyTransObj(paramObj) {
|
||||
var newObject = $.extend(true, {}, paramObj);
|
||||
Object.keys(newObject).forEach(function(key){
|
||||
var subObj = newObject[key];
|
||||
if(typeof subObj == 'object') {
|
||||
if (subObj.hasOwnProperty("isParamObj")) {
|
||||
var value = getNotEmptyStr(subObj.value);
|
||||
if(isEmpty(value) && isNotEmpty(subObj.paramType)) {
|
||||
value = getAutoFillValue(subObj.paramType, key);
|
||||
}
|
||||
newObject[key] = value;
|
||||
} else if(subObj instanceof Array) {
|
||||
subObj[0] = getParamBodyTransObj(subObj[0]);
|
||||
} else {
|
||||
newObject[key] = getParamBodyTransObj(subObj);
|
||||
}
|
||||
}
|
||||
});
|
||||
return newObject;
|
||||
}
|
||||
|
||||
function serializeArrayToBulkEdit(formArr) {
|
||||
var formObj = serializeArrayToObj(formArr);
|
||||
var formStr = "";
|
||||
Object.keys(formObj).forEach(function(key){
|
||||
formStr += key + ":" + formObj[key] + "\n";
|
||||
});
|
||||
return formStr;
|
||||
}
|
||||
|
||||
function serializeArrayToObj(formArr) {
|
||||
var paramObj = {};
|
||||
for (var i = 0; i < formArr.length; i++) {
|
||||
if (formArr[i].name == "paramName" && i < formArr.length) {
|
||||
var key = formArr[i].value;
|
||||
var value = formArr[i+1].value;
|
||||
if(isNotEmpty(key)) {
|
||||
paramObj[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return paramObj;
|
||||
}
|
||||
|
||||
function bulkEditToTable(tableId, bulkEdit) {
|
||||
$(tableId + " table tbody .new").remove();
|
||||
var valueCount = 0;
|
||||
var headerArr = bulkEdit.split("\n");
|
||||
for (var i = 0; i < headerArr.length; i++) {
|
||||
var index = headerArr[i].indexOf(":");
|
||||
if(index < 0) {
|
||||
continue;
|
||||
}
|
||||
var key = headerArr[i].substring(0, index);
|
||||
var value = headerArr[i].substring(index+1, headerArr[i].length);
|
||||
if(valueCount > 0) {
|
||||
$(tableId + " table tbody").append(getParamTableTr(key, value, "", ""));
|
||||
} else {
|
||||
$(tableId + " table tbody .base input[name=paramName]").val(key);
|
||||
$(tableId + " table tbody .base input[name=paramValue]").val(value);
|
||||
}
|
||||
valueCount++;
|
||||
}
|
||||
if(valueCount > 0) {
|
||||
$(tableId + " table tbody").append(getParamTableTr("", "", "", ""));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取参数的tr
|
||||
* @param name
|
||||
* @param value
|
||||
* @param namePl
|
||||
* @param valuePl
|
||||
* @returns
|
||||
*/
|
||||
function getParamTableTr(name, value, namePl, valuePl) {
|
||||
name = getNotEmptyStr(name);
|
||||
namePl = getNotEmptyStr(namePl);
|
||||
value = getNotEmptyStr(value);
|
||||
valuePl = getNotEmptyStr(valuePl);
|
||||
|
||||
var regExp = new RegExp("\"", "gm");
|
||||
name = (typeof name === 'string') ? name.replace(regExp, """) : name;
|
||||
namePl = (typeof namePl === 'string') ? namePl.replace(regExp, """) : namePl;
|
||||
value = (typeof value === 'string') ? value.replace(regExp, """) : value;
|
||||
valuePl = (typeof valuePl === 'string') ? valuePl.replace(regExp, """) : valuePl;
|
||||
var resultStr =
|
||||
'<tr class="new">'
|
||||
+'<td><input type="text" class="form-control" name="paramName" value="'+name+'" placeholder="'+namePl+'"></td>'
|
||||
+'<td><input type="text" class="form-control" name="paramValue" value="'+value+'" placeholder="'+valuePl+'"></td>'
|
||||
+'<td><i class="icon-times"></i></td>'
|
||||
+'</tr>';
|
||||
return resultStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自动填充的值
|
||||
* @param paramType
|
||||
* @returns
|
||||
*/
|
||||
function getAutoFillValue(paramType, paramName) {
|
||||
if(userSettings.autoFillParam == 0 || isEmpty(paramType)) {
|
||||
return "";
|
||||
}
|
||||
paramName = getNotEmptyStr(paramName).toLowerCase();
|
||||
var isTimeColumn = (paramType.indexOf("date-time") >= 0
|
||||
|| paramName.endWith("date") || paramName.endWith("time"));
|
||||
var isTypeColumn = (paramName.endWith("type") || paramName.endWith("status")
|
||||
|| paramName.endWith("level") || paramName.endWith("num"));
|
||||
var isPriceColumn = (paramName.endWith("money") || paramName.endWith("price")
|
||||
|| paramName.endWith("cash") || paramName.endWith("coin"));
|
||||
var isBooleanColumn = (paramName.startWith("is"));
|
||||
var resultValue = "";
|
||||
if(paramType.indexOf("int") >= 0){
|
||||
if(isTypeColumn) {
|
||||
resultValue = Math.ceil(Math.random() * 5);
|
||||
} else if(paramName.endWith("age")) {
|
||||
resultValue = Math.ceil(Math.random() * 100);
|
||||
} else {
|
||||
resultValue = Math.ceil(Math.random() * 100);
|
||||
}
|
||||
} else if(paramType.indexOf("double") >= 0){
|
||||
resultValue = Math.ceil(Math.random() * 1000);
|
||||
} else if(paramType.indexOf("float") >= 0){
|
||||
resultValue = parseFloat(Math.random() * 1000).toFixed(2);
|
||||
} else if(paramType.indexOf("byte") >= 0){
|
||||
if(isTypeColumn) {
|
||||
resultValue = Math.ceil(Math.random() * 5);
|
||||
} else {
|
||||
resultValue = Math.ceil(Math.random() * 127);
|
||||
}
|
||||
} else if(paramType.indexOf("boolean") >= 0){
|
||||
resultValue = Math.random() > 0.5;
|
||||
} else if(isTimeColumn){
|
||||
resultValue = getNowDateTime();
|
||||
} else {
|
||||
if(paramName.endWith("id")) {
|
||||
resultValue = Math.ceil(Math.random() * 1000);
|
||||
} else if(paramName.endWith("age")) {
|
||||
resultValue = Math.ceil(Math.random() * 100);
|
||||
} else if(isPriceColumn){
|
||||
resultValue = parseFloat(Math.random() * 1000).toFixed(2);
|
||||
} else if(isTypeColumn){
|
||||
resultValue = Math.ceil(Math.random() * 5);
|
||||
} else if(isBooleanColumn){
|
||||
resultValue = (Math.random() > 0.5) ? 0 : 1;
|
||||
} else if(paramName.endWith("phone") || paramName.endWith("mobile")){
|
||||
var arr = ["15226645814", "15226645815", "15226645816", "15226645817", "15226645818"];
|
||||
resultValue = arr[Math.ceil(Math.random() * 5) - 1];
|
||||
} else if(paramName.endWith("ids")){
|
||||
var counts = Math.ceil(Math.random() * 5);
|
||||
for (var i = 0; i < counts; i++) {
|
||||
if(isNotEmpty(resultValue)){resultValue += ",";}
|
||||
resultValue += Math.ceil(Math.random() * 1000);
|
||||
}
|
||||
} else if(paramName.endWith("types")){
|
||||
var counts = Math.ceil(Math.random() * 3);
|
||||
for (var i = 0; i < counts; i++) {
|
||||
if(isNotEmpty(resultValue)){resultValue += ",";}
|
||||
resultValue += Math.ceil(Math.random() * 5);
|
||||
}
|
||||
} else if(paramName.endWith("md5")){
|
||||
resultValue = "5082079d92a8ef985f59e001d445ff20";
|
||||
} else if(paramName.endWith("photo")){
|
||||
resultValue = "http://www.zyplayer.com/freeplay/img/headIcon/myhead.jpg";
|
||||
} else if(paramName.endWith("url") || paramName.endWith("uri")){
|
||||
var arr = ["http://www.zyplayer.com", "http://www.kongjianzhou.com"];
|
||||
resultValue = arr[Math.ceil(Math.random() * 2) - 1];
|
||||
} else if(paramName.endWith("username")){
|
||||
var arr = ["张三", "李四", "王二", "暮光:城中城", "海贼王"];
|
||||
resultValue = arr[Math.ceil(Math.random() * 5) - 1];
|
||||
} else if(userSettings.autoFillParam == 2){
|
||||
//var arr = ["您好!","请!","对不起。","谢谢!","再见!","您早!","晚安!","请问您贵姓?","请原谅!","不用谢!","没关系!","欢迎您光临!","请坐!","请喝茶!","请多关照!","请多指教!","谢谢您的合作!","对不起,让您久等了。","没关系,我刚到。","给您添麻烦了。","我能为您做什么?","您好,请问您需要帮助吗?","您走好。","请慢走!"];
|
||||
//resultValue = arr[Math.ceil(Math.random() * 24) - 1];
|
||||
resultValue = "我是默认字符串";
|
||||
}
|
||||
//console.log(paramType);
|
||||
}
|
||||
return resultValue;
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* 以每个Tag方式生成并展示:
|
||||
* 核心信息控制器
|
||||
* /api/data/getDataList
|
||||
* /api/data/getDataDetail
|
||||
* 跟进控制器
|
||||
* /api/track/getTrackList
|
||||
* /api/track/getTrackDetail
|
||||
*
|
||||
* 先把树形的写完了再写这个,,
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年5月26日
|
||||
*/
|
||||
|
||||
function createTreeViewByTag(json, keywords) {
|
||||
var pathIndex = {};
|
||||
var paths = json.paths;
|
||||
var domain = json.domainUrl;// 服务器代理会返回此属性
|
||||
if(isEmpty(domain)) {
|
||||
domain = "http://" + json.host + json.basePath;
|
||||
}
|
||||
if(domain.endWith("/")) {
|
||||
domain = domain.substring(0, domain.length - 1);
|
||||
}
|
||||
if (isEmptyObject(paths)) {
|
||||
return;
|
||||
}
|
||||
//console.log(paths);
|
||||
Object.keys(paths).forEach(function(key){
|
||||
//console.log(key, paths[key]);
|
||||
if(!findInPathsValue(key, paths[key], keywords)) {
|
||||
return;
|
||||
}
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "get");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "head");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "post");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "put");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "patch");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "delete");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "options");
|
||||
setRequestMethodForTag(domain, paths[key], pathIndex, key, "trace");
|
||||
});
|
||||
//console.log(pathIndex);
|
||||
var htmlStr = '<li>';
|
||||
htmlStr += '<a href="#">'+json.info.title+'</a>';
|
||||
htmlStr += '<ul>';
|
||||
htmlStr += getTreeHtmlForTag(pathIndex, projectTreeIdIndex);
|
||||
htmlStr += '</ul>';
|
||||
htmlStr += '</li>';
|
||||
$('#apiPathTree .projects').append(htmlStr);
|
||||
projectTreeIdIndex++;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置对象的各种请求方式,存在则复制
|
||||
* @param source 资源,原始json的paths的指定对象
|
||||
* @param pathObj 当前的待赋值对象
|
||||
* @param url url绝对路径
|
||||
* @param method 请求方式,post、get...
|
||||
* @returns
|
||||
*/
|
||||
function setRequestMethodForTag(domain, source, pathObj, url, method) {
|
||||
if (isEmpty(source[method])) {
|
||||
return;
|
||||
}
|
||||
source[method].tags.forEach(function(val, index) {
|
||||
var tempObj = pathObj[val];
|
||||
if(isEmpty(tempObj)) {
|
||||
tempObj = pathObj[val] = {};
|
||||
}
|
||||
var tempUrlObj = tempObj[url];
|
||||
if(isEmpty(tempUrlObj)) {
|
||||
tempUrlObj = tempObj[url] = {};
|
||||
}
|
||||
var tempPath = projectTreeIdIndex + url + "." + method;
|
||||
tempUrlObj[method] = source[method];
|
||||
tempUrlObj[method].path = tempPath;
|
||||
tempUrlObj[method].url = url;
|
||||
tempUrlObj[method].method = method;
|
||||
tempUrlObj[method].domain = domain;
|
||||
treePathDataMap.set(tempPath, source[method]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 将对象列表递归的方式转换成文档格式html字符串
|
||||
* @param pathData 处理后的对象列表
|
||||
* @returns 生成的html字符串
|
||||
*/
|
||||
function getTreeHtmlForTag(pathData, treeIdStr) {
|
||||
var tempStr = "";
|
||||
var indexNow = 1;
|
||||
// get, head, post, put, patch, delete, options, trace
|
||||
var actionArrays = ["get", "head", "post", "put", "patch", "delete", "options", "trace"];
|
||||
Object.keys(pathData).forEach(function(key){
|
||||
var tempNode = pathData[key];
|
||||
var tempTreeId = treeIdStr + "_" + indexNow;
|
||||
// 只有一个子元素,而且有method元素,说明是只有一个节点
|
||||
var nodeSub = getObjectFirstAttributeIfOnly(tempNode);
|
||||
if(nodeSub != null && isNotEmpty(nodeSub.method)) {
|
||||
var summary = isEmpty(nodeSub.summary) ? "" : "(" + nodeSub.summary + ")";
|
||||
if(summary.length > 10){
|
||||
summary = summary.substring(0, 10)+"...)";// 防止被撑得太长,只显示10个字
|
||||
}
|
||||
nodeSub.treeId = tempTreeId;
|
||||
tempStr += '<li m-id="'+tempTreeId+'"><a href="#" class="show-doc" path="'+nodeSub.path+'">'+key+'<span>'+summary+'</span></a></li>';
|
||||
} else if(haveString(actionArrays, key)) {
|
||||
//console.log(tempTreeId);
|
||||
tempNode.treeId = tempTreeId;
|
||||
var summary = isEmpty(tempNode.summary) ? "" : "("+tempNode.summary+")";
|
||||
if(summary.length > 10){
|
||||
summary = summary.substring(0, 10)+"...)";// 防止被撑得太长,只显示10个字
|
||||
}
|
||||
tempStr += '<li m-id="'+tempTreeId+'"><a href="#" class="show-doc" path="'+tempNode.path+'">'+key+'<span>'+summary+'</span></a></li>';
|
||||
} else {
|
||||
tempStr += '<li>';
|
||||
tempStr += '<a href="#">'+key+'</a>';
|
||||
tempStr += '<ul>';
|
||||
tempStr += getTreeHtmlForTag(tempNode, tempTreeId);
|
||||
tempStr += '</ul>';
|
||||
tempStr += '</li>';
|
||||
}
|
||||
indexNow++;
|
||||
});
|
||||
return tempStr;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
* 以树形方式生成并展示:
|
||||
* /api
|
||||
* /data
|
||||
* /getDateList
|
||||
* post
|
||||
* get
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年5月26日
|
||||
*/
|
||||
|
||||
/**
|
||||
* 把原始的json字符串转换成对象列表的方式,方便后续使用
|
||||
* @param json swagger的原始对象
|
||||
* @returns
|
||||
*/
|
||||
function createTreeViewByTree(json, keywords) {
|
||||
var pathIndex = {};
|
||||
var paths = json.paths;
|
||||
var domain = json.domainUrl;// 服务器代理会返回此属性
|
||||
if(isEmpty(domain)) {
|
||||
domain = "http://" + json.host + json.basePath;
|
||||
}
|
||||
if(domain.endWith("/")) {
|
||||
domain = domain.substring(0, domain.length - 1);
|
||||
}
|
||||
if (isEmptyObject(paths)) {
|
||||
return;
|
||||
}
|
||||
//console.log(paths);
|
||||
Object.keys(paths).forEach(function(key){
|
||||
//console.log(key, paths[key]);
|
||||
if(!findInPathsValue(key, paths[key], keywords)) {
|
||||
return;
|
||||
}
|
||||
var keyArr = key.split("/");
|
||||
var nowPathObj = null;
|
||||
keyArr.forEach(function(val, index) {
|
||||
//console.log(val, index);
|
||||
if(isEmpty(val) && index == 0) {
|
||||
return;
|
||||
}
|
||||
var nowPath = "/" + val;
|
||||
if(nowPathObj == null) {
|
||||
nowPathObj = {};
|
||||
nowPathObj[nowPath] = pathIndex[nowPath];
|
||||
if(nowPathObj[nowPath] == null) {
|
||||
nowPathObj[nowPath] = {};
|
||||
pathIndex[nowPath] = nowPathObj[nowPath];
|
||||
}
|
||||
}
|
||||
var tempPathObj = nowPathObj[nowPath];
|
||||
if(isEmpty(tempPathObj)) {
|
||||
tempPathObj = nowPathObj[nowPath] = {};
|
||||
}
|
||||
nowPathObj = tempPathObj;
|
||||
if(index == keyArr.length - 1) {
|
||||
//get, head, post, put, patch, delete, options, trace
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "get");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "head");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "post");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "put");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "patch");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "delete");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "options");
|
||||
setRequestMethodForTree(domain, paths[key], tempPathObj, key, "trace");
|
||||
}
|
||||
});
|
||||
});
|
||||
var htmlStr = '<li>';
|
||||
htmlStr += '<a href="#">'+json.info.title+'</a>';
|
||||
htmlStr += '<ul>';
|
||||
htmlStr += getTreeHtmlForTree(pathIndex, projectTreeIdIndex);
|
||||
htmlStr += '</ul>';
|
||||
htmlStr += '</li>';
|
||||
$('#apiPathTree .projects').append(htmlStr);
|
||||
projectTreeIdIndex++;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置对象的各种请求方式,存在则复制
|
||||
* @param source 资源,原始json的paths的指定对象
|
||||
* @param pathObj 当前的待赋值对象
|
||||
* @param url url绝对路径
|
||||
* @param method 请求方式,post、get...
|
||||
* @returns
|
||||
*/
|
||||
function setRequestMethodForTree(domain, source, pathObj, url, method) {
|
||||
if (isEmpty(source[method])) {
|
||||
return;
|
||||
}
|
||||
var tempPath = projectTreeIdIndex + url + "." + method;
|
||||
pathObj[method] = source[method];
|
||||
pathObj[method].path = tempPath;
|
||||
pathObj[method].url = url;
|
||||
pathObj[method].method = method;
|
||||
pathObj[method].domain = domain;
|
||||
treePathDataMap.set(tempPath, source[method]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将对象列表递归的方式转换成文档格式html字符串
|
||||
* @param pathData 处理后的对象列表
|
||||
* @returns 生成的html字符串
|
||||
*/
|
||||
function getTreeHtmlForTree(pathData, treeIdStr) {
|
||||
var tempStr = "";
|
||||
var indexNow = 1;
|
||||
Object.keys(pathData).forEach(function(key){
|
||||
var tempNode = pathData[key];
|
||||
var tempTreeId = treeIdStr + "_" + indexNow;
|
||||
var nodeSub = getObjectFirstAttributeIfOnly(tempNode);
|
||||
if(nodeSub != null && isNotEmpty(nodeSub.method)) {
|
||||
//console.log(nodeSub);
|
||||
nodeSub.treeId = tempTreeId;
|
||||
var summary = isEmpty(nodeSub.summary) ? "" : "("+nodeSub.summary+")";
|
||||
if(summary.length > 10){
|
||||
summary = summary.substring(0, 10)+"...)";// 防止被撑得太长,只显示10个字
|
||||
}
|
||||
tempStr += '<li m-id="'+tempTreeId+'"><a href="#" class="show-doc" path="'+nodeSub.path+'">'+key+'<span>'+summary+'</span></a></li>';
|
||||
} else if(key.indexOf("/") < 0) {
|
||||
//console.log(tempTreeId);
|
||||
tempNode.treeId = tempTreeId;
|
||||
var summary = isEmpty(tempNode.summary) ? "" : "("+tempNode.summary+")";
|
||||
if(summary.length > 10){
|
||||
summary = summary.substring(0, 10)+"...)";// 防止被撑得太长,只显示10个字
|
||||
}
|
||||
tempStr += '<li m-id="'+tempTreeId+'"><a href="#" class="show-doc" path="'+tempNode.path+'">'+key+'<span>'+summary+'</span></a></li>';
|
||||
} else {
|
||||
tempStr += '<li>';
|
||||
tempStr += '<a href="#">'+key+'</a>';
|
||||
tempStr += '<ul>';
|
||||
tempStr += getTreeHtmlForTree(tempNode, tempTreeId);
|
||||
tempStr += '</ul>';
|
||||
tempStr += '</li>';
|
||||
}
|
||||
indexNow++;
|
||||
});
|
||||
return tempStr;
|
||||
}
|
||||
|
||||
1309
zyplayer-doc-swagger/src/main/resources/webjars/mg-ui/js/mg-ui.js
Normal file
1309
zyplayer-doc-swagger/src/main/resources/webjars/mg-ui/js/mg-ui.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
||||
|
||||
/**
|
||||
* 两个元素上下、左右拖动动态改变大小
|
||||
* @author 暮光:城中城
|
||||
* @since 2017年5月7日
|
||||
*/
|
||||
(function($){
|
||||
$.fn.mgResizebleHeight = function(options) {
|
||||
var defaults = {prev:this,next:this, prevHtMin:0, prevHtMax:999, nextHtMin:0, nextHtMax:999};
|
||||
var opts = $.extend(defaults, options);
|
||||
var disY = 0, prevH = 0, nextH = 0, isStart = false;
|
||||
var prev, next, thisObj = this;
|
||||
$(document).mousemove(function(ev){
|
||||
if(!isStart){return;}
|
||||
var ev = ev || window.event;
|
||||
var H = ev.clientY - disY;
|
||||
var prevHNow = prevH+H, nextHNow = nextH-H;
|
||||
if(opts.prevHtMin >= prevHNow) {
|
||||
prevHNow = opts.prevHtMin;
|
||||
nextHNow = next.outerHeight();
|
||||
}
|
||||
if(opts.nextHtMin >= nextHNow) {
|
||||
nextHNow = opts.nextHtMin;
|
||||
prevHNow = prev.outerHeight();
|
||||
}
|
||||
if(opts.prevHtMax <= prevHNow) {
|
||||
prevHNow = opts.prevHtMax;
|
||||
nextHNow = next.outerHeight();
|
||||
}
|
||||
if(opts.nextHtMax <= nextHNow) {
|
||||
nextHNow = opts.nextHtMax;
|
||||
prevHNow = prev.outerHeight();
|
||||
}
|
||||
//prev.css("height", prevHNow + 'px');
|
||||
//next.css("height", nextHNow + 'px');
|
||||
if(typeof opts.onresize == 'function') {
|
||||
opts.onresize(prevHNow, nextHNow);
|
||||
}
|
||||
}).mouseup(function(ev){
|
||||
isStart = false;
|
||||
});
|
||||
$(this).mousedown(function(ev){
|
||||
var ev = ev || window.event;
|
||||
disY = ev.clientY;
|
||||
prev = (opts.prev == thisObj)?$(opts.prev).prev():$(opts.prev);
|
||||
next = (opts.next == thisObj)?$(opts.next).next():$(opts.next);
|
||||
prevH = prev.outerHeight();
|
||||
nextH = next.outerHeight();
|
||||
isStart = true;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 改变宽度的功能,只是实现各种消息的通知,实际改变大小需要在回调里面自己操作
|
||||
*/
|
||||
$.fn.mgResizebleWidth = function(options) {
|
||||
var defaults = {prev:this,next:this, prevWtMin:0, prevWtMax:999, nextWtMin:0, nextWtMax:999};
|
||||
var opts = $.extend(defaults, options);
|
||||
var disX = 0, prevW = 0, nextW = 0, isStart = false;
|
||||
var prev, next, thisObj = this;
|
||||
$(document).mousemove(function(ev){
|
||||
if(!isStart){return;}
|
||||
var ev = ev || window.event;
|
||||
var W = ev.clientX - disX;
|
||||
var prevWNow = prevW+W, nextWNow = nextW-W;
|
||||
if(opts.prevWtMin >= prevWNow) {
|
||||
prevWNow = opts.prevWtMin;
|
||||
nextWNow = next.outerWidth();
|
||||
}
|
||||
if(opts.nextWtMin >= nextWNow) {
|
||||
nextWNow = opts.nextWtMin;
|
||||
prevWNow = prev.outerWidth();
|
||||
}
|
||||
if(opts.prevWtMax <= prevWNow) {
|
||||
prevWNow = opts.prevWtMax;
|
||||
nextWNow = next.outerWidth();
|
||||
}
|
||||
if(opts.nextWtMax <= nextWNow) {
|
||||
nextWNow = opts.nextWtMax;
|
||||
prevWNow = prev.outerWidth();
|
||||
}
|
||||
//prev.css("width", prevWNow + 'px');
|
||||
//next.css("width", nextWNow + 'px');
|
||||
if(typeof opts.onresize == 'function') {
|
||||
opts.onresize(prevWNow, nextWNow);
|
||||
}
|
||||
}).mouseup(function(ev){
|
||||
if(!isStart){return;}
|
||||
isStart = false;
|
||||
if(typeof opts.onfinish == 'function') {
|
||||
opts.onfinish();
|
||||
}
|
||||
});
|
||||
$(this).mousedown(function(ev){
|
||||
var ev = ev || window.event;
|
||||
disX = ev.clientX;
|
||||
prev = (opts.prev == thisObj)?$(opts.prev).prev():$(opts.prev);
|
||||
next = (opts.next == thisObj)?$(opts.next).next():$(opts.next);
|
||||
prevW = prev.outerWidth();
|
||||
nextW = next.outerWidth();
|
||||
isStart = true;
|
||||
if(typeof opts.onstart == 'function') {
|
||||
opts.onstart();
|
||||
}
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* 提示工具类
|
||||
* @author 暮光:城中城
|
||||
* @since 2017年5月7日
|
||||
*/
|
||||
var Toast = {
|
||||
notOpen:function(){
|
||||
var data = {
|
||||
message:"该功能暂未开放,敬请期待!",
|
||||
icon: 'exclamation-sign',type:"warning",
|
||||
};
|
||||
this.show(data);
|
||||
},
|
||||
warn:function(msg, time){
|
||||
var data = {
|
||||
message:msg,time:time,
|
||||
icon: 'exclamation-sign',type:'warning',
|
||||
};
|
||||
this.show(data);
|
||||
},
|
||||
error:function(msg, time){
|
||||
var data = {
|
||||
message:msg,time:time,
|
||||
icon: 'exclamation-sign',type:'danger',
|
||||
};
|
||||
this.show(data);
|
||||
},
|
||||
show:function(data){
|
||||
data.time = isEmpty(data.time)?2000:data.time;
|
||||
data.placement = isEmpty(data.placement)?'top':data.placement;
|
||||
new $.zui.Messager(data.message, data).show();
|
||||
}
|
||||
}
|
||||
6
zyplayer-doc-swagger/src/main/resources/webjars/zui/css/zui-theme.min.css
vendored
Normal file
6
zyplayer-doc-swagger/src/main/resources/webjars/zui/css/zui-theme.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
6
zyplayer-doc-swagger/src/main/resources/webjars/zui/css/zui.lite.min.css
vendored
Normal file
6
zyplayer-doc-swagger/src/main/resources/webjars/zui/css/zui.lite.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
6
zyplayer-doc-swagger/src/main/resources/webjars/zui/css/zui.min.css
vendored
Normal file
6
zyplayer-doc-swagger/src/main/resources/webjars/zui/css/zui.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 290 KiB |
Binary file not shown.
Binary file not shown.
15
zyplayer-doc-swagger/src/main/resources/webjars/zui/js/zui.lite.min.js
vendored
Normal file
15
zyplayer-doc-swagger/src/main/resources/webjars/zui/js/zui.lite.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
16
zyplayer-doc-swagger/src/main/resources/webjars/zui/js/zui.min.js
vendored
Normal file
16
zyplayer-doc-swagger/src/main/resources/webjars/zui/js/zui.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
zyplayer-doc-swagger/src/main/resources/webjars/zui/lib/dashboard/zui.dashboard.min.css
vendored
Normal file
6
zyplayer-doc-swagger/src/main/resources/webjars/zui/lib/dashboard/zui.dashboard.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
7
zyplayer-doc-swagger/src/main/resources/webjars/zui/lib/dashboard/zui.dashboard.min.js
vendored
Normal file
7
zyplayer-doc-swagger/src/main/resources/webjars/zui/lib/dashboard/zui.dashboard.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user