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

feat:(util/gconv): 把转换相关的配置独立出来 #4114

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

wln32
Copy link
Member

@wln32 wln32 commented Jan 13, 2025

新增几个api用于为不同模块之间提供自定义的转换
NewConvertConfig 创建一个转换配置
RegisterTypeConvertFunc 为当前配置注册非接口类型的转换,空接口也可以用这个
RegisterInterfaceTypeConvertFunc 为当前配置注册接口类型的转换
RegisterDefaultConvertFuncs 为当前配置增加常见的类型转换
主要就是以上4个api
添加配置后,gconvhttp还有orm这些依赖gconv的模块,可以创建不同的配置来调用gconv,这样不同配置,互不影响

@wln32 wln32 changed the title feat feat:(util/gconv): 把转换相关的配置独立出来 Jan 13, 2025
@wln32 wln32 requested a review from gqcn January 13, 2025 12:34
@gqcn gqcn added feature discuss We need discuss to make decision. slow reviewing It might be complicated or too many changes, which needs more time reviewing. labels Jan 14, 2025
wln32 and others added 2 commits January 14, 2025 14:31
2.存储接口类型的转换由map改为slice,以保证稳定性
3.全局变量defaultConfig改为方法调用DefaultConvertConfig()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss We need discuss to make decision. feature slow reviewing It might be complicated or too many changes, which needs more time reviewing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants