diff --git a/hiver-admin/pom.xml b/hiver-admin/pom.xml index fb8d5b75..9874cf8a 100644 --- a/hiver-admin/pom.xml +++ b/hiver-admin/pom.xml @@ -43,6 +43,11 @@ hiver-open 1.0-SNAPSHOT + + cc.hiver + hiver-mall + 1.0-SNAPSHOT + com.alibaba diff --git a/hiver-admin/src/main/resources/application.yml b/hiver-admin/src/main/resources/application.yml index 89141df5..3a2cccec 100644 --- a/hiver-admin/src/main/resources/application.yml +++ b/hiver-admin/src/main/resources/application.yml @@ -283,6 +283,8 @@ ignored: - /hiver/iot/sensorHelper/** - /hiver/goview/visual/** - /hiver/license/verifyLicense + # 临时增加 + - /hiver/app/** # 限流及黑名单不拦截的路径 limitUrls: - /**/*.js diff --git a/hiver-admin/test-output/test-report.html b/hiver-admin/test-output/test-report.html index 08710052..79f23440 100644 --- a/hiver-admin/test-output/test-report.html +++ b/hiver-admin/test-output/test-report.html @@ -35,7 +35,7 @@ Hiver
  • - 27, 2023 11:49:37 + 31, 2023 23:25:57
  • @@ -84,7 +84,7 @@

    passTest

    -

    11:49:37 / 0.017 secs

    +

    23:25:57 / 0.01 secs

    @@ -92,9 +92,9 @@
    #test-id=1
    passTest
    -06.27.2023 11:49:37 -06.27.2023 11:49:37 -0.017 secs +07.31.2023 23:25:57 +07.31.2023 23:25:57 +0.01 secs
    @@ -104,7 +104,7 @@ Pass - 11:49:37 + 23:25:57 Test passed @@ -128,13 +128,13 @@

    Started

    -

    27, 2023 11:49:37

    +

    31, 2023 23:25:57

    Ended

    -

    27, 2023 11:49:38

    +

    31, 2023 23:25:57

    diff --git a/hiver-core/src/main/java/cc/hiver/core/base/HiverBaseMallEntity.java b/hiver-core/src/main/java/cc/hiver/core/base/HiverBaseMallEntity.java new file mode 100644 index 00000000..00f747a1 --- /dev/null +++ b/hiver-core/src/main/java/cc/hiver/core/base/HiverBaseMallEntity.java @@ -0,0 +1,68 @@ +package cc.hiver.core.base; + +import cc.hiver.core.common.constant.CommonConstant; +import cc.hiver.core.common.utils.SnowFlakeUtil; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.data.annotation.CreatedBy; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedBy; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.persistence.EntityListeners; +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; +import java.io.Serializable; +import java.util.Date; + +@Data +@MappedSuperclass +@EntityListeners(AuditingEntityListener.class) +@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}) +public abstract class HiverBaseMallEntity implements Serializable { + private static final long serialVersionUID = 1L; + + @Id + @TableId + @ApiModelProperty(value = "唯一标识") + private String id = SnowFlakeUtil.nextId().toString(); + + @ApiModelProperty("店铺id") + private String mallId; + + @ApiModelProperty("办公区域") + private String region; + + @ApiModelProperty(value = "创建者") + @CreatedBy + @TableField(fill = FieldFill.INSERT) + private String createBy; + + @CreatedDate + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "更新者") + @LastModifiedBy + @TableField(fill = FieldFill.UPDATE) + private String updateBy; + + @LastModifiedDate + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.UPDATE) + private Date updateTime; + + @ApiModelProperty(value = "删除标志 默认0") + private Integer delFlag = CommonConstant.STATUS_NORMAL; +} \ No newline at end of file diff --git a/hiver-core/src/main/java/cc/hiver/core/base/HiverBasePageQuery.java b/hiver-core/src/main/java/cc/hiver/core/base/HiverBasePageQuery.java new file mode 100644 index 00000000..b307a246 --- /dev/null +++ b/hiver-core/src/main/java/cc/hiver/core/base/HiverBasePageQuery.java @@ -0,0 +1,33 @@ +/* +Copyright [2022] [https://hiver.cc] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + */ +package cc.hiver.core.base; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author Yazhi Li + */ +@Data +@ApiModel +public class HiverBasePageQuery { + @ApiModelProperty(value = "页码", example = "1") + private int pageNum = 1; + + @ApiModelProperty(value = "每页记录数", example = "10") + private int pageSize = 10; +} diff --git a/hiver-core/src/main/java/cc/hiver/core/common/constant/CommonConstant.java b/hiver-core/src/main/java/cc/hiver/core/common/constant/CommonConstant.java index dced3c78..09c228e9 100644 --- a/hiver-core/src/main/java/cc/hiver/core/common/constant/CommonConstant.java +++ b/hiver-core/src/main/java/cc/hiver/core/common/constant/CommonConstant.java @@ -125,4 +125,14 @@ public interface CommonConstant { * 部门负责人类型 副负责人 */ Integer HEADER_TYPE_VICE = 1; + + /** + * 是 + */ + Integer STATUS_YES = 1; + + /** + * 否 + */ + Integer STATUS_NO = 0; } diff --git a/hiver-core/src/main/java/cc/hiver/core/common/constant/MallConstant.java b/hiver-core/src/main/java/cc/hiver/core/common/constant/MallConstant.java new file mode 100644 index 00000000..7fd4524b --- /dev/null +++ b/hiver-core/src/main/java/cc/hiver/core/common/constant/MallConstant.java @@ -0,0 +1,48 @@ +package cc.hiver.core.common.constant; + +/** + * 商城静态常量 + * + * @author Yazhi Li + */ +public interface MallConstant { + /** + * 上架 + */ + Integer GOODS_PUT_ON_SALE = 0; + + /** + * 下架 + */ + Integer GOODS_PULL_ON_SALE = -1; + + /** + * 销售单处理中 + */ + Integer SALES_ORDER_PROCESS = 0; + + /** + * 销售单临时保存 + */ + Integer SALES_ORDER_SAVED = 1; + + /** + * 订单锁定的商品列表key前缀 + */ + String ORDER_LOCKED_SKUS_PREFIX = "order:locked:goods:"; + + /** + * 商品分布式锁key前缀 + */ + String SKU_LOCK_PREFIX = "product:stock:lock:"; + + /** + * 临时规格ID前缀 + */ + String SPEC_TEMP_ID_PREFIX = "tid_"; + + /** + * 会员购物车缓存KEY前缀 + */ + String MEMBER_CART_PREFIX = "MEMBER:CART:"; +} diff --git a/hiver-core/src/main/java/cc/hiver/core/vo/Option.java b/hiver-core/src/main/java/cc/hiver/core/vo/Option.java new file mode 100644 index 00000000..1bcd9ee6 --- /dev/null +++ b/hiver-core/src/main/java/cc/hiver/core/vo/Option.java @@ -0,0 +1,52 @@ +/* +Copyright [2022] [https://hiver.cc] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + */ +package cc.hiver.core.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @author Yazhi Li + */ +@ApiModel("下拉选项对象") +@Data +@NoArgsConstructor +public class Option { + public Option(T value, String label) { + this.value = value; + this.label = label; + } + + public Option(T value, String label, List