-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support export to postman customize workspace #524
Conversation
@tangcent ubuntu CI test不知道怎么没通过,看了一下没看明白怎么修改。本地倒是可以运行的 |
本地执行:
|
|
|
Codecov Report
@@ Coverage Diff @@
## master #524 +/- ##
===============================================
+ Coverage 39.596% 41.969% +2.373%
- Complexity 1492 1677 +185
===============================================
Files 197 203 +6
Lines 11491 12495 +1004
Branches 2580 2923 +343
===============================================
+ Hits 4550 5244 +694
- Misses 5956 6220 +264
- Partials 985 1031 +46
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@gcdd1993 以下 easy-yapi/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/actions/ApiDashBoardAction.kt Lines 26 to 52 in 81eb654
easy-yapi/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/suv/SuvApiExporter.kt Lines 400 to 439 in 81eb654
|
logger!!.error("Authentication failed!") | ||
return | ||
} | ||
val returnObj = returnValue.asJsonElement() | ||
val errorName = returnObj | ||
.sub("error") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些格式化的改动最好去掉,会对review产生干扰。
如果需要做格式化、整理import、修复typo等,可以单独提交一个PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
抱歉,我来恢复一下,IDEA自动给我格式化了
idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/settings/helper/PostmanSettingsHelper.kt
Show resolved
Hide resolved
return null | ||
} | ||
|
||
private fun selectWorkspace(module: String): String? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tangcent selectWorkspace
是private
的方法,这个有什么办法可以写单元测试吗?
...ugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/postman/DefaultPostmanApiHelper.kt
Outdated
Show resolved
Hide resolved
...ugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/postman/DefaultPostmanApiHelper.kt
Show resolved
Hide resolved
@@ -104,12 +114,18 @@ open class DefaultPostmanApiHelper : PostmanApiHelper { | |||
* @return collection id | |||
*/ | |||
override fun createCollection(collection: HashMap<String, Any?>): HashMap<String, Any?>? { | |||
|
|||
// get workspace | |||
val module = actionContext.callInReadUI { moduleHelper.findModuleByPath(ActionUtils.findCurrentPath()) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在这一步获取module无法处理这种情况: UserCtrl.java#L16-L20
当我尝试导出spring-demo或者仅导出UserCtrl.java时, 均只提示我选择springboot-demo
对应的WorkSpace
,而没有提示我选择user
对应的WorkSpace
需要根据开发者是否有一个项目下的接口导入多个WorkSpace
的需求来处理这个问题:
- 如果没有的话,直接关联
Project
->WorkSpace
是不是更合理? - 如果有的话,就比较麻烦了,需要改造:
Lines 511 to 521 in 81eb654
private fun doParseRequests(requests: MutableList<Request>): HashMap<String, Any?> { //parse [request...] -> // { // "module":{ // "folder":[request...] // } // } val moduleFolderApiMap: HashMap<String, HashMap<Folder, ArrayList<HashMap<String, Any?>>>> = HashMap()
在对module
进行分组聚合后,再对它们归属的workspace
进行分组聚合
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得直接关联Project
-> WorkSpace
更为合理。
是我理解错了,我原先的想法就是一个Project
导入一个WorkSpace
,错把module
当成project
了
…rt/postman/DefaultPostmanApiHelper.kt Co-authored-by: tangcent <[email protected]>
@tangcent |
LGTM |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@gcdd1993 先合进来再改? |
额,还需要改啥,上面的都改好了 |
feature #283