diff --git a/src/main/resources/templates/codegen/form.java.vm b/src/main/resources/templates/codegen/form.java.vm index e2c07377..f05ce6b8 100644 --- a/src/main/resources/templates/codegen/form.java.vm +++ b/src/main/resources/templates/codegen/form.java.vm @@ -7,6 +7,7 @@ import lombok.Getter; import lombok.Setter; #if(${hasLocalDateTime}) import java.time.LocalDateTime; +import com.fasterxml.jackson.annotation.JsonFormat; #end #if(${hasBigDecimal}) import java.math.BigDecimal; @@ -46,6 +47,9 @@ public class ${entityName}Form implements Serializable { #if($fieldConfig.maxLength) @Size(max=$fieldConfig.maxLength, message="$fieldConfig.fieldComment长度不能超过${fieldConfig.maxLength}个字符") #end + #if($fieldConfig.fieldType == 'LocalDateTime') + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + #end private ${fieldConfig.fieldType} ${fieldConfig.fieldName}; #end