You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the request and response parameters include Date types, regardless of java.sql.Date, joda.DateTime, LocalDate, LocalDateTime, or other date types, they are currently all returned as Strings in the yyyy-MM-dd HH:mm:ss format.
当请求参数以及响应参数中有Date类型,不论java.sql.Date , joda.DateTime, LocalDate, LocalDateTime 等日期类型,现在均返回string及 yyyy-MM-dd HH:mm:ss 格式
Basic example(pr的用例)
@DaTa
public class RequestUserParam{
private Date createTime;
private Date updateTime;
}
@DaTa
public class ResponseUserVo{
private Date createTime;
private Date updateTime;
}
All date types are String and cannot be changed.
所有日期类型均为string并不可变更
Motivation(提出这个pr目的)
During implementation, we support various inputs such as yDuring implementation, we support various inputs such as y-dd HH:mm while the response parameter date types are uniformly standardized to be returned as timestamps. Therefore, there is a discrepancy between the generated documentation's response parameters and the actual requests.
It is expected that the date type can be customized with user-defined types and formats.
Example:
我们在实施的过程中,输入支持 yyyy-MM-dd HH:mm:ss 或时间戳等多种输入,而响应参数的日期类型则统一规范了返回为时间戳,故而生成文档的响应参数与真实请求出现了差异
When the dateFormat type is set to timestamp, it should return a long type; other formats can be customized.
当dateFormat type为 timestamp时,则返回long类型,其他可以自定义格式
The text was updated successfully, but these errors were encountered:
@Star-Forever-007
This is too complex. I think it would be sufficient to support the time type annotations of the JSON library. For interfaces, time can only be of two types: string/long. As for the intermediate class casting, we do not have the technology to support it, which makes it complex for users and also complicates the maintenance of Smart-Doc's code.
这样太复杂了,我觉得也就是支持下json库时间类型注解就可以了,时间对于接口就只能是string/long两种类型。至于中间写类强转的我们没有支持的技术,用户用起来复杂,smart-doc代码维护也复杂
shalousun
changed the title
请求参数以及响应参数类型是Date类型时,希望可以自定义格式
When the request and response parameter types are Date, I hope to customize the format.
Mar 10, 2024
Summary(关于这个pr的描述)
When the request and response parameters include Date types, regardless of java.sql.Date, joda.DateTime, LocalDate, LocalDateTime, or other date types, they are currently all returned as Strings in the yyyy-MM-dd HH:mm:ss format.
当请求参数以及响应参数中有Date类型,不论java.sql.Date , joda.DateTime, LocalDate, LocalDateTime 等日期类型,现在均返回string及 yyyy-MM-dd HH:mm:ss 格式
Basic example(pr的用例)
@DaTa
public class RequestUserParam{
private Date createTime;
private Date updateTime;
}
@DaTa
public class ResponseUserVo{
private Date createTime;
private Date updateTime;
}
All date types are String and cannot be changed.
所有日期类型均为string并不可变更
Motivation(提出这个pr目的)
During implementation, we support various inputs such as yDuring implementation, we support various inputs such as y-dd HH:mm while the response parameter date types are uniformly standardized to be returned as timestamps. Therefore, there is a discrepancy between the generated documentation's response parameters and the actual requests.
It is expected that the date type can be customized with user-defined types and formats.
Example:
我们在实施的过程中,输入支持 yyyy-MM-dd HH:mm:ss 或时间戳等多种输入,而响应参数的日期类型则统一规范了返回为时间戳,故而生成文档的响应参数与真实请求出现了差异
期望日期类型可以自定义类型及格式
例:
When the dateFormat type is set to timestamp, it should return a long type; other formats can be customized.
当dateFormat type为 timestamp时,则返回long类型,其他可以自定义格式
The text was updated successfully, but these errors were encountered: