图库需求
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
package com.czg.account.dto;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Null;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 图片分类
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-26
|
||||
*/
|
||||
@Data
|
||||
public class PictureClassifyDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Null(message = "ID必须为空", groups = InsertGroup.class)
|
||||
@NotNull(message = "ID不能为空", groups = UpdateGroup.class)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@NotBlank(message = "分类名称不能为空", groups = DefaultGroup.class)
|
||||
private String name;
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
@NotNull(message = "排序值不能为空", groups = DefaultGroup.class)
|
||||
private Integer sort;
|
||||
/**
|
||||
* 单位来源 1-系统预设 0-商家创建
|
||||
*/
|
||||
private Integer isSystem;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 逻辑删除 1-是 0-否
|
||||
*/
|
||||
private Integer isDel;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.czg.account.dto;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Null;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 图库
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-26
|
||||
*/
|
||||
@Data
|
||||
public class PictureGalleryDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Null(message = "ID必须为空", groups = DefaultGroup.class)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 图片分类id
|
||||
*/
|
||||
@NotNull(message = "图片分类id不能为空", groups = DefaultGroup.class)
|
||||
private Long pictureClassifyId;
|
||||
/**
|
||||
* 图片URL地址
|
||||
*/
|
||||
@NotBlank(message = "图片URL地址不能为空", groups = DefaultGroup.class)
|
||||
private String url;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 逻辑删除 1-是 0-否
|
||||
*/
|
||||
private Integer isDel;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.czg.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import com.mybatisflex.core.keygen.KeyGenerators;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 图片分类
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-26
|
||||
*/
|
||||
@Data
|
||||
@Table("tb_picture_classify")
|
||||
public class PictureClassify implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id(keyType = KeyType.Generator, value = KeyGenerators.snowFlakeId)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 单位来源 1-系统预设 0-商家创建
|
||||
*/
|
||||
private Integer isSystem;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 逻辑删除 1-是 0-否
|
||||
*/
|
||||
@Column(onInsertValue = "0")
|
||||
private Integer isDel;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.czg.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 图库
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-26
|
||||
*/
|
||||
@Data
|
||||
@Table("tb_picture_gallery")
|
||||
public class PictureGallery implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 图片分类id
|
||||
*/
|
||||
private Long pictureClassifyId;
|
||||
/**
|
||||
* 图片URL地址
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 逻辑删除 1-是 0-否
|
||||
*/
|
||||
@Column(onInsertValue = "0")
|
||||
private Integer isDel;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.czg.account.service;
|
||||
|
||||
import com.czg.account.dto.PictureClassifyDTO;
|
||||
import com.czg.account.entity.PictureClassify;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 图片分类
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-26
|
||||
*/
|
||||
public interface PictureClassifyService extends IService<PictureClassify> {
|
||||
|
||||
/**
|
||||
* 获取图片分类列表
|
||||
*
|
||||
* @param param 查询条件
|
||||
*/
|
||||
List<PictureClassifyDTO> getPictureClassifyList(PictureClassifyDTO param);
|
||||
|
||||
/**
|
||||
* 添加图片分类
|
||||
*
|
||||
* @param dto 图片分类DTO
|
||||
*/
|
||||
void addPictureClassify(PictureClassifyDTO dto);
|
||||
|
||||
/**
|
||||
* 更新图片分类
|
||||
*
|
||||
* @param dto 图片分类DTO
|
||||
*/
|
||||
void updatePictureClassify(PictureClassifyDTO dto);
|
||||
|
||||
/**
|
||||
* 删除图片分类
|
||||
*
|
||||
* @param id 图片分类ID
|
||||
*/
|
||||
void deletePictureClassify(Long id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.czg.account.service;
|
||||
|
||||
import com.czg.account.dto.PictureGalleryDTO;
|
||||
import com.czg.account.entity.PictureGallery;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
/**
|
||||
* 图库
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-26
|
||||
*/
|
||||
public interface PictureGalleryService extends IService<PictureGallery> {
|
||||
/**
|
||||
* 获取图库分页数据
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
Page<PictureGalleryDTO> getPictureGalleryPage(PictureGalleryDTO param);
|
||||
|
||||
/**
|
||||
* 添加图库图片
|
||||
*
|
||||
* @param dto 图片数据
|
||||
*/
|
||||
void addPictureGallery(PictureGalleryDTO dto);
|
||||
|
||||
/**
|
||||
* 删除图库图片
|
||||
*
|
||||
* @param id 图片ID
|
||||
*/
|
||||
void deletePictureGallery(Long id);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user