diff --git a/muyu-common/muyu-common-core/src/main/java/com/muyu/common/core/utils/ObjUtils.java b/muyu-common/muyu-common-core/src/main/java/com/muyu/common/core/utils/ObjUtils.java new file mode 100644 index 0000000..35f459c --- /dev/null +++ b/muyu-common/muyu-common-core/src/main/java/com/muyu/common/core/utils/ObjUtils.java @@ -0,0 +1,65 @@ +package com.muyu.common.core.utils; + +import org.apache.commons.lang3.ObjectUtils; + +import java.math.BigDecimal; + +/** + * @author DongZl + * @description: 对象工具类 + * @Date 2023-10-9 下午 04:56 + */ +public class ObjUtils { + + /** + * 兼容 + * CharSequence: 如果长度为零,则认为为空。 + * Array: 如果长度为零,则认为为空。 + * Collection: 如果元素为零,则认为为空。 + * Map: 如果键值映射为零,则认为为空。 + * @param o 对象 + * @return 如果对象具有受支持的类型并且为空或null,则为true,否则为false + */ + public static boolean notNull(Object o){ + return ObjectUtils.isNotEmpty(o); + } + + /** + * 判断long类型不为0 + * @param val 值 + * @return 返回值不为0 + */ + public static boolean notNull(Long val){ + return ObjectUtils.isNotEmpty(val) && val != 0; + } + + /** + * 判断Integer类型不为0 + * @param val 值 + * @return 返回值不为0 + */ + public static boolean notNull(Integer val){ + return ObjectUtils.isNotEmpty(val) && val != 0; + } + /** + * 判断BigDecimal类型不为0 + * @param val 值 + * @return 返回值不为0 + */ + public static boolean notNull(BigDecimal val){ + return ObjectUtils.isNotEmpty(val) && val.doubleValue() == 0.00; + } + /** + * 判断BigDecimal类型不为0 + * @param val 值 + * @return 返回值不为0 + */ + public static boolean notChildNull(Object[] val){ + for (Object o : val) { + if (!notNull(o)){ + return false; + } + } + return true; + } +} diff --git a/muyu-modules/muyu-product/muyu-product-common/pom.xml b/muyu-modules/muyu-product/muyu-product-common/pom.xml index 51aa072..a1e6024 100644 --- a/muyu-modules/muyu-product/muyu-product-common/pom.xml +++ b/muyu-modules/muyu-product/muyu-product-common/pom.xml @@ -18,11 +18,10 @@ + com.muyu muyu-common-core - - - \ No newline at end of file + diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsAttributeGroup.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsAttributeGroup.java new file mode 100644 index 0000000..d3d6cff --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsAttributeGroup.java @@ -0,0 +1,55 @@ +package com.muyu.product.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 属性与组中间对象 as_attribute_group + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("as_attribute_group") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "AsAttributeGroup", description = "属性与组中间") +public class AsAttributeGroup extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 组ID */ + @Excel(name = "组ID") + @ApiModelProperty(name = "组ID", value = "组ID", required = true) + private Long groupId; + + /** 属性id */ + @Excel(name = "属性id") + @ApiModelProperty(name = "属性id", value = "属性id", required = true) + private Long attributeId; + + + public static AsAttributeGroup buildGroup (Long attributeGroupId, + Long attributeId) { + return AsAttributeGroup.builder() + .groupId(attributeGroupId) + .attributeId(attributeId) + .build(); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsBrandProject.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsBrandProject.java new file mode 100644 index 0000000..0d1e2ef --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsBrandProject.java @@ -0,0 +1,47 @@ +package com.muyu.product.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 品牌商品中间对象 as_brand_project + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("as_brand_project") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "AsBrandProject", description = "品牌商品中间") +public class AsBrandProject extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 品牌id */ + @Excel(name = "品牌id") + @ApiModelProperty(name = "品牌id", value = "品牌id", required = true) + private Long brandId; + + /** 商品id */ + @Excel(name = "商品id") + @ApiModelProperty(name = "商品id", value = "商品id", required = true) + private String projectId; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsCategoryAttribute.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsCategoryAttribute.java new file mode 100644 index 0000000..1423b22 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsCategoryAttribute.java @@ -0,0 +1,60 @@ +package com.muyu.product.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.product.domain.base.CategoryBase; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 品类属性中间对象 as_category_attribute + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("as_category_attribute") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "AsCategoryAttribute", description = "品类属性中间") +public class AsCategoryAttribute extends BaseEntity implements CategoryBase { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 品类id */ + @Excel(name = "品类id") + @ApiModelProperty(name = "品类id", value = "品类id", required = true) + private Long categoryId; + + /** 属性id */ + @Excel(name = "属性id") + @ApiModelProperty(name = "属性id", value = "属性id", required = true) + private Long attributeId; + + + public static AsCategoryAttribute categoryBuild(Long categoryInfoId, Long attributeId) { + return AsCategoryAttribute.builder() + .categoryId(categoryInfoId) + .attributeId(attributeId) + .build(); + } + + @Override + public Long getBaseId () { + return this.attributeId; + } +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsCategoryAttributeGroup.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsCategoryAttributeGroup.java new file mode 100644 index 0000000..1dd2789 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsCategoryAttributeGroup.java @@ -0,0 +1,60 @@ +package com.muyu.product.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.product.domain.base.CategoryBase; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 品类属性组中间对象 as_category_attribute_group + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("as_category_attribute_group") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "AsCategoryAttributeGroup", description = "品类属性组中间") +public class AsCategoryAttributeGroup extends BaseEntity implements CategoryBase { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 品类id */ + @Excel(name = "品类id") + @ApiModelProperty(name = "品类id", value = "品类id", required = true) + private Long categoryId; + + /** 属性组 */ + @Excel(name = "属性组") + @ApiModelProperty(name = "属性组", value = "属性组", required = true) + private Long attributeGroupId; + + + public static AsCategoryAttributeGroup categoryBuild(Long categoryInfoId, Long attributeGroupId) { + return AsCategoryAttributeGroup.builder() + .attributeGroupId(attributeGroupId) + .categoryId(categoryInfoId) + .build(); + } + + @Override + public Long getBaseId () { + return this.attributeGroupId; + } +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsCategoryBrand.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsCategoryBrand.java new file mode 100644 index 0000000..e40bb11 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsCategoryBrand.java @@ -0,0 +1,59 @@ +package com.muyu.product.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.product.domain.base.CategoryBase; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 品类品牌中间对象 as_category_brand + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("as_category_brand") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "AsCategoryBrand", description = "品类品牌中间") +public class AsCategoryBrand extends BaseEntity implements CategoryBase { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 品类id */ + @Excel(name = "品类id") + @ApiModelProperty(name = "品类id", value = "品类id", required = true) + private Long categoryId; + + /** 品牌id */ + @Excel(name = "品牌id") + @ApiModelProperty(name = "品牌id", value = "品牌id", required = true) + private Long brandId; + + public static AsCategoryBrand categoryBuild(Long categoryInfoId, Long brandId) { + return AsCategoryBrand.builder() + .brandId(brandId) + .categoryId(categoryInfoId) + .build(); + } + + @Override + public Long getBaseId () { + return this.brandId; + } +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsProductAttributeInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsProductAttributeInfo.java new file mode 100644 index 0000000..49f25a8 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsProductAttributeInfo.java @@ -0,0 +1,54 @@ +package com.muyu.product.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品属性对象 as_product_attribute_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("as_product_attribute_info") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "AsProductAttributeInfo", description = "商品属性") +public class AsProductAttributeInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 属性编号 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "属性编号", value = "属性编号") + private Long id; + + /** 商品 */ + @Excel(name = "商品") + @ApiModelProperty(name = "商品", value = "商品", required = true) + private Long productId; + + /** 属性 */ + @Excel(name = "属性") + @ApiModelProperty(name = "属性", value = "属性", required = true) + private Long attributeId; + + /** 属性值 */ + @Excel(name = "属性值") + @ApiModelProperty(name = "属性值", value = "属性值", required = true) + private String value; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/Attribute.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/Attribute.java index 3c4c7b0..692837f 100644 --- a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/Attribute.java +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/Attribute.java @@ -23,8 +23,8 @@ public class Attribute extends BaseEntity private String name; /** 分组 */ - @Excel(name = "分组") - private Long gruopId; + @Excel(name = "编码") + private Long code; public void setId(Long id) { @@ -44,14 +44,14 @@ public class Attribute extends BaseEntity { return name; } - public void setGruopId(Long gruopId) + public void setCode(Long code) { - this.gruopId = gruopId; + this.code = code; } - public Long getGruopId() + public Long getCode() { - return gruopId; + return code; } @Override @@ -59,7 +59,7 @@ public class Attribute extends BaseEntity return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("name", getName()) - .append("gruopId", getGruopId()) + .append("code", getCode()) .append("remark", getRemark()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AttributeGroup.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AttributeGroup.java index eb9319f..e9450e2 100644 --- a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AttributeGroup.java +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AttributeGroup.java @@ -1,70 +1,84 @@ package com.muyu.product.domain; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; import com.muyu.common.core.annotation.Excel; +import com.muyu.product.domain.req.AttributeGroupQueryReq; +import com.muyu.product.domain.req.AttributeGroupSaveReq; +import com.muyu.product.domain.req.AttributeGroupEditReq; import com.muyu.common.core.web.domain.BaseEntity; /** * 属性组对象 attribute_group * - * @author yuanjunzhe - * @date 2024-02-29 + * @author DongZeLiang + * @date 2024-02-27 */ -public class AttributeGroup extends BaseEntity -{ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("attribute_group") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "AttributeGroup", description = "属性组") +public class AttributeGroup extends BaseEntity { + private static final long serialVersionUID = 1L; - /** 主键 */ + /** 属性组编号 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "属性组编号", value = "属性组编号") private Long id; /** 组名称 */ @Excel(name = "组名称") + @ApiModelProperty(name = "组名称", value = "组名称", required = true) private String name; - /** 转态 */ - @Excel(name = "转态") - private String status; + /** 状态 */ + @Excel(name = "状态") + @ApiModelProperty(name = "状态", value = "状态", required = true) + private String states; - public void setId(Long id) - { - this.id = id; + + /** + * 查询构造器 + */ + public static AttributeGroup queryBuild( AttributeGroupQueryReq attributeGroupQueryReq){ + return AttributeGroup.builder() + .name(attributeGroupQueryReq.getName()) + .states(attributeGroupQueryReq.getStates()) + .build(); } - public Long getId() - { - return id; - } - public void setName(String name) - { - this.name = name; + /** + * 添加构造器 + */ + public static AttributeGroup saveBuild(AttributeGroupSaveReq attributeGroupSaveReq){ + return AttributeGroup.builder() + .name(attributeGroupSaveReq.getName()) + .states(attributeGroupSaveReq.getStates()) + .build(); } - public String getName() - { - return name; - } - public void setStatus(String status) - { - this.status = status; + /** + * 修改构造器 + */ + public static AttributeGroup editBuild(Long id, AttributeGroupEditReq attributeGroupEditReq){ + return AttributeGroup.builder() + .id(id) + .name(attributeGroupEditReq.getName()) + .states(attributeGroupEditReq.getStates()) + .build(); } - public String getStatus() - { - return status; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("name", getName()) - .append("status", getStatus()) - .append("remark", getRemark()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); - } } diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AttributeInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AttributeInfo.java new file mode 100644 index 0000000..2071ddc --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AttributeInfo.java @@ -0,0 +1,93 @@ +package com.muyu.product.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.product.domain.model.TemplateAttributeModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.product.domain.req.AttributeInfoQueryReq; +import com.muyu.product.domain.req.AttributeInfoSaveReq; +import com.muyu.product.domain.req.AttributeInfoEditReq; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品属性对象 attribute_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("attribute_info") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "AttributeInfo", description = "商品属性") +public class AttributeInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 属性编号 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "属性编号", value = "属性编号") + private Long id; + + /** 属性编码 */ + @Excel(name = "属性编码") + @ApiModelProperty(name = "属性编码", value = "属性编码", required = true) + private String code; + + /** 属性名 */ + @Excel(name = "属性名") + @ApiModelProperty(name = "属性名", value = "属性名", required = true) + private String name; + + + public TemplateAttributeModel buildTemplateModel(){ + return TemplateAttributeModel.builder() + .id(this.getId()) + .code(this.getCode()) + .name(this.getName()) + .build(); + } + + /** + * 查询构造器 + */ + public static AttributeInfo queryBuild( AttributeInfoQueryReq attributeInfoQueryReq){ + return AttributeInfo.builder() + .name(attributeInfoQueryReq.getName()) + .code(attributeInfoQueryReq.getCode()) + .build(); + } + + /** + * 添加构造器 + */ + public static AttributeInfo saveBuild(AttributeInfoSaveReq attributeInfoSaveReq){ + return AttributeInfo.builder() + .name(attributeInfoSaveReq.getName()) + .code(attributeInfoSaveReq.getCode()) + .build(); + } + + /** + * 修改构造器 + */ + public static AttributeInfo editBuild(Long id, AttributeInfoEditReq attributeInfoEditReq){ + return AttributeInfo.builder() + .id(id) + .name(attributeInfoEditReq.getName()) + .code(attributeInfoEditReq.getCode()) + .build(); + } + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/BrandInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/BrandInfo.java index 10ff9ee..d94d3af 100644 --- a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/BrandInfo.java +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/BrandInfo.java @@ -1,98 +1,113 @@ package com.muyu.product.domain; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; import com.muyu.common.core.annotation.Excel; +import com.muyu.product.domain.req.BrandInfoQueryReq; +import com.muyu.product.domain.req.BrandInfoSaveReq; +import com.muyu.product.domain.req.BrandInfoEditReq; import com.muyu.common.core.web.domain.BaseEntity; /** - * 商品品牌对象 brand_info + * 品牌信息对象 brand_info * - * @author yuanjunzhe - * @date 2024-02-29 + * @author DongZeLiang + * @date 2024-02-27 */ -public class BrandInfo extends BaseEntity -{ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("brand_info") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "BrandInfo", description = "品牌信息") +public class BrandInfo extends BaseEntity { + private static final long serialVersionUID = 1L; - /** 主键 */ + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") private Long id; - /** 品牌名称 */ + /** + * 品牌名称 + */ @Excel(name = "品牌名称") - private String name; + @ApiModelProperty(name = "品牌名称", value = "品牌名称", required = true) + private String nam; - /** logo */ - @Excel(name = "logo") + /** + * LOGO + */ + @Excel(name = "LOGO") + @ApiModelProperty(name = "LOGO", value = "LOGO", required = true) private String logo; - /** 介绍 */ + /** + * 是否启用 + */ + @Excel(name = "是否启用") + @ApiModelProperty(name = "是否启用", value = "是否启用", required = true) + private String start; + + /** + * 介绍 + */ @Excel(name = "介绍") + @ApiModelProperty(name = "介绍", value = "介绍") private String introduction; - /** 状态 */ - @Excel(name = "状态") - private String status; - - public void setId(Long id) - { - this.id = id; + /** + * 查询构造器 + */ + public static BrandInfo queryBuild(BrandInfoQueryReq brandInfoQueryReq) { + return BrandInfo.builder() + .nam(brandInfoQueryReq.getNam()) + .logo(brandInfoQueryReq.getLogo()) + .start(brandInfoQueryReq.getStart()) + .introduction(brandInfoQueryReq.getIntroduction()) + .build(); } - public Long getId() - { - return id; - } - public void setName(String name) - { - this.name = name; + /** + * 添加构造器 + */ + public static BrandInfo saveBuild(BrandInfoSaveReq brandInfoSaveReq) { + return BrandInfo.builder() + .nam(brandInfoSaveReq.getNam()) + .logo(brandInfoSaveReq.getLogo()) + .start(brandInfoSaveReq.getStart()) + .introduction(brandInfoSaveReq.getIntroduction()) + .remark(brandInfoSaveReq.getRemark()) + .build(); } - public String getName() - { - return name; - } - public void setLogo(String logo) - { - this.logo = logo; + /** + * 修改构造器 + */ + public static BrandInfo editBuild(Long id, BrandInfoEditReq brandInfoEditReq) { + return BrandInfo.builder() + .id(id) + .nam(brandInfoEditReq.getNam()) + .logo(brandInfoEditReq.getLogo()) + .start(brandInfoEditReq.getStart()) + .introduction(brandInfoEditReq.getIntroduction()) + .createBy(brandInfoEditReq.getCreateBy()) + .createTime(brandInfoEditReq.getCreateTime()) + .updateBy(brandInfoEditReq.getUpdateBy()) + .createTime(brandInfoEditReq.getCreateTime()) + .remark(brandInfoEditReq.getRemark()) + .build(); } - public String getLogo() - { - return logo; - } - public void setIntroduction(String introduction) - { - this.introduction = introduction; - } - - public String getIntroduction() - { - return introduction; - } - public void setStatus(String status) - { - this.status = status; - } - - public String getStatus() - { - return status; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("name", getName()) - .append("logo", getLogo()) - .append("introduction", getIntroduction()) - .append("status", getStatus()) - .append("remark", getRemark()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); - } } diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/CategoryInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/CategoryInfo.java index d663b2b..918b02c 100644 --- a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/CategoryInfo.java +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/CategoryInfo.java @@ -1,99 +1,116 @@ package com.muyu.product.domain; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.product.domain.model.CategoryInfoSaveModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; import com.muyu.common.core.annotation.Excel; +import com.muyu.product.domain.req.CategoryInfoQueryReq; +import com.muyu.product.domain.req.CategoryInfoSaveReq; +import com.muyu.product.domain.req.CategoryInfoEditReq; import com.muyu.common.core.web.domain.TreeEntity; +import java.util.Date; +import java.util.function.Function; +import java.util.function.Supplier; + /** * 品类信息对象 category_info * - * @author yuanjunzhe - * @date 2024-02-29 + * @author DongZeLiang + * @date 2024-02-27 */ -public class CategoryInfo extends TreeEntity -{ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("category_info") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "CategoryInfo", description = "品类信息") +public class CategoryInfo extends TreeEntity { + private static final long serialVersionUID = 1L; /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") private Long id; - /** 品类信息 */ - @Excel(name = "品类信息") + /** 品类名称 */ + @Excel(name = "品类名称") + @ApiModelProperty(name = "品类名称", value = "品类名称", required = true) private String name; /** 图片 */ @Excel(name = "图片") + @ApiModelProperty(name = "图片", value = "图片", required = true) private String image; /** 是否启用 */ @Excel(name = "是否启用") - private String status; + @ApiModelProperty(name = "是否启用", value = "是否启用", required = true) + private String start; /** 介绍 */ @Excel(name = "介绍") + @ApiModelProperty(name = "介绍", value = "介绍") private String introduction; - public void setId(Long id) - { - this.id = id; + /** + * 查询构造器 + */ + public static CategoryInfo queryBuild( CategoryInfoQueryReq categoryInfoQueryReq){ + return CategoryInfo.builder() + .name(categoryInfoQueryReq.getName()) + .image(categoryInfoQueryReq.getImage()) + .start(categoryInfoQueryReq.getStart()) + .introduction(categoryInfoQueryReq.getIntroduction()) + .build(); } - public Long getId() - { - return id; - } - public void setName(String name) - { - this.name = name; + /** + * 添加构造器 + */ + public static CategoryInfo saveBuild(CategoryInfoSaveReq categoryInfoSaveReq, Supplier supplier){ + return CategoryInfo.builder() + .name(categoryInfoSaveReq.getName()) + .image(categoryInfoSaveReq.getImage()) + .start(categoryInfoSaveReq.getStart()) + .introduction(categoryInfoSaveReq.getIntroduction()) + .parentId(categoryInfoSaveReq.getParentId()) + .createBy(supplier.get()) + .createTime(new Date()) + .build(); } - public String getName() - { - return name; - } - public void setImage(String image) - { - this.image = image; + /** + * 修改构造器 + */ + public static CategoryInfo editBuild(Long id, CategoryInfoEditReq categoryInfoEditReq){ + return CategoryInfo.builder() + .id(id) + .name(categoryInfoEditReq.getName()) + .image(categoryInfoEditReq.getImage()) + .start(categoryInfoEditReq.getStart()) + .introduction(categoryInfoEditReq.getIntroduction()) + .build(); } - public String getImage() - { - return image; - } - public void setStatus(String status) - { - this.status = status; - } - - public String getStatus() - { - return status; - } - public void setIntroduction(String introduction) - { - this.introduction = introduction; - } - - public String getIntroduction() - { - return introduction; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("name", getName()) - .append("image", getImage()) - .append("parentId", getParentId()) - .append("status", getStatus()) - .append("introduction", getIntroduction()) - .append("remark", getRemark()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); + public static CategoryInfo saveModelBuild(CategoryInfoSaveModel categoryInfoSaveModel) { + return CategoryInfo.builder() + .name(categoryInfoSaveModel.getName()) + .image(categoryInfoSaveModel.getImage()) + .start(categoryInfoSaveModel.getStart()) + .introduction(categoryInfoSaveModel.getIntroduction()) + .parentId(categoryInfoSaveModel.getParentId()) + .createBy(categoryInfoSaveModel.getCreateBy()) + .createTime(new Date()) + .build(); } } diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/CommentInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/CommentInfo.java new file mode 100644 index 0000000..1d31c59 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/CommentInfo.java @@ -0,0 +1,97 @@ +package com.muyu.product.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.product.domain.req.CommentInfoQueryReq; +import com.muyu.product.domain.req.CommentInfoSaveReq; +import com.muyu.product.domain.req.CommentInfoEditReq; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品评论对象 comment_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("comment_info") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "CommentInfo", description = "商品评论") +public class CommentInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 商品id */ + @Excel(name = "商品id") + @ApiModelProperty(name = "商品id", value = "商品id", required = true) + private Long projectId; + + /** 评论 */ + @Excel(name = "评论") + @ApiModelProperty(name = "评论", value = "评论") + private String comment; + + /** 图片 */ + @Excel(name = "图片") + @ApiModelProperty(name = "图片", value = "图片") + private String images; + + /** 父类id */ + @Excel(name = "父类id") + @ApiModelProperty(name = "父类id", value = "父类id") + private String parentId; + + /** + * 查询构造器 + */ + public static CommentInfo queryBuild( CommentInfoQueryReq commentInfoQueryReq){ + return CommentInfo.builder() + .projectId(commentInfoQueryReq.getProjectId()) + .comment(commentInfoQueryReq.getComment()) + .images(commentInfoQueryReq.getImages()) + .parentId(commentInfoQueryReq.getParentId()) + .build(); + } + + /** + * 添加构造器 + */ + public static CommentInfo saveBuild(CommentInfoSaveReq commentInfoSaveReq){ + return CommentInfo.builder() + .projectId(commentInfoSaveReq.getProjectId()) + .comment(commentInfoSaveReq.getComment()) + .images(commentInfoSaveReq.getImages()) + .parentId(commentInfoSaveReq.getParentId()) + .build(); + } + + /** + * 修改构造器 + */ + public static CommentInfo editBuild(Long id, CommentInfoEditReq commentInfoEditReq){ + return CommentInfo.builder() + .id(id) + .projectId(commentInfoEditReq.getProjectId()) + .comment(commentInfoEditReq.getComment()) + .images(commentInfoEditReq.getImages()) + .parentId(commentInfoEditReq.getParentId()) + .build(); + } + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/CommentLikeInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/CommentLikeInfo.java new file mode 100644 index 0000000..fb399de --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/CommentLikeInfo.java @@ -0,0 +1,81 @@ +package com.muyu.product.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.product.domain.req.CommentLikeInfoQueryReq; +import com.muyu.product.domain.req.CommentLikeInfoSaveReq; +import com.muyu.product.domain.req.CommentLikeInfoEditReq; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 评论点赞对象 comment_like_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("comment_like_info") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "CommentLikeInfo", description = "评论点赞") +public class CommentLikeInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 评论id */ + @Excel(name = "评论id") + @ApiModelProperty(name = "评论id", value = "评论id", required = true) + private Long commentId; + + /** 点赞人id */ + @Excel(name = "点赞人id") + @ApiModelProperty(name = "点赞人id", value = "点赞人id", required = true) + private Long userId; + + /** + * 查询构造器 + */ + public static CommentLikeInfo queryBuild( CommentLikeInfoQueryReq commentLikeInfoQueryReq){ + return CommentLikeInfo.builder() + .commentId(commentLikeInfoQueryReq.getCommentId()) + .userId(commentLikeInfoQueryReq.getUserId()) + .build(); + } + + /** + * 添加构造器 + */ + public static CommentLikeInfo saveBuild(CommentLikeInfoSaveReq commentLikeInfoSaveReq){ + return CommentLikeInfo.builder() + .commentId(commentLikeInfoSaveReq.getCommentId()) + .userId(commentLikeInfoSaveReq.getUserId()) + .build(); + } + + /** + * 修改构造器 + */ + public static CommentLikeInfo editBuild(Long id, CommentLikeInfoEditReq commentLikeInfoEditReq){ + return CommentLikeInfo.builder() + .id(id) + .commentId(commentLikeInfoEditReq.getCommentId()) + .userId(commentLikeInfoEditReq.getUserId()) + .build(); + } + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ProjectInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ProjectInfo.java new file mode 100644 index 0000000..2688652 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ProjectInfo.java @@ -0,0 +1,145 @@ +package com.muyu.product.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.product.domain.req.ProjectInfoQueryReq; +import com.muyu.product.domain.req.ProjectInfoSaveReq; +import com.muyu.product.domain.req.ProjectInfoEditReq; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品信息对象 project_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("project_info") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ProjectInfo", description = "商品信息") +public class ProjectInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 商品名称 */ + @Excel(name = "商品名称") + @ApiModelProperty(name = "商品名称", value = "商品名称") + private String name; + + /** 商品描述 */ + @Excel(name = "商品描述") + @ApiModelProperty(name = "商品描述", value = "商品描述") + private String introduction; + + /** 主类型 */ + @Excel(name = "主类型") + @ApiModelProperty(name = "主类型", value = "主类型") + private String mianType; + + /** 父类型 */ + @Excel(name = "父类型") + @ApiModelProperty(name = "父类型", value = "父类型") + private String parentType; + + /** 商品类型 */ + @Excel(name = "商品类型") + @ApiModelProperty(name = "商品类型", value = "商品类型") + private String type; + + /** 商品图片 */ + @Excel(name = "商品图片") + @ApiModelProperty(name = "商品图片", value = "商品图片") + private String image; + + /** 商品轮播图 */ + @Excel(name = "商品轮播图") + @ApiModelProperty(name = "商品轮播图", value = "商品轮播图") + private String carouselImages; + + /** 商品状态 */ + @Excel(name = "商品状态") + @ApiModelProperty(name = "商品状态", value = "商品状态") + private String status; + + /** 规格 */ + @Excel(name = "规格") + @ApiModelProperty(name = "规格", value = "规格") + private Long ruleId; + + /** 品牌 */ + @Excel(name = "品牌") + @ApiModelProperty(name = "品牌", value = "品牌") + private Long brandId; + + /** + * 查询构造器 + */ + public static ProjectInfo queryBuild( ProjectInfoQueryReq projectInfoQueryReq){ + return ProjectInfo.builder() + .name(projectInfoQueryReq.getName()) + .introduction(projectInfoQueryReq.getIntroduction()) + .mianType(projectInfoQueryReq.getMianType()) + .parentType(projectInfoQueryReq.getParentType()) + .type(projectInfoQueryReq.getType()) + .image(projectInfoQueryReq.getImage()) + .carouselImages(projectInfoQueryReq.getCarouselImages()) + .status(projectInfoQueryReq.getStatus()) + .ruleId(projectInfoQueryReq.getRuleId()) + .brandId(projectInfoQueryReq.getBrandId()) + .build(); + } + + /** + * 添加构造器 + */ + public static ProjectInfo saveBuild(ProjectInfoSaveReq projectInfoSaveReq){ + return ProjectInfo.builder() + .name(projectInfoSaveReq.getName()) + .introduction(projectInfoSaveReq.getIntroduction()) + .mianType(projectInfoSaveReq.getMianType()) + .parentType(projectInfoSaveReq.getParentType()) + .type(projectInfoSaveReq.getType()) + .image(projectInfoSaveReq.getImage()) + .carouselImages(projectInfoSaveReq.getCarouselImages()) + .status(projectInfoSaveReq.getStatus()) + .ruleId(projectInfoSaveReq.getRuleId()) + .brandId(projectInfoSaveReq.getBrandId()) + .build(); + } + + /** + * 修改构造器 + */ + public static ProjectInfo editBuild(Long id, ProjectInfoEditReq projectInfoEditReq){ + return ProjectInfo.builder() + .id(id) + .name(projectInfoEditReq.getName()) + .introduction(projectInfoEditReq.getIntroduction()) + .mianType(projectInfoEditReq.getMianType()) + .parentType(projectInfoEditReq.getParentType()) + .type(projectInfoEditReq.getType()) + .image(projectInfoEditReq.getImage()) + .carouselImages(projectInfoEditReq.getCarouselImages()) + .status(projectInfoEditReq.getStatus()) + .ruleId(projectInfoEditReq.getRuleId()) + .brandId(projectInfoEditReq.getBrandId()) + .build(); + } + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ProjectSkuInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ProjectSkuInfo.java new file mode 100644 index 0000000..3ea0dcb --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ProjectSkuInfo.java @@ -0,0 +1,106 @@ +package com.muyu.product.domain; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.product.domain.req.ProjectSkuInfoQueryReq; +import com.muyu.product.domain.req.ProjectSkuInfoSaveReq; +import com.muyu.product.domain.req.ProjectSkuInfoEditReq; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品SKU对象 project_sku_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("project_sku_info") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ProjectSkuInfo", description = "商品SKU") +public class ProjectSkuInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 商品id */ + @Excel(name = "商品id") + @ApiModelProperty(name = "商品id", value = "商品id", required = true) + private Long projectId; + + /** sku */ + @Excel(name = "sku") + @ApiModelProperty(name = "sku", value = "sku", required = true) + private String sku; + + /** 商品库存 */ + @Excel(name = "商品库存") + @ApiModelProperty(name = "商品库存", value = "商品库存", required = true) + private Long stock; + + /** 商品价格 */ + @Excel(name = "商品价格") + @ApiModelProperty(name = "商品价格", value = "商品价格", required = true) + private BigDecimal price; + + /** 规格图片 */ + @Excel(name = "规格图片") + @ApiModelProperty(name = "规格图片", value = "规格图片", required = true) + private String image; + + /** + * 查询构造器 + */ + public static ProjectSkuInfo queryBuild( ProjectSkuInfoQueryReq projectSkuInfoQueryReq){ + return ProjectSkuInfo.builder() + .projectId(projectSkuInfoQueryReq.getProjectId()) + .sku(projectSkuInfoQueryReq.getSku()) + .stock(projectSkuInfoQueryReq.getStock()) + .price(projectSkuInfoQueryReq.getPrice()) + .image(projectSkuInfoQueryReq.getImage()) + .build(); + } + + /** + * 添加构造器 + */ + public static ProjectSkuInfo saveBuild(ProjectSkuInfoSaveReq projectSkuInfoSaveReq){ + return ProjectSkuInfo.builder() + .projectId(projectSkuInfoSaveReq.getProjectId()) + .sku(projectSkuInfoSaveReq.getSku()) + .stock(projectSkuInfoSaveReq.getStock()) + .price(projectSkuInfoSaveReq.getPrice()) + .image(projectSkuInfoSaveReq.getImage()) + .build(); + } + + /** + * 修改构造器 + */ + public static ProjectSkuInfo editBuild(Long id, ProjectSkuInfoEditReq projectSkuInfoEditReq){ + return ProjectSkuInfo.builder() + .id(id) + .projectId(projectSkuInfoEditReq.getProjectId()) + .sku(projectSkuInfoEditReq.getSku()) + .stock(projectSkuInfoEditReq.getStock()) + .price(projectSkuInfoEditReq.getPrice()) + .image(projectSkuInfoEditReq.getImage()) + .build(); + } + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/RuleAttrInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/RuleAttrInfo.java new file mode 100644 index 0000000..131611e --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/RuleAttrInfo.java @@ -0,0 +1,102 @@ +package com.muyu.product.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.product.domain.model.RuleAttrAddModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.product.domain.req.RuleAttrInfoQueryReq; +import com.muyu.product.domain.req.RuleAttrInfoSaveReq; +import com.muyu.product.domain.req.RuleAttrInfoEditReq; +import com.muyu.common.core.web.domain.BaseEntity; + +import java.util.Date; +import java.util.function.Supplier; + +/** + * 规格详情对象 rule_attr_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("rule_attr_info") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "RuleAttrInfo", description = "规格详情") +public class RuleAttrInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 规格id */ + @Excel(name = "规格id") + @ApiModelProperty(name = "规格id", value = "规格id", required = true) + private Long ruleId; + + /** 类目名称 */ + @Excel(name = "类目名称") + @ApiModelProperty(name = "类目名称", value = "类目名称") + private String name; + + /** 规格值 */ + @Excel(name = "规格值") + @ApiModelProperty(name = "规格值", value = "规格值") + private String attrValue; + + /** + * 查询构造器 + */ + public static RuleAttrInfo queryBuild( RuleAttrInfoQueryReq ruleAttrInfoQueryReq){ + return RuleAttrInfo.builder() + .ruleId(ruleAttrInfoQueryReq.getRuleId()) + .name(ruleAttrInfoQueryReq.getName()) + .attrValue(ruleAttrInfoQueryReq.getAttrValue()) + .build(); + } + + /** + * 添加构造器 + */ + public static RuleAttrInfo saveBuild(RuleAttrInfoSaveReq ruleAttrInfoSaveReq){ + return RuleAttrInfo.builder() + .ruleId(ruleAttrInfoSaveReq.getRuleId()) + .name(ruleAttrInfoSaveReq.getName()) + .attrValue(ruleAttrInfoSaveReq.getAttrValue()) + .build(); + } + + /** + * 修改构造器 + */ + public static RuleAttrInfo editBuild(Long id, RuleAttrInfoEditReq ruleAttrInfoEditReq){ + return RuleAttrInfo.builder() + .id(id) + .ruleId(ruleAttrInfoEditReq.getRuleId()) + .name(ruleAttrInfoEditReq.getName()) + .attrValue(ruleAttrInfoEditReq.getAttrValue()) + .build(); + } + + public static RuleAttrInfo addModelBuild (RuleAttrAddModel ruleAttrAddModel, Supplier ruleId, Supplier createBy) { + return RuleAttrInfo.builder() + .ruleId(ruleId.get()) + .name(ruleAttrAddModel.getName()) + .attrValue(String.join(",", ruleAttrAddModel.getValueList())) + .createBy(createBy.get()) + .createTime(new Date()) + .build(); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/RuleInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/RuleInfo.java new file mode 100644 index 0000000..454cbad --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/RuleInfo.java @@ -0,0 +1,99 @@ +package com.muyu.product.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.product.domain.model.RuleInfoAddModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.product.domain.req.RuleInfoQueryReq; +import com.muyu.product.domain.req.RuleInfoSaveReq; +import com.muyu.product.domain.req.RuleInfoEditReq; +import com.muyu.common.core.web.domain.BaseEntity; + +import java.util.Date; +import java.util.function.Supplier; + +/** + * 商品规格对象 rule_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("rule_info") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "RuleInfo", description = "商品规格") +public class RuleInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 规格名称 */ + @Excel(name = "规格名称") + @ApiModelProperty(name = "规格名称", value = "规格名称") + private String name; + + /** 规格状态 */ + @Excel(name = "规格状态") + @ApiModelProperty(name = "规格状态", value = "规格状态") + private String status; + + /** + * 查询构造器 + */ + public static RuleInfo queryBuild( RuleInfoQueryReq ruleInfoQueryReq){ + return RuleInfo.builder() + .name(ruleInfoQueryReq.getName()) + .status(ruleInfoQueryReq.getStatus()) + .build(); + } + + /** + * 添加构造器 + */ + public static RuleInfo saveBuild(RuleInfoSaveReq ruleInfoSaveReq){ + return RuleInfo.builder() + .name(ruleInfoSaveReq.getName()) + .status(ruleInfoSaveReq.getStatus()) + .build(); + } + + /** + * 修改构造器 + */ + public static RuleInfo editBuild(Long id, RuleInfoEditReq ruleInfoEditReq){ + return RuleInfo.builder() + .id(id) + .name(ruleInfoEditReq.getName()) + .status(ruleInfoEditReq.getStatus()) + .build(); + } + + /** + * + * @param ruleInfoAddModel 添加模型 + * @param createBy 创建者 + * @return 规格对象 + */ + public static RuleInfo addModelBuild (RuleInfoAddModel ruleInfoAddModel, Supplier createBy) { + return RuleInfo.builder() + .name(ruleInfoAddModel.getName()) + .status(ruleInfoAddModel.getStatus()) + .createBy(createBy.get()) + .createTime(new Date()) + .build(); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/base/CategoryBase.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/base/CategoryBase.java new file mode 100644 index 0000000..ae3b33c --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/base/CategoryBase.java @@ -0,0 +1,11 @@ +package com.muyu.product.domain.base; + +/** + * @author DongZl + * @description: attribute基础方法 + * @Date 2024-3-1 下午 02:28 + */ +public interface CategoryBase { + + public Long getBaseId(); +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/AttributeGroupSaveModel.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/AttributeGroupSaveModel.java new file mode 100644 index 0000000..eecfb3f --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/AttributeGroupSaveModel.java @@ -0,0 +1,55 @@ +package com.muyu.product.domain.model; + +import com.muyu.common.core.web.domain.BaseEntity; +import com.muyu.product.domain.AttributeGroup; +import com.muyu.product.domain.req.AttributeGroupSaveReq; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.List; + + + +/** + * @author DongZl + * @description: 属性组添加模型 + * @Date 2024-2-28 下午 03:16 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class AttributeGroupSaveModel extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 组名称 */ + private String name; + + /** 状态 */ + private String states; + + /** + * 属性ID集合 + */ + private List attributeIdList; + + public static AttributeGroupSaveModel saveReqBuild (AttributeGroupSaveReq req){ + return AttributeGroupSaveModel.builder() + .name(req.getName()) + .states(req.getStates()) + .attributeIdList(req.getAttributeIdList()) + .build(); + } + + public AttributeGroup buildAttributeGroup () { + return AttributeGroup.builder() + .name(this.getName()) + .states(this.getStates()) + .build(); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/CategoryInfoSaveModel.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/CategoryInfoSaveModel.java new file mode 100644 index 0000000..8a77303 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/CategoryInfoSaveModel.java @@ -0,0 +1,78 @@ +package com.muyu.product.domain.model; + +import com.muyu.common.core.web.domain.TreeEntity; +import com.muyu.product.domain.CategoryInfo; +import com.muyu.product.domain.req.CategoryInfoSaveReq; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.Date; +import java.util.List; +import java.util.function.Supplier; + +/** + * 品类信息对象 category_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class CategoryInfoSaveModel extends TreeEntity { + + private static final long serialVersionUID = 1L; + + + /** 品类名称 */ + private String name; + + /** 图片 */ + private String image; + + /** 是否启用 */ + private String start; + + /** 介绍 */ + private String introduction; + + /** + * 商品属性组关联ID + */ + private List attributeGroupIdList; + /** + * 商品属性关联ID + */ + private List attributeIdList; + + /** + * 商品品牌组关联ID + */ + private List brandIdList; + + /** + * 添加构造器 + */ + public static CategoryInfoSaveModel saveBuild(CategoryInfoSaveReq categoryInfoSaveReq, Supplier supplier){ + return CategoryInfoSaveModel.builder() + .name(categoryInfoSaveReq.getName()) + .image(categoryInfoSaveReq.getImage()) + .start(categoryInfoSaveReq.getStart()) + .introduction(categoryInfoSaveReq.getIntroduction()) + .parentId(categoryInfoSaveReq.getParentId()) + .attributeGroupIdList(categoryInfoSaveReq.getAttributeGroupIdList()) + .attributeIdList(categoryInfoSaveReq.getAttributeIdList()) + .brandIdList(categoryInfoSaveReq.getBrandIdList()) + .createBy(supplier.get()) + .createTime(new Date()) + .build(); + } + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/RuleAttrAddModel.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/RuleAttrAddModel.java new file mode 100644 index 0000000..e293352 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/RuleAttrAddModel.java @@ -0,0 +1,44 @@ +package com.muyu.product.domain.model; + +import com.muyu.common.core.web.domain.BaseEntity; +import com.muyu.product.domain.RuleAttrInfo; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.Arrays; +import java.util.List; + + +/** + * @author DongZl + * @description: 规格属性,添加模型 + * @Date 2024-3-4 下午 02:28 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class RuleAttrAddModel extends BaseEntity { + + /** + * 规格属性名称 + */ + private String name; + + /** + * 规格属性值集合 + */ + private List valueList; + + public static RuleAttrAddModel infoBuild (RuleAttrInfo ruleAttrInfo) { + return RuleAttrAddModel.builder() + .name(ruleAttrInfo.getName()) + .valueList(Arrays.stream(ruleAttrInfo.getAttrValue().split(",")).toList()) + .build(); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/RuleInfoAddModel.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/RuleInfoAddModel.java new file mode 100644 index 0000000..d2742b3 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/RuleInfoAddModel.java @@ -0,0 +1,44 @@ +package com.muyu.product.domain.model; + +import com.muyu.common.core.web.domain.BaseEntity; +import com.muyu.product.domain.req.RuleInfoSaveReq; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.List; + +/** + * @author DongZl + * @description: 规格保存模型 + * @Date 2024-3-4 下午 02:33 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class RuleInfoAddModel extends BaseEntity { + + /** 规格名称 */ + private String name; + + /** 规格状态 */ + private String status; + + /** + * 规格属性集合 + */ + private List ruleAttrList; + + public static RuleInfoAddModel saveReqBuild(RuleInfoSaveReq req){ + return RuleInfoAddModel.builder() + .name(req.getName()) + .status(req.getStatus()) + .ruleAttrList(req.getRuleAttrList()) + .build(); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/TemplateAttributeGroupModel.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/TemplateAttributeGroupModel.java new file mode 100644 index 0000000..3258cc8 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/TemplateAttributeGroupModel.java @@ -0,0 +1,60 @@ +package com.muyu.product.domain.model; + +import com.muyu.common.core.utils.StringUtils; +import com.muyu.common.core.web.domain.BaseEntity; +import com.muyu.product.domain.AttributeGroup; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.List; +import java.util.function.Function; +import java.util.function.Supplier; + +/** + * @author DongZl + * @description: 共有属性组 + * @Date 2024-3-6 下午 02:29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class TemplateAttributeGroupModel extends BaseEntity { + + /** + * 组名称 + */ + private String groupName; + + /** + * 属性组下属性集合 + */ + private List attributeList; + + /** + * 是否有效 + * @return + */ + public boolean isEffective(){ + return StringUtils.isNotEmpty(groupName) && attributeList != null && !attributeList.isEmpty(); + } + + /** + * + * @param attributeGroup + * @param attributeList + * @return + */ + public static TemplateAttributeGroupModel attributeGroupBuild(AttributeGroup attributeGroup, + Function> attributeList){ + return TemplateAttributeGroupModel.builder() + .groupName(attributeGroup.getName()) + .attributeList(attributeList.apply(attributeGroup.getId())) + .build(); + + } +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/TemplateAttributeModel.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/TemplateAttributeModel.java new file mode 100644 index 0000000..8cbeb02 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/TemplateAttributeModel.java @@ -0,0 +1,36 @@ +package com.muyu.product.domain.model; + +import com.muyu.common.core.web.domain.BaseEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * @author DongZl + * @description: 共有属性 + * @Date 2024-3-6 下午 02:30 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class TemplateAttributeModel extends BaseEntity { + + /** + * 主键 + */ + private Long id; + + /** + * 属性名称 + */ + private String name; + + /** + * 编码 + */ + private String code; +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeGroupEditReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeGroupEditReq.java new file mode 100644 index 0000000..35a1b47 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeGroupEditReq.java @@ -0,0 +1,37 @@ +package com.muyu.product.domain.req; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 属性组对象 attribute_group + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "AttributeGroupEditReq", description = "属性组") +public class AttributeGroupEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 组名称 */ + @ApiModelProperty(name = "组名称", value = "组名称", required = true) + private String name; + + /** 状态 */ + @ApiModelProperty(name = "状态", value = "状态", required = true) + private String states; + + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeGroupQueryReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeGroupQueryReq.java new file mode 100644 index 0000000..4a85156 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeGroupQueryReq.java @@ -0,0 +1,36 @@ +package com.muyu.product.domain.req; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 属性组对象 attribute_group + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "AttributeGroupQueryReq", description = "属性组") +public class AttributeGroupQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 组名称 */ + @ApiModelProperty(name = "组名称", value = "组名称") + private String name; + + /** 状态 */ + @ApiModelProperty(name = "状态", value = "状态") + private String states; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeGroupSaveReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeGroupSaveReq.java new file mode 100644 index 0000000..609dbab --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeGroupSaveReq.java @@ -0,0 +1,48 @@ +package com.muyu.product.domain.req; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 属性组对象 attribute_group + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "AttributeGroupSaveReq", description = "属性组") +public class AttributeGroupSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 属性组编号 */ + @ApiModelProperty(name = "属性组编号", value = "属性组编号") + private Long id; + + /** 组名称 */ + @ApiModelProperty(name = "组名称", value = "组名称", required = true) + private String name; + + /** 状态 */ + @ApiModelProperty(name = "状态", value = "状态", required = true) + private String states; + + /** + * 属性ID集合 + */ + @ApiModelProperty(name = "属性ID集合", value = "属性ID集合", required = true) + private List attributeIdList; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeInfoEditReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeInfoEditReq.java new file mode 100644 index 0000000..20d95cd --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeInfoEditReq.java @@ -0,0 +1,40 @@ +package com.muyu.product.domain.req; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品属性对象 attribute_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "AttributeInfoEditReq", description = "商品属性") +public class AttributeInfoEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 属性名 */ + @ApiModelProperty(name = "属性名", value = "属性名", required = true) + private String name; + + /** 分组 */ + @ApiModelProperty(name = "分组", value = "分组") + private Long groupId; + + @ApiModelProperty(name = "属性编码", value = "属性编码") + private String code; + + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeInfoQueryReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeInfoQueryReq.java new file mode 100644 index 0000000..aba8144 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeInfoQueryReq.java @@ -0,0 +1,36 @@ +package com.muyu.product.domain.req; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品属性对象 attribute_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "AttributeInfoQueryReq", description = "商品属性") +public class AttributeInfoQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 属性名 */ + @ApiModelProperty(name = "属性名", value = "属性名") + private String name; + + @ApiModelProperty(name = "属性编码", value = "属性编码") + private String code; + + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeInfoSaveReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeInfoSaveReq.java new file mode 100644 index 0000000..893ddba --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/AttributeInfoSaveReq.java @@ -0,0 +1,41 @@ +package com.muyu.product.domain.req; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品属性对象 attribute_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "AttributeInfoSaveReq", description = "商品属性") +public class AttributeInfoSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 属性编号 */ + + @ApiModelProperty(name = "属性编号", value = "属性编号") + private Long id; + + /** 属性名 */ + + @ApiModelProperty(name = "属性名", value = "属性名", required = true) + private String name; + + @ApiModelProperty(name = "属性编码", value = "属性编码") + private String code; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/BrandInfoEditReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/BrandInfoEditReq.java new file mode 100644 index 0000000..b9b6c4d --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/BrandInfoEditReq.java @@ -0,0 +1,42 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 品牌信息对象 brand_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "BrandInfoEditReq", description = "品牌信息") +public class BrandInfoEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 品牌名称 */ + @ApiModelProperty(name = "品牌名称", value = "品牌名称", required = true) + private String nam; + + /** LOGO */ + @ApiModelProperty(name = "LOGO", value = "LOGO", required = true) + private String logo; + + /** 是否启用 */ + @ApiModelProperty(name = "是否启用", value = "是否启用", required = true) + private String start; + + /** 介绍 */ + @ApiModelProperty(name = "介绍", value = "介绍") + private String introduction; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/BrandInfoQueryReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/BrandInfoQueryReq.java new file mode 100644 index 0000000..5c17d05 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/BrandInfoQueryReq.java @@ -0,0 +1,42 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 品牌信息对象 brand_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "BrandInfoQueryReq", description = "品牌信息") +public class BrandInfoQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 品牌名称 */ + @ApiModelProperty(name = "品牌名称", value = "品牌名称") + private String nam; + + /** LOGO */ + @ApiModelProperty(name = "LOGO", value = "LOGO") + private String logo; + + /** 是否启用 */ + @ApiModelProperty(name = "是否启用", value = "是否启用") + private String start; + + /** 介绍 */ + @ApiModelProperty(name = "介绍", value = "介绍") + private String introduction; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/BrandInfoSaveReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/BrandInfoSaveReq.java new file mode 100644 index 0000000..15d7c84 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/BrandInfoSaveReq.java @@ -0,0 +1,51 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 品牌信息对象 brand_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "BrandInfoSaveReq", description = "品牌信息") +public class BrandInfoSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 品牌名称 */ + + @ApiModelProperty(name = "品牌名称", value = "品牌名称", required = true) + private String nam; + + /** LOGO */ + + @ApiModelProperty(name = "LOGO", value = "LOGO", required = true) + private String logo; + + /** 是否启用 */ + + @ApiModelProperty(name = "是否启用", value = "是否启用", required = true) + private String start; + + /** 介绍 */ + + @ApiModelProperty(name = "介绍", value = "介绍") + private String introduction; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CategoryInfoEditReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CategoryInfoEditReq.java new file mode 100644 index 0000000..023446a --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CategoryInfoEditReq.java @@ -0,0 +1,42 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.TreeEntity; + +/** + * 品类信息对象 category_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "CategoryInfoEditReq", description = "品类信息") +public class CategoryInfoEditReq extends TreeEntity { + + private static final long serialVersionUID = 1L; + + /** 品类名称 */ + @ApiModelProperty(name = "品类名称", value = "品类名称", required = true) + private String name; + + /** 图片 */ + @ApiModelProperty(name = "图片", value = "图片", required = true) + private String image; + + /** 是否启用 */ + @ApiModelProperty(name = "是否启用", value = "是否启用", required = true) + private String start; + + /** 介绍 */ + @ApiModelProperty(name = "介绍", value = "介绍") + private String introduction; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CategoryInfoQueryReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CategoryInfoQueryReq.java new file mode 100644 index 0000000..fcfbd47 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CategoryInfoQueryReq.java @@ -0,0 +1,42 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.TreeEntity; + +/** + * 品类信息对象 category_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "CategoryInfoQueryReq", description = "品类信息") +public class CategoryInfoQueryReq extends TreeEntity { + + private static final long serialVersionUID = 1L; + + /** 品类名称 */ + @ApiModelProperty(name = "品类名称", value = "品类名称") + private String name; + + /** 图片 */ + @ApiModelProperty(name = "图片", value = "图片") + private String image; + + /** 是否启用 */ + @ApiModelProperty(name = "是否启用", value = "是否启用") + private String start; + + /** 介绍 */ + @ApiModelProperty(name = "介绍", value = "介绍") + private String introduction; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CategoryInfoSaveReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CategoryInfoSaveReq.java new file mode 100644 index 0000000..f65452b --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CategoryInfoSaveReq.java @@ -0,0 +1,67 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.TreeEntity; + +import java.util.List; + +/** + * 品类信息对象 category_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "CategoryInfoSaveReq", description = "品类信息") +public class CategoryInfoSaveReq extends TreeEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 品类名称 */ + + @ApiModelProperty(name = "品类名称", value = "品类名称", required = true) + private String name; + + /** 图片 */ + + @ApiModelProperty(name = "图片", value = "图片", required = true) + private String image; + + /** 是否启用 */ + + @ApiModelProperty(name = "是否启用", value = "是否启用", required = true) + private String start; + + /** 介绍 */ + + @ApiModelProperty(name = "介绍", value = "介绍") + private String introduction; + + /** + * 商品属性组关联ID + */ + private List attributeGroupIdList; + /** + * 商品属性关联ID + */ + private List attributeIdList; + + /** + * 商品品牌组关联ID + */ + private List brandIdList; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentInfoEditReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentInfoEditReq.java new file mode 100644 index 0000000..58069f0 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentInfoEditReq.java @@ -0,0 +1,42 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品评论对象 comment_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "CommentInfoEditReq", description = "商品评论") +public class CommentInfoEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 商品id */ + @ApiModelProperty(name = "商品id", value = "商品id", required = true) + private Long projectId; + + /** 评论 */ + @ApiModelProperty(name = "评论", value = "评论") + private String comment; + + /** 图片 */ + @ApiModelProperty(name = "图片", value = "图片") + private String images; + + /** 父类id */ + @ApiModelProperty(name = "父类id", value = "父类id") + private String parentId; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentInfoQueryReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentInfoQueryReq.java new file mode 100644 index 0000000..885abe8 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentInfoQueryReq.java @@ -0,0 +1,42 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品评论对象 comment_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "CommentInfoQueryReq", description = "商品评论") +public class CommentInfoQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 商品id */ + @ApiModelProperty(name = "商品id", value = "商品id") + private Long projectId; + + /** 评论 */ + @ApiModelProperty(name = "评论", value = "评论") + private String comment; + + /** 图片 */ + @ApiModelProperty(name = "图片", value = "图片") + private String images; + + /** 父类id */ + @ApiModelProperty(name = "父类id", value = "父类id") + private String parentId; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentInfoSaveReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentInfoSaveReq.java new file mode 100644 index 0000000..a547ded --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentInfoSaveReq.java @@ -0,0 +1,51 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品评论对象 comment_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "CommentInfoSaveReq", description = "商品评论") +public class CommentInfoSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 商品id */ + + @ApiModelProperty(name = "商品id", value = "商品id", required = true) + private Long projectId; + + /** 评论 */ + + @ApiModelProperty(name = "评论", value = "评论") + private String comment; + + /** 图片 */ + + @ApiModelProperty(name = "图片", value = "图片") + private String images; + + /** 父类id */ + + @ApiModelProperty(name = "父类id", value = "父类id") + private String parentId; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentLikeInfoEditReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentLikeInfoEditReq.java new file mode 100644 index 0000000..854308b --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentLikeInfoEditReq.java @@ -0,0 +1,34 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 评论点赞对象 comment_like_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "CommentLikeInfoEditReq", description = "评论点赞") +public class CommentLikeInfoEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 评论id */ + @ApiModelProperty(name = "评论id", value = "评论id", required = true) + private Long commentId; + + /** 点赞人id */ + @ApiModelProperty(name = "点赞人id", value = "点赞人id", required = true) + private Long userId; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentLikeInfoQueryReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentLikeInfoQueryReq.java new file mode 100644 index 0000000..25737d6 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentLikeInfoQueryReq.java @@ -0,0 +1,34 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 评论点赞对象 comment_like_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "CommentLikeInfoQueryReq", description = "评论点赞") +public class CommentLikeInfoQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 评论id */ + @ApiModelProperty(name = "评论id", value = "评论id") + private Long commentId; + + /** 点赞人id */ + @ApiModelProperty(name = "点赞人id", value = "点赞人id") + private Long userId; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentLikeInfoSaveReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentLikeInfoSaveReq.java new file mode 100644 index 0000000..89396ef --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/CommentLikeInfoSaveReq.java @@ -0,0 +1,41 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 评论点赞对象 comment_like_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "CommentLikeInfoSaveReq", description = "评论点赞") +public class CommentLikeInfoSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 评论id */ + + @ApiModelProperty(name = "评论id", value = "评论id", required = true) + private Long commentId; + + /** 点赞人id */ + + @ApiModelProperty(name = "点赞人id", value = "点赞人id", required = true) + private Long userId; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoEditReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoEditReq.java new file mode 100644 index 0000000..f6dc539 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoEditReq.java @@ -0,0 +1,66 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品信息对象 project_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "ProjectInfoEditReq", description = "商品信息") +public class ProjectInfoEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 商品名称 */ + @ApiModelProperty(name = "商品名称", value = "商品名称") + private String name; + + /** 商品描述 */ + @ApiModelProperty(name = "商品描述", value = "商品描述") + private String introduction; + + /** 主类型 */ + @ApiModelProperty(name = "主类型", value = "主类型") + private String mianType; + + /** 父类型 */ + @ApiModelProperty(name = "父类型", value = "父类型") + private String parentType; + + /** 商品类型 */ + @ApiModelProperty(name = "商品类型", value = "商品类型") + private String type; + + /** 商品图片 */ + @ApiModelProperty(name = "商品图片", value = "商品图片") + private String image; + + /** 商品轮播图 */ + @ApiModelProperty(name = "商品轮播图", value = "商品轮播图") + private String carouselImages; + + /** 商品状态 */ + @ApiModelProperty(name = "商品状态", value = "商品状态") + private String status; + + /** 规格 */ + @ApiModelProperty(name = "规格", value = "规格") + private Long ruleId; + + /** 品牌 */ + @ApiModelProperty(name = "品牌", value = "品牌") + private Long brandId; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoQueryReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoQueryReq.java new file mode 100644 index 0000000..72f5185 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoQueryReq.java @@ -0,0 +1,66 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品信息对象 project_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "ProjectInfoQueryReq", description = "商品信息") +public class ProjectInfoQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 商品名称 */ + @ApiModelProperty(name = "商品名称", value = "商品名称") + private String name; + + /** 商品描述 */ + @ApiModelProperty(name = "商品描述", value = "商品描述") + private String introduction; + + /** 主类型 */ + @ApiModelProperty(name = "主类型", value = "主类型") + private String mianType; + + /** 父类型 */ + @ApiModelProperty(name = "父类型", value = "父类型") + private String parentType; + + /** 商品类型 */ + @ApiModelProperty(name = "商品类型", value = "商品类型") + private String type; + + /** 商品图片 */ + @ApiModelProperty(name = "商品图片", value = "商品图片") + private String image; + + /** 商品轮播图 */ + @ApiModelProperty(name = "商品轮播图", value = "商品轮播图") + private String carouselImages; + + /** 商品状态 */ + @ApiModelProperty(name = "商品状态", value = "商品状态") + private String status; + + /** 规格 */ + @ApiModelProperty(name = "规格", value = "规格") + private Long ruleId; + + /** 品牌 */ + @ApiModelProperty(name = "品牌", value = "品牌") + private Long brandId; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoSaveReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoSaveReq.java new file mode 100644 index 0000000..8907e6d --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoSaveReq.java @@ -0,0 +1,81 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品信息对象 project_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "ProjectInfoSaveReq", description = "商品信息") +public class ProjectInfoSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 商品名称 */ + + @ApiModelProperty(name = "商品名称", value = "商品名称") + private String name; + + /** 商品描述 */ + + @ApiModelProperty(name = "商品描述", value = "商品描述") + private String introduction; + + /** 主类型 */ + + @ApiModelProperty(name = "主类型", value = "主类型") + private String mianType; + + /** 父类型 */ + + @ApiModelProperty(name = "父类型", value = "父类型") + private String parentType; + + /** 商品类型 */ + + @ApiModelProperty(name = "商品类型", value = "商品类型") + private String type; + + /** 商品图片 */ + + @ApiModelProperty(name = "商品图片", value = "商品图片") + private String image; + + /** 商品轮播图 */ + + @ApiModelProperty(name = "商品轮播图", value = "商品轮播图") + private String carouselImages; + + /** 商品状态 */ + + @ApiModelProperty(name = "商品状态", value = "商品状态") + private String status; + + /** 规格 */ + + @ApiModelProperty(name = "规格", value = "规格") + private Long ruleId; + + /** 品牌 */ + + @ApiModelProperty(name = "品牌", value = "品牌") + private Long brandId; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectSkuInfoEditReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectSkuInfoEditReq.java new file mode 100644 index 0000000..e28d898 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectSkuInfoEditReq.java @@ -0,0 +1,47 @@ +package com.muyu.product.domain.req; + +import java.math.BigDecimal; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品SKU对象 project_sku_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "ProjectSkuInfoEditReq", description = "商品SKU") +public class ProjectSkuInfoEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 商品id */ + @ApiModelProperty(name = "商品id", value = "商品id", required = true) + private Long projectId; + + /** sku */ + @ApiModelProperty(name = "sku", value = "sku", required = true) + private String sku; + + /** 商品库存 */ + @ApiModelProperty(name = "商品库存", value = "商品库存", required = true) + private Long stock; + + /** 商品价格 */ + @ApiModelProperty(name = "商品价格", value = "商品价格", required = true) + private BigDecimal price; + + /** 规格图片 */ + @ApiModelProperty(name = "规格图片", value = "规格图片", required = true) + private String image; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectSkuInfoQueryReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectSkuInfoQueryReq.java new file mode 100644 index 0000000..48e9f4f --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectSkuInfoQueryReq.java @@ -0,0 +1,47 @@ +package com.muyu.product.domain.req; + +import java.math.BigDecimal; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品SKU对象 project_sku_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "ProjectSkuInfoQueryReq", description = "商品SKU") +public class ProjectSkuInfoQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 商品id */ + @ApiModelProperty(name = "商品id", value = "商品id") + private Long projectId; + + /** sku */ + @ApiModelProperty(name = "sku", value = "sku") + private String sku; + + /** 商品库存 */ + @ApiModelProperty(name = "商品库存", value = "商品库存") + private Long stock; + + /** 商品价格 */ + @ApiModelProperty(name = "商品价格", value = "商品价格") + private BigDecimal price; + + /** 规格图片 */ + @ApiModelProperty(name = "规格图片", value = "规格图片") + private String image; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectSkuInfoSaveReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectSkuInfoSaveReq.java new file mode 100644 index 0000000..26856fc --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectSkuInfoSaveReq.java @@ -0,0 +1,57 @@ +package com.muyu.product.domain.req; + +import java.math.BigDecimal; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品SKU对象 project_sku_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "ProjectSkuInfoSaveReq", description = "商品SKU") +public class ProjectSkuInfoSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 商品id */ + + @ApiModelProperty(name = "商品id", value = "商品id", required = true) + private Long projectId; + + /** sku */ + + @ApiModelProperty(name = "sku", value = "sku", required = true) + private String sku; + + /** 商品库存 */ + + @ApiModelProperty(name = "商品库存", value = "商品库存", required = true) + private Long stock; + + /** 商品价格 */ + + @ApiModelProperty(name = "商品价格", value = "商品价格", required = true) + private BigDecimal price; + + /** 规格图片 */ + + @ApiModelProperty(name = "规格图片", value = "规格图片", required = true) + private String image; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleAttrInfoEditReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleAttrInfoEditReq.java new file mode 100644 index 0000000..7f14789 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleAttrInfoEditReq.java @@ -0,0 +1,38 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 规格详情对象 rule_attr_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "RuleAttrInfoEditReq", description = "规格详情") +public class RuleAttrInfoEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 规格id */ + @ApiModelProperty(name = "规格id", value = "规格id", required = true) + private Long ruleId; + + /** 类目名称 */ + @ApiModelProperty(name = "类目名称", value = "类目名称") + private String name; + + /** 规格值 */ + @ApiModelProperty(name = "规格值", value = "规格值") + private String attrValue; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleAttrInfoQueryReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleAttrInfoQueryReq.java new file mode 100644 index 0000000..f003eb7 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleAttrInfoQueryReq.java @@ -0,0 +1,38 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 规格详情对象 rule_attr_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "RuleAttrInfoQueryReq", description = "规格详情") +public class RuleAttrInfoQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 规格id */ + @ApiModelProperty(name = "规格id", value = "规格id") + private Long ruleId; + + /** 类目名称 */ + @ApiModelProperty(name = "类目名称", value = "类目名称") + private String name; + + /** 规格值 */ + @ApiModelProperty(name = "规格值", value = "规格值") + private String attrValue; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleAttrInfoSaveReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleAttrInfoSaveReq.java new file mode 100644 index 0000000..d05e745 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleAttrInfoSaveReq.java @@ -0,0 +1,46 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 规格详情对象 rule_attr_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "RuleAttrInfoSaveReq", description = "规格详情") +public class RuleAttrInfoSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 规格id */ + + @ApiModelProperty(name = "规格id", value = "规格id", required = true) + private Long ruleId; + + /** 类目名称 */ + + @ApiModelProperty(name = "类目名称", value = "类目名称") + private String name; + + /** 规格值 */ + + @ApiModelProperty(name = "规格值", value = "规格值") + private String attrValue; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleInfoEditReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleInfoEditReq.java new file mode 100644 index 0000000..bc9d602 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleInfoEditReq.java @@ -0,0 +1,34 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品规格对象 rule_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "RuleInfoEditReq", description = "商品规格") +public class RuleInfoEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 规格名称 */ + @ApiModelProperty(name = "规格名称", value = "规格名称") + private String name; + + /** 规格状态 */ + @ApiModelProperty(name = "规格状态", value = "规格状态") + private String status; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleInfoQueryReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleInfoQueryReq.java new file mode 100644 index 0000000..3c50d3a --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleInfoQueryReq.java @@ -0,0 +1,34 @@ +package com.muyu.product.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 商品规格对象 rule_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "RuleInfoQueryReq", description = "商品规格") +public class RuleInfoQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 规格名称 */ + @ApiModelProperty(name = "规格名称", value = "规格名称") + private String name; + + /** 规格状态 */ + @ApiModelProperty(name = "规格状态", value = "规格状态") + private String status; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleInfoSaveReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleInfoSaveReq.java new file mode 100644 index 0000000..c6ef9ff --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/RuleInfoSaveReq.java @@ -0,0 +1,41 @@ +package com.muyu.product.domain.req; + +import com.muyu.product.domain.model.RuleAttrAddModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +import java.util.List; + +/** + * 商品规格对象 rule_info + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "RuleInfoSaveReq", description = "商品规格") +public class RuleInfoSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 规格名称 */ + @ApiModelProperty(name = "规格名称", value = "规格名称") + private String name; + + /** 规格状态 */ + @ApiModelProperty(name = "规格状态", value = "规格状态") + private String status; + + /** + * 规格属性集合 + */ + private List ruleAttrList; +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/AttributeGroupPageResp.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/AttributeGroupPageResp.java new file mode 100644 index 0000000..7936caf --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/AttributeGroupPageResp.java @@ -0,0 +1,59 @@ +package com.muyu.product.domain.resp; + +import com.muyu.common.core.web.domain.BaseEntity; +import com.muyu.product.domain.AttributeGroup; +import com.muyu.product.domain.AttributeInfo; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.List; +import java.util.function.Function; + +/** + * @author DongZl + * @description: 属性组列表对象 + * @Date 2024-2-28 下午 04:15 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class AttributeGroupPageResp extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 属性组编号 */ + private Long id; + + /** 组名称 */ + private String name; + + /** 状态 */ + private String states; + + /** + * 属性对象集合 + */ + private List attributeInfoList; + + public static AttributeGroupPageResp groupBuild (AttributeGroup attributeGroup, List attributeInfos) { + return AttributeGroupPageResp.builder() + .id(attributeGroup.getId()) + .name(attributeGroup.getName()) + .states(attributeGroup.getStates()) + .attributeInfoList(attributeInfos) + .build(); + } + public static AttributeGroupPageResp groupFunBuild (AttributeGroup attributeGroup, Function > function) { + return AttributeGroupPageResp.builder() + .id(attributeGroup.getId()) + .name(attributeGroup.getName()) + .states(attributeGroup.getStates()) + .attributeInfoList(function.apply(attributeGroup.getId())) + .build(); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/CategoryCommonElementResp.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/CategoryCommonElementResp.java new file mode 100644 index 0000000..b69efda --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/CategoryCommonElementResp.java @@ -0,0 +1,39 @@ +package com.muyu.product.domain.resp; + +import com.muyu.common.core.web.domain.BaseEntity; +import com.muyu.product.domain.model.TemplateAttributeGroupModel; +import com.muyu.product.domain.model.TemplateAttributeModel; +import lombok.*; +import lombok.experimental.SuperBuilder; + +import java.util.List; + +/** + * @author DongZl + * @description: 商品类别公共元素 + * @Date 2024-3-6 下午 02:25 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class CategoryCommonElementResp extends BaseEntity { + + /** + * 共有属性组 + */ + private List templateAttributeGroupList; + + /** + * 共有属性 + */ + private List templateAttributeList; + + /** + * 自有属性(所有未包含属性) + */ + private List attributeList; + + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/CategoryParentCommonElementResp.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/CategoryParentCommonElementResp.java new file mode 100644 index 0000000..ba5576a --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/CategoryParentCommonElementResp.java @@ -0,0 +1,39 @@ +package com.muyu.product.domain.resp; + +import com.muyu.product.domain.AttributeGroup; +import com.muyu.product.domain.AttributeInfo; +import com.muyu.product.domain.BrandInfo; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @author DongZl + * @description: 类别父通用元素 + * @Date 2024-3-1 上午 11:02 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class CategoryParentCommonElementResp { + + /** + * 属性集合 + */ + private List attributeInfoList; + + /** + * 属性组集合 + */ + private List attributeGroupList; + + /** + * 品牌集合 + */ + private List brandInfoList; + +} diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/RuleInfoResp.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/RuleInfoResp.java new file mode 100644 index 0000000..8596383 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/RuleInfoResp.java @@ -0,0 +1,48 @@ +package com.muyu.product.domain.resp; + +import com.muyu.common.core.web.domain.BaseEntity; +import com.muyu.product.domain.RuleInfo; +import com.muyu.product.domain.model.RuleAttrAddModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.List; +import java.util.function.Function; + +/** + * @author DongZl + * @description: 规格返回结果集 + * @Date 2024-3-4 下午 04:08 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class RuleInfoResp extends BaseEntity { + + private Long id; + + /** 规格名称 */ + private String name; + + /** 规格状态 */ + private String status; + + /** + * 规格属性集合 + */ + private List ruleAttrList; + + public static RuleInfoResp infoBuild (RuleInfo ruleInfo, Function> ruleAttrList) { + return RuleInfoResp.builder() + .id(ruleInfo.getId()) + .name(ruleInfo.getName()) + .status(ruleInfo.getStatus()) + .ruleAttrList(ruleAttrList.apply(ruleInfo.getId())) + .build(); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-remote/pom.xml b/muyu-modules/muyu-product/muyu-product-remote/pom.xml index 3500821..af751dd 100644 --- a/muyu-modules/muyu-product/muyu-product-remote/pom.xml +++ b/muyu-modules/muyu-product/muyu-product-remote/pom.xml @@ -18,10 +18,10 @@ + com.muyu muyu-product-common - - \ No newline at end of file + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/MuYuProductApplication.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/MuYuProductApplication.java index 7ec82c8..84b6d80 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/MuYuProductApplication.java +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/MuYuProductApplication.java @@ -1,10 +1,4 @@ -package com.muyu.product;/** - * @Author:yjz - * @Package:com.muyu.product - * @Project:muyu - * @name:MuYuProductApplication - * @Date:2024/2/29 14:12 - */ +package com.muyu.product; import com.muyu.common.security.annotation.EnableCustomConfig; import com.muyu.common.security.annotation.EnableMyFeignClients; @@ -13,10 +7,9 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** - *@ClassName MuYuProductApplication - *@Description 描述 - *@Author JunZhe.Yuan - *@Date 2024/2/29 14:12 + * @author DongZl + * @description: 商品启动类 + * @Date 2024-2-26 下午 04:07 */ @EnableCustomConfig @EnableCustomSwagger2 @@ -26,4 +19,5 @@ public class MuYuProductApplication { public static void main (String[] args) { SpringApplication.run(MuYuProductApplication.class, args); } + } diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/AttributeController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/AttributeController.java deleted file mode 100644 index 4ab7966..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/AttributeController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.muyu.product.controller; - -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.muyu.common.log.annotation.Log; -import com.muyu.common.log.enums.BusinessType; -import com.muyu.common.security.annotation.RequiresPermissions; -import com.muyu.product.domain.Attribute; -import com.muyu.product.service.IAttributeService; -import com.muyu.common.core.web.controller.BaseController; -import com.muyu.common.core.domain.Result; -import com.muyu.common.core.utils.poi.ExcelUtil; -import com.muyu.common.core.web.page.TableDataInfo; - -/** - * 商品属性Controller - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@RestController -@RequestMapping("/attribute") -public class AttributeController extends BaseController -{ - @Autowired - private IAttributeService attributeService; - - /** - * 查询商品属性列表 - */ - @RequiresPermissions("product:attribute:list") - @GetMapping("/list") - public Result> list(Attribute attribute) - { - startPage(); - List list = attributeService.selectAttributeList(attribute); - return getDataTable(list); - } - - /** - * 导出商品属性列表 - */ - @RequiresPermissions("product:attribute:export") - @Log(title = "商品属性", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, Attribute attribute) - { - List list = attributeService.selectAttributeList(attribute); - ExcelUtil util = new ExcelUtil(Attribute.class); - util.exportExcel(response, list, "商品属性数据"); - } - - /** - * 获取商品属性详细信息 - */ - @RequiresPermissions("product:attribute:query") - @GetMapping(value = "/{id}") - public Result getInfo(@PathVariable("id") Long id) - { - return success(attributeService.selectAttributeById(id)); - } - - /** - * 新增商品属性 - */ - @RequiresPermissions("product:attribute:add") - @Log(title = "商品属性", businessType = BusinessType.INSERT) - @PostMapping - public Result add(@RequestBody Attribute attribute) - { - return toAjax(attributeService.insertAttribute(attribute)); - } - - /** - * 修改商品属性 - */ - @RequiresPermissions("product:attribute:edit") - @Log(title = "商品属性", businessType = BusinessType.UPDATE) - @PutMapping - public Result edit(@RequestBody Attribute attribute) - { - return toAjax(attributeService.updateAttribute(attribute)); - } - - /** - * 删除商品属性 - */ - @RequiresPermissions("product:attribute:remove") - @Log(title = "商品属性", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public Result remove(@PathVariable Long[] ids) - { - return toAjax(attributeService.deleteAttributeByIds(ids)); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/AttributeGroupController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/AttributeGroupController.java index a349d7e..9716f7a 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/AttributeGroupController.java +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/AttributeGroupController.java @@ -1,61 +1,63 @@ package com.muyu.product.controller; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.common.log.annotation.Log; import com.muyu.common.log.enums.BusinessType; import com.muyu.common.security.annotation.RequiresPermissions; import com.muyu.product.domain.AttributeGroup; -import com.muyu.product.service.IAttributeGroupService; -import com.muyu.common.core.web.controller.BaseController; -import com.muyu.common.core.domain.Result; -import com.muyu.common.core.utils.poi.ExcelUtil; -import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.product.domain.model.AttributeGroupSaveModel; +import com.muyu.product.domain.req.AttributeGroupEditReq; +import com.muyu.product.domain.req.AttributeGroupQueryReq; +import com.muyu.product.domain.req.AttributeGroupSaveReq; +import com.muyu.product.domain.resp.AttributeGroupPageResp; +import com.muyu.product.service.AttributeGroupService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 属性组Controller * - * @author yuanjunzhe - * @date 2024-02-29 + * @author DongZeLiang + * @date 2024-02-27 */ +@Api(tags = "属性组") @RestController @RequestMapping("/attributeGroup") -public class AttributeGroupController extends BaseController -{ +public class AttributeGroupController extends BaseController { @Autowired - private IAttributeGroupService attributeGroupService; + private AttributeGroupService attributeGroupService; /** * 查询属性组列表 */ + @ApiOperation("获取属性组列表") @RequiresPermissions("product:attributeGroup:list") @GetMapping("/list") - public Result> list(AttributeGroup attributeGroup) - { + public Result> list(AttributeGroupQueryReq attributeGroupQueryReq) { startPage(); - List list = attributeGroupService.selectAttributeGroupList(attributeGroup); - return getDataTable(list); + TableDataInfo tableDataInfo = + attributeGroupService.page(AttributeGroup.queryBuild(attributeGroupQueryReq)); + return Result.success(tableDataInfo); } /** * 导出属性组列表 */ + @ApiOperation("导出属性组列表") @RequiresPermissions("product:attributeGroup:export") @Log(title = "属性组", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, AttributeGroup attributeGroup) - { - List list = attributeGroupService.selectAttributeGroupList(attributeGroup); + public void export(HttpServletResponse response, AttributeGroup attributeGroup) { + List list = attributeGroupService.list(attributeGroup); ExcelUtil util = new ExcelUtil(AttributeGroup.class); util.exportExcel(response, list, "属性组数据"); } @@ -63,11 +65,12 @@ public class AttributeGroupController extends BaseController /** * 获取属性组详细信息 */ + @ApiOperation("获取属性组详细信息") @RequiresPermissions("product:attributeGroup:query") @GetMapping(value = "/{id}") - public Result getInfo(@PathVariable("id") Long id) - { - return success(attributeGroupService.selectAttributeGroupById(id)); + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + return Result.success(attributeGroupService.getById(id)); } /** @@ -76,9 +79,11 @@ public class AttributeGroupController extends BaseController @RequiresPermissions("product:attributeGroup:add") @Log(title = "属性组", businessType = BusinessType.INSERT) @PostMapping - public Result add(@RequestBody AttributeGroup attributeGroup) - { - return toAjax(attributeGroupService.insertAttributeGroup(attributeGroup)); + @ApiOperation("新增属性组") + public Result add(@RequestBody AttributeGroupSaveReq attributeGroupSaveReq) { + return toAjax( + attributeGroupService.save(AttributeGroupSaveModel.saveReqBuild(attributeGroupSaveReq)) + ); } /** @@ -86,10 +91,10 @@ public class AttributeGroupController extends BaseController */ @RequiresPermissions("product:attributeGroup:edit") @Log(title = "属性组", businessType = BusinessType.UPDATE) - @PutMapping - public Result edit(@RequestBody AttributeGroup attributeGroup) - { - return toAjax(attributeGroupService.updateAttributeGroup(attributeGroup)); + @PutMapping("/{id}") + @ApiOperation("修改属性组") + public Result edit(@PathVariable Long id, @RequestBody AttributeGroupEditReq attributeGroupEditReq) { + return toAjax(attributeGroupService.updateById(AttributeGroup.editBuild(id,attributeGroupEditReq))); } /** @@ -97,9 +102,10 @@ public class AttributeGroupController extends BaseController */ @RequiresPermissions("product:attributeGroup:remove") @Log(title = "属性组", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public Result remove(@PathVariable Long[] ids) - { - return toAjax(attributeGroupService.deleteAttributeGroupByIds(ids)); + @DeleteMapping("/{ids}") + @ApiOperation("删除属性组") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + return toAjax(attributeGroupService.removeBatchByIds(ids)); } } diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/AttributeInfoController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/AttributeInfoController.java new file mode 100644 index 0000000..0d408a5 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/AttributeInfoController.java @@ -0,0 +1,106 @@ +package com.muyu.product.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.product.domain.AttributeInfo; +import com.muyu.product.domain.req.AttributeInfoEditReq; +import com.muyu.product.domain.req.AttributeInfoQueryReq; +import com.muyu.product.domain.req.AttributeInfoSaveReq; +import com.muyu.product.service.AttributeInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 商品属性Controller + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Api(tags = "商品属性") +@RestController +@RequestMapping("/attribute") +public class AttributeInfoController extends BaseController { + @Autowired + private AttributeInfoService attributeInfoService; + + /** + * 查询商品属性列表 + */ + @ApiOperation("获取商品属性列表") + @RequiresPermissions("product:attribute:list") + @GetMapping("/list") + public Result> list(AttributeInfoQueryReq attributeInfoQueryReq) { + startPage(); + List list = attributeInfoService.list(AttributeInfo.queryBuild(attributeInfoQueryReq)); + return getDataTable(list); + } + + /** + * 导出商品属性列表 + */ + @ApiOperation("导出商品属性列表") + @RequiresPermissions("product:attribute:export") + @Log(title = "商品属性", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, AttributeInfo attributeInfo) { + List list = attributeInfoService.list(attributeInfo); + ExcelUtil util = new ExcelUtil(AttributeInfo.class); + util.exportExcel(response, list, "商品属性数据"); + } + + /** + * 获取商品属性详细信息 + */ + @ApiOperation("获取商品属性详细信息") + @RequiresPermissions("product:attribute:query") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + return Result.success(attributeInfoService.getById(id)); + } + + /** + * 新增商品属性 + */ + @RequiresPermissions("product:attribute:add") + @Log(title = "商品属性", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增商品属性") + public Result add(@RequestBody AttributeInfoSaveReq attributeInfoSaveReq) { + return toAjax(attributeInfoService.save(AttributeInfo.saveBuild(attributeInfoSaveReq))); + } + + /** + * 修改商品属性 + */ + @RequiresPermissions("product:attribute:edit") + @Log(title = "商品属性", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改商品属性") + public Result edit(@PathVariable Long id, @RequestBody AttributeInfoEditReq attributeInfoEditReq) { + return toAjax(attributeInfoService.updateById(AttributeInfo.editBuild(id,attributeInfoEditReq))); + } + + /** + * 删除商品属性 + */ + @RequiresPermissions("product:attribute:remove") + @Log(title = "商品属性", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除商品属性") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + return toAjax(attributeInfoService.removeBatchByIds(ids)); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/BrandInfoController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/BrandInfoController.java index 4075e8b..3c770c1 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/BrandInfoController.java +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/BrandInfoController.java @@ -1,105 +1,109 @@ package com.muyu.product.controller; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.text.Convert; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.log.annotation.Log; import com.muyu.common.log.enums.BusinessType; import com.muyu.common.security.annotation.RequiresPermissions; import com.muyu.product.domain.BrandInfo; -import com.muyu.product.service.IBrandInfoService; -import com.muyu.common.core.web.controller.BaseController; -import com.muyu.common.core.domain.Result; -import com.muyu.common.core.utils.poi.ExcelUtil; -import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.product.domain.req.BrandInfoEditReq; +import com.muyu.product.domain.req.BrandInfoQueryReq; +import com.muyu.product.domain.req.BrandInfoSaveReq; +import com.muyu.product.service.BrandInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** - * 商品品牌Controller + * 品牌信息Controller * - * @author yuanjunzhe - * @date 2024-02-29 + * @author DongZeLiang + * @date 2024-02-27 */ +@Api(tags = "品牌信息") @RestController @RequestMapping("/brand") -public class BrandInfoController extends BaseController -{ +public class BrandInfoController extends BaseController { @Autowired - private IBrandInfoService brandInfoService; + private BrandInfoService brandInfoService; /** - * 查询商品品牌列表 + * 查询品牌信息列表 */ + @ApiOperation("获取品牌信息列表") @RequiresPermissions("product:brand:list") @GetMapping("/list") - public Result> list(BrandInfo brandInfo) - { - startPage(); - List list = brandInfoService.selectBrandInfoList(brandInfo); - return getDataTable(list); + public Result list(BrandInfoQueryReq brandInfoQueryReq) { + boolean isPage = brandInfoQueryReq.getParams().get("isPage") == null || Convert.toBool(brandInfoQueryReq.getParams().get("isPage"), true); + if (isPage){ + startPage(); + } + List list = brandInfoService.list(BrandInfo.queryBuild(brandInfoQueryReq)); + return isPage ? getDataTable(list) : Result.success(list); } /** - * 导出商品品牌列表 + * 导出品牌信息列表 */ + @ApiOperation("导出品牌信息列表") @RequiresPermissions("product:brand:export") - @Log(title = "商品品牌", businessType = BusinessType.EXPORT) + @Log(title = "品牌信息", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, BrandInfo brandInfo) - { - List list = brandInfoService.selectBrandInfoList(brandInfo); + public void export(HttpServletResponse response, BrandInfo brandInfo) { + List list = brandInfoService.list(brandInfo); ExcelUtil util = new ExcelUtil(BrandInfo.class); - util.exportExcel(response, list, "商品品牌数据"); + util.exportExcel(response, list, "品牌信息数据"); } /** - * 获取商品品牌详细信息 + * 获取品牌信息详细信息 */ + @ApiOperation("获取品牌信息详细信息") @RequiresPermissions("product:brand:query") @GetMapping(value = "/{id}") - public Result getInfo(@PathVariable("id") Long id) - { - return success(brandInfoService.selectBrandInfoById(id)); + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + return Result.success(brandInfoService.getById(id)); } /** - * 新增商品品牌 + * 新增品牌信息 */ @RequiresPermissions("product:brand:add") - @Log(title = "商品品牌", businessType = BusinessType.INSERT) + @Log(title = "品牌信息", businessType = BusinessType.INSERT) @PostMapping - public Result add(@RequestBody BrandInfo brandInfo) - { - return toAjax(brandInfoService.insertBrandInfo(brandInfo)); + @ApiOperation("新增品牌信息") + public Result add(@RequestBody BrandInfoSaveReq brandInfoSaveReq) { + return toAjax(brandInfoService.save(BrandInfo.saveBuild(brandInfoSaveReq))); } /** - * 修改商品品牌 + * 修改品牌信息 */ @RequiresPermissions("product:brand:edit") - @Log(title = "商品品牌", businessType = BusinessType.UPDATE) - @PutMapping - public Result edit(@RequestBody BrandInfo brandInfo) - { - return toAjax(brandInfoService.updateBrandInfo(brandInfo)); + @Log(title = "品牌信息", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改品牌信息") + public Result edit(@PathVariable Long id, @RequestBody BrandInfoEditReq brandInfoEditReq) { + return toAjax(brandInfoService.updateById(BrandInfo.editBuild(id,brandInfoEditReq))); } /** - * 删除商品品牌 + * 删除品牌信息 */ @RequiresPermissions("product:brand:remove") - @Log(title = "商品品牌", businessType = BusinessType.DELETE) + @Log(title = "品牌信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") - public Result remove(@PathVariable Long[] ids) - { - return toAjax(brandInfoService.deleteBrandInfoByIds(ids)); + @ApiOperation("删除品牌信息") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + return toAjax(brandInfoService.removeBatchByIds(ids)); } } diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CategoryInfoController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CategoryInfoController.java index e759984..91bb6bf 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CategoryInfoController.java +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CategoryInfoController.java @@ -1,59 +1,61 @@ package com.muyu.product.controller; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.log.annotation.Log; import com.muyu.common.log.enums.BusinessType; import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.common.security.utils.SecurityUtils; import com.muyu.product.domain.CategoryInfo; -import com.muyu.product.service.ICategoryInfoService; -import com.muyu.common.core.web.controller.BaseController; -import com.muyu.common.core.domain.Result; -import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.product.domain.model.CategoryInfoSaveModel; +import com.muyu.product.domain.req.CategoryInfoEditReq; +import com.muyu.product.domain.req.CategoryInfoSaveReq; +import com.muyu.product.domain.resp.CategoryCommonElementResp; +import com.muyu.product.domain.resp.CategoryParentCommonElementResp; +import com.muyu.product.service.CategoryInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 品类信息Controller * - * @author yuanjunzhe - * @date 2024-02-29 + * @author DongZeLiang + * @date 2024-02-27 */ +@Api(tags = "品类信息") @RestController @RequestMapping("/category") -public class CategoryInfoController extends BaseController -{ +public class CategoryInfoController extends BaseController { @Autowired - private ICategoryInfoService categoryInfoService; + private CategoryInfoService categoryInfoService; /** * 查询品类信息列表 */ + @ApiOperation("获取品类信息列表") @RequiresPermissions("product:category:list") @GetMapping("/list") - public Result list(CategoryInfo categoryInfo) - { - List list = categoryInfoService.selectCategoryInfoList(categoryInfo); - return success(list); + public Result> list(CategoryInfo categoryInfo) { + List list = categoryInfoService.list(categoryInfo); + return Result.success(list); } /** * 导出品类信息列表 */ + @ApiOperation("导出品类信息列表") @RequiresPermissions("product:category:export") @Log(title = "品类信息", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, CategoryInfo categoryInfo) - { - List list = categoryInfoService.selectCategoryInfoList(categoryInfo); + public void export(HttpServletResponse response, CategoryInfo categoryInfo) { + List list = categoryInfoService.list(categoryInfo); ExcelUtil util = new ExcelUtil(CategoryInfo.class); util.exportExcel(response, list, "品类信息数据"); } @@ -61,11 +63,23 @@ public class CategoryInfoController extends BaseController /** * 获取品类信息详细信息 */ + @ApiOperation("获取品类信息详细信息") @RequiresPermissions("product:category:query") @GetMapping(value = "/{id}") - public Result getInfo(@PathVariable("id") Long id) - { - return success(categoryInfoService.selectCategoryInfoById(id)); + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + return Result.success(categoryInfoService.getById(id)); + } + + /** + * 获取品类信息详细信息 + */ + @ApiOperation("获取品类信息共有属性信息") + @RequiresPermissions("product:category:query") + @GetMapping(value = "/getTemplateAttribute/{cateGoryId}") + @ApiImplicitParam(name = "cateGoryId", value = "cateGoryId", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getTemplateAttributeByCateGoryId(@PathVariable("cateGoryId") Long cateGoryId) { + return Result.success(categoryInfoService.getTemplateAttributeByCateGoryId(cateGoryId)); } /** @@ -74,9 +88,11 @@ public class CategoryInfoController extends BaseController @RequiresPermissions("product:category:add") @Log(title = "品类信息", businessType = BusinessType.INSERT) @PostMapping - public Result add(@RequestBody CategoryInfo categoryInfo) - { - return toAjax(categoryInfoService.insertCategoryInfo(categoryInfo)); + @ApiOperation("新增品类信息") + public Result add(@RequestBody CategoryInfoSaveReq categoryInfoSaveReq) { + return toAjax(categoryInfoService.save( + CategoryInfoSaveModel.saveBuild(categoryInfoSaveReq, SecurityUtils::getUsername) + )); } /** @@ -84,10 +100,10 @@ public class CategoryInfoController extends BaseController */ @RequiresPermissions("product:category:edit") @Log(title = "品类信息", businessType = BusinessType.UPDATE) - @PutMapping - public Result edit(@RequestBody CategoryInfo categoryInfo) - { - return toAjax(categoryInfoService.updateCategoryInfo(categoryInfo)); + @PutMapping("/{id}") + @ApiOperation("修改品类信息") + public Result edit(@PathVariable Long id, @RequestBody CategoryInfoEditReq categoryInfoEditReq) { + return toAjax(categoryInfoService.updateById(CategoryInfo.editBuild(id,categoryInfoEditReq))); } /** @@ -96,8 +112,23 @@ public class CategoryInfoController extends BaseController @RequiresPermissions("product:category:remove") @Log(title = "品类信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") - public Result remove(@PathVariable Long[] ids) - { - return toAjax(categoryInfoService.deleteCategoryInfoByIds(ids)); + @ApiOperation("删除品类信息") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + return toAjax(categoryInfoService.removeBatchByIds(ids)); + } + + /** + * 通过品类ID获取父级以上的属性、属性组、品牌集合 + * @param categoryId 品类ID + * @return 父级以上的属性、属性组、品牌集合 + */ + @GetMapping("/parentCommonElement/{categoryId}") + @ApiOperation("通过品类ID获取父级以上的属性集合") + @ApiImplicitParam(name = "categoryId", value = "categoryId", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class, example = "1") + public Result parentCommonElement( + @PathVariable(value = "categoryId") Long categoryId + ) { + return Result.success(categoryInfoService.parentCommonElement(categoryId)); } } diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CommentInfoController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CommentInfoController.java new file mode 100644 index 0000000..d2bd745 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CommentInfoController.java @@ -0,0 +1,106 @@ +package com.muyu.product.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.product.domain.CommentInfo; +import com.muyu.product.domain.req.CommentInfoEditReq; +import com.muyu.product.domain.req.CommentInfoQueryReq; +import com.muyu.product.domain.req.CommentInfoSaveReq; +import com.muyu.product.service.CommentInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 商品评论Controller + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Api(tags = "商品评论") +@RestController +@RequestMapping("/comment") +public class CommentInfoController extends BaseController { + @Autowired + private CommentInfoService commentInfoService; + + /** + * 查询商品评论列表 + */ + @ApiOperation("获取商品评论列表") + @RequiresPermissions("product:comment:list") + @GetMapping("/list") + public Result> list(CommentInfoQueryReq commentInfoQueryReq) { + startPage(); + List list = commentInfoService.list(CommentInfo.queryBuild(commentInfoQueryReq)); + return getDataTable(list); + } + + /** + * 导出商品评论列表 + */ + @ApiOperation("导出商品评论列表") + @RequiresPermissions("product:comment:export") + @Log(title = "商品评论", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, CommentInfo commentInfo) { + List list = commentInfoService.list(commentInfo); + ExcelUtil util = new ExcelUtil(CommentInfo.class); + util.exportExcel(response, list, "商品评论数据"); + } + + /** + * 获取商品评论详细信息 + */ + @ApiOperation("获取商品评论详细信息") + @RequiresPermissions("product:comment:query") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + return Result.success(commentInfoService.getById(id)); + } + + /** + * 新增商品评论 + */ + @RequiresPermissions("product:comment:add") + @Log(title = "商品评论", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增商品评论") + public Result add(@RequestBody CommentInfoSaveReq commentInfoSaveReq) { + return toAjax(commentInfoService.save(CommentInfo.saveBuild(commentInfoSaveReq))); + } + + /** + * 修改商品评论 + */ + @RequiresPermissions("product:comment:edit") + @Log(title = "商品评论", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改商品评论") + public Result edit(@PathVariable Long id, @RequestBody CommentInfoEditReq commentInfoEditReq) { + return toAjax(commentInfoService.updateById(CommentInfo.editBuild(id,commentInfoEditReq))); + } + + /** + * 删除商品评论 + */ + @RequiresPermissions("product:comment:remove") + @Log(title = "商品评论", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除商品评论") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + return toAjax(commentInfoService.removeBatchByIds(ids)); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CommentLikeController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CommentLikeController.java deleted file mode 100644 index d7e6907..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CommentLikeController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.muyu.product.controller; - -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.muyu.common.log.annotation.Log; -import com.muyu.common.log.enums.BusinessType; -import com.muyu.common.security.annotation.RequiresPermissions; -import com.muyu.product.domain.CommentLike; -import com.muyu.product.service.ICommentLikeService; -import com.muyu.common.core.web.controller.BaseController; -import com.muyu.common.core.domain.Result; -import com.muyu.common.core.utils.poi.ExcelUtil; -import com.muyu.common.core.web.page.TableDataInfo; - -/** - * 评论点赞Controller - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@RestController -@RequestMapping("/commentLike") -public class CommentLikeController extends BaseController -{ - @Autowired - private ICommentLikeService commentLikeService; - - /** - * 查询评论点赞列表 - */ - @RequiresPermissions("product:commentLike:list") - @GetMapping("/list") - public Result> list(CommentLike commentLike) - { - startPage(); - List list = commentLikeService.selectCommentLikeList(commentLike); - return getDataTable(list); - } - - /** - * 导出评论点赞列表 - */ - @RequiresPermissions("product:commentLike:export") - @Log(title = "评论点赞", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, CommentLike commentLike) - { - List list = commentLikeService.selectCommentLikeList(commentLike); - ExcelUtil util = new ExcelUtil(CommentLike.class); - util.exportExcel(response, list, "评论点赞数据"); - } - - /** - * 获取评论点赞详细信息 - */ - @RequiresPermissions("product:commentLike:query") - @GetMapping(value = "/{id}") - public Result getInfo(@PathVariable("id") Long id) - { - return success(commentLikeService.selectCommentLikeById(id)); - } - - /** - * 新增评论点赞 - */ - @RequiresPermissions("product:commentLike:add") - @Log(title = "评论点赞", businessType = BusinessType.INSERT) - @PostMapping - public Result add(@RequestBody CommentLike commentLike) - { - return toAjax(commentLikeService.insertCommentLike(commentLike)); - } - - /** - * 修改评论点赞 - */ - @RequiresPermissions("product:commentLike:edit") - @Log(title = "评论点赞", businessType = BusinessType.UPDATE) - @PutMapping - public Result edit(@RequestBody CommentLike commentLike) - { - return toAjax(commentLikeService.updateCommentLike(commentLike)); - } - - /** - * 删除评论点赞 - */ - @RequiresPermissions("product:commentLike:remove") - @Log(title = "评论点赞", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public Result remove(@PathVariable Long[] ids) - { - return toAjax(commentLikeService.deleteCommentLikeByIds(ids)); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CommentLikeInfoController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CommentLikeInfoController.java new file mode 100644 index 0000000..816d618 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/CommentLikeInfoController.java @@ -0,0 +1,106 @@ +package com.muyu.product.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.product.domain.CommentLikeInfo; +import com.muyu.product.domain.req.CommentLikeInfoEditReq; +import com.muyu.product.domain.req.CommentLikeInfoQueryReq; +import com.muyu.product.domain.req.CommentLikeInfoSaveReq; +import com.muyu.product.service.CommentLikeInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 评论点赞Controller + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Api(tags = "评论点赞") +@RestController +@RequestMapping("/commentLike") +public class CommentLikeInfoController extends BaseController { + @Autowired + private CommentLikeInfoService commentLikeInfoService; + + /** + * 查询评论点赞列表 + */ + @ApiOperation("获取评论点赞列表") + @RequiresPermissions("product:commentLike:list") + @GetMapping("/list") + public Result> list(CommentLikeInfoQueryReq commentLikeInfoQueryReq) { + startPage(); + List list = commentLikeInfoService.list(CommentLikeInfo.queryBuild(commentLikeInfoQueryReq)); + return getDataTable(list); + } + + /** + * 导出评论点赞列表 + */ + @ApiOperation("导出评论点赞列表") + @RequiresPermissions("product:commentLike:export") + @Log(title = "评论点赞", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, CommentLikeInfo commentLikeInfo) { + List list = commentLikeInfoService.list(commentLikeInfo); + ExcelUtil util = new ExcelUtil(CommentLikeInfo.class); + util.exportExcel(response, list, "评论点赞数据"); + } + + /** + * 获取评论点赞详细信息 + */ + @ApiOperation("获取评论点赞详细信息") + @RequiresPermissions("product:commentLike:query") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + return Result.success(commentLikeInfoService.getById(id)); + } + + /** + * 新增评论点赞 + */ + @RequiresPermissions("product:commentLike:add") + @Log(title = "评论点赞", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增评论点赞") + public Result add(@RequestBody CommentLikeInfoSaveReq commentLikeInfoSaveReq) { + return toAjax(commentLikeInfoService.save(CommentLikeInfo.saveBuild(commentLikeInfoSaveReq))); + } + + /** + * 修改评论点赞 + */ + @RequiresPermissions("product:commentLike:edit") + @Log(title = "评论点赞", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改评论点赞") + public Result edit(@PathVariable Long id, @RequestBody CommentLikeInfoEditReq commentLikeInfoEditReq) { + return toAjax(commentLikeInfoService.updateById(CommentLikeInfo.editBuild(id,commentLikeInfoEditReq))); + } + + /** + * 删除评论点赞 + */ + @RequiresPermissions("product:commentLike:remove") + @Log(title = "评论点赞", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除评论点赞") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + return toAjax(commentLikeInfoService.removeBatchByIds(ids)); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProductCommentController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProductCommentController.java deleted file mode 100644 index fd6ea90..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProductCommentController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.muyu.product.controller; - -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.muyu.common.log.annotation.Log; -import com.muyu.common.log.enums.BusinessType; -import com.muyu.common.security.annotation.RequiresPermissions; -import com.muyu.product.domain.ProductComment; -import com.muyu.product.service.IProductCommentService; -import com.muyu.common.core.web.controller.BaseController; -import com.muyu.common.core.domain.Result; -import com.muyu.common.core.utils.poi.ExcelUtil; -import com.muyu.common.core.web.page.TableDataInfo; - -/** - * 商品评论Controller - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@RestController -@RequestMapping("/productComment") -public class ProductCommentController extends BaseController -{ - @Autowired - private IProductCommentService productCommentService; - - /** - * 查询商品评论列表 - */ - @RequiresPermissions("product:productComment:list") - @GetMapping("/list") - public Result> list(ProductComment productComment) - { - startPage(); - List list = productCommentService.selectProductCommentList(productComment); - return getDataTable(list); - } - - /** - * 导出商品评论列表 - */ - @RequiresPermissions("product:productComment:export") - @Log(title = "商品评论", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, ProductComment productComment) - { - List list = productCommentService.selectProductCommentList(productComment); - ExcelUtil util = new ExcelUtil(ProductComment.class); - util.exportExcel(response, list, "商品评论数据"); - } - - /** - * 获取商品评论详细信息 - */ - @RequiresPermissions("product:productComment:query") - @GetMapping(value = "/{id}") - public Result getInfo(@PathVariable("id") Long id) - { - return success(productCommentService.selectProductCommentById(id)); - } - - /** - * 新增商品评论 - */ - @RequiresPermissions("product:productComment:add") - @Log(title = "商品评论", businessType = BusinessType.INSERT) - @PostMapping - public Result add(@RequestBody ProductComment productComment) - { - return toAjax(productCommentService.insertProductComment(productComment)); - } - - /** - * 修改商品评论 - */ - @RequiresPermissions("product:productComment:edit") - @Log(title = "商品评论", businessType = BusinessType.UPDATE) - @PutMapping - public Result edit(@RequestBody ProductComment productComment) - { - return toAjax(productCommentService.updateProductComment(productComment)); - } - - /** - * 删除商品评论 - */ - @RequiresPermissions("product:productComment:remove") - @Log(title = "商品评论", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public Result remove(@PathVariable Long[] ids) - { - return toAjax(productCommentService.deleteProductCommentByIds(ids)); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProductController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProductController.java deleted file mode 100644 index 4f04a89..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProductController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.muyu.product.controller; - -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.muyu.common.log.annotation.Log; -import com.muyu.common.log.enums.BusinessType; -import com.muyu.common.security.annotation.RequiresPermissions; -import com.muyu.product.domain.Product; -import com.muyu.product.service.IProductService; -import com.muyu.common.core.web.controller.BaseController; -import com.muyu.common.core.domain.Result; -import com.muyu.common.core.utils.poi.ExcelUtil; -import com.muyu.common.core.web.page.TableDataInfo; - -/** - * 商品信息Controller - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@RestController -@RequestMapping("/product") -public class ProductController extends BaseController -{ - @Autowired - private IProductService productService; - - /** - * 查询商品信息列表 - */ - @RequiresPermissions("product:product:list") - @GetMapping("/list") - public Result> list(Product product) - { - startPage(); - List list = productService.selectProductList(product); - return getDataTable(list); - } - - /** - * 导出商品信息列表 - */ - @RequiresPermissions("product:product:export") - @Log(title = "商品信息", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, Product product) - { - List list = productService.selectProductList(product); - ExcelUtil util = new ExcelUtil(Product.class); - util.exportExcel(response, list, "商品信息数据"); - } - - /** - * 获取商品信息详细信息 - */ - @RequiresPermissions("product:product:query") - @GetMapping(value = "/{id}") - public Result getInfo(@PathVariable("id") Long id) - { - return success(productService.selectProductById(id)); - } - - /** - * 新增商品信息 - */ - @RequiresPermissions("product:product:add") - @Log(title = "商品信息", businessType = BusinessType.INSERT) - @PostMapping - public Result add(@RequestBody Product product) - { - return toAjax(productService.insertProduct(product)); - } - - /** - * 修改商品信息 - */ - @RequiresPermissions("product:product:edit") - @Log(title = "商品信息", businessType = BusinessType.UPDATE) - @PutMapping - public Result edit(@RequestBody Product product) - { - return toAjax(productService.updateProduct(product)); - } - - /** - * 删除商品信息 - */ - @RequiresPermissions("product:product:remove") - @Log(title = "商品信息", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public Result remove(@PathVariable Long[] ids) - { - return toAjax(productService.deleteProductByIds(ids)); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProductSkuController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProductSkuController.java deleted file mode 100644 index 78a4c5d..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProductSkuController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.muyu.product.controller; - -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.muyu.common.log.annotation.Log; -import com.muyu.common.log.enums.BusinessType; -import com.muyu.common.security.annotation.RequiresPermissions; -import com.muyu.product.domain.ProductSku; -import com.muyu.product.service.IProductSkuService; -import com.muyu.common.core.web.controller.BaseController; -import com.muyu.common.core.domain.Result; -import com.muyu.common.core.utils.poi.ExcelUtil; -import com.muyu.common.core.web.page.TableDataInfo; - -/** - * 商品skuController - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@RestController -@RequestMapping("/SKU") -public class ProductSkuController extends BaseController -{ - @Autowired - private IProductSkuService productSkuService; - - /** - * 查询商品sku列表 - */ - @RequiresPermissions("product:SKU:list") - @GetMapping("/list") - public Result> list(ProductSku productSku) - { - startPage(); - List list = productSkuService.selectProductSkuList(productSku); - return getDataTable(list); - } - - /** - * 导出商品sku列表 - */ - @RequiresPermissions("product:SKU:export") - @Log(title = "商品sku", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, ProductSku productSku) - { - List list = productSkuService.selectProductSkuList(productSku); - ExcelUtil util = new ExcelUtil(ProductSku.class); - util.exportExcel(response, list, "商品sku数据"); - } - - /** - * 获取商品sku详细信息 - */ - @RequiresPermissions("product:SKU:query") - @GetMapping(value = "/{id}") - public Result getInfo(@PathVariable("id") Long id) - { - return success(productSkuService.selectProductSkuById(id)); - } - - /** - * 新增商品sku - */ - @RequiresPermissions("product:SKU:add") - @Log(title = "商品sku", businessType = BusinessType.INSERT) - @PostMapping - public Result add(@RequestBody ProductSku productSku) - { - return toAjax(productSkuService.insertProductSku(productSku)); - } - - /** - * 修改商品sku - */ - @RequiresPermissions("product:SKU:edit") - @Log(title = "商品sku", businessType = BusinessType.UPDATE) - @PutMapping - public Result edit(@RequestBody ProductSku productSku) - { - return toAjax(productSkuService.updateProductSku(productSku)); - } - - /** - * 删除商品sku - */ - @RequiresPermissions("product:SKU:remove") - @Log(title = "商品sku", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public Result remove(@PathVariable Long[] ids) - { - return toAjax(productSkuService.deleteProductSkuByIds(ids)); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProjectInfoController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProjectInfoController.java new file mode 100644 index 0000000..6e6abf2 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProjectInfoController.java @@ -0,0 +1,106 @@ +package com.muyu.product.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.product.domain.ProjectInfo; +import com.muyu.product.domain.req.ProjectInfoEditReq; +import com.muyu.product.domain.req.ProjectInfoQueryReq; +import com.muyu.product.domain.req.ProjectInfoSaveReq; +import com.muyu.product.service.ProjectInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 商品信息Controller + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Api(tags = "商品信息") +@RestController +@RequestMapping("/info") +public class ProjectInfoController extends BaseController { + @Autowired + private ProjectInfoService projectInfoService; + + /** + * 查询商品信息列表 + */ + @ApiOperation("获取商品信息列表") + @RequiresPermissions("product:info:list") + @GetMapping("/list") + public Result> list(ProjectInfoQueryReq projectInfoQueryReq) { + startPage(); + List list = projectInfoService.list(ProjectInfo.queryBuild(projectInfoQueryReq)); + return getDataTable(list); + } + + /** + * 导出商品信息列表 + */ + @ApiOperation("导出商品信息列表") + @RequiresPermissions("product:info:export") + @Log(title = "商品信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ProjectInfo projectInfo) { + List list = projectInfoService.list(projectInfo); + ExcelUtil util = new ExcelUtil(ProjectInfo.class); + util.exportExcel(response, list, "商品信息数据"); + } + + /** + * 获取商品信息详细信息 + */ + @ApiOperation("获取商品信息详细信息") + @RequiresPermissions("product:info:query") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + return Result.success(projectInfoService.getById(id)); + } + + /** + * 新增商品信息 + */ + @RequiresPermissions("product:info:add") + @Log(title = "商品信息", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增商品信息") + public Result add(@RequestBody ProjectInfoSaveReq projectInfoSaveReq) { + return toAjax(projectInfoService.save(ProjectInfo.saveBuild(projectInfoSaveReq))); + } + + /** + * 修改商品信息 + */ + @RequiresPermissions("product:info:edit") + @Log(title = "商品信息", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改商品信息") + public Result edit(@PathVariable Long id, @RequestBody ProjectInfoEditReq projectInfoEditReq) { + return toAjax(projectInfoService.updateById(ProjectInfo.editBuild(id,projectInfoEditReq))); + } + + /** + * 删除商品信息 + */ + @RequiresPermissions("product:info:remove") + @Log(title = "商品信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除商品信息") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + return toAjax(projectInfoService.removeBatchByIds(ids)); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProjectSkuInfoController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProjectSkuInfoController.java new file mode 100644 index 0000000..92513ab --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/ProjectSkuInfoController.java @@ -0,0 +1,106 @@ +package com.muyu.product.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.product.domain.ProjectSkuInfo; +import com.muyu.product.domain.req.ProjectSkuInfoEditReq; +import com.muyu.product.domain.req.ProjectSkuInfoQueryReq; +import com.muyu.product.domain.req.ProjectSkuInfoSaveReq; +import com.muyu.product.service.ProjectSkuInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 商品SKUController + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Api(tags = "商品SKU") +@RestController +@RequestMapping("/sku") +public class ProjectSkuInfoController extends BaseController { + @Autowired + private ProjectSkuInfoService projectSkuInfoService; + + /** + * 查询商品SKU列表 + */ + @ApiOperation("获取商品SKU列表") + @RequiresPermissions("product:sku:list") + @GetMapping("/list") + public Result> list(ProjectSkuInfoQueryReq projectSkuInfoQueryReq) { + startPage(); + List list = projectSkuInfoService.list(ProjectSkuInfo.queryBuild(projectSkuInfoQueryReq)); + return getDataTable(list); + } + + /** + * 导出商品SKU列表 + */ + @ApiOperation("导出商品SKU列表") + @RequiresPermissions("product:sku:export") + @Log(title = "商品SKU", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ProjectSkuInfo projectSkuInfo) { + List list = projectSkuInfoService.list(projectSkuInfo); + ExcelUtil util = new ExcelUtil(ProjectSkuInfo.class); + util.exportExcel(response, list, "商品SKU数据"); + } + + /** + * 获取商品SKU详细信息 + */ + @ApiOperation("获取商品SKU详细信息") + @RequiresPermissions("product:sku:query") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + return Result.success(projectSkuInfoService.getById(id)); + } + + /** + * 新增商品SKU + */ + @RequiresPermissions("product:sku:add") + @Log(title = "商品SKU", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增商品SKU") + public Result add(@RequestBody ProjectSkuInfoSaveReq projectSkuInfoSaveReq) { + return toAjax(projectSkuInfoService.save(ProjectSkuInfo.saveBuild(projectSkuInfoSaveReq))); + } + + /** + * 修改商品SKU + */ + @RequiresPermissions("product:sku:edit") + @Log(title = "商品SKU", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改商品SKU") + public Result edit(@PathVariable Long id, @RequestBody ProjectSkuInfoEditReq projectSkuInfoEditReq) { + return toAjax(projectSkuInfoService.updateById(ProjectSkuInfo.editBuild(id,projectSkuInfoEditReq))); + } + + /** + * 删除商品SKU + */ + @RequiresPermissions("product:sku:remove") + @Log(title = "商品SKU", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除商品SKU") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + return toAjax(projectSkuInfoService.removeBatchByIds(ids)); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/RuleAttrController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/RuleAttrController.java deleted file mode 100644 index 0ce5c80..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/RuleAttrController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.muyu.product.controller; - -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.muyu.common.log.annotation.Log; -import com.muyu.common.log.enums.BusinessType; -import com.muyu.common.security.annotation.RequiresPermissions; -import com.muyu.product.domain.RuleAttr; -import com.muyu.product.service.IRuleAttrService; -import com.muyu.common.core.web.controller.BaseController; -import com.muyu.common.core.domain.Result; -import com.muyu.common.core.utils.poi.ExcelUtil; -import com.muyu.common.core.web.page.TableDataInfo; - -/** - * 规格详情Controller - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@RestController -@RequestMapping("/ruleAttr") -public class RuleAttrController extends BaseController -{ - @Autowired - private IRuleAttrService ruleAttrService; - - /** - * 查询规格详情列表 - */ - @RequiresPermissions("product:ruleAttr:list") - @GetMapping("/list") - public Result> list(RuleAttr ruleAttr) - { - startPage(); - List list = ruleAttrService.selectRuleAttrList(ruleAttr); - return getDataTable(list); - } - - /** - * 导出规格详情列表 - */ - @RequiresPermissions("product:ruleAttr:export") - @Log(title = "规格详情", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, RuleAttr ruleAttr) - { - List list = ruleAttrService.selectRuleAttrList(ruleAttr); - ExcelUtil util = new ExcelUtil(RuleAttr.class); - util.exportExcel(response, list, "规格详情数据"); - } - - /** - * 获取规格详情详细信息 - */ - @RequiresPermissions("product:ruleAttr:query") - @GetMapping(value = "/{id}") - public Result getInfo(@PathVariable("id") Long id) - { - return success(ruleAttrService.selectRuleAttrById(id)); - } - - /** - * 新增规格详情 - */ - @RequiresPermissions("product:ruleAttr:add") - @Log(title = "规格详情", businessType = BusinessType.INSERT) - @PostMapping - public Result add(@RequestBody RuleAttr ruleAttr) - { - return toAjax(ruleAttrService.insertRuleAttr(ruleAttr)); - } - - /** - * 修改规格详情 - */ - @RequiresPermissions("product:ruleAttr:edit") - @Log(title = "规格详情", businessType = BusinessType.UPDATE) - @PutMapping - public Result edit(@RequestBody RuleAttr ruleAttr) - { - return toAjax(ruleAttrService.updateRuleAttr(ruleAttr)); - } - - /** - * 删除规格详情 - */ - @RequiresPermissions("product:ruleAttr:remove") - @Log(title = "规格详情", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public Result remove(@PathVariable Long[] ids) - { - return toAjax(ruleAttrService.deleteRuleAttrByIds(ids)); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/RuleAttrInfoController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/RuleAttrInfoController.java new file mode 100644 index 0000000..c62792a --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/RuleAttrInfoController.java @@ -0,0 +1,106 @@ +package com.muyu.product.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.product.domain.RuleAttrInfo; +import com.muyu.product.domain.req.RuleAttrInfoEditReq; +import com.muyu.product.domain.req.RuleAttrInfoQueryReq; +import com.muyu.product.domain.req.RuleAttrInfoSaveReq; +import com.muyu.product.service.RuleAttrInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 规格详情Controller + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Api(tags = "规格详情") +@RestController +@RequestMapping("/ruleAttr") +public class RuleAttrInfoController extends BaseController { + @Autowired + private RuleAttrInfoService ruleAttrInfoService; + + /** + * 查询规格详情列表 + */ + @ApiOperation("获取规格详情列表") + @RequiresPermissions("product:ruleAttr:list") + @GetMapping("/list") + public Result> list(RuleAttrInfoQueryReq ruleAttrInfoQueryReq) { + startPage(); + List list = ruleAttrInfoService.list(RuleAttrInfo.queryBuild(ruleAttrInfoQueryReq)); + return getDataTable(list); + } + + /** + * 导出规格详情列表 + */ + @ApiOperation("导出规格详情列表") + @RequiresPermissions("product:ruleAttr:export") + @Log(title = "规格详情", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, RuleAttrInfo ruleAttrInfo) { + List list = ruleAttrInfoService.list(ruleAttrInfo); + ExcelUtil util = new ExcelUtil(RuleAttrInfo.class); + util.exportExcel(response, list, "规格详情数据"); + } + + /** + * 获取规格详情详细信息 + */ + @ApiOperation("获取规格详情详细信息") + @RequiresPermissions("product:ruleAttr:query") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + return Result.success(ruleAttrInfoService.getById(id)); + } + + /** + * 新增规格详情 + */ + @RequiresPermissions("product:ruleAttr:add") + @Log(title = "规格详情", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增规格详情") + public Result add(@RequestBody RuleAttrInfoSaveReq ruleAttrInfoSaveReq) { + return toAjax(ruleAttrInfoService.save(RuleAttrInfo.saveBuild(ruleAttrInfoSaveReq))); + } + + /** + * 修改规格详情 + */ + @RequiresPermissions("product:ruleAttr:edit") + @Log(title = "规格详情", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改规格详情") + public Result edit(@PathVariable Long id, @RequestBody RuleAttrInfoEditReq ruleAttrInfoEditReq) { + return toAjax(ruleAttrInfoService.updateById(RuleAttrInfo.editBuild(id,ruleAttrInfoEditReq))); + } + + /** + * 删除规格详情 + */ + @RequiresPermissions("product:ruleAttr:remove") + @Log(title = "规格详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除规格详情") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + return toAjax(ruleAttrInfoService.removeBatchByIds(ids)); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/RuleController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/RuleController.java deleted file mode 100644 index a47145d..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/RuleController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.muyu.product.controller; - -import java.util.List; - -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.muyu.common.log.annotation.Log; -import com.muyu.common.log.enums.BusinessType; -import com.muyu.common.security.annotation.RequiresPermissions; -import com.muyu.product.domain.Rule; -import com.muyu.product.service.IRuleService; -import com.muyu.common.core.web.controller.BaseController; -import com.muyu.common.core.domain.Result; -import com.muyu.common.core.utils.poi.ExcelUtil; -import com.muyu.common.core.web.page.TableDataInfo; - -/** - * 商品规格Controller - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@RestController -@RequestMapping("/rule") -public class RuleController extends BaseController -{ - @Autowired - private IRuleService ruleService; - - /** - * 查询商品规格列表 - */ - @RequiresPermissions("product:rule:list") - @GetMapping("/list") - public Result> list(Rule rule) - { - startPage(); - List list = ruleService.selectRuleList(rule); - return getDataTable(list); - } - - /** - * 导出商品规格列表 - */ - @RequiresPermissions("product:rule:export") - @Log(title = "商品规格", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, Rule rule) - { - List list = ruleService.selectRuleList(rule); - ExcelUtil util = new ExcelUtil(Rule.class); - util.exportExcel(response, list, "商品规格数据"); - } - - /** - * 获取商品规格详细信息 - */ - @RequiresPermissions("product:rule:query") - @GetMapping(value = "/{id}") - public Result getInfo(@PathVariable("id") Long id) - { - return success(ruleService.selectRuleById(id)); - } - - /** - * 新增商品规格 - */ - @RequiresPermissions("product:rule:add") - @Log(title = "商品规格", businessType = BusinessType.INSERT) - @PostMapping - public Result add(@RequestBody Rule rule) - { - return toAjax(ruleService.insertRule(rule)); - } - - /** - * 修改商品规格 - */ - @RequiresPermissions("product:rule:edit") - @Log(title = "商品规格", businessType = BusinessType.UPDATE) - @PutMapping - public Result edit(@RequestBody Rule rule) - { - return toAjax(ruleService.updateRule(rule)); - } - - /** - * 删除商品规格 - */ - @RequiresPermissions("product:rule:remove") - @Log(title = "商品规格", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public Result remove(@PathVariable Long[] ids) - { - return toAjax(ruleService.deleteRuleByIds(ids)); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/RuleInfoController.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/RuleInfoController.java new file mode 100644 index 0000000..f29dcc9 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/controller/RuleInfoController.java @@ -0,0 +1,112 @@ +package com.muyu.product.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.text.Convert; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.product.domain.RuleInfo; +import com.muyu.product.domain.model.RuleInfoAddModel; +import com.muyu.product.domain.req.RuleInfoEditReq; +import com.muyu.product.domain.req.RuleInfoQueryReq; +import com.muyu.product.domain.req.RuleInfoSaveReq; +import com.muyu.product.domain.resp.RuleInfoResp; +import com.muyu.product.service.RuleInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 商品规格Controller + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Api(tags = "商品规格") +@RestController +@RequestMapping("/rule") +public class RuleInfoController extends BaseController { + @Autowired + private RuleInfoService ruleInfoService; + + /** + * 查询商品规格列表 + */ + @ApiOperation("获取商品规格列表") + @RequiresPermissions("product:rule:list") + @GetMapping("/list") + public Result list(RuleInfoQueryReq ruleInfoQueryReq) { + boolean isPage = ruleInfoQueryReq.getParams().get("isPage") == null || Convert.toBool(ruleInfoQueryReq.getParams().get("isPage"), true); + if (isPage){ + startPage(); + } + TableDataInfo tableDataInfo = ruleInfoService.queryList(ruleInfoQueryReq); + return isPage ? Result.success(tableDataInfo) : Result.success(tableDataInfo.getRows()); + } + + /** + * 导出商品规格列表 + */ + @ApiOperation("导出商品规格列表") + @RequiresPermissions("product:rule:export") + @Log(title = "商品规格", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, RuleInfo ruleInfo) { + List list = ruleInfoService.list(ruleInfo); + ExcelUtil util = new ExcelUtil(RuleInfo.class); + util.exportExcel(response, list, "商品规格数据"); + } + + /** + * 获取商品规格详细信息 + */ + @ApiOperation("获取商品规格详细信息") + @RequiresPermissions("product:rule:query") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + return Result.success(ruleInfoService.getById(id)); + } + + /** + * 新增商品规格 + */ + @RequiresPermissions("product:rule:add") + @Log(title = "商品规格", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增商品规格") + public Result add(@RequestBody RuleInfoSaveReq ruleInfoSaveReq) { + return toAjax(ruleInfoService.save(RuleInfoAddModel.saveReqBuild(ruleInfoSaveReq))); + } + + /** + * 修改商品规格 + */ + @RequiresPermissions("product:rule:edit") + @Log(title = "商品规格", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改商品规格") + public Result edit(@PathVariable Long id, @RequestBody RuleInfoEditReq ruleInfoEditReq) { + return toAjax(ruleInfoService.updateById(RuleInfo.editBuild(id,ruleInfoEditReq))); + } + + /** + * 删除商品规格 + */ + @RequiresPermissions("product:rule:remove") + @Log(title = "商品规格", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除商品规格") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + return toAjax(ruleInfoService.removeBatchByIds(ids)); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsAttributeGroupMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsAttributeGroupMapper.java new file mode 100644 index 0000000..cccc851 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsAttributeGroupMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.AsAttributeGroup; + +/** + * 属性与组中间Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AsAttributeGroupMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsBrandProjectMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsBrandProjectMapper.java new file mode 100644 index 0000000..ce57a2a --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsBrandProjectMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.AsBrandProject; + +/** + * 品牌商品中间Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AsBrandProjectMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsCategoryAttributeGroupMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsCategoryAttributeGroupMapper.java new file mode 100644 index 0000000..ccca942 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsCategoryAttributeGroupMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.AsCategoryAttributeGroup; + +/** + * 品类属性组中间Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AsCategoryAttributeGroupMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsCategoryAttributeMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsCategoryAttributeMapper.java new file mode 100644 index 0000000..62fc494 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsCategoryAttributeMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.AsCategoryAttribute; + +/** + * 品类属性中间Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AsCategoryAttributeMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsCategoryBrandMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsCategoryBrandMapper.java new file mode 100644 index 0000000..887aae0 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsCategoryBrandMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.AsCategoryBrand; + +/** + * 品类品牌中间Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AsCategoryBrandMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsProductAttributeInfoMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsProductAttributeInfoMapper.java new file mode 100644 index 0000000..6ee2f34 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AsProductAttributeInfoMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.AsProductAttributeInfo; + +/** + * 商品属性Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AsProductAttributeInfoMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AttributeGroupMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AttributeGroupMapper.java index 24f67f4..8cd6283 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AttributeGroupMapper.java +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AttributeGroupMapper.java @@ -1,61 +1,14 @@ package com.muyu.product.mapper; -import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.muyu.product.domain.AttributeGroup; /** * 属性组Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 + * + * @author DongZeLiang + * @date 2024-02-27 */ -public interface AttributeGroupMapper -{ - /** - * 查询属性组 - * - * @param id 属性组主键 - * @return 属性组 - */ - public AttributeGroup selectAttributeGroupById(Long id); +public interface AttributeGroupMapper extends BaseMapper { - /** - * 查询属性组列表 - * - * @param attributeGroup 属性组 - * @return 属性组集合 - */ - public List selectAttributeGroupList(AttributeGroup attributeGroup); - - /** - * 新增属性组 - * - * @param attributeGroup 属性组 - * @return 结果 - */ - public int insertAttributeGroup(AttributeGroup attributeGroup); - - /** - * 修改属性组 - * - * @param attributeGroup 属性组 - * @return 结果 - */ - public int updateAttributeGroup(AttributeGroup attributeGroup); - - /** - * 删除属性组 - * - * @param id 属性组主键 - * @return 结果 - */ - public int deleteAttributeGroupById(Long id); - - /** - * 批量删除属性组 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteAttributeGroupByIds(Long[] ids); } diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AttributeInfoMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AttributeInfoMapper.java new file mode 100644 index 0000000..65fd3d5 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AttributeInfoMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.AttributeInfo; + +/** + * 商品属性Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AttributeInfoMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AttributeMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AttributeMapper.java deleted file mode 100644 index 6d5cb55..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/AttributeMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.mapper; - -import java.util.List; -import com.muyu.product.domain.Attribute; - -/** - * 商品属性Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface AttributeMapper -{ - /** - * 查询商品属性 - * - * @param id 商品属性主键 - * @return 商品属性 - */ - public Attribute selectAttributeById(Long id); - - /** - * 查询商品属性列表 - * - * @param attribute 商品属性 - * @return 商品属性集合 - */ - public List selectAttributeList(Attribute attribute); - - /** - * 新增商品属性 - * - * @param attribute 商品属性 - * @return 结果 - */ - public int insertAttribute(Attribute attribute); - - /** - * 修改商品属性 - * - * @param attribute 商品属性 - * @return 结果 - */ - public int updateAttribute(Attribute attribute); - - /** - * 删除商品属性 - * - * @param id 商品属性主键 - * @return 结果 - */ - public int deleteAttributeById(Long id); - - /** - * 批量删除商品属性 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteAttributeByIds(Long[] ids); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/BrandInfoMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/BrandInfoMapper.java index 7feb86c..650752e 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/BrandInfoMapper.java +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/BrandInfoMapper.java @@ -1,61 +1,14 @@ package com.muyu.product.mapper; -import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.muyu.product.domain.BrandInfo; /** - * 商品品牌Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 + * 品牌信息Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 */ -public interface BrandInfoMapper -{ - /** - * 查询商品品牌 - * - * @param id 商品品牌主键 - * @return 商品品牌 - */ - public BrandInfo selectBrandInfoById(Long id); +public interface BrandInfoMapper extends BaseMapper { - /** - * 查询商品品牌列表 - * - * @param brandInfo 商品品牌 - * @return 商品品牌集合 - */ - public List selectBrandInfoList(BrandInfo brandInfo); - - /** - * 新增商品品牌 - * - * @param brandInfo 商品品牌 - * @return 结果 - */ - public int insertBrandInfo(BrandInfo brandInfo); - - /** - * 修改商品品牌 - * - * @param brandInfo 商品品牌 - * @return 结果 - */ - public int updateBrandInfo(BrandInfo brandInfo); - - /** - * 删除商品品牌 - * - * @param id 商品品牌主键 - * @return 结果 - */ - public int deleteBrandInfoById(Long id); - - /** - * 批量删除商品品牌 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteBrandInfoByIds(Long[] ids); } diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/BrandProductMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/BrandProductMapper.java deleted file mode 100644 index 98142a4..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/BrandProductMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.mapper; - -import java.util.List; -import com.muyu.product.domain.BrandProduct; - -/** - * 品牌商品中间Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface BrandProductMapper -{ - /** - * 查询品牌商品中间 - * - * @param id 品牌商品中间主键 - * @return 品牌商品中间 - */ - public BrandProduct selectBrandProductById(Long id); - - /** - * 查询品牌商品中间列表 - * - * @param brandProduct 品牌商品中间 - * @return 品牌商品中间集合 - */ - public List selectBrandProductList(BrandProduct brandProduct); - - /** - * 新增品牌商品中间 - * - * @param brandProduct 品牌商品中间 - * @return 结果 - */ - public int insertBrandProduct(BrandProduct brandProduct); - - /** - * 修改品牌商品中间 - * - * @param brandProduct 品牌商品中间 - * @return 结果 - */ - public int updateBrandProduct(BrandProduct brandProduct); - - /** - * 删除品牌商品中间 - * - * @param id 品牌商品中间主键 - * @return 结果 - */ - public int deleteBrandProductById(Long id); - - /** - * 批量删除品牌商品中间 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteBrandProductByIds(Long[] ids); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryAttributeGroupMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryAttributeGroupMapper.java deleted file mode 100644 index 068c0c8..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryAttributeGroupMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.mapper; - -import java.util.List; -import com.muyu.product.domain.CategoryAttributeGroup; - -/** - * 品类Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface CategoryAttributeGroupMapper -{ - /** - * 查询品类 - * - * @param id 品类主键 - * @return 品类 - */ - public CategoryAttributeGroup selectCategoryAttributeGroupById(Long id); - - /** - * 查询品类列表 - * - * @param categoryAttributeGroup 品类 - * @return 品类集合 - */ - public List selectCategoryAttributeGroupList(CategoryAttributeGroup categoryAttributeGroup); - - /** - * 新增品类 - * - * @param categoryAttributeGroup 品类 - * @return 结果 - */ - public int insertCategoryAttributeGroup(CategoryAttributeGroup categoryAttributeGroup); - - /** - * 修改品类 - * - * @param categoryAttributeGroup 品类 - * @return 结果 - */ - public int updateCategoryAttributeGroup(CategoryAttributeGroup categoryAttributeGroup); - - /** - * 删除品类 - * - * @param id 品类主键 - * @return 结果 - */ - public int deleteCategoryAttributeGroupById(Long id); - - /** - * 批量删除品类 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteCategoryAttributeGroupByIds(Long[] ids); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryAttributeMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryAttributeMapper.java deleted file mode 100644 index a26de01..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryAttributeMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.mapper; - -import java.util.List; -import com.muyu.product.domain.CategoryAttribute; - -/** - * 品类Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface CategoryAttributeMapper -{ - /** - * 查询品类 - * - * @param id 品类主键 - * @return 品类 - */ - public CategoryAttribute selectCategoryAttributeById(Long id); - - /** - * 查询品类列表 - * - * @param categoryAttribute 品类 - * @return 品类集合 - */ - public List selectCategoryAttributeList(CategoryAttribute categoryAttribute); - - /** - * 新增品类 - * - * @param categoryAttribute 品类 - * @return 结果 - */ - public int insertCategoryAttribute(CategoryAttribute categoryAttribute); - - /** - * 修改品类 - * - * @param categoryAttribute 品类 - * @return 结果 - */ - public int updateCategoryAttribute(CategoryAttribute categoryAttribute); - - /** - * 删除品类 - * - * @param id 品类主键 - * @return 结果 - */ - public int deleteCategoryAttributeById(Long id); - - /** - * 批量删除品类 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteCategoryAttributeByIds(Long[] ids); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryBrandMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryBrandMapper.java deleted file mode 100644 index 306cc13..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryBrandMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.mapper; - -import java.util.List; -import com.muyu.product.domain.CategoryBrand; - -/** - * 品类Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface CategoryBrandMapper -{ - /** - * 查询品类 - * - * @param id 品类主键 - * @return 品类 - */ - public CategoryBrand selectCategoryBrandById(Long id); - - /** - * 查询品类列表 - * - * @param categoryBrand 品类 - * @return 品类集合 - */ - public List selectCategoryBrandList(CategoryBrand categoryBrand); - - /** - * 新增品类 - * - * @param categoryBrand 品类 - * @return 结果 - */ - public int insertCategoryBrand(CategoryBrand categoryBrand); - - /** - * 修改品类 - * - * @param categoryBrand 品类 - * @return 结果 - */ - public int updateCategoryBrand(CategoryBrand categoryBrand); - - /** - * 删除品类 - * - * @param id 品类主键 - * @return 结果 - */ - public int deleteCategoryBrandById(Long id); - - /** - * 批量删除品类 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteCategoryBrandByIds(Long[] ids); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryInfoMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryInfoMapper.java index 34edba8..e9c2661 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryInfoMapper.java +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CategoryInfoMapper.java @@ -1,61 +1,14 @@ package com.muyu.product.mapper; -import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.muyu.product.domain.CategoryInfo; /** * 品类信息Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 + * + * @author DongZeLiang + * @date 2024-02-27 */ -public interface CategoryInfoMapper -{ - /** - * 查询品类信息 - * - * @param id 品类信息主键 - * @return 品类信息 - */ - public CategoryInfo selectCategoryInfoById(Long id); +public interface CategoryInfoMapper extends BaseMapper { - /** - * 查询品类信息列表 - * - * @param categoryInfo 品类信息 - * @return 品类信息集合 - */ - public List selectCategoryInfoList(CategoryInfo categoryInfo); - - /** - * 新增品类信息 - * - * @param categoryInfo 品类信息 - * @return 结果 - */ - public int insertCategoryInfo(CategoryInfo categoryInfo); - - /** - * 修改品类信息 - * - * @param categoryInfo 品类信息 - * @return 结果 - */ - public int updateCategoryInfo(CategoryInfo categoryInfo); - - /** - * 删除品类信息 - * - * @param id 品类信息主键 - * @return 结果 - */ - public int deleteCategoryInfoById(Long id); - - /** - * 批量删除品类信息 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteCategoryInfoByIds(Long[] ids); } diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CommentInfoMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CommentInfoMapper.java new file mode 100644 index 0000000..871e738 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CommentInfoMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.CommentInfo; + +/** + * 商品评论Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface CommentInfoMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CommentLikeInfoMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CommentLikeInfoMapper.java new file mode 100644 index 0000000..21349f8 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CommentLikeInfoMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.CommentLikeInfo; + +/** + * 评论点赞Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface CommentLikeInfoMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CommentLikeMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CommentLikeMapper.java deleted file mode 100644 index d0b1e94..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/CommentLikeMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.mapper; - -import java.util.List; -import com.muyu.product.domain.CommentLike; - -/** - * 评论点赞Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface CommentLikeMapper -{ - /** - * 查询评论点赞 - * - * @param id 评论点赞主键 - * @return 评论点赞 - */ - public CommentLike selectCommentLikeById(Long id); - - /** - * 查询评论点赞列表 - * - * @param commentLike 评论点赞 - * @return 评论点赞集合 - */ - public List selectCommentLikeList(CommentLike commentLike); - - /** - * 新增评论点赞 - * - * @param commentLike 评论点赞 - * @return 结果 - */ - public int insertCommentLike(CommentLike commentLike); - - /** - * 修改评论点赞 - * - * @param commentLike 评论点赞 - * @return 结果 - */ - public int updateCommentLike(CommentLike commentLike); - - /** - * 删除评论点赞 - * - * @param id 评论点赞主键 - * @return 结果 - */ - public int deleteCommentLikeById(Long id); - - /** - * 批量删除评论点赞 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteCommentLikeByIds(Long[] ids); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProductAttributeMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProductAttributeMapper.java deleted file mode 100644 index c21e8a1..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProductAttributeMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.mapper; - -import java.util.List; -import com.muyu.product.domain.ProductAttribute; - -/** - * 商品属性Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface ProductAttributeMapper -{ - /** - * 查询商品属性 - * - * @param id 商品属性主键 - * @return 商品属性 - */ - public ProductAttribute selectProductAttributeById(Long id); - - /** - * 查询商品属性列表 - * - * @param productAttribute 商品属性 - * @return 商品属性集合 - */ - public List selectProductAttributeList(ProductAttribute productAttribute); - - /** - * 新增商品属性 - * - * @param productAttribute 商品属性 - * @return 结果 - */ - public int insertProductAttribute(ProductAttribute productAttribute); - - /** - * 修改商品属性 - * - * @param productAttribute 商品属性 - * @return 结果 - */ - public int updateProductAttribute(ProductAttribute productAttribute); - - /** - * 删除商品属性 - * - * @param id 商品属性主键 - * @return 结果 - */ - public int deleteProductAttributeById(Long id); - - /** - * 批量删除商品属性 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteProductAttributeByIds(Long[] ids); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProductCommentMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProductCommentMapper.java deleted file mode 100644 index 50d5a66..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProductCommentMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.mapper; - -import java.util.List; -import com.muyu.product.domain.ProductComment; - -/** - * 商品评论Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface ProductCommentMapper -{ - /** - * 查询商品评论 - * - * @param id 商品评论主键 - * @return 商品评论 - */ - public ProductComment selectProductCommentById(Long id); - - /** - * 查询商品评论列表 - * - * @param productComment 商品评论 - * @return 商品评论集合 - */ - public List selectProductCommentList(ProductComment productComment); - - /** - * 新增商品评论 - * - * @param productComment 商品评论 - * @return 结果 - */ - public int insertProductComment(ProductComment productComment); - - /** - * 修改商品评论 - * - * @param productComment 商品评论 - * @return 结果 - */ - public int updateProductComment(ProductComment productComment); - - /** - * 删除商品评论 - * - * @param id 商品评论主键 - * @return 结果 - */ - public int deleteProductCommentById(Long id); - - /** - * 批量删除商品评论 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteProductCommentByIds(Long[] ids); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProductMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProductMapper.java deleted file mode 100644 index 98e33e2..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProductMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.mapper; - -import java.util.List; -import com.muyu.product.domain.Product; - -/** - * 商品信息Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface ProductMapper -{ - /** - * 查询商品信息 - * - * @param id 商品信息主键 - * @return 商品信息 - */ - public Product selectProductById(Long id); - - /** - * 查询商品信息列表 - * - * @param product 商品信息 - * @return 商品信息集合 - */ - public List selectProductList(Product product); - - /** - * 新增商品信息 - * - * @param product 商品信息 - * @return 结果 - */ - public int insertProduct(Product product); - - /** - * 修改商品信息 - * - * @param product 商品信息 - * @return 结果 - */ - public int updateProduct(Product product); - - /** - * 删除商品信息 - * - * @param id 商品信息主键 - * @return 结果 - */ - public int deleteProductById(Long id); - - /** - * 批量删除商品信息 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteProductByIds(Long[] ids); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProductSkuMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProductSkuMapper.java deleted file mode 100644 index 8ea9fae..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProductSkuMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.mapper; - -import java.util.List; -import com.muyu.product.domain.ProductSku; - -/** - * 商品skuMapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface ProductSkuMapper -{ - /** - * 查询商品sku - * - * @param id 商品sku主键 - * @return 商品sku - */ - public ProductSku selectProductSkuById(Long id); - - /** - * 查询商品sku列表 - * - * @param productSku 商品sku - * @return 商品sku集合 - */ - public List selectProductSkuList(ProductSku productSku); - - /** - * 新增商品sku - * - * @param productSku 商品sku - * @return 结果 - */ - public int insertProductSku(ProductSku productSku); - - /** - * 修改商品sku - * - * @param productSku 商品sku - * @return 结果 - */ - public int updateProductSku(ProductSku productSku); - - /** - * 删除商品sku - * - * @param id 商品sku主键 - * @return 结果 - */ - public int deleteProductSkuById(Long id); - - /** - * 批量删除商品sku - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteProductSkuByIds(Long[] ids); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProjectInfoMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProjectInfoMapper.java new file mode 100644 index 0000000..293a72e --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProjectInfoMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.ProjectInfo; + +/** + * 商品信息Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface ProjectInfoMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProjectSkuInfoMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProjectSkuInfoMapper.java new file mode 100644 index 0000000..9ae73dc --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/ProjectSkuInfoMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.ProjectSkuInfo; + +/** + * 商品SKUMapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface ProjectSkuInfoMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/RuleAttrInfoMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/RuleAttrInfoMapper.java new file mode 100644 index 0000000..3cbdd02 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/RuleAttrInfoMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.RuleAttrInfo; + +/** + * 规格详情Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface RuleAttrInfoMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/RuleAttrMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/RuleAttrMapper.java deleted file mode 100644 index 118e978..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/RuleAttrMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.mapper; - -import java.util.List; -import com.muyu.product.domain.RuleAttr; - -/** - * 规格详情Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface RuleAttrMapper -{ - /** - * 查询规格详情 - * - * @param id 规格详情主键 - * @return 规格详情 - */ - public RuleAttr selectRuleAttrById(Long id); - - /** - * 查询规格详情列表 - * - * @param ruleAttr 规格详情 - * @return 规格详情集合 - */ - public List selectRuleAttrList(RuleAttr ruleAttr); - - /** - * 新增规格详情 - * - * @param ruleAttr 规格详情 - * @return 结果 - */ - public int insertRuleAttr(RuleAttr ruleAttr); - - /** - * 修改规格详情 - * - * @param ruleAttr 规格详情 - * @return 结果 - */ - public int updateRuleAttr(RuleAttr ruleAttr); - - /** - * 删除规格详情 - * - * @param id 规格详情主键 - * @return 结果 - */ - public int deleteRuleAttrById(Long id); - - /** - * 批量删除规格详情 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteRuleAttrByIds(Long[] ids); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/RuleInfoMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/RuleInfoMapper.java new file mode 100644 index 0000000..b8cac11 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/RuleInfoMapper.java @@ -0,0 +1,14 @@ +package com.muyu.product.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.product.domain.RuleInfo; + +/** + * 商品规格Mapper接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface RuleInfoMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/RuleMapper.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/RuleMapper.java deleted file mode 100644 index 786d536..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/mapper/RuleMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.mapper; - -import java.util.List; -import com.muyu.product.domain.Rule; - -/** - * 商品规格Mapper接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface RuleMapper -{ - /** - * 查询商品规格 - * - * @param id 商品规格主键 - * @return 商品规格 - */ - public Rule selectRuleById(Long id); - - /** - * 查询商品规格列表 - * - * @param rule 商品规格 - * @return 商品规格集合 - */ - public List selectRuleList(Rule rule); - - /** - * 新增商品规格 - * - * @param rule 商品规格 - * @return 结果 - */ - public int insertRule(Rule rule); - - /** - * 修改商品规格 - * - * @param rule 商品规格 - * @return 结果 - */ - public int updateRule(Rule rule); - - /** - * 删除商品规格 - * - * @param id 商品规格主键 - * @return 结果 - */ - public int deleteRuleById(Long id); - - /** - * 批量删除商品规格 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteRuleByIds(Long[] ids); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsAttributeGroupService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsAttributeGroupService.java new file mode 100644 index 0000000..0950447 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsAttributeGroupService.java @@ -0,0 +1,23 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.AsAttributeGroup; + +import java.util.List; + +/** + * 属性与组中间Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AsAttributeGroupService extends IService { + /** + * 查询属性与组中间列表 + * + * @param asAttributeGroup 属性与组中间 + * @return 属性与组中间集合 + */ + public List list(AsAttributeGroup asAttributeGroup); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsBrandProjectService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsBrandProjectService.java new file mode 100644 index 0000000..999772a --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsBrandProjectService.java @@ -0,0 +1,23 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.AsBrandProject; + +import java.util.List; + +/** + * 品牌商品中间Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AsBrandProjectService extends IService { + /** + * 查询品牌商品中间列表 + * + * @param asBrandProject 品牌商品中间 + * @return 品牌商品中间集合 + */ + public List list(AsBrandProject asBrandProject); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsCategoryAttributeGroupService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsCategoryAttributeGroupService.java new file mode 100644 index 0000000..9c3d69e --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsCategoryAttributeGroupService.java @@ -0,0 +1,23 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.AsCategoryAttributeGroup; + +import java.util.List; + +/** + * 品类属性组中间Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AsCategoryAttributeGroupService extends IService { + /** + * 查询品类属性组中间列表 + * + * @param asCategoryAttributeGroup 品类属性组中间 + * @return 品类属性组中间集合 + */ + public List list(AsCategoryAttributeGroup asCategoryAttributeGroup); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsCategoryAttributeService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsCategoryAttributeService.java new file mode 100644 index 0000000..f6c06ac --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsCategoryAttributeService.java @@ -0,0 +1,23 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.AsCategoryAttribute; + +import java.util.List; + +/** + * 品类属性中间Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AsCategoryAttributeService extends IService { + /** + * 查询品类属性中间列表 + * + * @param asCategoryAttribute 品类属性中间 + * @return 品类属性中间集合 + */ + public List list(AsCategoryAttribute asCategoryAttribute); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsCategoryBrandService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsCategoryBrandService.java new file mode 100644 index 0000000..4ec3c18 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsCategoryBrandService.java @@ -0,0 +1,23 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.AsCategoryBrand; + +import java.util.List; + +/** + * 品类品牌中间Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AsCategoryBrandService extends IService { + /** + * 查询品类品牌中间列表 + * + * @param asCategoryBrand 品类品牌中间 + * @return 品类品牌中间集合 + */ + public List list(AsCategoryBrand asCategoryBrand); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsProductAttributeInfoService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsProductAttributeInfoService.java new file mode 100644 index 0000000..f06c44d --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AsProductAttributeInfoService.java @@ -0,0 +1,23 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.AsProductAttributeInfo; + +import java.util.List; + +/** + * 商品属性Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AsProductAttributeInfoService extends IService { + /** + * 查询商品属性列表 + * + * @param asProductAttributeInfo 商品属性 + * @return 商品属性集合 + */ + public List list(AsProductAttributeInfo asProductAttributeInfo); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AttributeGroupService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AttributeGroupService.java new file mode 100644 index 0000000..bddd269 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AttributeGroupService.java @@ -0,0 +1,41 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.product.domain.AttributeGroup; +import com.muyu.product.domain.model.AttributeGroupSaveModel; +import com.muyu.product.domain.resp.AttributeGroupPageResp; + +import java.util.List; + +/** + * 属性组Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AttributeGroupService extends IService { + + /** + * 分页查询 + * @param attributeGroup 分组对象 + * @return 返回结果 + */ + public TableDataInfo page(AttributeGroup attributeGroup); + + /** + * 查询属性组列表 + * + * @param attributeGroup 属性组 + * @return 属性组集合 + */ + public List list(AttributeGroup attributeGroup); + + /** + * 保存 + * @param attributeGroupSaveModel 属性组保存模型 + * @return 是否成功 + */ + public Boolean save(AttributeGroupSaveModel attributeGroupSaveModel); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AttributeInfoService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AttributeInfoService.java new file mode 100644 index 0000000..faa91b3 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/AttributeInfoService.java @@ -0,0 +1,29 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.AttributeInfo; + +import java.util.List; + +/** + * 商品属性Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface AttributeInfoService extends IService { + /** + * 查询商品属性列表 + * + * @param attributeInfo 商品属性 + * @return 商品属性集合 + */ + public List list(AttributeInfo attributeInfo); + + /** + * 通过groupId查询属性集合 + * @param groupId 属性组Id + * @return 属性集合 + */ + public List attributeListByGroupId(Long groupId); +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/BrandInfoService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/BrandInfoService.java new file mode 100644 index 0000000..2b75c68 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/BrandInfoService.java @@ -0,0 +1,23 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.BrandInfo; + +import java.util.List; + +/** + * 品牌信息Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface BrandInfoService extends IService { + /** + * 查询品牌信息列表 + * + * @param brandInfo 品牌信息 + * @return 品牌信息集合 + */ + public List list(BrandInfo brandInfo); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/CategoryInfoService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/CategoryInfoService.java new file mode 100644 index 0000000..f48896b --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/CategoryInfoService.java @@ -0,0 +1,70 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.AttributeGroup; +import com.muyu.product.domain.AttributeInfo; +import com.muyu.product.domain.BrandInfo; +import com.muyu.product.domain.CategoryInfo; +import com.muyu.product.domain.model.CategoryInfoSaveModel; +import com.muyu.product.domain.resp.CategoryCommonElementResp; +import com.muyu.product.domain.resp.CategoryParentCommonElementResp; + +import java.util.List; + +/** + * 品类信息Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface CategoryInfoService extends IService { + /** + * 查询品类信息列表 + * + * @param categoryInfo 品类信息 + * @return 品类信息集合 + */ + public List list(CategoryInfo categoryInfo); + + /** + * 保存 + * @param categoryInfoSaveModel 保存品类模型 + * @return 是否成功 + */ + public boolean save(CategoryInfoSaveModel categoryInfoSaveModel); + + /** + * 通过品类ID获取父级以上的属性组集合 + * @param categoryId 品类ID + * @return 父级以上的属性组集合 + */ + List getAttributeGroup (Long categoryId); + + /** + * 通过品类ID获取父级以上的品牌集合 + * @param categoryId 品类ID + * @return 父级以上的品牌集合 + */ + List getBrand (Long categoryId); + + /** + * 通过品类ID获取父级以上的属性集合 + * @param categoryId 品类ID + * @return 父级以上的属性集合 + */ + List getAttribute (Long categoryId); + + /** + * 通过品类ID获取父级以上的属性、属性组、品牌集合 + * @param categoryId 品类ID + * @return 父级以上的属性、属性组、品牌集合 + */ + CategoryParentCommonElementResp parentCommonElement (Long categoryId); + + /** + * 通过品类ID获取品类共有属性 + * @param cateGoryId 品类ID + * @return 品类共有属性 + */ + CategoryCommonElementResp getTemplateAttributeByCateGoryId (Long cateGoryId); +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/CommentInfoService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/CommentInfoService.java new file mode 100644 index 0000000..671684a --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/CommentInfoService.java @@ -0,0 +1,23 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.CommentInfo; + +import java.util.List; + +/** + * 商品评论Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface CommentInfoService extends IService { + /** + * 查询商品评论列表 + * + * @param commentInfo 商品评论 + * @return 商品评论集合 + */ + public List list(CommentInfo commentInfo); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/CommentLikeInfoService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/CommentLikeInfoService.java new file mode 100644 index 0000000..7a62a74 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/CommentLikeInfoService.java @@ -0,0 +1,23 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.CommentLikeInfo; + +import java.util.List; + +/** + * 评论点赞Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface CommentLikeInfoService extends IService { + /** + * 查询评论点赞列表 + * + * @param commentLikeInfo 评论点赞 + * @return 评论点赞集合 + */ + public List list(CommentLikeInfo commentLikeInfo); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IAttributeGroupService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IAttributeGroupService.java deleted file mode 100644 index 71621c4..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IAttributeGroupService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.AttributeGroup; - -/** - * 属性组Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface IAttributeGroupService -{ - /** - * 查询属性组 - * - * @param id 属性组主键 - * @return 属性组 - */ - public AttributeGroup selectAttributeGroupById(Long id); - - /** - * 查询属性组列表 - * - * @param attributeGroup 属性组 - * @return 属性组集合 - */ - public List selectAttributeGroupList(AttributeGroup attributeGroup); - - /** - * 新增属性组 - * - * @param attributeGroup 属性组 - * @return 结果 - */ - public int insertAttributeGroup(AttributeGroup attributeGroup); - - /** - * 修改属性组 - * - * @param attributeGroup 属性组 - * @return 结果 - */ - public int updateAttributeGroup(AttributeGroup attributeGroup); - - /** - * 批量删除属性组 - * - * @param ids 需要删除的属性组主键集合 - * @return 结果 - */ - public int deleteAttributeGroupByIds(Long[] ids); - - /** - * 删除属性组信息 - * - * @param id 属性组主键 - * @return 结果 - */ - public int deleteAttributeGroupById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IAttributeService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IAttributeService.java deleted file mode 100644 index ec95bdc..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IAttributeService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.Attribute; - -/** - * 商品属性Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface IAttributeService -{ - /** - * 查询商品属性 - * - * @param id 商品属性主键 - * @return 商品属性 - */ - public Attribute selectAttributeById(Long id); - - /** - * 查询商品属性列表 - * - * @param attribute 商品属性 - * @return 商品属性集合 - */ - public List selectAttributeList(Attribute attribute); - - /** - * 新增商品属性 - * - * @param attribute 商品属性 - * @return 结果 - */ - public int insertAttribute(Attribute attribute); - - /** - * 修改商品属性 - * - * @param attribute 商品属性 - * @return 结果 - */ - public int updateAttribute(Attribute attribute); - - /** - * 批量删除商品属性 - * - * @param ids 需要删除的商品属性主键集合 - * @return 结果 - */ - public int deleteAttributeByIds(Long[] ids); - - /** - * 删除商品属性信息 - * - * @param id 商品属性主键 - * @return 结果 - */ - public int deleteAttributeById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IBrandInfoService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IBrandInfoService.java deleted file mode 100644 index e9e913b..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IBrandInfoService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.BrandInfo; - -/** - * 商品品牌Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface IBrandInfoService -{ - /** - * 查询商品品牌 - * - * @param id 商品品牌主键 - * @return 商品品牌 - */ - public BrandInfo selectBrandInfoById(Long id); - - /** - * 查询商品品牌列表 - * - * @param brandInfo 商品品牌 - * @return 商品品牌集合 - */ - public List selectBrandInfoList(BrandInfo brandInfo); - - /** - * 新增商品品牌 - * - * @param brandInfo 商品品牌 - * @return 结果 - */ - public int insertBrandInfo(BrandInfo brandInfo); - - /** - * 修改商品品牌 - * - * @param brandInfo 商品品牌 - * @return 结果 - */ - public int updateBrandInfo(BrandInfo brandInfo); - - /** - * 批量删除商品品牌 - * - * @param ids 需要删除的商品品牌主键集合 - * @return 结果 - */ - public int deleteBrandInfoByIds(Long[] ids); - - /** - * 删除商品品牌信息 - * - * @param id 商品品牌主键 - * @return 结果 - */ - public int deleteBrandInfoById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IBrandProductService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IBrandProductService.java deleted file mode 100644 index e3f75ba..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IBrandProductService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.BrandProduct; - -/** - * 品牌商品中间Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface IBrandProductService -{ - /** - * 查询品牌商品中间 - * - * @param id 品牌商品中间主键 - * @return 品牌商品中间 - */ - public BrandProduct selectBrandProductById(Long id); - - /** - * 查询品牌商品中间列表 - * - * @param brandProduct 品牌商品中间 - * @return 品牌商品中间集合 - */ - public List selectBrandProductList(BrandProduct brandProduct); - - /** - * 新增品牌商品中间 - * - * @param brandProduct 品牌商品中间 - * @return 结果 - */ - public int insertBrandProduct(BrandProduct brandProduct); - - /** - * 修改品牌商品中间 - * - * @param brandProduct 品牌商品中间 - * @return 结果 - */ - public int updateBrandProduct(BrandProduct brandProduct); - - /** - * 批量删除品牌商品中间 - * - * @param ids 需要删除的品牌商品中间主键集合 - * @return 结果 - */ - public int deleteBrandProductByIds(Long[] ids); - - /** - * 删除品牌商品中间信息 - * - * @param id 品牌商品中间主键 - * @return 结果 - */ - public int deleteBrandProductById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICategoryAttributeGroupService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICategoryAttributeGroupService.java deleted file mode 100644 index 4878684..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICategoryAttributeGroupService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.CategoryAttributeGroup; - -/** - * 品类Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface ICategoryAttributeGroupService -{ - /** - * 查询品类 - * - * @param id 品类主键 - * @return 品类 - */ - public CategoryAttributeGroup selectCategoryAttributeGroupById(Long id); - - /** - * 查询品类列表 - * - * @param categoryAttributeGroup 品类 - * @return 品类集合 - */ - public List selectCategoryAttributeGroupList(CategoryAttributeGroup categoryAttributeGroup); - - /** - * 新增品类 - * - * @param categoryAttributeGroup 品类 - * @return 结果 - */ - public int insertCategoryAttributeGroup(CategoryAttributeGroup categoryAttributeGroup); - - /** - * 修改品类 - * - * @param categoryAttributeGroup 品类 - * @return 结果 - */ - public int updateCategoryAttributeGroup(CategoryAttributeGroup categoryAttributeGroup); - - /** - * 批量删除品类 - * - * @param ids 需要删除的品类主键集合 - * @return 结果 - */ - public int deleteCategoryAttributeGroupByIds(Long[] ids); - - /** - * 删除品类信息 - * - * @param id 品类主键 - * @return 结果 - */ - public int deleteCategoryAttributeGroupById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICategoryAttributeService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICategoryAttributeService.java deleted file mode 100644 index 57ca2b2..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICategoryAttributeService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.CategoryAttribute; - -/** - * 品类Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface ICategoryAttributeService -{ - /** - * 查询品类 - * - * @param id 品类主键 - * @return 品类 - */ - public CategoryAttribute selectCategoryAttributeById(Long id); - - /** - * 查询品类列表 - * - * @param categoryAttribute 品类 - * @return 品类集合 - */ - public List selectCategoryAttributeList(CategoryAttribute categoryAttribute); - - /** - * 新增品类 - * - * @param categoryAttribute 品类 - * @return 结果 - */ - public int insertCategoryAttribute(CategoryAttribute categoryAttribute); - - /** - * 修改品类 - * - * @param categoryAttribute 品类 - * @return 结果 - */ - public int updateCategoryAttribute(CategoryAttribute categoryAttribute); - - /** - * 批量删除品类 - * - * @param ids 需要删除的品类主键集合 - * @return 结果 - */ - public int deleteCategoryAttributeByIds(Long[] ids); - - /** - * 删除品类信息 - * - * @param id 品类主键 - * @return 结果 - */ - public int deleteCategoryAttributeById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICategoryBrandService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICategoryBrandService.java deleted file mode 100644 index a4b997e..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICategoryBrandService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.CategoryBrand; - -/** - * 品类Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface ICategoryBrandService -{ - /** - * 查询品类 - * - * @param id 品类主键 - * @return 品类 - */ - public CategoryBrand selectCategoryBrandById(Long id); - - /** - * 查询品类列表 - * - * @param categoryBrand 品类 - * @return 品类集合 - */ - public List selectCategoryBrandList(CategoryBrand categoryBrand); - - /** - * 新增品类 - * - * @param categoryBrand 品类 - * @return 结果 - */ - public int insertCategoryBrand(CategoryBrand categoryBrand); - - /** - * 修改品类 - * - * @param categoryBrand 品类 - * @return 结果 - */ - public int updateCategoryBrand(CategoryBrand categoryBrand); - - /** - * 批量删除品类 - * - * @param ids 需要删除的品类主键集合 - * @return 结果 - */ - public int deleteCategoryBrandByIds(Long[] ids); - - /** - * 删除品类信息 - * - * @param id 品类主键 - * @return 结果 - */ - public int deleteCategoryBrandById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICategoryInfoService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICategoryInfoService.java deleted file mode 100644 index a6d754f..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICategoryInfoService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.CategoryInfo; - -/** - * 品类信息Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface ICategoryInfoService -{ - /** - * 查询品类信息 - * - * @param id 品类信息主键 - * @return 品类信息 - */ - public CategoryInfo selectCategoryInfoById(Long id); - - /** - * 查询品类信息列表 - * - * @param categoryInfo 品类信息 - * @return 品类信息集合 - */ - public List selectCategoryInfoList(CategoryInfo categoryInfo); - - /** - * 新增品类信息 - * - * @param categoryInfo 品类信息 - * @return 结果 - */ - public int insertCategoryInfo(CategoryInfo categoryInfo); - - /** - * 修改品类信息 - * - * @param categoryInfo 品类信息 - * @return 结果 - */ - public int updateCategoryInfo(CategoryInfo categoryInfo); - - /** - * 批量删除品类信息 - * - * @param ids 需要删除的品类信息主键集合 - * @return 结果 - */ - public int deleteCategoryInfoByIds(Long[] ids); - - /** - * 删除品类信息信息 - * - * @param id 品类信息主键 - * @return 结果 - */ - public int deleteCategoryInfoById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICommentLikeService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICommentLikeService.java deleted file mode 100644 index d880c59..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ICommentLikeService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.CommentLike; - -/** - * 评论点赞Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface ICommentLikeService -{ - /** - * 查询评论点赞 - * - * @param id 评论点赞主键 - * @return 评论点赞 - */ - public CommentLike selectCommentLikeById(Long id); - - /** - * 查询评论点赞列表 - * - * @param commentLike 评论点赞 - * @return 评论点赞集合 - */ - public List selectCommentLikeList(CommentLike commentLike); - - /** - * 新增评论点赞 - * - * @param commentLike 评论点赞 - * @return 结果 - */ - public int insertCommentLike(CommentLike commentLike); - - /** - * 修改评论点赞 - * - * @param commentLike 评论点赞 - * @return 结果 - */ - public int updateCommentLike(CommentLike commentLike); - - /** - * 批量删除评论点赞 - * - * @param ids 需要删除的评论点赞主键集合 - * @return 结果 - */ - public int deleteCommentLikeByIds(Long[] ids); - - /** - * 删除评论点赞信息 - * - * @param id 评论点赞主键 - * @return 结果 - */ - public int deleteCommentLikeById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IProductAttributeService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IProductAttributeService.java deleted file mode 100644 index 0b4eb2f..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IProductAttributeService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.ProductAttribute; - -/** - * 商品属性Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface IProductAttributeService -{ - /** - * 查询商品属性 - * - * @param id 商品属性主键 - * @return 商品属性 - */ - public ProductAttribute selectProductAttributeById(Long id); - - /** - * 查询商品属性列表 - * - * @param productAttribute 商品属性 - * @return 商品属性集合 - */ - public List selectProductAttributeList(ProductAttribute productAttribute); - - /** - * 新增商品属性 - * - * @param productAttribute 商品属性 - * @return 结果 - */ - public int insertProductAttribute(ProductAttribute productAttribute); - - /** - * 修改商品属性 - * - * @param productAttribute 商品属性 - * @return 结果 - */ - public int updateProductAttribute(ProductAttribute productAttribute); - - /** - * 批量删除商品属性 - * - * @param ids 需要删除的商品属性主键集合 - * @return 结果 - */ - public int deleteProductAttributeByIds(Long[] ids); - - /** - * 删除商品属性信息 - * - * @param id 商品属性主键 - * @return 结果 - */ - public int deleteProductAttributeById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IProductCommentService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IProductCommentService.java deleted file mode 100644 index 71a9ba4..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IProductCommentService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.ProductComment; - -/** - * 商品评论Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface IProductCommentService -{ - /** - * 查询商品评论 - * - * @param id 商品评论主键 - * @return 商品评论 - */ - public ProductComment selectProductCommentById(Long id); - - /** - * 查询商品评论列表 - * - * @param productComment 商品评论 - * @return 商品评论集合 - */ - public List selectProductCommentList(ProductComment productComment); - - /** - * 新增商品评论 - * - * @param productComment 商品评论 - * @return 结果 - */ - public int insertProductComment(ProductComment productComment); - - /** - * 修改商品评论 - * - * @param productComment 商品评论 - * @return 结果 - */ - public int updateProductComment(ProductComment productComment); - - /** - * 批量删除商品评论 - * - * @param ids 需要删除的商品评论主键集合 - * @return 结果 - */ - public int deleteProductCommentByIds(Long[] ids); - - /** - * 删除商品评论信息 - * - * @param id 商品评论主键 - * @return 结果 - */ - public int deleteProductCommentById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IProductService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IProductService.java deleted file mode 100644 index 7684ec5..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IProductService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.Product; - -/** - * 商品信息Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface IProductService -{ - /** - * 查询商品信息 - * - * @param id 商品信息主键 - * @return 商品信息 - */ - public Product selectProductById(Long id); - - /** - * 查询商品信息列表 - * - * @param product 商品信息 - * @return 商品信息集合 - */ - public List selectProductList(Product product); - - /** - * 新增商品信息 - * - * @param product 商品信息 - * @return 结果 - */ - public int insertProduct(Product product); - - /** - * 修改商品信息 - * - * @param product 商品信息 - * @return 结果 - */ - public int updateProduct(Product product); - - /** - * 批量删除商品信息 - * - * @param ids 需要删除的商品信息主键集合 - * @return 结果 - */ - public int deleteProductByIds(Long[] ids); - - /** - * 删除商品信息信息 - * - * @param id 商品信息主键 - * @return 结果 - */ - public int deleteProductById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IProductSkuService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IProductSkuService.java deleted file mode 100644 index 5d0f053..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IProductSkuService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.ProductSku; - -/** - * 商品skuService接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface IProductSkuService -{ - /** - * 查询商品sku - * - * @param id 商品sku主键 - * @return 商品sku - */ - public ProductSku selectProductSkuById(Long id); - - /** - * 查询商品sku列表 - * - * @param productSku 商品sku - * @return 商品sku集合 - */ - public List selectProductSkuList(ProductSku productSku); - - /** - * 新增商品sku - * - * @param productSku 商品sku - * @return 结果 - */ - public int insertProductSku(ProductSku productSku); - - /** - * 修改商品sku - * - * @param productSku 商品sku - * @return 结果 - */ - public int updateProductSku(ProductSku productSku); - - /** - * 批量删除商品sku - * - * @param ids 需要删除的商品sku主键集合 - * @return 结果 - */ - public int deleteProductSkuByIds(Long[] ids); - - /** - * 删除商品sku信息 - * - * @param id 商品sku主键 - * @return 结果 - */ - public int deleteProductSkuById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IRuleAttrService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IRuleAttrService.java deleted file mode 100644 index 413d788..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IRuleAttrService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.RuleAttr; - -/** - * 规格详情Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface IRuleAttrService -{ - /** - * 查询规格详情 - * - * @param id 规格详情主键 - * @return 规格详情 - */ - public RuleAttr selectRuleAttrById(Long id); - - /** - * 查询规格详情列表 - * - * @param ruleAttr 规格详情 - * @return 规格详情集合 - */ - public List selectRuleAttrList(RuleAttr ruleAttr); - - /** - * 新增规格详情 - * - * @param ruleAttr 规格详情 - * @return 结果 - */ - public int insertRuleAttr(RuleAttr ruleAttr); - - /** - * 修改规格详情 - * - * @param ruleAttr 规格详情 - * @return 结果 - */ - public int updateRuleAttr(RuleAttr ruleAttr); - - /** - * 批量删除规格详情 - * - * @param ids 需要删除的规格详情主键集合 - * @return 结果 - */ - public int deleteRuleAttrByIds(Long[] ids); - - /** - * 删除规格详情信息 - * - * @param id 规格详情主键 - * @return 结果 - */ - public int deleteRuleAttrById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IRuleService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IRuleService.java deleted file mode 100644 index 68ec24f..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/IRuleService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.muyu.product.service; - -import java.util.List; -import com.muyu.product.domain.Rule; - -/** - * 商品规格Service接口 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -public interface IRuleService -{ - /** - * 查询商品规格 - * - * @param id 商品规格主键 - * @return 商品规格 - */ - public Rule selectRuleById(Long id); - - /** - * 查询商品规格列表 - * - * @param rule 商品规格 - * @return 商品规格集合 - */ - public List selectRuleList(Rule rule); - - /** - * 新增商品规格 - * - * @param rule 商品规格 - * @return 结果 - */ - public int insertRule(Rule rule); - - /** - * 修改商品规格 - * - * @param rule 商品规格 - * @return 结果 - */ - public int updateRule(Rule rule); - - /** - * 批量删除商品规格 - * - * @param ids 需要删除的商品规格主键集合 - * @return 结果 - */ - public int deleteRuleByIds(Long[] ids); - - /** - * 删除商品规格信息 - * - * @param id 商品规格主键 - * @return 结果 - */ - public int deleteRuleById(Long id); -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ProjectInfoService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ProjectInfoService.java new file mode 100644 index 0000000..8511de2 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ProjectInfoService.java @@ -0,0 +1,23 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.ProjectInfo; + +import java.util.List; + +/** + * 商品信息Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface ProjectInfoService extends IService { + /** + * 查询商品信息列表 + * + * @param projectInfo 商品信息 + * @return 商品信息集合 + */ + public List list(ProjectInfo projectInfo); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ProjectSkuInfoService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ProjectSkuInfoService.java new file mode 100644 index 0000000..4d17142 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/ProjectSkuInfoService.java @@ -0,0 +1,23 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.ProjectSkuInfo; + +import java.util.List; + +/** + * 商品SKUService接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface ProjectSkuInfoService extends IService { + /** + * 查询商品SKU列表 + * + * @param projectSkuInfo 商品SKU + * @return 商品SKU集合 + */ + public List list(ProjectSkuInfo projectSkuInfo); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/RuleAttrInfoService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/RuleAttrInfoService.java new file mode 100644 index 0000000..72ccbab --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/RuleAttrInfoService.java @@ -0,0 +1,23 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.product.domain.RuleAttrInfo; + +import java.util.List; + +/** + * 规格详情Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface RuleAttrInfoService extends IService { + /** + * 查询规格详情列表 + * + * @param ruleAttrInfo 规格详情 + * @return 规格详情集合 + */ + public List list(RuleAttrInfo ruleAttrInfo); + +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/RuleInfoService.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/RuleInfoService.java new file mode 100644 index 0000000..7e909d2 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/RuleInfoService.java @@ -0,0 +1,35 @@ +package com.muyu.product.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.product.domain.RuleInfo; +import com.muyu.product.domain.model.RuleInfoAddModel; +import com.muyu.product.domain.req.RuleInfoQueryReq; +import com.muyu.product.domain.resp.RuleInfoResp; + +import java.util.List; + +/** + * 商品规格Service接口 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +public interface RuleInfoService extends IService { + /** + * 查询商品规格列表 + * + * @param ruleInfo 商品规格 + * @return 商品规格集合 + */ + public List list(RuleInfo ruleInfo); + + /** + * 添加规格信息 + * @param ruleInfoAddModel 规格添加模型 + * @return 时候成功 + */ + public boolean save(RuleInfoAddModel ruleInfoAddModel); + + TableDataInfo queryList (RuleInfoQueryReq ruleInfoQueryReq); +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsAttributeGroupServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsAttributeGroupServiceImpl.java new file mode 100644 index 0000000..e3730fa --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsAttributeGroupServiceImpl.java @@ -0,0 +1,49 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.AsAttributeGroup; +import com.muyu.product.mapper.AsAttributeGroupMapper; +import com.muyu.product.service.AsAttributeGroupService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 属性与组中间Service业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class AsAttributeGroupServiceImpl extends ServiceImpl implements AsAttributeGroupService { + + /** + * 查询属性与组中间列表 + * + * @param asAttributeGroup 属性与组中间 + * @return 属性与组中间 + */ + @Override + public List list(AsAttributeGroup asAttributeGroup) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(asAttributeGroup.getGroupId())){ + queryWrapper.eq(AsAttributeGroup::getGroupId, asAttributeGroup.getGroupId()); + } + + if (ObjUtils.notNull(asAttributeGroup.getAttributeId())){ + queryWrapper.eq(AsAttributeGroup::getAttributeId, asAttributeGroup.getAttributeId()); + } + + + + + + return list(queryWrapper); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsBrandProjectServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsBrandProjectServiceImpl.java new file mode 100644 index 0000000..88d1657 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsBrandProjectServiceImpl.java @@ -0,0 +1,49 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.AsBrandProject; +import com.muyu.product.mapper.AsBrandProjectMapper; +import com.muyu.product.service.AsBrandProjectService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 品牌商品中间Service业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class AsBrandProjectServiceImpl extends ServiceImpl implements AsBrandProjectService { + + /** + * 查询品牌商品中间列表 + * + * @param asBrandProject 品牌商品中间 + * @return 品牌商品中间 + */ + @Override + public List list(AsBrandProject asBrandProject) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(asBrandProject.getBrandId())){ + queryWrapper.eq(AsBrandProject::getBrandId, asBrandProject.getBrandId()); + } + + if (ObjUtils.notNull(asBrandProject.getProjectId())){ + queryWrapper.eq(AsBrandProject::getProjectId, asBrandProject.getProjectId()); + } + + + + + + return list(queryWrapper); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsCategoryAttributeGroupServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsCategoryAttributeGroupServiceImpl.java new file mode 100644 index 0000000..149c1fa --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsCategoryAttributeGroupServiceImpl.java @@ -0,0 +1,49 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.AsCategoryAttributeGroup; +import com.muyu.product.mapper.AsCategoryAttributeGroupMapper; +import com.muyu.product.service.AsCategoryAttributeGroupService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 品类属性组中间Service业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class AsCategoryAttributeGroupServiceImpl extends ServiceImpl implements AsCategoryAttributeGroupService { + + /** + * 查询品类属性组中间列表 + * + * @param asCategoryAttributeGroup 品类属性组中间 + * @return 品类属性组中间 + */ + @Override + public List list(AsCategoryAttributeGroup asCategoryAttributeGroup) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(asCategoryAttributeGroup.getCategoryId())){ + queryWrapper.eq(AsCategoryAttributeGroup::getCategoryId, asCategoryAttributeGroup.getCategoryId()); + } + + if (ObjUtils.notNull(asCategoryAttributeGroup.getAttributeGroupId())){ + queryWrapper.eq(AsCategoryAttributeGroup::getAttributeGroupId, asCategoryAttributeGroup.getAttributeGroupId()); + } + + + + + + return list(queryWrapper); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsCategoryAttributeServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsCategoryAttributeServiceImpl.java new file mode 100644 index 0000000..ac3b9a6 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsCategoryAttributeServiceImpl.java @@ -0,0 +1,49 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.AsCategoryAttribute; +import com.muyu.product.mapper.AsCategoryAttributeMapper; +import com.muyu.product.service.AsCategoryAttributeService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 品类属性中间Service业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class AsCategoryAttributeServiceImpl extends ServiceImpl implements AsCategoryAttributeService { + + /** + * 查询品类属性中间列表 + * + * @param asCategoryAttribute 品类属性中间 + * @return 品类属性中间 + */ + @Override + public List list(AsCategoryAttribute asCategoryAttribute) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(asCategoryAttribute.getCategoryId())){ + queryWrapper.eq(AsCategoryAttribute::getCategoryId, asCategoryAttribute.getCategoryId()); + } + + if (ObjUtils.notNull(asCategoryAttribute.getAttributeId())){ + queryWrapper.eq(AsCategoryAttribute::getAttributeId, asCategoryAttribute.getAttributeId()); + } + + + + + + return list(queryWrapper); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsCategoryBrandServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsCategoryBrandServiceImpl.java new file mode 100644 index 0000000..c238cd7 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsCategoryBrandServiceImpl.java @@ -0,0 +1,49 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.AsCategoryBrand; +import com.muyu.product.mapper.AsCategoryBrandMapper; +import com.muyu.product.service.AsCategoryBrandService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 品类品牌中间Service业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class AsCategoryBrandServiceImpl extends ServiceImpl implements AsCategoryBrandService { + + /** + * 查询品类品牌中间列表 + * + * @param asCategoryBrand 品类品牌中间 + * @return 品类品牌中间 + */ + @Override + public List list(AsCategoryBrand asCategoryBrand) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(asCategoryBrand.getCategoryId())){ + queryWrapper.eq(AsCategoryBrand::getCategoryId, asCategoryBrand.getCategoryId()); + } + + if (ObjUtils.notNull(asCategoryBrand.getBrandId())){ + queryWrapper.eq(AsCategoryBrand::getBrandId, asCategoryBrand.getBrandId()); + } + + + + + + return list(queryWrapper); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsProductAttributeInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsProductAttributeInfoServiceImpl.java new file mode 100644 index 0000000..f9a8b58 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AsProductAttributeInfoServiceImpl.java @@ -0,0 +1,49 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.AsProductAttributeInfo; +import com.muyu.product.mapper.AsProductAttributeInfoMapper; +import com.muyu.product.service.AsProductAttributeInfoService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商品属性Service业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class AsProductAttributeInfoServiceImpl extends ServiceImpl implements AsProductAttributeInfoService { + + /** + * 查询商品属性列表 + * + * @param asProductAttributeInfo 商品属性 + * @return 商品属性 + */ + @Override + public List list(AsProductAttributeInfo asProductAttributeInfo) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(asProductAttributeInfo.getProductId())){ + queryWrapper.eq(AsProductAttributeInfo::getProductId, asProductAttributeInfo.getProductId()); + } + + if (ObjUtils.notNull(asProductAttributeInfo.getAttributeId())){ + queryWrapper.eq(AsProductAttributeInfo::getAttributeId, asProductAttributeInfo.getAttributeId()); + } + + if (ObjUtils.notNull(asProductAttributeInfo.getValue())){ + queryWrapper.eq(AsProductAttributeInfo::getValue, asProductAttributeInfo.getValue()); + } + + return list(queryWrapper); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AttributeGroupServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AttributeGroupServiceImpl.java index 1029dc7..5b736ea 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AttributeGroupServiceImpl.java +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AttributeGroupServiceImpl.java @@ -1,96 +1,107 @@ package com.muyu.product.service.impl; -import java.util.List; -import com.muyu.common.core.utils.DateUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageInfo; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.product.domain.AsAttributeGroup; +import com.muyu.product.domain.AttributeGroup; +import com.muyu.product.domain.model.AttributeGroupSaveModel; +import com.muyu.product.domain.resp.AttributeGroupPageResp; +import com.muyu.product.mapper.AttributeGroupMapper; +import com.muyu.product.service.AsAttributeGroupService; +import com.muyu.product.service.AttributeGroupService; +import com.muyu.product.service.AttributeInfoService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.muyu.product.mapper.AttributeGroupMapper; -import com.muyu.product.domain.AttributeGroup; -import com.muyu.product.service.IAttributeGroupService; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; /** * 属性组Service业务层处理 * - * @author yuanjunzhe - * @date 2024-02-29 + * @author DongZeLiang + * @date 2024-02-27 */ +@Slf4j @Service -public class AttributeGroupServiceImpl implements IAttributeGroupService -{ +public class AttributeGroupServiceImpl extends ServiceImpl implements AttributeGroupService { + @Autowired - private AttributeGroupMapper attributeGroupMapper; + private AsAttributeGroupService attributeGroupService; + + @Autowired + private AttributeInfoService attributeInfoService; /** - * 查询属性组 + * 分页查询 * - * @param id 属性组主键 - * @return 属性组 + * @param attributeGroupQuery 分组对象 + * + * @return 返回结果 */ @Override - public AttributeGroup selectAttributeGroupById(Long id) - { - return attributeGroupMapper.selectAttributeGroupById(id); + public TableDataInfo page (AttributeGroup attributeGroupQuery) { + List list = this.list(attributeGroupQuery); + List pageRespList = list.stream() + .map(attributeGroup -> + AttributeGroupPageResp.groupFunBuild( + attributeGroup, groupId -> attributeInfoService.attributeListByGroupId(groupId) + ) + ) + .toList(); + return TableDataInfo.builder() + .total(new PageInfo(list).getTotal()) + .rows(pageRespList) + .build(); } /** * 查询属性组列表 * * @param attributeGroup 属性组 + * * @return 属性组 */ @Override - public List selectAttributeGroupList(AttributeGroup attributeGroup) - { - return attributeGroupMapper.selectAttributeGroupList(attributeGroup); + public List list (AttributeGroup attributeGroup) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + if (ObjUtils.notNull(attributeGroup.getName())) { + queryWrapper.like(AttributeGroup::getName, attributeGroup.getName()); + } + + if (ObjUtils.notNull(attributeGroup.getStates())) { + queryWrapper.eq(AttributeGroup::getStates, attributeGroup.getStates()); + } + + return list(queryWrapper); } /** - * 新增属性组 + * 保存 * - * @param attributeGroup 属性组 - * @return 结果 + * @param attributeGroupSaveModel 属性组保存模型 + * + * @return 是否成功 */ @Override - public int insertAttributeGroup(AttributeGroup attributeGroup) - { - attributeGroup.setCreateTime(DateUtils.getNowDate()); - return attributeGroupMapper.insertAttributeGroup(attributeGroup); - } + @Transactional + public Boolean save (AttributeGroupSaveModel attributeGroupSaveModel) { + AttributeGroup attributeGroup = attributeGroupSaveModel.buildAttributeGroup(); + boolean save = this.save(attributeGroup); + // 处理属性ID + Long attributeGroupId = attributeGroup.getId(); + List attributeIdList = attributeGroupSaveModel.getAttributeIdList(); - /** - * 修改属性组 - * - * @param attributeGroup 属性组 - * @return 结果 - */ - @Override - public int updateAttributeGroup(AttributeGroup attributeGroup) - { - attributeGroup.setUpdateTime(DateUtils.getNowDate()); - return attributeGroupMapper.updateAttributeGroup(attributeGroup); - } - - /** - * 批量删除属性组 - * - * @param ids 需要删除的属性组主键 - * @return 结果 - */ - @Override - public int deleteAttributeGroupByIds(Long[] ids) - { - return attributeGroupMapper.deleteAttributeGroupByIds(ids); - } - - /** - * 删除属性组信息 - * - * @param id 属性组主键 - * @return 结果 - */ - @Override - public int deleteAttributeGroupById(Long id) - { - return attributeGroupMapper.deleteAttributeGroupById(id); + attributeGroupService.saveBatch( + attributeIdList.stream() + .map(attributeId -> AsAttributeGroup.buildGroup(attributeGroupId, attributeId)) + .toList() + ); + return save; } } diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AttributeInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AttributeInfoServiceImpl.java new file mode 100644 index 0000000..c381123 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AttributeInfoServiceImpl.java @@ -0,0 +1,77 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.exception.ServiceException; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.AsAttributeGroup; +import com.muyu.product.domain.AttributeInfo; +import com.muyu.product.mapper.AttributeInfoMapper; +import com.muyu.product.service.AsAttributeGroupService; +import com.muyu.product.service.AttributeInfoService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商品属性Service业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class AttributeInfoServiceImpl extends ServiceImpl implements AttributeInfoService { + + @Autowired + private AsAttributeGroupService asAttributeGroupService; + + /** + * 查询商品属性列表 + * + * @param attributeInfo 商品属性 + * @return 商品属性 + */ + @Override + public List list(AttributeInfo attributeInfo) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(attributeInfo.getName())){ + queryWrapper.like(AttributeInfo::getName, attributeInfo.getName()); + } + + if (ObjUtils.notNull(attributeInfo.getCode())){ + queryWrapper.like(AttributeInfo::getCode, attributeInfo.getCode()); + } + + return list(queryWrapper); + } + + /** + * 通过groupId查询属性集合 + * + * @param groupId 属性组Id + * + * @return 属性集合 + */ + @Override + public List attributeListByGroupId (Long groupId) { + if (groupId == null){ + throw new ServiceException("查询商品属性组,属性组ID不可为空"); + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(AsAttributeGroup::getGroupId, groupId); + List list = asAttributeGroupService.list(queryWrapper).stream() + .map(AsAttributeGroup::getAttributeId) + .toList(); + if (list == null || list.isEmpty()){ + return null; + } + return this.listByIds( + list + ); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AttributeServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AttributeServiceImpl.java deleted file mode 100644 index eb5e3b9..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/AttributeServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.muyu.product.service.impl; - -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.AttributeMapper; -import com.muyu.product.domain.Attribute; -import com.muyu.product.service.IAttributeService; - -/** - * 商品属性Service业务层处理 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@Service -public class AttributeServiceImpl implements IAttributeService -{ - @Autowired - private AttributeMapper attributeMapper; - - /** - * 查询商品属性 - * - * @param id 商品属性主键 - * @return 商品属性 - */ - @Override - public Attribute selectAttributeById(Long id) - { - return attributeMapper.selectAttributeById(id); - } - - /** - * 查询商品属性列表 - * - * @param attribute 商品属性 - * @return 商品属性 - */ - @Override - public List selectAttributeList(Attribute attribute) - { - return attributeMapper.selectAttributeList(attribute); - } - - /** - * 新增商品属性 - * - * @param attribute 商品属性 - * @return 结果 - */ - @Override - public int insertAttribute(Attribute attribute) - { - attribute.setCreateTime(DateUtils.getNowDate()); - return attributeMapper.insertAttribute(attribute); - } - - /** - * 修改商品属性 - * - * @param attribute 商品属性 - * @return 结果 - */ - @Override - public int updateAttribute(Attribute attribute) - { - attribute.setUpdateTime(DateUtils.getNowDate()); - return attributeMapper.updateAttribute(attribute); - } - - /** - * 批量删除商品属性 - * - * @param ids 需要删除的商品属性主键 - * @return 结果 - */ - @Override - public int deleteAttributeByIds(Long[] ids) - { - return attributeMapper.deleteAttributeByIds(ids); - } - - /** - * 删除商品属性信息 - * - * @param id 商品属性主键 - * @return 结果 - */ - @Override - public int deleteAttributeById(Long id) - { - return attributeMapper.deleteAttributeById(id); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/BrandInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/BrandInfoServiceImpl.java index b7858da..4f49bff 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/BrandInfoServiceImpl.java +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/BrandInfoServiceImpl.java @@ -1,96 +1,69 @@ package com.muyu.product.service.impl; -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.BrandInfoMapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.common.security.utils.SecurityUtils; import com.muyu.product.domain.BrandInfo; -import com.muyu.product.service.IBrandInfoService; +import com.muyu.product.mapper.BrandInfoMapper; +import com.muyu.product.service.BrandInfoService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; /** - * 商品品牌Service业务层处理 + * 品牌信息Service业务层处理 * - * @author yuanjunzhe - * @date 2024-02-29 + * @author DongZeLiang + * @date 2024-02-27 */ +@Slf4j @Service -public class BrandInfoServiceImpl implements IBrandInfoService -{ - @Autowired - private BrandInfoMapper brandInfoMapper; +public class BrandInfoServiceImpl extends ServiceImpl implements BrandInfoService { /** - * 查询商品品牌 + * 查询品牌信息列表 * - * @param id 商品品牌主键 - * @return 商品品牌 + * @param brandInfo 品牌信息 + * @return 品牌信息 */ @Override - public BrandInfo selectBrandInfoById(Long id) - { - return brandInfoMapper.selectBrandInfoById(id); + public List list(BrandInfo brandInfo) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(brandInfo.getNam())){ + queryWrapper.like(BrandInfo::getNam, brandInfo.getNam()); + } + + if (ObjUtils.notNull(brandInfo.getLogo())){ + queryWrapper.eq(BrandInfo::getLogo, brandInfo.getLogo()); + } + + if (ObjUtils.notNull(brandInfo.getStart())){ + queryWrapper.eq(BrandInfo::getStart, brandInfo.getStart()); + } + + if (ObjUtils.notNull(brandInfo.getIntroduction())){ + queryWrapper.eq(BrandInfo::getIntroduction, brandInfo.getIntroduction()); + } + + return list(queryWrapper); } - /** - * 查询商品品牌列表 - * - * @param brandInfo 商品品牌 - * @return 商品品牌 - */ @Override - public List selectBrandInfoList(BrandInfo brandInfo) - { - return brandInfoMapper.selectBrandInfoList(brandInfo); + public boolean save(BrandInfo entity) { + entity.setCreateBy(SecurityUtils.getUsername()); + entity.setCreateTime(new Date()); + return super.save(entity); } - /** - * 新增商品品牌 - * - * @param brandInfo 商品品牌 - * @return 结果 - */ @Override - public int insertBrandInfo(BrandInfo brandInfo) - { - brandInfo.setCreateTime(DateUtils.getNowDate()); - return brandInfoMapper.insertBrandInfo(brandInfo); - } - - /** - * 修改商品品牌 - * - * @param brandInfo 商品品牌 - * @return 结果 - */ - @Override - public int updateBrandInfo(BrandInfo brandInfo) - { - brandInfo.setUpdateTime(DateUtils.getNowDate()); - return brandInfoMapper.updateBrandInfo(brandInfo); - } - - /** - * 批量删除商品品牌 - * - * @param ids 需要删除的商品品牌主键 - * @return 结果 - */ - @Override - public int deleteBrandInfoByIds(Long[] ids) - { - return brandInfoMapper.deleteBrandInfoByIds(ids); - } - - /** - * 删除商品品牌信息 - * - * @param id 商品品牌主键 - * @return 结果 - */ - @Override - public int deleteBrandInfoById(Long id) - { - return brandInfoMapper.deleteBrandInfoById(id); + public boolean updateById(BrandInfo entity) { + entity.setUpdateBy(SecurityUtils.getUsername()); + entity.setUpdateTime(new Date()); + return super.updateById(entity); } } diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/BrandProductServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/BrandProductServiceImpl.java deleted file mode 100644 index c3ecb16..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/BrandProductServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.muyu.product.service.impl; - -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.BrandProductMapper; -import com.muyu.product.domain.BrandProduct; -import com.muyu.product.service.IBrandProductService; - -/** - * 品牌商品中间Service业务层处理 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@Service -public class BrandProductServiceImpl implements IBrandProductService -{ - @Autowired - private BrandProductMapper brandProductMapper; - - /** - * 查询品牌商品中间 - * - * @param id 品牌商品中间主键 - * @return 品牌商品中间 - */ - @Override - public BrandProduct selectBrandProductById(Long id) - { - return brandProductMapper.selectBrandProductById(id); - } - - /** - * 查询品牌商品中间列表 - * - * @param brandProduct 品牌商品中间 - * @return 品牌商品中间 - */ - @Override - public List selectBrandProductList(BrandProduct brandProduct) - { - return brandProductMapper.selectBrandProductList(brandProduct); - } - - /** - * 新增品牌商品中间 - * - * @param brandProduct 品牌商品中间 - * @return 结果 - */ - @Override - public int insertBrandProduct(BrandProduct brandProduct) - { - brandProduct.setCreateTime(DateUtils.getNowDate()); - return brandProductMapper.insertBrandProduct(brandProduct); - } - - /** - * 修改品牌商品中间 - * - * @param brandProduct 品牌商品中间 - * @return 结果 - */ - @Override - public int updateBrandProduct(BrandProduct brandProduct) - { - brandProduct.setUpdateTime(DateUtils.getNowDate()); - return brandProductMapper.updateBrandProduct(brandProduct); - } - - /** - * 批量删除品牌商品中间 - * - * @param ids 需要删除的品牌商品中间主键 - * @return 结果 - */ - @Override - public int deleteBrandProductByIds(Long[] ids) - { - return brandProductMapper.deleteBrandProductByIds(ids); - } - - /** - * 删除品牌商品中间信息 - * - * @param id 品牌商品中间主键 - * @return 结果 - */ - @Override - public int deleteBrandProductById(Long id) - { - return brandProductMapper.deleteBrandProductById(id); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryAttributeGroupServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryAttributeGroupServiceImpl.java deleted file mode 100644 index dd2c2d1..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryAttributeGroupServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.muyu.product.service.impl; - -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.CategoryAttributeGroupMapper; -import com.muyu.product.domain.CategoryAttributeGroup; -import com.muyu.product.service.ICategoryAttributeGroupService; - -/** - * 品类Service业务层处理 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@Service -public class CategoryAttributeGroupServiceImpl implements ICategoryAttributeGroupService -{ - @Autowired - private CategoryAttributeGroupMapper categoryAttributeGroupMapper; - - /** - * 查询品类 - * - * @param id 品类主键 - * @return 品类 - */ - @Override - public CategoryAttributeGroup selectCategoryAttributeGroupById(Long id) - { - return categoryAttributeGroupMapper.selectCategoryAttributeGroupById(id); - } - - /** - * 查询品类列表 - * - * @param categoryAttributeGroup 品类 - * @return 品类 - */ - @Override - public List selectCategoryAttributeGroupList(CategoryAttributeGroup categoryAttributeGroup) - { - return categoryAttributeGroupMapper.selectCategoryAttributeGroupList(categoryAttributeGroup); - } - - /** - * 新增品类 - * - * @param categoryAttributeGroup 品类 - * @return 结果 - */ - @Override - public int insertCategoryAttributeGroup(CategoryAttributeGroup categoryAttributeGroup) - { - categoryAttributeGroup.setCreateTime(DateUtils.getNowDate()); - return categoryAttributeGroupMapper.insertCategoryAttributeGroup(categoryAttributeGroup); - } - - /** - * 修改品类 - * - * @param categoryAttributeGroup 品类 - * @return 结果 - */ - @Override - public int updateCategoryAttributeGroup(CategoryAttributeGroup categoryAttributeGroup) - { - categoryAttributeGroup.setUpdateTime(DateUtils.getNowDate()); - return categoryAttributeGroupMapper.updateCategoryAttributeGroup(categoryAttributeGroup); - } - - /** - * 批量删除品类 - * - * @param ids 需要删除的品类主键 - * @return 结果 - */ - @Override - public int deleteCategoryAttributeGroupByIds(Long[] ids) - { - return categoryAttributeGroupMapper.deleteCategoryAttributeGroupByIds(ids); - } - - /** - * 删除品类信息 - * - * @param id 品类主键 - * @return 结果 - */ - @Override - public int deleteCategoryAttributeGroupById(Long id) - { - return categoryAttributeGroupMapper.deleteCategoryAttributeGroupById(id); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryAttributeServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryAttributeServiceImpl.java deleted file mode 100644 index b370941..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryAttributeServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.muyu.product.service.impl; - -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.CategoryAttributeMapper; -import com.muyu.product.domain.CategoryAttribute; -import com.muyu.product.service.ICategoryAttributeService; - -/** - * 品类Service业务层处理 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@Service -public class CategoryAttributeServiceImpl implements ICategoryAttributeService -{ - @Autowired - private CategoryAttributeMapper categoryAttributeMapper; - - /** - * 查询品类 - * - * @param id 品类主键 - * @return 品类 - */ - @Override - public CategoryAttribute selectCategoryAttributeById(Long id) - { - return categoryAttributeMapper.selectCategoryAttributeById(id); - } - - /** - * 查询品类列表 - * - * @param categoryAttribute 品类 - * @return 品类 - */ - @Override - public List selectCategoryAttributeList(CategoryAttribute categoryAttribute) - { - return categoryAttributeMapper.selectCategoryAttributeList(categoryAttribute); - } - - /** - * 新增品类 - * - * @param categoryAttribute 品类 - * @return 结果 - */ - @Override - public int insertCategoryAttribute(CategoryAttribute categoryAttribute) - { - categoryAttribute.setCreateTime(DateUtils.getNowDate()); - return categoryAttributeMapper.insertCategoryAttribute(categoryAttribute); - } - - /** - * 修改品类 - * - * @param categoryAttribute 品类 - * @return 结果 - */ - @Override - public int updateCategoryAttribute(CategoryAttribute categoryAttribute) - { - categoryAttribute.setUpdateTime(DateUtils.getNowDate()); - return categoryAttributeMapper.updateCategoryAttribute(categoryAttribute); - } - - /** - * 批量删除品类 - * - * @param ids 需要删除的品类主键 - * @return 结果 - */ - @Override - public int deleteCategoryAttributeByIds(Long[] ids) - { - return categoryAttributeMapper.deleteCategoryAttributeByIds(ids); - } - - /** - * 删除品类信息 - * - * @param id 品类主键 - * @return 结果 - */ - @Override - public int deleteCategoryAttributeById(Long id) - { - return categoryAttributeMapper.deleteCategoryAttributeById(id); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryBrandServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryBrandServiceImpl.java deleted file mode 100644 index 46b1765..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryBrandServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.muyu.product.service.impl; - -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.CategoryBrandMapper; -import com.muyu.product.domain.CategoryBrand; -import com.muyu.product.service.ICategoryBrandService; - -/** - * 品类Service业务层处理 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@Service -public class CategoryBrandServiceImpl implements ICategoryBrandService -{ - @Autowired - private CategoryBrandMapper categoryBrandMapper; - - /** - * 查询品类 - * - * @param id 品类主键 - * @return 品类 - */ - @Override - public CategoryBrand selectCategoryBrandById(Long id) - { - return categoryBrandMapper.selectCategoryBrandById(id); - } - - /** - * 查询品类列表 - * - * @param categoryBrand 品类 - * @return 品类 - */ - @Override - public List selectCategoryBrandList(CategoryBrand categoryBrand) - { - return categoryBrandMapper.selectCategoryBrandList(categoryBrand); - } - - /** - * 新增品类 - * - * @param categoryBrand 品类 - * @return 结果 - */ - @Override - public int insertCategoryBrand(CategoryBrand categoryBrand) - { - categoryBrand.setCreateTime(DateUtils.getNowDate()); - return categoryBrandMapper.insertCategoryBrand(categoryBrand); - } - - /** - * 修改品类 - * - * @param categoryBrand 品类 - * @return 结果 - */ - @Override - public int updateCategoryBrand(CategoryBrand categoryBrand) - { - categoryBrand.setUpdateTime(DateUtils.getNowDate()); - return categoryBrandMapper.updateCategoryBrand(categoryBrand); - } - - /** - * 批量删除品类 - * - * @param ids 需要删除的品类主键 - * @return 结果 - */ - @Override - public int deleteCategoryBrandByIds(Long[] ids) - { - return categoryBrandMapper.deleteCategoryBrandByIds(ids); - } - - /** - * 删除品类信息 - * - * @param id 品类主键 - * @return 结果 - */ - @Override - public int deleteCategoryBrandById(Long id) - { - return categoryBrandMapper.deleteCategoryBrandById(id); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryInfoServiceImpl.java index 99308b9..9fbd687 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryInfoServiceImpl.java +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CategoryInfoServiceImpl.java @@ -1,96 +1,368 @@ package com.muyu.product.service.impl; -import java.util.List; -import com.muyu.common.core.utils.DateUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.*; +import com.muyu.product.domain.base.CategoryBase; +import com.muyu.product.domain.model.CategoryInfoSaveModel; +import com.muyu.product.domain.model.TemplateAttributeGroupModel; +import com.muyu.product.domain.model.TemplateAttributeModel; +import com.muyu.product.domain.resp.CategoryCommonElementResp; +import com.muyu.product.domain.resp.CategoryParentCommonElementResp; +import com.muyu.product.mapper.CategoryInfoMapper; +import com.muyu.product.service.*; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.muyu.product.mapper.CategoryInfoMapper; -import com.muyu.product.domain.CategoryInfo; -import com.muyu.product.service.ICategoryInfoService; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Stream; /** * 品类信息Service业务层处理 * - * @author yuanjunzhe - * @date 2024-02-29 + * @author DongZeLiang + * @date 2024-02-27 */ +@Slf4j @Service -public class CategoryInfoServiceImpl implements ICategoryInfoService -{ - @Autowired - private CategoryInfoMapper categoryInfoMapper; +public class CategoryInfoServiceImpl extends ServiceImpl implements CategoryInfoService { - /** - * 查询品类信息 - * - * @param id 品类信息主键 - * @return 品类信息 - */ - @Override - public CategoryInfo selectCategoryInfoById(Long id) - { - return categoryInfoMapper.selectCategoryInfoById(id); - } + + @Autowired + private AsCategoryAttributeService asCategoryAttributeService; + + @Autowired + private AsCategoryAttributeGroupService asCategoryAttributeGroupService; + + @Autowired + private AsCategoryBrandService asCategoryBrandService; + + @Autowired + private AsAttributeGroupService asAttributeGroupService; + + @Autowired + private AttributeInfoService attributeInfoService; + + @Autowired + private BrandInfoService brandInfoService; + + @Autowired + private AttributeGroupService attributeGroupService; /** * 查询品类信息列表 * * @param categoryInfo 品类信息 + * * @return 品类信息 */ @Override - public List selectCategoryInfoList(CategoryInfo categoryInfo) - { - return categoryInfoMapper.selectCategoryInfoList(categoryInfo); + public List list (CategoryInfo categoryInfo) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(categoryInfo.getName())) { + queryWrapper.like(CategoryInfo::getName, categoryInfo.getName()); + } + + if (ObjUtils.notNull(categoryInfo.getImage())) { + queryWrapper.eq(CategoryInfo::getImage, categoryInfo.getImage()); + } + + if (ObjUtils.notNull(categoryInfo.getParentId())) { + queryWrapper.eq(CategoryInfo::getParentId, categoryInfo.getParentId()); + } + + if (ObjUtils.notNull(categoryInfo.getStart())) { + queryWrapper.eq(CategoryInfo::getStart, categoryInfo.getStart()); + } + + if (ObjUtils.notNull(categoryInfo.getIntroduction())) { + queryWrapper.eq(CategoryInfo::getIntroduction, categoryInfo.getIntroduction()); + } + + return list(queryWrapper); + } + + @Override + @Transactional + public boolean save (CategoryInfoSaveModel categoryInfoSaveModel) { + CategoryInfo categoryInfo = CategoryInfo.saveModelBuild(categoryInfoSaveModel); + boolean save = this.save(categoryInfo); + Long categoryInfoId = categoryInfo.getId(); + List attributeIdList = categoryInfoSaveModel.getAttributeIdList(); + if (attributeIdList != null && !attributeIdList.isEmpty()) { + asCategoryAttributeService.saveBatch( + attributeIdList.stream() + .map(attributeId -> AsCategoryAttribute.categoryBuild(categoryInfoId, attributeId)) + .toList() + ); + } + List attributeGroupIdList = categoryInfoSaveModel.getAttributeGroupIdList(); + if (attributeGroupIdList != null && !attributeGroupIdList.isEmpty()) { + asCategoryAttributeGroupService.saveBatch( + attributeGroupIdList.stream() + .map(attributeGroupId -> AsCategoryAttributeGroup.categoryBuild(categoryInfoId, attributeGroupId)) + .toList() + ); + } + List brandIdList = categoryInfoSaveModel.getBrandIdList(); + if (brandIdList != null && !brandIdList.isEmpty()) { + asCategoryBrandService.saveBatch( + brandIdList.stream() + .map(brandId -> AsCategoryBrand.categoryBuild(categoryInfoId, brandId)) + .toList() + ); + } + return save; } /** - * 新增品类信息 + * 通过品类ID获取父级以上的属性组集合 * - * @param categoryInfo 品类信息 - * @return 结果 + * @param categoryId 品类ID + * + * @return 父级以上的属性组集合 */ @Override - public int insertCategoryInfo(CategoryInfo categoryInfo) - { - categoryInfo.setCreateTime(DateUtils.getNowDate()); - return categoryInfoMapper.insertCategoryInfo(categoryInfo); + public List getAttributeGroup (Long categoryId) { + List attributeGroupList = new ArrayList<>(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(AsCategoryAttributeGroup::getCategoryId, categoryId); + List asCategoryAttributeGroupList = asCategoryAttributeGroupService.list(queryWrapper); + if (asCategoryAttributeGroupList != null && !asCategoryAttributeGroupList.isEmpty()) { + List attributeGroupIdList = asCategoryAttributeGroupList.stream() + .map(AsCategoryAttributeGroup::getAttributeGroupId) + .toList(); + attributeGroupList.addAll(attributeGroupService.listByIds(attributeGroupIdList)); + } + CategoryInfo categoryInfo = this.getById(categoryId); + if (categoryInfo.getParentId() != 0) { + if (attributeGroupList.isEmpty()) { + attributeGroupList.addAll(getAttributeGroup(categoryInfo.getParentId())); + } else { + List attributeGroups = getAttributeGroup(categoryInfo.getParentId()); + attributeGroups.forEach(attributeGroup -> { + if (!attributeGroupList.contains(attributeGroup)) { + attributeGroupList.add(attributeGroup); + } + }); + } + } + return attributeGroupList; } /** - * 修改品类信息 + * 通过品类ID获取父级以上的品牌集合 * - * @param categoryInfo 品类信息 - * @return 结果 + * @param categoryId 品类ID + * + * @return 父级以上的品牌集合 */ @Override - public int updateCategoryInfo(CategoryInfo categoryInfo) - { - categoryInfo.setUpdateTime(DateUtils.getNowDate()); - return categoryInfoMapper.updateCategoryInfo(categoryInfo); + public List getBrand (Long categoryId) { + List brandInfoList = new ArrayList<>(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(AsCategoryBrand::getCategoryId, categoryId); + List asCategoryBrandList = asCategoryBrandService.list(queryWrapper); + if (asCategoryBrandList != null && !asCategoryBrandList.isEmpty()) { + List brandIdList = asCategoryBrandList.stream() + .map(AsCategoryBrand::getBrandId) + .toList(); + brandInfoList.addAll(brandInfoService.listByIds(brandIdList)); + } + CategoryInfo categoryInfo = this.getById(categoryId); + if (categoryInfo.getParentId() != 0) { + if (brandInfoList.isEmpty()) { + brandInfoList.addAll(getBrand(categoryInfo.getParentId())); + } else { + List brandInfos = getBrand(categoryInfo.getParentId()); + brandInfos.forEach(brandInfo -> { + if (!brandInfoList.contains(brandInfo)) { + brandInfoList.add(brandInfo); + } + }); + } + + } + return brandInfoList; } /** - * 批量删除品类信息 + * 通过品类ID获取父级以上的属性集合 * - * @param ids 需要删除的品类信息主键 - * @return 结果 + * @param categoryId 品类ID + * + * @return 父级以上的属性集合 */ @Override - public int deleteCategoryInfoByIds(Long[] ids) - { - return categoryInfoMapper.deleteCategoryInfoByIds(ids); + public List getAttribute (Long categoryId) { + List attributeInfoList = new ArrayList<>(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(AsCategoryAttribute::getCategoryId, categoryId); + List asCategoryAttributeList = asCategoryAttributeService.list(queryWrapper); + if (asCategoryAttributeList != null && !asCategoryAttributeList.isEmpty()) { + List attributeIdList = asCategoryAttributeList.stream() + .map(AsCategoryAttribute::getAttributeId) + .toList(); + attributeInfoList.addAll(attributeInfoService.listByIds(attributeIdList)); + } + CategoryInfo categoryInfo = this.getById(categoryId); + if (categoryInfo.getParentId() != 0) { + if (attributeInfoList.isEmpty()) { + attributeInfoList.addAll(getAttribute(categoryInfo.getParentId())); + } else { + List attributeInfos = getAttribute(categoryInfo.getParentId()); + attributeInfos.forEach(attributeInfoQuery -> { + if (!attributeInfoList.contains(attributeInfoQuery)) { + attributeInfoList.add(attributeInfoQuery); + } + }); + } + } + return attributeInfoList; + } + + + public List getCommon (Long categoryId, IService iService, IService bsiService) { + List list = new ArrayList(); + QueryWrapper asQueryWrapper = new QueryWrapper<>(); + asQueryWrapper.eq("category_id", categoryId); + List asList = iService.list(asQueryWrapper); + if (asList != null && !asList.isEmpty()) { + List baseIdList = asList.stream() + .map(as -> { + if (as instanceof CategoryBase categoryBase) { + return categoryBase.getBaseId(); + } + return null; + }) + .toList(); + list.addAll(bsiService.listByIds(baseIdList)); + } + CategoryInfo categoryInfo = this.getById(categoryId); + if (categoryInfo.getParentId() != 0) { + if (list.isEmpty()) { + list.addAll(getCommon(categoryInfo.getParentId(), iService, bsiService)); + } else { + List commonList = getCommon(categoryInfo.getParentId(), iService, bsiService); + commonList.forEach(common -> { + if (!list.contains(common)) { + list.add(common); + } + }); + } + } + return list; } /** - * 删除品类信息信息 + * 通过品类ID获取父级以上的属性、属性组、品牌集合 * - * @param id 品类信息主键 - * @return 结果 + * @param categoryId 品类ID + * + * @return 父级以上的属性、属性组、品牌集合 */ @Override - public int deleteCategoryInfoById(Long id) - { - return categoryInfoMapper.deleteCategoryInfoById(id); + public CategoryParentCommonElementResp parentCommonElement (Long categoryId) { + return CategoryParentCommonElementResp.builder() + .attributeInfoList(getCommon(categoryId, asCategoryAttributeService, attributeInfoService)) + .attributeGroupList(getCommon(categoryId, asCategoryAttributeGroupService, attributeGroupService)) + .brandInfoList(getCommon(categoryId, asCategoryBrandService, brandInfoService)) + .build(); + } + + private void getParentIdListByCateGoryId(List parentIdList, Long cateGoryId){ + if (cateGoryId.equals(0L)){ + return; + } + CategoryInfo categoryInfo = this.getById(cateGoryId); + parentIdList.add(categoryInfo.getId()); + getParentIdListByCateGoryId(parentIdList, categoryInfo.getParentId()); + } + + /** + * 通过品类ID获取品类共有属性 + * + * @param cateGoryId 品类ID + * + * @return 品类共有属性 + */ + @Override + public CategoryCommonElementResp getTemplateAttributeByCateGoryId (Long cateGoryId) { + List cateGoryIdList = new ArrayList<>(); + getParentIdListByCateGoryId(cateGoryIdList, cateGoryId); + // 取出和品类相关联的属性组关系 - 中间表 + LambdaQueryWrapper asCategoryAttributeGroupLambdaQueryWrapper = new LambdaQueryWrapper<>(){{ + in(AsCategoryAttributeGroup::getCategoryId, cateGoryIdList); + }}; + List categoryAttributeGroupList = asCategoryAttributeGroupService.list(asCategoryAttributeGroupLambdaQueryWrapper); + List attributeGroupModelList = categoryAttributeGroupList.stream() + .map(asCategoryAttributeGroup -> TemplateAttributeGroupModel.attributeGroupBuild( + attributeGroupService.getById(asCategoryAttributeGroup.getAttributeGroupId()), + attributeGroupId -> { + LambdaQueryWrapper asAttributeGroupQueryWrapper = new LambdaQueryWrapper<>() {{ + eq(AsAttributeGroup::getGroupId, asCategoryAttributeGroup.getAttributeGroupId()); + }}; + List attributeIdList = asAttributeGroupService.list(asAttributeGroupQueryWrapper).stream() + .map(AsAttributeGroup::getAttributeId) + .toList(); + if (attributeIdList.isEmpty()){ + return new ArrayList<>(); + } + return attributeInfoService.listByIds(attributeIdList).stream() + .map(AttributeInfo::buildTemplateModel) + .toList(); + } + )) + .filter(TemplateAttributeGroupModel::isEffective) + .toList(); + + List templateAttributeModelList = new ArrayList<>(); + LambdaQueryWrapper categoryAttributeQueryWrapper = new LambdaQueryWrapper<>(); + categoryAttributeQueryWrapper.in(AsCategoryAttribute::getCategoryId, cateGoryIdList); + List asCategoryAttributeList = asCategoryAttributeService.list(categoryAttributeQueryWrapper); + if (asCategoryAttributeList != null && !asCategoryAttributeList.isEmpty()){ + templateAttributeModelList = attributeInfoService.listByIds( + asCategoryAttributeList.stream() + .map(AsCategoryAttribute::getAttributeId) + .toList() + ).stream() + .map(AttributeInfo::buildTemplateModel) + .toList(); + } + + List attributeModelList = new ArrayList<>(); + List attributeIdList = new ArrayList<>(); + if (!templateAttributeModelList.isEmpty()){ + attributeIdList.addAll( + templateAttributeModelList.stream().map(TemplateAttributeModel::getId).toList() + ); + } + if (!attributeGroupModelList.isEmpty()){ + attributeIdList.addAll( + attributeGroupModelList.stream() + .flatMap((Function>) templateAttributeGroupModel -> templateAttributeGroupModel.getAttributeList().stream()) + .map(TemplateAttributeModel::getId) + .toList() + ); + } + + LambdaQueryWrapper attributeInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); + attributeInfoLambdaQueryWrapper.notIn(!attributeIdList.isEmpty(), AttributeInfo::getId, attributeIdList); + attributeModelList = attributeInfoService.list(attributeInfoLambdaQueryWrapper).stream().map(AttributeInfo::buildTemplateModel).toList(); + + return CategoryCommonElementResp.builder() + .templateAttributeGroupList(attributeGroupModelList) + .templateAttributeList(templateAttributeModelList) + .attributeList(attributeModelList) + .build(); } } diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CommentInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CommentInfoServiceImpl.java new file mode 100644 index 0000000..290dac4 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CommentInfoServiceImpl.java @@ -0,0 +1,57 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.CommentInfo; +import com.muyu.product.mapper.CommentInfoMapper; +import com.muyu.product.service.CommentInfoService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商品评论Service业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class CommentInfoServiceImpl extends ServiceImpl implements CommentInfoService { + + /** + * 查询商品评论列表 + * + * @param commentInfo 商品评论 + * @return 商品评论 + */ + @Override + public List list(CommentInfo commentInfo) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(commentInfo.getProjectId())){ + queryWrapper.eq(CommentInfo::getProjectId, commentInfo.getProjectId()); + } + + if (ObjUtils.notNull(commentInfo.getComment())){ + queryWrapper.eq(CommentInfo::getComment, commentInfo.getComment()); + } + + if (ObjUtils.notNull(commentInfo.getImages())){ + queryWrapper.eq(CommentInfo::getImages, commentInfo.getImages()); + } + + if (ObjUtils.notNull(commentInfo.getParentId())){ + queryWrapper.eq(CommentInfo::getParentId, commentInfo.getParentId()); + } + + + + + + return list(queryWrapper); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CommentLikeInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CommentLikeInfoServiceImpl.java new file mode 100644 index 0000000..5348e34 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CommentLikeInfoServiceImpl.java @@ -0,0 +1,49 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.CommentLikeInfo; +import com.muyu.product.mapper.CommentLikeInfoMapper; +import com.muyu.product.service.CommentLikeInfoService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 评论点赞Service业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class CommentLikeInfoServiceImpl extends ServiceImpl implements CommentLikeInfoService { + + /** + * 查询评论点赞列表 + * + * @param commentLikeInfo 评论点赞 + * @return 评论点赞 + */ + @Override + public List list(CommentLikeInfo commentLikeInfo) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(commentLikeInfo.getCommentId())){ + queryWrapper.eq(CommentLikeInfo::getCommentId, commentLikeInfo.getCommentId()); + } + + if (ObjUtils.notNull(commentLikeInfo.getUserId())){ + queryWrapper.eq(CommentLikeInfo::getUserId, commentLikeInfo.getUserId()); + } + + + + + + return list(queryWrapper); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CommentLikeServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CommentLikeServiceImpl.java deleted file mode 100644 index 7ff3ec4..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/CommentLikeServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.muyu.product.service.impl; - -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.CommentLikeMapper; -import com.muyu.product.domain.CommentLike; -import com.muyu.product.service.ICommentLikeService; - -/** - * 评论点赞Service业务层处理 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@Service -public class CommentLikeServiceImpl implements ICommentLikeService -{ - @Autowired - private CommentLikeMapper commentLikeMapper; - - /** - * 查询评论点赞 - * - * @param id 评论点赞主键 - * @return 评论点赞 - */ - @Override - public CommentLike selectCommentLikeById(Long id) - { - return commentLikeMapper.selectCommentLikeById(id); - } - - /** - * 查询评论点赞列表 - * - * @param commentLike 评论点赞 - * @return 评论点赞 - */ - @Override - public List selectCommentLikeList(CommentLike commentLike) - { - return commentLikeMapper.selectCommentLikeList(commentLike); - } - - /** - * 新增评论点赞 - * - * @param commentLike 评论点赞 - * @return 结果 - */ - @Override - public int insertCommentLike(CommentLike commentLike) - { - commentLike.setCreateTime(DateUtils.getNowDate()); - return commentLikeMapper.insertCommentLike(commentLike); - } - - /** - * 修改评论点赞 - * - * @param commentLike 评论点赞 - * @return 结果 - */ - @Override - public int updateCommentLike(CommentLike commentLike) - { - commentLike.setUpdateTime(DateUtils.getNowDate()); - return commentLikeMapper.updateCommentLike(commentLike); - } - - /** - * 批量删除评论点赞 - * - * @param ids 需要删除的评论点赞主键 - * @return 结果 - */ - @Override - public int deleteCommentLikeByIds(Long[] ids) - { - return commentLikeMapper.deleteCommentLikeByIds(ids); - } - - /** - * 删除评论点赞信息 - * - * @param id 评论点赞主键 - * @return 结果 - */ - @Override - public int deleteCommentLikeById(Long id) - { - return commentLikeMapper.deleteCommentLikeById(id); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProductAttributeServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProductAttributeServiceImpl.java deleted file mode 100644 index 7246dc8..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProductAttributeServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.muyu.product.service.impl; - -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.ProductAttributeMapper; -import com.muyu.product.domain.ProductAttribute; -import com.muyu.product.service.IProductAttributeService; - -/** - * 商品属性Service业务层处理 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@Service -public class ProductAttributeServiceImpl implements IProductAttributeService -{ - @Autowired - private ProductAttributeMapper productAttributeMapper; - - /** - * 查询商品属性 - * - * @param id 商品属性主键 - * @return 商品属性 - */ - @Override - public ProductAttribute selectProductAttributeById(Long id) - { - return productAttributeMapper.selectProductAttributeById(id); - } - - /** - * 查询商品属性列表 - * - * @param productAttribute 商品属性 - * @return 商品属性 - */ - @Override - public List selectProductAttributeList(ProductAttribute productAttribute) - { - return productAttributeMapper.selectProductAttributeList(productAttribute); - } - - /** - * 新增商品属性 - * - * @param productAttribute 商品属性 - * @return 结果 - */ - @Override - public int insertProductAttribute(ProductAttribute productAttribute) - { - productAttribute.setCreateTime(DateUtils.getNowDate()); - return productAttributeMapper.insertProductAttribute(productAttribute); - } - - /** - * 修改商品属性 - * - * @param productAttribute 商品属性 - * @return 结果 - */ - @Override - public int updateProductAttribute(ProductAttribute productAttribute) - { - productAttribute.setUpdateTime(DateUtils.getNowDate()); - return productAttributeMapper.updateProductAttribute(productAttribute); - } - - /** - * 批量删除商品属性 - * - * @param ids 需要删除的商品属性主键 - * @return 结果 - */ - @Override - public int deleteProductAttributeByIds(Long[] ids) - { - return productAttributeMapper.deleteProductAttributeByIds(ids); - } - - /** - * 删除商品属性信息 - * - * @param id 商品属性主键 - * @return 结果 - */ - @Override - public int deleteProductAttributeById(Long id) - { - return productAttributeMapper.deleteProductAttributeById(id); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProductCommentServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProductCommentServiceImpl.java deleted file mode 100644 index d15e21c..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProductCommentServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.muyu.product.service.impl; - -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.ProductCommentMapper; -import com.muyu.product.domain.ProductComment; -import com.muyu.product.service.IProductCommentService; - -/** - * 商品评论Service业务层处理 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@Service -public class ProductCommentServiceImpl implements IProductCommentService -{ - @Autowired - private ProductCommentMapper productCommentMapper; - - /** - * 查询商品评论 - * - * @param id 商品评论主键 - * @return 商品评论 - */ - @Override - public ProductComment selectProductCommentById(Long id) - { - return productCommentMapper.selectProductCommentById(id); - } - - /** - * 查询商品评论列表 - * - * @param productComment 商品评论 - * @return 商品评论 - */ - @Override - public List selectProductCommentList(ProductComment productComment) - { - return productCommentMapper.selectProductCommentList(productComment); - } - - /** - * 新增商品评论 - * - * @param productComment 商品评论 - * @return 结果 - */ - @Override - public int insertProductComment(ProductComment productComment) - { - productComment.setCreateTime(DateUtils.getNowDate()); - return productCommentMapper.insertProductComment(productComment); - } - - /** - * 修改商品评论 - * - * @param productComment 商品评论 - * @return 结果 - */ - @Override - public int updateProductComment(ProductComment productComment) - { - productComment.setUpdateTime(DateUtils.getNowDate()); - return productCommentMapper.updateProductComment(productComment); - } - - /** - * 批量删除商品评论 - * - * @param ids 需要删除的商品评论主键 - * @return 结果 - */ - @Override - public int deleteProductCommentByIds(Long[] ids) - { - return productCommentMapper.deleteProductCommentByIds(ids); - } - - /** - * 删除商品评论信息 - * - * @param id 商品评论主键 - * @return 结果 - */ - @Override - public int deleteProductCommentById(Long id) - { - return productCommentMapper.deleteProductCommentById(id); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProductServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProductServiceImpl.java deleted file mode 100644 index 1d52db5..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProductServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.muyu.product.service.impl; - -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.ProductMapper; -import com.muyu.product.domain.Product; -import com.muyu.product.service.IProductService; - -/** - * 商品信息Service业务层处理 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@Service -public class ProductServiceImpl implements IProductService -{ - @Autowired - private ProductMapper productMapper; - - /** - * 查询商品信息 - * - * @param id 商品信息主键 - * @return 商品信息 - */ - @Override - public Product selectProductById(Long id) - { - return productMapper.selectProductById(id); - } - - /** - * 查询商品信息列表 - * - * @param product 商品信息 - * @return 商品信息 - */ - @Override - public List selectProductList(Product product) - { - return productMapper.selectProductList(product); - } - - /** - * 新增商品信息 - * - * @param product 商品信息 - * @return 结果 - */ - @Override - public int insertProduct(Product product) - { - product.setCreateTime(DateUtils.getNowDate()); - return productMapper.insertProduct(product); - } - - /** - * 修改商品信息 - * - * @param product 商品信息 - * @return 结果 - */ - @Override - public int updateProduct(Product product) - { - product.setUpdateTime(DateUtils.getNowDate()); - return productMapper.updateProduct(product); - } - - /** - * 批量删除商品信息 - * - * @param ids 需要删除的商品信息主键 - * @return 结果 - */ - @Override - public int deleteProductByIds(Long[] ids) - { - return productMapper.deleteProductByIds(ids); - } - - /** - * 删除商品信息信息 - * - * @param id 商品信息主键 - * @return 结果 - */ - @Override - public int deleteProductById(Long id) - { - return productMapper.deleteProductById(id); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProductSkuServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProductSkuServiceImpl.java deleted file mode 100644 index fa9c67c..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProductSkuServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.muyu.product.service.impl; - -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.ProductSkuMapper; -import com.muyu.product.domain.ProductSku; -import com.muyu.product.service.IProductSkuService; - -/** - * 商品skuService业务层处理 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@Service -public class ProductSkuServiceImpl implements IProductSkuService -{ - @Autowired - private ProductSkuMapper productSkuMapper; - - /** - * 查询商品sku - * - * @param id 商品sku主键 - * @return 商品sku - */ - @Override - public ProductSku selectProductSkuById(Long id) - { - return productSkuMapper.selectProductSkuById(id); - } - - /** - * 查询商品sku列表 - * - * @param productSku 商品sku - * @return 商品sku - */ - @Override - public List selectProductSkuList(ProductSku productSku) - { - return productSkuMapper.selectProductSkuList(productSku); - } - - /** - * 新增商品sku - * - * @param productSku 商品sku - * @return 结果 - */ - @Override - public int insertProductSku(ProductSku productSku) - { - productSku.setCreateTime(DateUtils.getNowDate()); - return productSkuMapper.insertProductSku(productSku); - } - - /** - * 修改商品sku - * - * @param productSku 商品sku - * @return 结果 - */ - @Override - public int updateProductSku(ProductSku productSku) - { - productSku.setUpdateTime(DateUtils.getNowDate()); - return productSkuMapper.updateProductSku(productSku); - } - - /** - * 批量删除商品sku - * - * @param ids 需要删除的商品sku主键 - * @return 结果 - */ - @Override - public int deleteProductSkuByIds(Long[] ids) - { - return productSkuMapper.deleteProductSkuByIds(ids); - } - - /** - * 删除商品sku信息 - * - * @param id 商品sku主键 - * @return 结果 - */ - @Override - public int deleteProductSkuById(Long id) - { - return productSkuMapper.deleteProductSkuById(id); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProjectInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProjectInfoServiceImpl.java new file mode 100644 index 0000000..2a84567 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProjectInfoServiceImpl.java @@ -0,0 +1,81 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.ProjectInfo; +import com.muyu.product.mapper.ProjectInfoMapper; +import com.muyu.product.service.ProjectInfoService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商品信息Service业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class ProjectInfoServiceImpl extends ServiceImpl implements ProjectInfoService { + + /** + * 查询商品信息列表 + * + * @param projectInfo 商品信息 + * @return 商品信息 + */ + @Override + public List list(ProjectInfo projectInfo) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(projectInfo.getName())){ + queryWrapper.like(ProjectInfo::getName, projectInfo.getName()); + } + + if (ObjUtils.notNull(projectInfo.getIntroduction())){ + queryWrapper.eq(ProjectInfo::getIntroduction, projectInfo.getIntroduction()); + } + + if (ObjUtils.notNull(projectInfo.getMianType())){ + queryWrapper.eq(ProjectInfo::getMianType, projectInfo.getMianType()); + } + + if (ObjUtils.notNull(projectInfo.getParentType())){ + queryWrapper.eq(ProjectInfo::getParentType, projectInfo.getParentType()); + } + + if (ObjUtils.notNull(projectInfo.getType())){ + queryWrapper.eq(ProjectInfo::getType, projectInfo.getType()); + } + + if (ObjUtils.notNull(projectInfo.getImage())){ + queryWrapper.eq(ProjectInfo::getImage, projectInfo.getImage()); + } + + if (ObjUtils.notNull(projectInfo.getCarouselImages())){ + queryWrapper.eq(ProjectInfo::getCarouselImages, projectInfo.getCarouselImages()); + } + + if (ObjUtils.notNull(projectInfo.getStatus())){ + queryWrapper.eq(ProjectInfo::getStatus, projectInfo.getStatus()); + } + + if (ObjUtils.notNull(projectInfo.getRuleId())){ + queryWrapper.eq(ProjectInfo::getRuleId, projectInfo.getRuleId()); + } + + if (ObjUtils.notNull(projectInfo.getBrandId())){ + queryWrapper.eq(ProjectInfo::getBrandId, projectInfo.getBrandId()); + } + + + + + + return list(queryWrapper); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProjectSkuInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProjectSkuInfoServiceImpl.java new file mode 100644 index 0000000..00ebc81 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/ProjectSkuInfoServiceImpl.java @@ -0,0 +1,61 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.ProjectSkuInfo; +import com.muyu.product.mapper.ProjectSkuInfoMapper; +import com.muyu.product.service.ProjectSkuInfoService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商品SKUService业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class ProjectSkuInfoServiceImpl extends ServiceImpl implements ProjectSkuInfoService { + + /** + * 查询商品SKU列表 + * + * @param projectSkuInfo 商品SKU + * @return 商品SKU + */ + @Override + public List list(ProjectSkuInfo projectSkuInfo) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(projectSkuInfo.getProjectId())){ + queryWrapper.eq(ProjectSkuInfo::getProjectId, projectSkuInfo.getProjectId()); + } + + if (ObjUtils.notNull(projectSkuInfo.getSku())){ + queryWrapper.eq(ProjectSkuInfo::getSku, projectSkuInfo.getSku()); + } + + if (ObjUtils.notNull(projectSkuInfo.getStock())){ + queryWrapper.eq(ProjectSkuInfo::getStock, projectSkuInfo.getStock()); + } + + if (ObjUtils.notNull(projectSkuInfo.getPrice())){ + queryWrapper.eq(ProjectSkuInfo::getPrice, projectSkuInfo.getPrice()); + } + + if (ObjUtils.notNull(projectSkuInfo.getImage())){ + queryWrapper.eq(ProjectSkuInfo::getImage, projectSkuInfo.getImage()); + } + + + + + + return list(queryWrapper); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/RuleAttrInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/RuleAttrInfoServiceImpl.java new file mode 100644 index 0000000..cd6e910 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/RuleAttrInfoServiceImpl.java @@ -0,0 +1,53 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.product.domain.RuleAttrInfo; +import com.muyu.product.mapper.RuleAttrInfoMapper; +import com.muyu.product.service.RuleAttrInfoService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 规格详情Service业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class RuleAttrInfoServiceImpl extends ServiceImpl implements RuleAttrInfoService { + + /** + * 查询规格详情列表 + * + * @param ruleAttrInfo 规格详情 + * @return 规格详情 + */ + @Override + public List list(RuleAttrInfo ruleAttrInfo) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(ruleAttrInfo.getRuleId())){ + queryWrapper.eq(RuleAttrInfo::getRuleId, ruleAttrInfo.getRuleId()); + } + + if (ObjUtils.notNull(ruleAttrInfo.getName())){ + queryWrapper.like(RuleAttrInfo::getName, ruleAttrInfo.getName()); + } + + if (ObjUtils.notNull(ruleAttrInfo.getAttrValue())){ + queryWrapper.eq(RuleAttrInfo::getAttrValue, ruleAttrInfo.getAttrValue()); + } + + + + + + return list(queryWrapper); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/RuleAttrServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/RuleAttrServiceImpl.java deleted file mode 100644 index 1b5f636..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/RuleAttrServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.muyu.product.service.impl; - -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.RuleAttrMapper; -import com.muyu.product.domain.RuleAttr; -import com.muyu.product.service.IRuleAttrService; - -/** - * 规格详情Service业务层处理 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@Service -public class RuleAttrServiceImpl implements IRuleAttrService -{ - @Autowired - private RuleAttrMapper ruleAttrMapper; - - /** - * 查询规格详情 - * - * @param id 规格详情主键 - * @return 规格详情 - */ - @Override - public RuleAttr selectRuleAttrById(Long id) - { - return ruleAttrMapper.selectRuleAttrById(id); - } - - /** - * 查询规格详情列表 - * - * @param ruleAttr 规格详情 - * @return 规格详情 - */ - @Override - public List selectRuleAttrList(RuleAttr ruleAttr) - { - return ruleAttrMapper.selectRuleAttrList(ruleAttr); - } - - /** - * 新增规格详情 - * - * @param ruleAttr 规格详情 - * @return 结果 - */ - @Override - public int insertRuleAttr(RuleAttr ruleAttr) - { - ruleAttr.setCreateTime(DateUtils.getNowDate()); - return ruleAttrMapper.insertRuleAttr(ruleAttr); - } - - /** - * 修改规格详情 - * - * @param ruleAttr 规格详情 - * @return 结果 - */ - @Override - public int updateRuleAttr(RuleAttr ruleAttr) - { - ruleAttr.setUpdateTime(DateUtils.getNowDate()); - return ruleAttrMapper.updateRuleAttr(ruleAttr); - } - - /** - * 批量删除规格详情 - * - * @param ids 需要删除的规格详情主键 - * @return 结果 - */ - @Override - public int deleteRuleAttrByIds(Long[] ids) - { - return ruleAttrMapper.deleteRuleAttrByIds(ids); - } - - /** - * 删除规格详情信息 - * - * @param id 规格详情主键 - * @return 结果 - */ - @Override - public int deleteRuleAttrById(Long id) - { - return ruleAttrMapper.deleteRuleAttrById(id); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java new file mode 100644 index 0000000..5907dc1 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java @@ -0,0 +1,100 @@ +package com.muyu.product.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageInfo; +import com.muyu.common.core.text.Convert; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.common.security.utils.SecurityUtils; +import com.muyu.product.domain.RuleAttrInfo; +import com.muyu.product.domain.RuleInfo; +import com.muyu.product.domain.model.RuleAttrAddModel; +import com.muyu.product.domain.model.RuleInfoAddModel; +import com.muyu.product.domain.req.RuleInfoQueryReq; +import com.muyu.product.domain.resp.RuleInfoResp; +import com.muyu.product.mapper.RuleInfoMapper; +import com.muyu.product.service.RuleAttrInfoService; +import com.muyu.product.service.RuleInfoService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商品规格Service业务层处理 + * + * @author DongZeLiang + * @date 2024-02-27 + */ +@Slf4j +@Service +public class RuleInfoServiceImpl extends ServiceImpl implements RuleInfoService { + + @Autowired + private RuleAttrInfoService ruleAttrInfoService; + + /** + * 查询商品规格列表 + * + * @param ruleInfo 商品规格 + * @return 商品规格 + */ + @Override + public List list(RuleInfo ruleInfo) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(ruleInfo.getName())){ + queryWrapper.like(RuleInfo::getName, ruleInfo.getName()); + } + + if (ObjUtils.notNull(ruleInfo.getStatus())){ + queryWrapper.eq(RuleInfo::getStatus, ruleInfo.getStatus()); + } + + + + + + return list(queryWrapper); + } + + /** + * 添加规格信息 + * + * @param ruleInfoAddModel 规格添加模型 + * + * @return 时候成功 + */ + @Override + public boolean save (RuleInfoAddModel ruleInfoAddModel) { + RuleInfo ruleInfo = RuleInfo.addModelBuild(ruleInfoAddModel, SecurityUtils::getUsername); + boolean save = this.save(ruleInfo); + ruleAttrInfoService.saveBatch( + ruleInfoAddModel.getRuleAttrList().stream() + .map(ruleAttrAddModel -> RuleAttrInfo.addModelBuild(ruleAttrAddModel, ruleInfo::getId, SecurityUtils::getUsername)) + .toList() + ); + return save; + } + + @Override + public TableDataInfo queryList (RuleInfoQueryReq ruleInfoQueryReq) { + List list = this.list(RuleInfo.queryBuild(ruleInfoQueryReq)); + List ruleInfoRespList = list.stream() + .map(ruleInfo -> RuleInfoResp.infoBuild(ruleInfo, ruleId -> { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(RuleAttrInfo::getRuleId, ruleId); + return ruleAttrInfoService.list(queryWrapper).stream().map(RuleAttrAddModel::infoBuild).toList(); + })) + .toList(); + boolean isPage = ruleInfoQueryReq.getParams().get("isPage") == null || Convert.toBool(ruleInfoQueryReq.getParams().get("isPage"), true); + + return TableDataInfo.builder() + .rows(ruleInfoRespList) + .total(isPage ? new PageInfo<>(list).getTotal() : 0) + .build(); + } +} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/RuleServiceImpl.java b/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/RuleServiceImpl.java deleted file mode 100644 index 5949405..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/java/com/muyu/product/service/impl/RuleServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.muyu.product.service.impl; - -import java.util.List; -import com.muyu.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.muyu.product.mapper.RuleMapper; -import com.muyu.product.domain.Rule; -import com.muyu.product.service.IRuleService; - -/** - * 商品规格Service业务层处理 - * - * @author yuanjunzhe - * @date 2024-02-29 - */ -@Service -public class RuleServiceImpl implements IRuleService -{ - @Autowired - private RuleMapper ruleMapper; - - /** - * 查询商品规格 - * - * @param id 商品规格主键 - * @return 商品规格 - */ - @Override - public Rule selectRuleById(Long id) - { - return ruleMapper.selectRuleById(id); - } - - /** - * 查询商品规格列表 - * - * @param rule 商品规格 - * @return 商品规格 - */ - @Override - public List selectRuleList(Rule rule) - { - return ruleMapper.selectRuleList(rule); - } - - /** - * 新增商品规格 - * - * @param rule 商品规格 - * @return 结果 - */ - @Override - public int insertRule(Rule rule) - { - rule.setCreateTime(DateUtils.getNowDate()); - return ruleMapper.insertRule(rule); - } - - /** - * 修改商品规格 - * - * @param rule 商品规格 - * @return 结果 - */ - @Override - public int updateRule(Rule rule) - { - rule.setUpdateTime(DateUtils.getNowDate()); - return ruleMapper.updateRule(rule); - } - - /** - * 批量删除商品规格 - * - * @param ids 需要删除的商品规格主键 - * @return 结果 - */ - @Override - public int deleteRuleByIds(Long[] ids) - { - return ruleMapper.deleteRuleByIds(ids); - } - - /** - * 删除商品规格信息 - * - * @param id 商品规格主键 - * @return 结果 - */ - @Override - public int deleteRuleById(Long id) - { - return ruleMapper.deleteRuleById(id); - } -} diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/logback.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/logback.xml index aa340cd..69fb68b 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/logback.xml +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/logback.xml @@ -1,7 +1,7 @@ - + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsAttributeGroupMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsAttributeGroupMapper.xml new file mode 100644 index 0000000..05c468d --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsAttributeGroupMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + select id, group_id, attribute_id, remark, create_by, create_time, update_by, update_time from as_attribute_group + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsBrandProjectMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsBrandProjectMapper.xml new file mode 100644 index 0000000..abfce3a --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsBrandProjectMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + select id, brand_id, project_id, remark, create_by, create_time, update_by, update_time from as_brand_project + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsCategoryAttributeGroupMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsCategoryAttributeGroupMapper.xml new file mode 100644 index 0000000..7196d03 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsCategoryAttributeGroupMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + select id, category_id, attribute_group_id, remark, create_by, create_time, update_by, update_time from as_category_attribute_group + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsCategoryAttributeMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsCategoryAttributeMapper.xml new file mode 100644 index 0000000..d5544af --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsCategoryAttributeMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + select id, category_id, attribute_id, remark, create_by, create_time, update_by, update_time from as_category_attribute + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsCategoryBrandMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsCategoryBrandMapper.xml new file mode 100644 index 0000000..048317d --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsCategoryBrandMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + select id, category_id, brand_id, remark, create_by, create_time, update_by, update_time from as_category_brand + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsProductAttributeInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsProductAttributeInfoMapper.xml new file mode 100644 index 0000000..cd98362 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AsProductAttributeInfoMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + select id, product_id, attribute_id, value, create_by, create_time, updata_by, updata_time, remark from as_product_attribute_info + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AttributeGroupMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AttributeGroupMapper.xml index 4c37542..5edd11f 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AttributeGroupMapper.xml +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AttributeGroupMapper.xml @@ -3,79 +3,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - + - - + + + - select id, name, status, remark, create_by, create_time, update_by, update_time from attribute_group + select id, name, states, create_by, create_time, updata_by, updata_time, remark from attribute_group - - - - - - - insert into attribute_group - - name, - status, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{name}, - #{status}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update attribute_group - - name = #{name}, - status = #{status}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from attribute_group where id = #{id} - - - - delete from attribute_group where id in - - #{id} - - - \ No newline at end of file + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AttributeInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AttributeInfoMapper.xml new file mode 100644 index 0000000..9d60cfe --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AttributeInfoMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + select id, name, group_id, create_by, create_time, updata_by, updata_time, remark from attribute_info + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AttributeMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AttributeMapper.xml deleted file mode 100644 index 737e303..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/AttributeMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - select id, name, gruop_id, remark, create_by, create_time, update_by, update_time from attribute - - - - - - - - insert into attribute - - name, - gruop_id, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{name}, - #{gruopId}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update attribute - - name = #{name}, - gruop_id = #{gruopId}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from attribute where id = #{id} - - - - delete from attribute where id in - - #{id} - - - \ No newline at end of file diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/BrandInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/BrandInfoMapper.xml index d5157fd..eeeea6d 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/BrandInfoMapper.xml +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/BrandInfoMapper.xml @@ -3,13 +3,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - + + - @@ -18,74 +18,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, name, logo, introduction, status, remark, create_by, create_time, update_by, update_time from brand_info + select id, nam, logo, start, introduction, remark, create_by, create_time, update_by, update_time from brand_info - - - - - - - insert into brand_info - - name, - logo, - introduction, - status, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{name}, - #{logo}, - #{introduction}, - #{status}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update brand_info - - name = #{name}, - logo = #{logo}, - introduction = #{introduction}, - status = #{status}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from brand_info where id = #{id} - - - - delete from brand_info where id in - - #{id} - - - \ No newline at end of file + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/BrandProductMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/BrandProductMapper.xml deleted file mode 100644 index cb47dd5..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/BrandProductMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - select id, brand_id, product_id, remark, create_by, create_time, update_by, update_time from brand_product - - - - - - - - insert into brand_product - - brand_id, - product_id, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{brandId}, - #{productId}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update brand_product - - brand_id = #{brandId}, - product_id = #{productId}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from brand_product where id = #{id} - - - - delete from brand_product where id in - - #{id} - - - \ No newline at end of file diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryAttributeGroupMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryAttributeGroupMapper.xml deleted file mode 100644 index bab8fd8..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryAttributeGroupMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - select id, category_id, attribute_group_id, remark, create_by, create_time, update_by, update_time from category_attribute_group - - - - - - - - insert into category_attribute_group - - category_id, - attribute_group_id, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{categoryId}, - #{attributeGroupId}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update category_attribute_group - - category_id = #{categoryId}, - attribute_group_id = #{attributeGroupId}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from category_attribute_group where id = #{id} - - - - delete from category_attribute_group where id in - - #{id} - - - \ No newline at end of file diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryAttributeMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryAttributeMapper.xml deleted file mode 100644 index 63b7e38..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryAttributeMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - select id, category_id, attribute_id, remark, create_by, create_time, update_by, update_time from category_attribute - - - - - - - - insert into category_attribute - - category_id, - attribute_id, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{categoryId}, - #{attributeId}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update category_attribute - - category_id = #{categoryId}, - attribute_id = #{attributeId}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from category_attribute where id = #{id} - - - - delete from category_attribute where id in - - #{id} - - - \ No newline at end of file diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryBrandMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryBrandMapper.xml deleted file mode 100644 index 84fa794..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryBrandMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - select id, category_id, brand_id, remark, create_by, create_time, update_by, update_time from category_brand - - - - - - - - insert into category_brand - - category_id, - brand_id, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{categoryId}, - #{brandId}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update category_brand - - category_id = #{categoryId}, - brand_id = #{brandId}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from category_brand where id = #{id} - - - - delete from category_brand where id in - - #{id} - - - \ No newline at end of file diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryInfoMapper.xml index f7c4ed4..99be65b 100644 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryInfoMapper.xml +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CategoryInfoMapper.xml @@ -3,13 +3,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - + @@ -19,78 +19,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, name, image, parent_id, status, introduction, remark, create_by, create_time, update_by, update_time from category_info + select id, name, image, parent_id, start, introduction, remark, create_by, create_time, update_by, update_time from category_info - - - - - - - insert into category_info - - name, - image, - parent_id, - status, - introduction, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{name}, - #{image}, - #{parentId}, - #{status}, - #{introduction}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update category_info - - name = #{name}, - image = #{image}, - parent_id = #{parentId}, - status = #{status}, - introduction = #{introduction}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from category_info where id = #{id} - - - - delete from category_info where id in - - #{id} - - - \ No newline at end of file + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CommentInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CommentInfoMapper.xml new file mode 100644 index 0000000..9afe06e --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CommentInfoMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + select id, project_id, comment, images, parent_id, remark, create_by, create_time, update_by, update_time from comment_info + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CommentLikeInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CommentLikeInfoMapper.xml new file mode 100644 index 0000000..c9c6376 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CommentLikeInfoMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + select id, comment_id, user_id, remark, create_by, create_time, update_by, update_time from comment_like_info + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CommentLikeMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CommentLikeMapper.xml deleted file mode 100644 index 7cb1571..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/CommentLikeMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - select id, comment_id, user_id, remark, create_by, create_time, update_by, update_time from comment_like - - - - - - - - insert into comment_like - - comment_id, - user_id, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{commentId}, - #{userId}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update comment_like - - comment_id = #{commentId}, - user_id = #{userId}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from comment_like where id = #{id} - - - - delete from comment_like where id in - - #{id} - - - \ No newline at end of file diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProductAttributeMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProductAttributeMapper.xml deleted file mode 100644 index dfbe5fb..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProductAttributeMapper.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - select id, product_id, attribute_id, value, remark, create_by, create_time, update_by, update_time from product_attribute - - - - - - - - insert into product_attribute - - product_id, - attribute_id, - value, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{productId}, - #{attributeId}, - #{value}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update product_attribute - - product_id = #{productId}, - attribute_id = #{attributeId}, - value = #{value}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from product_attribute where id = #{id} - - - - delete from product_attribute where id in - - #{id} - - - \ No newline at end of file diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProductCommentMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProductCommentMapper.xml deleted file mode 100644 index dd44388..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProductCommentMapper.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - select id, product_id, comment, images, parent_id, remark, create_by, create_time, update_by, update_time from product_comment - - - - - - - - insert into product_comment - - product_id, - comment, - images, - parent_id, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{productId}, - #{comment}, - #{images}, - #{parentId}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update product_comment - - product_id = #{productId}, - comment = #{comment}, - images = #{images}, - parent_id = #{parentId}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from product_comment where id = #{id} - - - - delete from product_comment where id in - - #{id} - - - \ No newline at end of file diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProductMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProductMapper.xml deleted file mode 100644 index ebf4e3f..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProductMapper.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - select id, name, describe, type, image, carousel_images, status, rule_id, brand_id, remark, create_by, create_time, update_by, update_time from product - - - - - - - - insert into product - - name, - describe, - type, - image, - carousel_images, - status, - rule_id, - brand_id, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{name}, - #{describe}, - #{type}, - #{image}, - #{carouselImages}, - #{status}, - #{ruleId}, - #{brandId}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update product - - name = #{name}, - describe = #{describe}, - type = #{type}, - image = #{image}, - carousel_images = #{carouselImages}, - status = #{status}, - rule_id = #{ruleId}, - brand_id = #{brandId}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from product where id = #{id} - - - - delete from product where id in - - #{id} - - - \ No newline at end of file diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProductSkuMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProductSkuMapper.xml deleted file mode 100644 index 6cef11f..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProductSkuMapper.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - select id, product_id, sku, stock, price, image, remark, create_by, create_time, update_by, update_time from product_sku - - - - - - - - insert into product_sku - - product_id, - sku, - stock, - price, - image, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{productId}, - #{sku}, - #{stock}, - #{price}, - #{image}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update product_sku - - product_id = #{productId}, - sku = #{sku}, - stock = #{stock}, - price = #{price}, - image = #{image}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from product_sku where id = #{id} - - - - delete from product_sku where id in - - #{id} - - - \ No newline at end of file diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProjectInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProjectInfoMapper.xml new file mode 100644 index 0000000..52ca6e6 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProjectInfoMapper.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, name, introduction, mian_type, parent_type, type, image, carousel_images, status, rule_id, brand_id, remark, create_by, create_time, update_by, update_time from project_info + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProjectSkuInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProjectSkuInfoMapper.xml new file mode 100644 index 0000000..de5ebe4 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/ProjectSkuInfoMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + select id, project_id, sku, stock, price, image, remark, create_by, create_time, update_by, update_time from project_sku_info + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/RuleAttrInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/RuleAttrInfoMapper.xml new file mode 100644 index 0000000..3186330 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/RuleAttrInfoMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + select id, rule_id, name, attr_value, remark, create_by, create_time, update_by, update_time from rule_attr_info + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/RuleAttrMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/RuleAttrMapper.xml deleted file mode 100644 index 81dd34b..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/RuleAttrMapper.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - select id, rule_id, name, attr_value, remark, create_by, create_time, update_by, update_time from rule_attr - - - - - - - - insert into rule_attr - - rule_id, - name, - attr_value, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{ruleId}, - #{name}, - #{attrValue}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update rule_attr - - rule_id = #{ruleId}, - name = #{name}, - attr_value = #{attrValue}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from rule_attr where id = #{id} - - - - delete from rule_attr where id in - - #{id} - - - \ No newline at end of file diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/RuleInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/RuleInfoMapper.xml new file mode 100644 index 0000000..70724b9 --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/RuleInfoMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + select id, name, status, remark, create_by, create_time, update_by, update_time from rule_info + + diff --git a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/RuleMapper.xml b/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/RuleMapper.xml deleted file mode 100644 index 0a9e4ee..0000000 --- a/muyu-modules/muyu-product/muyu-product-service/src/main/resources/mapper/product/RuleMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - select id, name, status, remark, create_by, create_time, update_by, update_time from rule - - - - - - - - insert into rule - - name, - status, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{name}, - #{status}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update rule - - name = #{name}, - status = #{status}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from rule where id = #{id} - - - - delete from rule where id in - - #{id} - - - \ No newline at end of file diff --git a/muyu-modules/muyu-product/pom.xml b/muyu-modules/muyu-product/pom.xml index e486ec7..d092ab0 100644 --- a/muyu-modules/muyu-product/pom.xml +++ b/muyu-modules/muyu-product/pom.xml @@ -23,4 +23,4 @@ UTF-8 - \ No newline at end of file +