|
322 | 322 | App.exTxt.name = 'APIJSON自动化文档 ' + App.formatDateTime() |
323 | 323 | } |
324 | 324 | else if (App.view == 'markdown' || App.view == 'output') { |
325 | | - App.exTxt.name = 'APIJSON自动生成model ' + App.formatDateTime() |
| 325 | + App.exTxt.name = 'User' |
326 | 326 | } |
327 | 327 | else { |
328 | 328 | App.exTxt.name = 'APIJSON测试 ' + App.getMethod() + ' ' + App.formatDateTime() |
|
429 | 429 | , App.exTxt.name + '.txt') |
430 | 430 | } |
431 | 431 | else if (App.view == 'markdown' || App.view == 'output') { //model |
432 | | - saveTextAs('# ' + App.exTxt.name + '\n主页: https://github.com/TommyLemon/APIJSON' |
433 | | - + '\n\n\n## 使用方法\n1.新建java文件,例如A.java <br/> \n2.将以下与A同名的class代码复制粘贴到A文件内 <br/> \n3.import需要引入的类,可使用快捷键Ctrl+Shift+O <br/> ' |
434 | | - + '\n\n## Java model类 \n\n' + CodeUtil.parseJavaBean(docObj) |
435 | | - , App.exTxt.name + '.txt') |
| 432 | + // saveTextAs('# ' + App.exTxt.name + '\n主页: https://github.com/TommyLemon/APIJSON' |
| 433 | + // + '\n\n\n## 使用方法\n1.新建java文件,例如A.java <br/> \n2.将以下与A同名的class代码复制粘贴到A文件内 <br/> \n3.import需要引入的类,可使用快捷键Ctrl+Shift+O <br/> ' |
| 434 | + // + '\n\n## Java model类 \n\n' + CodeUtil.parseJavaBean(docObj) |
| 435 | + // , App.exTxt.name + '.txt') |
| 436 | + |
| 437 | + |
| 438 | + var clazz = App.exTxt.name |
| 439 | + var txt = CodeUtil.parseJavaBean(docObj, clazz) |
| 440 | + if (StringUtil.isEmpty(txt, true)) { |
| 441 | + alert('找不到 ' + clazz + ' 对应的表!请检查数据库中是否存在!\n如果不存在,请重新输入存在的表;\n如果存在,请刷新网页后重试。') |
| 442 | + return |
| 443 | + } |
| 444 | + saveTextAs(txt, clazz + '.java') |
436 | 445 | } |
437 | 446 | else { |
438 | 447 | saveTextAs('# ' + App.exTxt.name + '\n主页: https://github.com/TommyLemon/APIJSON' |
|
1302 | 1311 | if (item == null || item.name == null) { |
1303 | 1312 | continue |
1304 | 1313 | } |
1305 | | - //TODO 加了会因为增删改导致查询变化 if (item.url == '/logout') {// || item.userId != App.User.id) { |
1306 | | - if (item.userId != App.User.id || (item.url != '/get' && item.url != '/gets' && item.url != '/head' && item.url != '/heads')) { |
1307 | | - console.log('test item.userId != User.id || item.url == /logout >> continue') |
| 1314 | + if (item.url == '/logout') { |
| 1315 | + console.log('test item.url == "/logout" >> continue') |
1308 | 1316 | continue |
1309 | 1317 | } |
1310 | 1318 | console.log('test item = ' + JSON.stringify(item, null, ' ')) |
|
0 commit comments