From 32813b6cea56b4b64b6da71b74abbe98b08211c7 Mon Sep 17 00:00:00 2001 From: czx Date: Tue, 3 Dec 2024 10:55:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/suke/czx/Application.java | 2 ++ src/main/resources/template/Entity.java.vm | 35 ++++++++++----------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/suke/czx/Application.java b/src/main/java/com/suke/czx/Application.java index 3cb65b1..84ed304 100644 --- a/src/main/java/com/suke/czx/Application.java +++ b/src/main/java/com/suke/czx/Application.java @@ -3,10 +3,12 @@ package com.suke.czx; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; @Slf4j @EnableScheduling +@EnableAsync @SpringBootApplication public class Application { diff --git a/src/main/resources/template/Entity.java.vm b/src/main/resources/template/Entity.java.vm index 24888e7..b001851 100644 --- a/src/main/resources/template/Entity.java.vm +++ b/src/main/resources/template/Entity.java.vm @@ -26,25 +26,24 @@ import java.math.BigDecimal; */ @Data @TableName("${tableName}") -public class ${className} implements +public class ${className} implements Serializable { - Serializable { - public static final long serialVersionUID = 1L; + public static final long serialVersionUID = 1L; - #foreach ($column in $columns) - #if($column.columnKey != $null && $column.columnKey == "PRI") - @TableId(type = IdType.ASSIGN_UUID) - #end - #if($column.attrType == "Date") - @Schema(description = "$column.columnComment") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - #end - #if($column.attrType != "Date") - @Schema(description = "$column.columnComment") - #end - @JsonProperty(value = "$column.attrNameMin") - public $column.attrType $column.attrNameMin; + #foreach ($column in $columns) + #if($column.columnKey != $null && $column.columnKey == "PRI") + @TableId(type = IdType.ASSIGN_UUID) + #end + #if($column.attrType == "Date") + @Schema(description = "$column.columnComment") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + #end + #if($column.attrType != "Date") + @Schema(description = "$column.columnComment") + #end + @JsonProperty(value = "$column.attrNameMin") + public $column.attrType $column.attrNameMin; - #end + #end - } \ No newline at end of file +} \ No newline at end of file