商品模块代码提交

This commit is contained in:
Tankaikai
2025-02-16 12:06:02 +08:00
parent 2244fee745
commit 9d86c376ec
9 changed files with 191 additions and 161 deletions

View File

@@ -21,7 +21,7 @@ import java.time.LocalDateTime;
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class ShopProductSpecDTO extends TreeNode<ShopProductSpecDTO> implements Serializable {
public class ShopProdSpecDTO extends TreeNode<ShopProdSpecDTO> implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@@ -37,6 +37,10 @@ public class ShopProductSpecDTO extends TreeNode<ShopProductSpecDTO> implements
*/
@NotBlank(message = "规格名称不能为空", groups = DefaultGroup.class)
private String name;
/**
* 完整规格名称
*/
private String fullName;
/**
* 规格级别
*/
@@ -55,6 +59,10 @@ public class ShopProductSpecDTO extends TreeNode<ShopProductSpecDTO> implements
*/
@NotNull(message = "请选择上级规格", groups = DefaultGroup.class)
private Long pid;
/**
* 所有上级id用逗号分隔
*/
private String pids;
/**
* 店铺 id
*/

View File

@@ -73,6 +73,6 @@ public class ShopProdCategory implements Serializable {
/**
* 更新时间
*/
@Column(onUpdateValue = "now()")
@Column(onInsertValue = "now()", onUpdateValue = "now()")
private LocalDateTime updateTime;
}

View File

@@ -1,5 +1,6 @@
package com.czg.product.entity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
@@ -17,8 +18,8 @@ import java.time.LocalDateTime;
* @since 1.0 2025-02-13
*/
@Data
@Table("tb_shop_product_spec")
public class ShopProductSpec implements Serializable {
@Table("tb_shop_prod_spec")
public class ShopProdSpec implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@@ -32,6 +33,10 @@ public class ShopProductSpec implements Serializable {
* 规格名称
*/
private String name;
/**
* 完整规格名称
*/
private String fullName;
/**
* 规格级别
*/
@@ -44,6 +49,10 @@ public class ShopProductSpec implements Serializable {
* 上级 id
*/
private Long pid;
/**
* 所有上级id用逗号分隔
*/
private String pids;
/**
* 店铺 id
*/
@@ -55,9 +64,11 @@ public class ShopProductSpec implements Serializable {
/**
* 创建时间
*/
@Column(onInsertValue = "now()")
private LocalDateTime createTime;
/**
* 更新时间
*/
@Column(onInsertValue = "now()", onUpdateValue = "now()")
private LocalDateTime updateTime;
}

View File

@@ -22,41 +22,41 @@ import java.time.LocalDateTime;
public class ShopProdUnit implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id(keyType = KeyType.Generator, value = KeyGenerators.snowFlakeId)
private Long id;
/**
* 单位名称
*/
private String name;
/**
* 单位类型 number-计数 weight-记重
*/
private String unitType;
/**
* 单位来源 1-系统预设 0-商家创建
*/
private Integer isSystem;
/**
* 状态 0-禁用 1-启用
*/
private Integer status;
/**
* 店铺id
*/
private Long shopId;
/**
* 创建时间
*/
@Column(onInsertValue = "now()")
private LocalDateTime createTime;
/**
* 更新时间
*/
@Column(onUpdateValue = "now()")
private LocalDateTime updateTime;
/**
* id
*/
@Id(keyType = KeyType.Generator, value = KeyGenerators.snowFlakeId)
private Long id;
/**
* 单位名称
*/
private String name;
/**
* 单位类型 number-计数 weight-记重
*/
private String unitType;
/**
* 单位来源 1-系统预设 0-商家创建
*/
private Integer isSystem;
/**
* 状态 0-禁用 1-启用
*/
private Integer status;
/**
* 店铺id
*/
private Long shopId;
/**
* 创建时间
*/
@Column(onInsertValue = "now()")
private LocalDateTime createTime;
/**
* 更新时间
*/
@Column(onInsertValue = "now()", onUpdateValue = "now()")
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,33 @@
package com.czg.product.service;
import com.czg.product.dto.ShopProdSpecDTO;
import com.czg.product.entity.ShopProdSpec;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import java.util.List;
/**
* 商品规格
*
* @author Tankaikai tankaikai@aliyun.com
* @since 1.0 2025-02-13
*/
public interface ShopProdSpecService extends IService<ShopProdSpec> {
Page<ShopProdSpecDTO> getShopProdSpecPage(ShopProdSpecDTO param);
List<ShopProdSpecDTO> getShopProdSpecList(ShopProdSpecDTO param);
ShopProdSpecDTO getShopProdSpecById(Long id);
boolean addShopProdSpec(ShopProdSpecDTO dto);
boolean deleteShopProdSpec(Long id);
boolean updateShopProdSpec(ShopProdSpecDTO dto);
boolean disableShopProdSpec(Long id);
boolean enableShopProdSpec(Long id);
}

View File

@@ -1,33 +0,0 @@
package com.czg.product.service;
import com.czg.product.dto.ShopProductSpecDTO;
import com.czg.product.entity.ShopProductSpec;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import java.util.List;
/**
* 商品规格
*
* @author Tankaikai tankaikai@aliyun.com
* @since 1.0 2025-02-13
*/
public interface ShopProductSpecService extends IService<ShopProductSpec> {
Page<ShopProductSpecDTO> page(ShopProductSpecDTO param);
List<ShopProductSpecDTO> list(ShopProductSpecDTO param);
ShopProductSpecDTO get(Long id);
boolean save(ShopProductSpecDTO dto);
boolean delete(Long id);
boolean update(ShopProductSpecDTO dto);
boolean disable(Long id);
boolean enable(Long id);
}