1
This commit is contained in:
parent
719009b7f2
commit
910dc1ce7c
@ -27,11 +27,12 @@ module.exports = class {
|
|||||||
'desc': '用户登录',
|
'desc': '用户登录',
|
||||||
'group': 'User',
|
'group': 'User',
|
||||||
'url': 'api/v1/user/info/:user_id',
|
'url': 'api/v1/user/info/:user_id',
|
||||||
|
'is_json_params': true,
|
||||||
'params': [
|
'params': [
|
||||||
|
['!rsp', [new common.RspHead()], 'ok rsp']
|
||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
new common.RspHead(),
|
new common.RspHead(),
|
||||||
['rsp', new common.RspHead(), 'ok rsp']
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -117,11 +117,16 @@ class Doc
|
|||||||
this.data += ` * ${curIdent}'${item[0]}': { // struct ${item[2]}\n`;
|
this.data += ` * ${curIdent}'${item[0]}': { // struct ${item[2]}\n`;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (util.isArray(item)) {
|
||||||
if (['string', 'number'].indexOf(typeof item[1]) >= 0) {
|
if (['string', 'number'].indexOf(typeof item[1]) >= 0) {
|
||||||
const paramType = this.getFieldType(item[1]);
|
const paramType = this.getFieldType(item[1]);
|
||||||
this.data += ` * ${curIdent}'${item[0]}': ${this.getJsonValue(item[1])}, //${item[2]}\n`;
|
this.data += ` * ${curIdent}'${item[0]}': ${this.getJsonValue(item[1])}, //${item[2]}\n`;
|
||||||
} else {
|
} else {
|
||||||
console.log(11111111111, item, item.__proto__.name);
|
this.data += ` * ${curIdent}'${item[0]}': { // struct ${item[1].constructor.name} ${item[2]}\n`;
|
||||||
|
this.asJsonOut(item[1].fields, ident + 1);
|
||||||
|
this.data += ` * ${curIdent}}\n`;
|
||||||
|
}
|
||||||
|
} else if (typeof item == 'object'){
|
||||||
this.asJsonOut(item.fields, ident);
|
this.asJsonOut(item.fields, ident);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user