You've already forked FrameTour-BE
feat(puzzle): 实现拼图生成功能模块
- 新增拼图生成控制器 PuzzleGenerateController,支持 /api/puzzle/generate 接口 - 新增拼图模板管理控制器 PuzzleTemplateController,提供完整的 CRUD 和元素管理功能 - 定义拼图相关 DTO 类,包括模板、元素、生成请求与响应等数据传输对象 - 创建拼图相关的实体类 PuzzleTemplateEntity、PuzzleElementEntity 和 PuzzleGenerationRecordEntity - 实现 Mapper 接口用于数据库操作,支持模板和元素的增删改查及生成记录管理 - 开发 PuzzleGenerateServiceImpl 服务,完成从模板渲染到图片上传的完整流程 - 提供 PuzzleTemplateServiceImpl 服务,实现模板及其元素的全生命周期管理 - 引入 PuzzleImageRenderer 工具类负责图像合成渲染逻辑 - 支持将生成结果上传至 OSS 并记录生成过程的日志和元数据
This commit is contained in:
@@ -0,0 +1,141 @@
|
||||
package com.ycwl.basic.puzzle.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 创建元素请求DTO
|
||||
*
|
||||
* @author Claude
|
||||
* @since 2025-01-17
|
||||
*/
|
||||
@Data
|
||||
public class ElementCreateRequest {
|
||||
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
private Long templateId;
|
||||
|
||||
/**
|
||||
* 元素类型:1-图片 2-文字
|
||||
*/
|
||||
private Integer elementType;
|
||||
|
||||
/**
|
||||
* 元素标识
|
||||
*/
|
||||
private String elementKey;
|
||||
|
||||
/**
|
||||
* 元素名称
|
||||
*/
|
||||
private String elementName;
|
||||
|
||||
// ===== 位置和布局属性 =====
|
||||
|
||||
/**
|
||||
* X坐标
|
||||
*/
|
||||
private Integer xPosition;
|
||||
|
||||
/**
|
||||
* Y坐标
|
||||
*/
|
||||
private Integer yPosition;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private Integer width;
|
||||
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private Integer height;
|
||||
|
||||
/**
|
||||
* 层级
|
||||
*/
|
||||
private Integer zIndex;
|
||||
|
||||
/**
|
||||
* 旋转角度
|
||||
*/
|
||||
private Integer rotation;
|
||||
|
||||
/**
|
||||
* 不透明度
|
||||
*/
|
||||
private Integer opacity;
|
||||
|
||||
// ===== 图片元素属性 =====
|
||||
|
||||
/**
|
||||
* 默认图片URL
|
||||
*/
|
||||
private String defaultImageUrl;
|
||||
|
||||
/**
|
||||
* 图片适配模式
|
||||
*/
|
||||
private String imageFitMode;
|
||||
|
||||
/**
|
||||
* 圆角半径
|
||||
*/
|
||||
private Integer borderRadius;
|
||||
|
||||
// ===== 文字元素属性 =====
|
||||
|
||||
/**
|
||||
* 默认文本内容
|
||||
*/
|
||||
private String defaultText;
|
||||
|
||||
/**
|
||||
* 字体
|
||||
*/
|
||||
private String fontFamily;
|
||||
|
||||
/**
|
||||
* 字号
|
||||
*/
|
||||
private Integer fontSize;
|
||||
|
||||
/**
|
||||
* 字体颜色
|
||||
*/
|
||||
private String fontColor;
|
||||
|
||||
/**
|
||||
* 字重
|
||||
*/
|
||||
private String fontWeight;
|
||||
|
||||
/**
|
||||
* 字体样式
|
||||
*/
|
||||
private String fontStyle;
|
||||
|
||||
/**
|
||||
* 对齐方式
|
||||
*/
|
||||
private String textAlign;
|
||||
|
||||
/**
|
||||
* 行高倍数
|
||||
*/
|
||||
private BigDecimal lineHeight;
|
||||
|
||||
/**
|
||||
* 最大行数
|
||||
*/
|
||||
private Integer maxLines;
|
||||
|
||||
/**
|
||||
* 文本装饰
|
||||
*/
|
||||
private String textDecoration;
|
||||
}
|
||||
Reference in New Issue
Block a user