From f521ac4547382617134719181a5b71db0637ed58 Mon Sep 17 00:00:00 2001 From: zhaoxiang Date: Thu, 4 Jul 2019 15:55:11 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E7=A7=BB=E6=A4=8D=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/wiki/controller/Base.php | 10 +- application/wiki/controller/Index.php | 2 +- application/wiki/view/index/detail.html | 38 ++-- application/wiki/view/index/index.html | 2 +- public/static/.gitignore | 2 - public/static/defaultImg.jpg | Bin 0 -> 15839 bytes public/static/jsonFormater/Collapsed.gif | Bin 0 -> 215 bytes public/static/jsonFormater/Expanded.gif | Bin 0 -> 206 bytes public/static/jsonFormater/jsonFormater.css | 35 ++++ public/static/jsonFormater/jsonFormater.js | 202 ++++++++++++++++++++ route/wikiRoute.php | 38 ++++ 11 files changed, 297 insertions(+), 32 deletions(-) delete mode 100644 public/static/.gitignore create mode 100644 public/static/defaultImg.jpg create mode 100644 public/static/jsonFormater/Collapsed.gif create mode 100644 public/static/jsonFormater/Expanded.gif create mode 100644 public/static/jsonFormater/jsonFormater.css create mode 100644 public/static/jsonFormater/jsonFormater.js create mode 100644 route/wikiRoute.php diff --git a/application/wiki/controller/Base.php b/application/wiki/controller/Base.php index 8eb1a00..9c8c8aa 100644 --- a/application/wiki/controller/Base.php +++ b/application/wiki/controller/Base.php @@ -8,13 +8,13 @@ namespace app\wiki\controller; -use think\Config; +use think\facade\Config; use think\Controller; use think\exception\HttpResponseException; -use think\Request; -use think\Response; -use think\View as ViewTemplate; -use think\Url; +use think\facade\Request; +use think\facade\Response; +use think\facade\View as ViewTemplate; +use think\facade\Url; class Base extends Controller { diff --git a/application/wiki/controller/Index.php b/application/wiki/controller/Index.php index 671da98..3cc908a 100644 --- a/application/wiki/controller/Index.php +++ b/application/wiki/controller/Index.php @@ -58,7 +58,7 @@ class Index extends Base { } } - $apiList = (new AdminList())->whereIn('hash', $this->appInfo['app_api_show'][$groupHash])->where(['groupHash' => $groupHash])->select(); + $apiList = (new AdminList())->whereIn('hash', $this->appInfo['app_api_show'][$groupHash])->where(['group_hash' => $groupHash])->select(); $apiList = Tools::buildArrFromObj($apiList); $apiList = Tools::buildArrByNewKey($apiList, 'hash'); diff --git a/application/wiki/view/index/detail.html b/application/wiki/view/index/detail.html index 66bf604..83483f2 100644 --- a/application/wiki/view/index/detail.html +++ b/application/wiki/view/index/detail.html @@ -6,8 +6,8 @@ - - + +
@@ -45,13 +45,13 @@
-

接口唯一标识:{$hash}{if condition="$detail['isTest'] == 1"}({$detail['apiClass']}){/if}


+

接口唯一标识:{$hash}{if condition="$detail['is_test'] == 1"}({$detail['api_class']}){/if}


接口说明 {if condition="$detail['status'] eq 0 "} 禁用 {else /} - {if condition="$detail['isTest'] eq 1 "} + {if condition="$detail['is_test'] eq 1 "} 测试 {else /} 启用 @@ -78,7 +78,7 @@

公共请求参数

- + @@ -92,32 +92,24 @@ - + - - - - - - - -
参数名字类型是否必须默认值其他说明
参数名字类型字段状态默认值其他说明
access-token String{$detail['accessToken']==1?'必填':'勿填'}{$detail['access_token']==1?'复杂认证':'简易认证'} APP认证秘钥【请在Header头里面传递】
user-tokenString{$detail['needLogin']==1?'必填':'勿填'}用户认证秘钥【请在Header头里面传递】

请求参数

