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;