[FEATURE] 提供@JSONFields注解,并提供分组功能, 允许在调用toJSONString和parseObject时手动启用某个分组
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 613
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 6
Description
### 请描述您的需求或者改进建议
提供@JSONFields注解,提供分组功能, 允许在调用toJSONString和parseObject时手动指定某个分组.
### 请描述你建议的实现方案
正常情况下并不会特别需要指定@JSONField, 而对外部多个系统提供接口的时候,尤其是后建系统,会需要给每个系统以不同的字段名提供数据,如果有这个注解,且支持分组功能,就不用建多个实体和拷贝属性. 这会大大简化对外提供接口时需要不同数据字段名称的需求实现.
`@JSONFields({`
`@JSONField(name = "name1", group = "system1", format = "yyyy-MM-dd HH:mm:ss"),`
`@JSONField(name = "name2", group = "system2", format = "yyyy_MM_dd_HH_mm_ss")`
`})`
`private LocalDateTime name;`
### 描述您考虑过的替代方案
把实体拷贝很多份, 注解上不同的@JSONField.
#### 附加信息
*如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。*
Contributor guide
Research direction
Start by locating the JSONField annotation and the toJSONString and parseObject entry points mentioned in the request. Trace how field names and formats are currently selected, then determine how grouped annotations would be enabled for serialization and parsing. Done means one entity can expose the requested group-specific names and formats without duplicated entity classes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100