- + {volist name="request" id="vo"} - - - + + + @@ -158,8 +150,8 @@ {volist name="response" id="vo"} - - + + {/volist} @@ -187,11 +179,11 @@ isCollapsible: true, quoteKeys: true, tabSize: 2, - imgCollapsed: "__STATIC__/jsonFormater/Collapsed.gif", - imgExpanded: "__STATIC__/jsonFormater/Expanded.gif" + imgCollapsed: "/static/jsonFormater/Collapsed.gif", + imgExpanded: "/static/jsonFormater/Expanded.gif" }; window.jf = new JsonFormater(options); - jf.doFormat({$detail["returnStr"]}); + jf.doFormat({$detail["return_str"]}); }(); }); $('.ui .vertical').css('max-height', $('#detail').outerHeight(true)); diff --git a/application/wiki/view/index/index.html b/application/wiki/view/index/index.html index 731a5a8..92f7eba 100644 --- a/application/wiki/view/index/index.html +++ b/application/wiki/view/index/index.html @@ -39,7 +39,7 @@ {$groupInfo[$key]['name']} - {:date('Y-m-d', $groupInfo[$key]['updateTime'])} + {$groupInfo[$key]['update_time']} {php} diff --git a/public/static/.gitignore b/public/static/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/public/static/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/public/static/defaultImg.jpg b/public/static/defaultImg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8142bacd85ed2b365e16ecbe4c4ed14671e91df8 GIT binary patch literal 15839 zcmeHubzD`=*Y7?-N}NN3#GxAwNavv&LAuMJQ=~&$8U>_FTBSt5=d}qzf-ZT4roBXx_z*H4g6af$j06^#u@NE(3 zQ}DLC4geY&00#g7*Z?Mo2!Noe@8uvW0OLCi0Q#Vdf6?Y3wx2R!000yJEgxwIK!3`k zb$(CEKl4Anu@V6Q3(bKd`T6;hKtE^@7y{(|;`1Sqd7!^F=7E1{gskU5{-z5tf69C} za(?+X1IPiGPz+2AC?+NbCKeVZHZBYo7Y7HIgn$qaMovOOK~6$OMn%I+M|F{rnv4v= zg9Q$7h0}G0Y4FR8*lA{a$S%ek=gCO6g0Xzu08VmwM_ee$8!LOQs zzW*Tb2Z28b{7*$7AeS;#^DITp&kRqiO6X9|5brlnK@zBXnt+zu!NA$+7oqw7B0+i7 z$45rPP7n1SVg4rhR|Y&)aRTAo9$&3jlD68O_9Scxw?zI`iY7pbM&sl?vnFb9u`UJn zDa-@Zd`G$HqK_6;1S#TgKAM7jSh#8K zMDM83|9N2?^I?=Jn#a8v@oKR8^tq1ztK*~u|JL6s{K|m4>Nfi|xrfg{!(S4Y3ejwc zxTlkM6LYQ4;VY3fX`TSd47sf}SI}J>?%eLNEgLPt8%4ne4&yq)+1a4Vzqw2_AJr|*egj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C#&wa&Kgt7QEh7o%-1EYkM0)K{R6k&_;Pj$NZ6Dui4 zRqX2W70YAo(pzKZ9j}mu3eZFF)Qks)e2GLo$KnA7zWaKcT8JOj1)!A@MtM360#l0pJSM&d@;YuG45hw zi!MhxT>!^RSgc8DIH*(yP~K)d%Ew9rGdC@IYn&)_dEBqgItsmCNDO^eo_d-sVO z3_o%LN)9O`H{=jSP){;UIBHw7wdbZ%6 ztkucSe7ZZNBDN8YkLMSzfyA)hnoE8u=uy`|f*UWk(4eDRnh940fwWtmZ@jw7ptf2x f9o3S6udRpbC17y&%P~k#8L+zHa=exMZR&pkbrAx( literal 0 HcmV?d00001 diff --git a/public/static/jsonFormater/Collapsed.gif b/public/static/jsonFormater/Collapsed.gif new file mode 100644 index 0000000000000000000000000000000000000000..17cbc27b321c010dc7f8e118c3a9fdddd26aec9d GIT binary patch literal 215 zcmZ?wbhEHblwsgzIKsg2|NsAg|9=1Z^XJ>Quiw6Y`1tYd`wy=_et7xz&9j#;AHR5Z z<*?;Ebt__E-?BBcL(2nJ`vv(L98#90n0g_mO;!hSvb_Q_< z9gr-@P6pPH2daH3ne)P3*6N5Z+~C1j!W&@d!@1|E@Qyp3MjBCU?XCe4iv)B6G?Fz} yg{->XJ=H~1L}1#HMUGd~wx_LIba8`)+ytY~PK_RF6?^8a%vu{)+}NbZU=09HV`3Qq literal 0 HcmV?d00001 diff --git a/public/static/jsonFormater/Expanded.gif b/public/static/jsonFormater/Expanded.gif new file mode 100644 index 0000000000000000000000000000000000000000..2aa74410fc1d4b5ff2eddf807c2fea896858e81a GIT binary patch literal 206 zcmZ?wbhEHblwsgzIKsg2|NsAg|9=1Z^XJ>Quiw6Y`1tYd`wy=_et7xz&9j#;A3u0- z@9wROH*Q?KdG+-5%SWzVICkmG{xc_cZ8&sg|K1IUb}X-*y@LU42#~}I6o0ZXvNMP? z=zwHFb~3PfKTz#U$(%PmWNnV>!VM9OCA=YqF`SO~g?HRpX`~^>-?d;vh+@RN^Q}de pt32+|j2UHq`XK`Aba)o9_4yDyin+FDin{)zyDH2~alU^@T+ literal 0 HcmV?d00001 diff --git a/public/static/jsonFormater/jsonFormater.css b/public/static/jsonFormater/jsonFormater.css new file mode 100644 index 0000000..79c6909 --- /dev/null +++ b/public/static/jsonFormater/jsonFormater.css @@ -0,0 +1,35 @@ +@charset "utf-8"; +/* CSS Document */ +.jf-ObjectBrace { + color: #00AA00; + font-weight: bold; +} +.jf-ArrayBrace { + color: #0033FF; + font-weight: bold; +} +.jf-PropertyName { + color: #CC0000; + font-weight: bold; +} +.jf-String { + color: #007777; +} +.jf-Number { + color: #AA00AA; +} +.jf-Boolean { + color: #0000FF; +} +.jf-Null { + color: #0000FF; +} +.jf-Comma { + color: #000000; + font-weight: bold; +} +pre.jf-CodeContainer { + margin-top: 0; + margin-bottom: 0; + text-align: left; +} diff --git a/public/static/jsonFormater/jsonFormater.js b/public/static/jsonFormater/jsonFormater.js new file mode 100644 index 0000000..f6995b3 --- /dev/null +++ b/public/static/jsonFormater/jsonFormater.js @@ -0,0 +1,202 @@ +function JsonFormater(opt) { + this.options = $.extend({ + dom: '', + tabSize: 2, + singleTab: " ", + quoteKeys: true, + imgCollapsed: "images/Collapsed.gif", + imgExpanded: "images/Expanded.gif", + isCollapsible: true + }, opt || {}); + this.isFormated = false; + this.obj = { + _dateObj: new Date(), + _regexpObj: new RegExp() + }; + this.init(); +} +JsonFormater.prototype = { + init: function () { + this.tab = this.multiplyString(this.options.tabSize, this.options.singleTab); + this.bindEvent(); + }, + doFormat: function (json) { + var html; + var obj; + try { + if(typeof json == 'object'){ + obj = [json]; + }else{ + if (json == ""){ + json = "\"\""; + } + obj = eval("[" + json + "]"); + } + html = this.ProcessObject(obj[0], 0, false, false, false); + $(this.options.dom).addClass('jf-CodeContainer'); + $(this.options.dom).html(html); + this.isFormated = true; + } catch (e) { + alert("JSON数据格式不正确:\n" + e.message); + $(this.options.dom).html(""); + this.isFormated = false; + } + }, + bindEvent: function () { + var that = this; + $(this.options.dom).off('click','.imgToggle'); + $(this.options.dom).on('click', '.imgToggle', function () { + if (that.isFormated == false) { + return; + } + that.makeContentVisible($(this).parent().next(), !$(this).data('status')); + }); + }, + expandAll: function () { + if (this.isFormated == false) { + return; + } + var that = this; + this.traverseChildren($(this.options.dom), function(element){ + if(element.hasClass('jf-collapsible')){ + that.makeContentVisible(element, true); + } + }, 0); + }, + collapseAll: function () { + if (this.isFormated == false) { + return; + } + var that = this; + this.traverseChildren($(this.options.dom), function(element){ + if(element.hasClass('jf-collapsible')){ + that.makeContentVisible(element, false); + } + }, 0); + }, + collapseLevel: function(level){ + if (this.isFormated == false) { + return; + } + var that = this; + this.traverseChildren($(this.options.dom), function(element, depth){ + if(element.hasClass('jf-collapsible')){ + if(depth >= level){ + that.makeContentVisible(element, false); + }else{ + that.makeContentVisible(element, true); + } + } + }, 0); + + }, + isArray: function (obj) { + return obj && + typeof obj === 'object' && + typeof obj.length === 'number' && !(obj.propertyIsEnumerable('length')); + }, + getRow: function (indent, data, isPropertyContent) { + var tabs = ""; + if (!isPropertyContent) { + tabs = this.multiplyString(indent, this.tab); + } + if (data != null && data.length > 0 && data.charAt(data.length - 1) != "\n") { + data = data + "\n"; + } + return tabs + data; + }, + formatLiteral: function (literal, quote, comma, indent, isArray, style) { + if (typeof literal == 'string') { + literal = literal.split("<").join("<").split(">").join(">"); + } + var str = "" + quote + literal + quote + comma + ""; + if (isArray) str = this.getRow(indent, str); + return str; + }, + formatFunction: function (indent, obj) { + var tabs; + var i; + var funcStrArray = obj.toString().split("\n"); + var str = ""; + tabs = this.multiplyString(indent, this.tab); + for (i = 0; i < funcStrArray.length; i++) { + str += ((i == 0) ? "" : tabs) + funcStrArray[i] + "\n"; + } + return str; + }, + multiplyString: function (num, str) { + var result = ''; + for (var i = 0; i < num; i++) { + result += str; + } + return result; + }, + traverseChildren: function (element, func, depth) { + var length = element.children().length; + for (var i = 0; i < length; i++) { + this.traverseChildren(element.children().eq(i), func, depth + 1); + } + func(element, depth); + }, + makeContentVisible : function(element, visible){ + var img = element.prev().find('img'); + if(visible){ + element.show(); + img.attr('src', this.options.imgExpanded); + img.data('status', 1); + }else{ + element.hide(); + img.attr('src', this.options.imgCollapsed); + img.data('status', 0); + } + }, + ProcessObject: function (obj, indent, addComma, isArray, isPropertyContent) { + var html = ""; + var comma = (addComma) ? ", " : ""; + var type = typeof obj; + var clpsHtml = ""; + var prop; + if (this.isArray(obj)) { + if (obj.length == 0) { + html += this.getRow(indent, "[ ]" + comma, isPropertyContent); + } else { + clpsHtml = this.options.isCollapsible ? "" : ""; + html += this.getRow(indent, "[" + clpsHtml, isPropertyContent); + for (var i = 0; i < obj.length; i++) { + html += this.ProcessObject(obj[i], indent + 1, i < (obj.length - 1), true, false); + } + clpsHtml = this.options.isCollapsible ? "" : ""; + html += this.getRow(indent, clpsHtml + "]" + comma); + } + } else if (type == 'object') { + if (obj == null) { + html += this.formatLiteral("null", "", comma, indent, isArray, "Null"); + } else { + var numProps = 0; + for (prop in obj) numProps++; + if (numProps == 0) { + html += this.getRow(indent, "{ }" + comma, isPropertyContent); + } else { + clpsHtml = this.options.isCollapsible ? "" : ""; + html += this.getRow(indent, "{" + clpsHtml, isPropertyContent); + var j = 0; + for (prop in obj) { + var quote = this.options.quoteKeys ? "\"" : ""; + html += this.getRow(indent + 1, "" + quote + prop + quote + ": " + this.ProcessObject(obj[prop], indent + 1, ++j < numProps, false, true)); + } + clpsHtml = this.options.isCollapsible ? "" : ""; + html += this.getRow(indent, clpsHtml + "}" + 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 == 'undefined') { + html += this.formatLiteral("undefined", "", comma, indent, isArray, "Null"); + } else { + html += this.formatLiteral(obj.toString().split("\\").join("\\\\").split('"').join('\\"'), "\"", comma, indent, isArray, "String"); + } + return html; + } +}; diff --git a/route/wikiRoute.php b/route/wikiRoute.php new file mode 100644 index 0000000..95db9ff --- /dev/null +++ b/route/wikiRoute.php @@ -0,0 +1,38 @@ + [ + 'login' => [ + 'wiki/index/login', + ['method' => 'get'] + ], + 'doLogin' => [ + 'wiki/index/doLogin', + ['method' => 'post'] + ], + 'index' => [ + 'wiki/index/index', + ['method' => 'get'] + ], + 'calculation' => [ + 'wiki/index/calculation', + ['method' => 'get'] + ], + 'errorCode' => [ + 'wiki/index/errorCode', + ['method' => 'get'] + ], + 'detail/:groupHash/[:hash]' => [ + 'wiki/index/detail', + ['method' => 'get'] + ], + 'logout' => [ + 'wiki/index/logout', + ['method' => 'get'] + ], + '__miss__' => ['wiki/index/index'], + ], +];
参数名字类型是否必须默认值其他说明
参数名字类型是否必须默认值其他说明
{$vo['fieldName']}{$dataType[$vo['dataType']]}{$vo['isMust']==1?'必填':'可选'}{$vo['field_name']}{$dataType[$vo['data_type']]}{$vo['is_must']==1?'必填':'可选'} {$vo['default']} {$vo['range']} {$vo['info']}
{$vo['showName']}{$dataType[$vo['dataType']]}{$vo['show_name']}{$dataType[$vo['data_type']]} {$vo['info']}