From e75643ab29e149b2d8d5a0ee50bacc39a50c26df Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Thu, 31 Oct 2024 23:42:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=86=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=B1=BB=E5=88=AB=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/good/GoodController.java | 4 +--- .../heritage/model/entity/Address.java | 20 ++++++++++++++----- .../heritage/model/entity/Category.java | 17 ++++++++++++++++ .../heritage/model/entity/Coupon.java | 6 ++++++ .../cultural/heritage/model/entity/Good.java | 18 +++++++++++++++++ 5 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/cultural/heritage/model/entity/Coupon.java diff --git a/src/main/java/com/cultural/heritage/controller/good/GoodController.java b/src/main/java/com/cultural/heritage/controller/good/GoodController.java index e042dff..e22eb29 100644 --- a/src/main/java/com/cultural/heritage/controller/good/GoodController.java +++ b/src/main/java/com/cultural/heritage/controller/good/GoodController.java @@ -56,9 +56,7 @@ public class GoodController { Good good = new Good(); BeanUtils.copyProperties(goodAddRequest, good); boolean save = goodService.save(good); - if (!save) { - throw new BusinessException(ErrorCode.SYSTEM_ERROR); - } + ThrowUtils.throwIf(!save, ErrorCode.OPERATION_ERROR); return ResultUtils.success(true, "商品插入成功"); } diff --git a/src/main/java/com/cultural/heritage/model/entity/Address.java b/src/main/java/com/cultural/heritage/model/entity/Address.java index 989e840..3bed714 100644 --- a/src/main/java/com/cultural/heritage/model/entity/Address.java +++ b/src/main/java/com/cultural/heritage/model/entity/Address.java @@ -6,6 +6,7 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.util.Date; @Data public class Address implements Serializable { @@ -46,17 +47,26 @@ public class Address implements Serializable { */ private Long userId; - /** - * 是否删除 - */ - private Integer isDelete; - /** * 是否为默认地址 */ private Integer isDefault; + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 是否删除 + */ + private Integer isDelete; @Serial private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/cultural/heritage/model/entity/Category.java b/src/main/java/com/cultural/heritage/model/entity/Category.java index df6f6e9..101d493 100644 --- a/src/main/java/com/cultural/heritage/model/entity/Category.java +++ b/src/main/java/com/cultural/heritage/model/entity/Category.java @@ -7,6 +7,7 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.util.Date; @Data public class Category implements Serializable { @@ -37,6 +38,22 @@ public class Category implements Serializable { private String typeIntro; + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 是否删除 + */ + private Integer isDelete; + + @Serial private static final long serialVersionUID = 1L; } diff --git a/src/main/java/com/cultural/heritage/model/entity/Coupon.java b/src/main/java/com/cultural/heritage/model/entity/Coupon.java new file mode 100644 index 0000000..cf99b50 --- /dev/null +++ b/src/main/java/com/cultural/heritage/model/entity/Coupon.java @@ -0,0 +1,6 @@ +package com.cultural.heritage.model.entity; + + +public class Coupon { + +} diff --git a/src/main/java/com/cultural/heritage/model/entity/Good.java b/src/main/java/com/cultural/heritage/model/entity/Good.java index 7077413..fc38de9 100644 --- a/src/main/java/com/cultural/heritage/model/entity/Good.java +++ b/src/main/java/com/cultural/heritage/model/entity/Good.java @@ -7,6 +7,9 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; +import java.io.Serial; +import java.util.Date; + @TableName(value = "good") @Data @@ -82,7 +85,22 @@ public class Good { */ private Integer isShelves; + /** + * 创建时间 + */ + private Date createTime; + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 是否删除 + */ + private Integer isDelete; + + @Serial @TableField(exist = false) private static final long serialVersionUID = 1L;