Skip to content
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

我希望添加一些自己的配置 #1095

Open
gghxjava opened this issue Dec 22, 2023 · 6 comments
Open

我希望添加一些自己的配置 #1095

gghxjava opened this issue Dec 22, 2023 · 6 comments
Labels
type: bug Something isn't working

Comments

@gghxjava
Copy link

image

大佬我想添加一些配置项,我发现你的的projectSetting只能序列化基本数据类型 无法序列化对象,是有什么原因吗

@gghxjava gghxjava added the type: bug Something isn't working label Dec 22, 2023
@tangcent
Copy link
Owner

有报错吗? 我直接用的idea提供的存储:
https://github.com/tangcent/easy-yapi/blob/master/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/settings/xml/ProjectSettingsComponent.kt

private val projectSettingsComponent: ProjectSettingsComponent? by lazy {
project?.getService(ProjectSettingsComponent::class.java)
}

@gghxjava
Copy link
Author

image 大佬你试试 我序列化项目级别的数据 保存之后,然后关闭idea ,你会发现序列化失败

@tangcent
Copy link
Owner

你为啥要存DefaultTreeModel?

@gghxjava
Copy link
Author

因为我有一棵树 我不希望每次都去数据库获取 直接存储xml文件里面
我想了一个方法 我把他序列化为一个字节数组 存入xml文件 可以临时解决问题
但是我很想知道 为什么项目级存储 无法存储对象 而应用级可以 这令我很费解

@tangcent
Copy link
Owner

太复杂的对象还是自己处理序列化比较好,settings里面就放string

@gghxjava
Copy link
Author

1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants