GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 导出用例为 Markdown 文档:完善响应结果和注释 · TommyLemon/APIAuto@bd47eb9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • js
    • main.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎js/main.js‎

Copy file name to clipboardExpand all lines: js/main.js
+50-8Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3074,7 +3074,7 @@ https://github.com/Tencent/APIJSON/issues
30743074
saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON'
30753075
+ '\n\nBASE_URL: ' + this.getBaseUrl()
30763076
+ '\n\n\n## 测试用例(Markdown格式,可用工具预览) \n\n' + this.getDoc4TestCase()
3077-
+ '\n\n\n\n\n\n\n\n## 文档(Markdown格式,可用工具预览) \n\n' + doc
3077+
+ (this.view != 'markdown' ? '' : '\n\n\n\n\n\n\n\n## 文档(Markdown格式,可用工具预览) \n\n' + doc)
30783078
, this.exTxt.name + '.txt')
30793079
}
30803080
else if (this.view == 'markdown' || this.view == 'output') { //model
@@ -10662,17 +10662,59 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
1066210662

1066310663
getDoc4TestCase: function () {
1066410664
var list = this.remotes || []
10665-
var doc = ''
10666-
var item
10665+
var s = ''
1066710666
for (var i = 0; i < list.length; i ++) {
10668-
item = list[i] == null ? null : list[i].Document
10669-
if (item == null || item.name == null) {
10667+
var item = list[i]
10668+
var doc = item == null ? null : item.Document
10669+
if (doc == null || doc.name == null) {
1067010670
continue
1067110671
}
10672-
doc += '\n\n#### ' + (item.version > 0 ? 'V' + item.version : 'V*') + ' ' + item.name + ' ' + item.url
10673-
doc += '\n```json\n' + item.request + '\n```\n'
10672+
var tr = item.TestRecord
10673+
10674+
var req = doc.request
10675+
var res = ''
10676+
try {
10677+
var m = this.getMethod(doc.url);
10678+
var standardObj = null;
10679+
try {
10680+
standardObj = parseJSON(doc.standard);
10681+
} catch (e3) {
10682+
log(e3)
10683+
}
10684+
10685+
var isAPIJSONRouter = false;
10686+
try {
10687+
var apijson = parseJSON(doc.apijson);
10688+
isAPIJSONRouter = JSONResponse.isObject(apijson)
10689+
} catch (e3) {
10690+
log(e3)
10691+
}
10692+
10693+
req = StringUtil.trim(CodeUtil.parseComment(req, docObj == null ? null : docObj['[]'], m, this.database, this.language, true, standardObj, null, true, isAPIJSONRouter));
10694+
10695+
if (this.view != 'markdown') {
10696+
res = tr == null ? null : tr.response
10697+
var standardObj2 = null;
10698+
try {
10699+
standardObj2 = StringUtil.isEmpty(res) ? null : parseJSON(tr.standard);
10700+
} catch (e3) {
10701+
log(e3)
10702+
}
10703+
10704+
if (StringUtil.isNotEmpty(standardObj2)) {
10705+
res = StringUtil.trim(CodeUtil.parseComment(format(res), docObj == null ? null : docObj['[]'], m, this.database, this.language, false, standardObj2, null, true, isAPIJSONRouter));
10706+
}
10707+
}
10708+
} catch (e) {
10709+
log(e)
10710+
}
10711+
10712+
s += '\n\n#### ' + (i + 1) + '. ' + (doc.version > 0 ? 'V' + doc.version : 'V*') + ' ' + doc.name + ' ' + (doc.method || '') + ' ' + (doc.type || '') + ' ' + doc.url;
10713+
s += '\n```json\n' + req + '\n```\n';
10714+
s += StringUtil.isEmpty(res) ? '' : '\n=> Response:\n```json\n' + res + '\n```\n';
1067410715
}
10675-
return doc
10716+
10717+
return s
1067610718
},
1067710719

1067810720
enableCross: function (enable) {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.