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

[QUESTION] 动态类型及annotation单独maven包 #3292

Open
L1yp opened this issue Jan 17, 2025 · 0 comments
Open

[QUESTION] 动态类型及annotation单独maven包 #3292

L1yp opened this issue Jan 17, 2025 · 0 comments
Labels
question Further information is requested

Comments

@L1yp
Copy link

L1yp commented Jan 17, 2025

请描述您的问题

询问有关本项目的使用和其他方面的相关问题。

怎么支持动态类型,要求不能写出class数据,要保证redis/数据库/前端的数据一模一样,jackson写法如下:

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true)
@JsonSubTypes({
        @JsonSubTypes.Type(value = NumberInputFieldScheme.class, name = "number"),
        @JsonSubTypes.Type(value = TextInputFieldScheme.class, name = "text"),
        @JsonSubTypes.Type(value = OptionFieldScheme.class, name = "option"),
        @JsonSubTypes.Type(value = UserFieldScheme.class, name = "user"),
        @JsonSubTypes.Type(value = DeptFieldScheme.class, name = "dept"),
        @JsonSubTypes.Type(value = DateFieldScheme.class, name = "date"),
})
@JsonNaming(LowerCamelCaseStrategy.class)
@JsonInclude(Include.NON_NULL)
class FieldScheme {}

另外还有个问题,fastjson2是否有考虑把annotation独立一个maven包,有时候maven分模块的时候,定义model类型时只想引入annotation,而不是引入全量。

@L1yp L1yp added the question Further information is requested label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant