|
1382 | 1382 | } |
1383 | 1383 | } |
1384 | 1384 | }, |
1385 | | - 'Request[]': { |
1386 | | - 'Request': { |
1387 | | - '@order': 'version-,method-' |
| 1385 | + 'Access[]': { |
| 1386 | + 'Access': { |
| 1387 | + '@column': 'name,alias,get,head,gets,heads,post,put,delete', |
| 1388 | + '@order': 'date-,name+', |
| 1389 | + 'name()': 'getWithDefault(alias,name)', |
| 1390 | + 'r0()': 'removeKey(alias)' |
1388 | 1391 | } |
1389 | 1392 | }, |
1390 | 1393 | 'Function[]': { |
|
1396 | 1399 | 'r0()': 'removeKey(name)', |
1397 | 1400 | 'r1()': 'removeKey(arguments)' |
1398 | 1401 | } |
| 1402 | + }, |
| 1403 | + 'Request[]': { |
| 1404 | + 'Request': { |
| 1405 | + '@order': 'version-,method-' |
| 1406 | + } |
1399 | 1407 | } |
1400 | 1408 | }, function (url, res, err) { |
1401 | 1409 | if (err != null || res == null || res.data == null) { |
|
1468 | 1476 | //[] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
1469 | 1477 |
|
1470 | 1478 |
|
1471 | | - //Request[] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
1472 | | - list = docObj == null ? null : docObj['Request[]']; |
| 1479 | + |
| 1480 | + //Access[] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
| 1481 | + list = docObj == null ? null : docObj['Access[]']; |
1473 | 1482 | if (list != null) { |
1474 | | - log('getDoc Request[] = \n' + format(JSON.stringify(list))); |
| 1483 | + log('getDoc Access[] = \n' + format(JSON.stringify(list))); |
1475 | 1484 |
|
1476 | | - doc += '\n\n\n\n\n\n\n\n\n### 非开放请求' |
1477 | | - + ' \n 版本 | 方法 | 数据和结构' |
1478 | | - + ' \n -------- | ------------ | ------------ | ------------ '; |
| 1485 | + doc += '\n\n\n\n\n\n\n\n\n### 访问权限' |
| 1486 | + + ' \n 表名 | 允许 get 的角色 | 允许 head 的角色 | 允许 gets 的角色 | 允许 heads 的角色 | 允许 post 的角色 | 允许 put 的角色 | 允许 delete 的角色' |
| 1487 | + + ' \n -------- | -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | -------------- '; |
1479 | 1488 |
|
1480 | 1489 | for (var i = 0; i < list.length; i++) { |
1481 | 1490 | item = list[i]; |
1482 | 1491 | if (item == null) { |
1483 | 1492 | continue; |
1484 | 1493 | } |
1485 | | - log('getDoc Request[] for i=' + i + ': item = \n' + format(JSON.stringify(item))); |
| 1494 | + log('getDoc Access[] for i=' + i + ': item = \n' + format(JSON.stringify(item))); |
1486 | 1495 |
|
1487 | 1496 |
|
1488 | | - doc += '\n' + item.version + ' | ' + item.method |
1489 | | - + ' | ' + JSON.stringify(App.getStructure(item.structure, item.tag)); |
| 1497 | + doc += '\n' + item.name |
| 1498 | + + ' | ' + JSONResponse.getShowString(JSON.parse(item.get)) |
| 1499 | + + ' | ' + JSONResponse.getShowString(JSON.parse(item.head)) |
| 1500 | + + ' | ' + JSONResponse.getShowString(JSON.parse(item.gets)) |
| 1501 | + + ' | ' + JSONResponse.getShowString(JSON.parse(item.heads)) |
| 1502 | + + ' | ' + JSONResponse.getShowString(JSON.parse(item.post)) |
| 1503 | + + ' | ' + JSONResponse.getShowString(JSON.parse(item.put)) |
| 1504 | + + ' | ' + JSONResponse.getShowString(JSON.parse(item.delete)); |
1490 | 1505 | } |
1491 | 1506 |
|
1492 | | - doc += '\n注: \n1.GET,HEAD方法不受限,可传任何 数据、结构。\n2.可在最外层传版本version来指定使用的版本,不传或 version <= 0 则使用最新版。\n\n\n\n\n\n\n'; |
| 1507 | + doc += '\n' //避免没数据时表格显示没有网格 |
1493 | 1508 | } |
1494 | 1509 |
|
1495 | | - |
1496 | | - //Request[] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
| 1510 | + //Access[] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
1497 | 1511 |
|
1498 | 1512 |
|
1499 | 1513 | //Function[] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
|
1521 | 1535 |
|
1522 | 1536 | //Function[] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
1523 | 1537 |
|
| 1538 | + |
| 1539 | + //Request[] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
| 1540 | + list = docObj == null ? null : docObj['Request[]']; |
| 1541 | + if (list != null) { |
| 1542 | + log('getDoc Request[] = \n' + format(JSON.stringify(list))); |
| 1543 | + |
| 1544 | + doc += '\n\n\n\n\n\n\n\n\n### 非开放请求' |
| 1545 | + + ' \n 版本 | 方法 | 数据和结构' |
| 1546 | + + ' \n -------- | ------------ | ------------ | ------------ '; |
| 1547 | + |
| 1548 | + for (var i = 0; i < list.length; i++) { |
| 1549 | + item = list[i]; |
| 1550 | + if (item == null) { |
| 1551 | + continue; |
| 1552 | + } |
| 1553 | + log('getDoc Request[] for i=' + i + ': item = \n' + format(JSON.stringify(item))); |
| 1554 | + |
| 1555 | + |
| 1556 | + doc += '\n' + item.version + ' | ' + item.method |
| 1557 | + + ' | ' + JSON.stringify(App.getStructure(item.structure, item.tag)); |
| 1558 | + } |
| 1559 | + |
| 1560 | + doc += '\n注: \n1.GET,HEAD方法不受限,可传任何 数据、结构。\n2.可在最外层传版本version来指定使用的版本,不传或 version <= 0 则使用最新版。\n\n\n\n\n\n\n'; |
| 1561 | + } |
| 1562 | + |
| 1563 | + |
| 1564 | + //Request[] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
| 1565 | + |
1524 | 1566 | App.onChange(false); |
1525 | 1567 |
|
1526 | 1568 |
|
|
0 commit comments