You've already forked FrameTour-BE
refactor(pipeline): 重构人脸匹配管线为核心管线模块
- 移除专用人脸匹配管线实现,统一使用通用管线模块 - 更新所有Stage类继承自通用管线Stage基类 - 调整包路径引用从face.pipeline到pipeline.core - 修改上下文类实现通用管线上下文接口 - 删除冗余的人脸匹配专用注解和枚举类 - 更新工厂类引用至新的通用管线构建器 - 保持Stage功能逻辑不变仅调整继承结构
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
package com.ycwl.basic.image.pipeline.annotation;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Stage配置注解
|
||||
* 用于声明Stage的元数据和可选性控制信息
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface StageConfig {
|
||||
|
||||
/**
|
||||
* Stage的唯一标识
|
||||
* 用于外部配置引用该Stage
|
||||
* 例如: "watermark", "download", "upload"
|
||||
*/
|
||||
String stageId();
|
||||
|
||||
/**
|
||||
* 可选性模式
|
||||
* 默认为UNSUPPORT(不支持外部控制)
|
||||
*/
|
||||
StageOptionalMode optionalMode() default StageOptionalMode.UNSUPPORT;
|
||||
|
||||
/**
|
||||
* Stage描述信息
|
||||
* 用于文档和日志说明
|
||||
*/
|
||||
String description() default "";
|
||||
|
||||
/**
|
||||
* 默认是否启用
|
||||
* 仅当optionalMode=SUPPORT时有效
|
||||
* 当外部配置未明确指定时,使用此默认值
|
||||
*/
|
||||
boolean defaultEnabled() default true;
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package com.ycwl.basic.image.pipeline.core;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Pipeline Stage抽象基类
|
||||
* 提供默认实现和通用逻辑
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class AbstractPipelineStage<C extends PhotoProcessContext> implements PipelineStage<C> {
|
||||
|
||||
/**
|
||||
* 最终的shouldExecute判断
|
||||
* 整合了外部配置控制和业务逻辑判断
|
||||
*/
|
||||
@Override
|
||||
public final boolean shouldExecute(C context) {
|
||||
// 1. 检查Stage配置注解
|
||||
StageConfig config = getStageConfig();
|
||||
if (config != null) {
|
||||
String stageId = config.stageId();
|
||||
StageOptionalMode mode = config.optionalMode();
|
||||
|
||||
// FORCE_ON:强制执行,不检查外部配置
|
||||
if (mode == StageOptionalMode.FORCE_ON) {
|
||||
return shouldExecuteByBusinessLogic(context);
|
||||
}
|
||||
|
||||
// SUPPORT:检查外部配置
|
||||
if (mode == StageOptionalMode.SUPPORT) {
|
||||
boolean externalEnabled = context.isStageEnabled(stageId, config.defaultEnabled());
|
||||
if (!externalEnabled) {
|
||||
log.debug("[{}] Stage被外部配置禁用", stageId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// UNSUPPORT:不检查外部配置,直接走业务逻辑
|
||||
}
|
||||
|
||||
// 2. 执行业务逻辑判断
|
||||
return shouldExecuteByBusinessLogic(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* 子类实现业务逻辑判断
|
||||
* 默认总是执行
|
||||
*
|
||||
* 子类可以覆盖此方法实现条件性执行
|
||||
* 例如: 只有竖图才旋转, 只有普通照片才加水印等
|
||||
*/
|
||||
protected boolean shouldExecuteByBusinessLogic(C context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 模板方法:执行Stage前的准备工作
|
||||
*/
|
||||
protected void beforeExecute(C context) {
|
||||
log.debug("[{}] 开始执行", getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* 模板方法:执行Stage后的清理工作
|
||||
*/
|
||||
protected void afterExecute(C context, StageResult<C> result) {
|
||||
if (result.isSuccess()) {
|
||||
log.debug("[{}] 执行成功: {}", getName(), result.getMessage());
|
||||
} else if (result.isSkipped()) {
|
||||
log.debug("[{}] 已跳过: {}", getName(), result.getMessage());
|
||||
} else if (result.isDegraded()) {
|
||||
log.warn("[{}] 降级执行: {}", getName(), result.getMessage());
|
||||
} else {
|
||||
log.error("[{}] 执行失败: {}", getName(), result.getMessage(), result.getException());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 子类实现具体的处理逻辑
|
||||
*/
|
||||
protected abstract StageResult<C> doExecute(C context);
|
||||
|
||||
/**
|
||||
* 最终执行方法(带钩子)
|
||||
*/
|
||||
@Override
|
||||
public final StageResult<C> execute(C context) {
|
||||
beforeExecute(context);
|
||||
StageResult<C> result = doExecute(context);
|
||||
afterExecute(context, result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.ycwl.basic.model.Crop;
|
||||
import com.ycwl.basic.model.PrinterOrderItem;
|
||||
import com.ycwl.basic.image.pipeline.util.TempFileManager;
|
||||
import com.ycwl.basic.storage.adapters.IStorageAdapter;
|
||||
import com.ycwl.basic.pipeline.core.PipelineContext;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -23,7 +24,7 @@ import java.util.function.Consumer;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class PhotoProcessContext {
|
||||
public class PhotoProcessContext implements PipelineContext {
|
||||
|
||||
// ==================== 核心字段(构造时必填)====================
|
||||
|
||||
@@ -192,6 +193,7 @@ public class PhotoProcessContext {
|
||||
* @param defaultEnabled 默认值(当配置未指定时使用)
|
||||
* @return true-启用, false-禁用
|
||||
*/
|
||||
@Override
|
||||
public boolean isStageEnabled(String stageId, boolean defaultEnabled) {
|
||||
return stageEnabledMap.getOrDefault(stageId, defaultEnabled);
|
||||
}
|
||||
@@ -202,6 +204,7 @@ public class PhotoProcessContext {
|
||||
* @param stageId Stage唯一标识
|
||||
* @return true-启用, false-禁用
|
||||
*/
|
||||
@Override
|
||||
public boolean isStageEnabled(String stageId) {
|
||||
return stageEnabledMap.getOrDefault(stageId, false);
|
||||
}
|
||||
@@ -292,6 +295,7 @@ public class PhotoProcessContext {
|
||||
/**
|
||||
* 清理所有临时文件
|
||||
*/
|
||||
@Override
|
||||
public void cleanup() {
|
||||
if (cleaned) {
|
||||
return;
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
package com.ycwl.basic.image.pipeline.core;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.exception.PipelineException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 图片处理管线
|
||||
* 按顺序执行一系列Stage
|
||||
*/
|
||||
@Slf4j
|
||||
public class Pipeline<C extends PhotoProcessContext> {
|
||||
|
||||
private final List<PipelineStage<C>> stages;
|
||||
private final String name;
|
||||
|
||||
public Pipeline(String name, List<PipelineStage<C>> stages) {
|
||||
this.name = name;
|
||||
this.stages = new ArrayList<>(stages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行管线
|
||||
*
|
||||
* @param context 管线上下文
|
||||
* @return 执行成功返回true
|
||||
* @throws PipelineException 管线执行异常
|
||||
*/
|
||||
public boolean execute(C context) {
|
||||
log.info("[{}] 开始执行管线, Stage数量: {}", name, stages.size());
|
||||
long startTime = System.currentTimeMillis();
|
||||
int maxStages = 100; // 防止无限循环
|
||||
int executedCount = 0;
|
||||
|
||||
try {
|
||||
for (int i = 0; i < stages.size(); i++) {
|
||||
if (executedCount >= maxStages) {
|
||||
log.error("[{}] Stage执行数量超过最大限制({}),可能存在循环依赖", name, maxStages);
|
||||
throw new PipelineException("Stage执行数量超过最大限制,可能存在循环依赖");
|
||||
}
|
||||
|
||||
PipelineStage<C> stage = stages.get(i);
|
||||
String stageName = stage.getName();
|
||||
|
||||
log.debug("[{}] [{}/{}] 准备执行Stage: {}", name, i + 1, stages.size(), stageName);
|
||||
|
||||
if (!stage.shouldExecute(context)) {
|
||||
log.debug("[{}] Stage {} 条件不满足,跳过执行", name, stageName);
|
||||
continue;
|
||||
}
|
||||
|
||||
long stageStartTime = System.currentTimeMillis();
|
||||
StageResult<C> result = stage.execute(context);
|
||||
long stageDuration = System.currentTimeMillis() - stageStartTime;
|
||||
executedCount++;
|
||||
|
||||
logStageResult(stageName, result, stageDuration);
|
||||
|
||||
// 动态添加后续Stage
|
||||
if (result.getNextStages() != null && !result.getNextStages().isEmpty()) {
|
||||
List<PipelineStage<C>> nextStages = result.getNextStages();
|
||||
log.info("[{}] Stage {} 动态添加了 {} 个后续Stage", name, stageName, nextStages.size());
|
||||
|
||||
for (int j = 0; j < nextStages.size(); j++) {
|
||||
PipelineStage<C> nextStage = nextStages.get(j);
|
||||
stages.add(i + 1 + j, nextStage);
|
||||
log.debug("[{}] - 插入Stage: {} 到位置 {}", name, nextStage.getName(), i + 1 + j);
|
||||
}
|
||||
}
|
||||
|
||||
if (result.isFailed()) {
|
||||
log.error("[{}] Stage {} 执行失败,管线终止", name, stageName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
long totalDuration = System.currentTimeMillis() - startTime;
|
||||
log.info("[{}] 管线执行完成, 总Stage数: {}, 实际执行: {}, 耗时: {}ms",
|
||||
name, stages.size(), executedCount, totalDuration);
|
||||
return true;
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("[{}] 管线执行异常", name, e);
|
||||
throw new PipelineException("管线执行失败: " + e.getMessage(), e);
|
||||
} finally {
|
||||
safeCleanup(context);
|
||||
}
|
||||
}
|
||||
|
||||
private void logStageResult(String stageName, StageResult<C> result, long duration) {
|
||||
String statusIcon = switch (result.getStatus()) {
|
||||
case SUCCESS -> "✓";
|
||||
case SKIPPED -> "○";
|
||||
case DEGRADED -> "△";
|
||||
case FAILED -> "✗";
|
||||
};
|
||||
|
||||
log.info("[{}] {} Stage {} - {} (耗时: {}ms)",
|
||||
name, statusIcon, stageName, result.getStatus(), duration);
|
||||
|
||||
if (result.getMessage() != null) {
|
||||
log.debug("[{}] 详情: {}", name, result.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getStageCount() {
|
||||
return stages.size();
|
||||
}
|
||||
|
||||
public List<String> getStageNames() {
|
||||
return stages.stream().map(PipelineStage::getName).toList();
|
||||
}
|
||||
|
||||
private void safeCleanup(C context) {
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
context.cleanup();
|
||||
} catch (Exception cleanupError) {
|
||||
log.warn("[{}] 管线清理失败", name, cleanupError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.ycwl.basic.image.pipeline.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Pipeline构建器
|
||||
* 使用Builder模式动态组装管线
|
||||
*/
|
||||
public class PipelineBuilder<C extends PhotoProcessContext> {
|
||||
|
||||
private String name = "DefaultPipeline";
|
||||
private final List<PipelineStage<C>> stages = new ArrayList<>();
|
||||
|
||||
public PipelineBuilder() {
|
||||
}
|
||||
|
||||
public PipelineBuilder(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置管线名称
|
||||
*/
|
||||
public PipelineBuilder<C> name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加Stage
|
||||
*/
|
||||
public PipelineBuilder<C> addStage(PipelineStage<C> stage) {
|
||||
if (stage != null) {
|
||||
this.stages.add(stage);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加Stage
|
||||
*/
|
||||
public PipelineBuilder<C> addStages(List<PipelineStage<C>> stages) {
|
||||
if (stages != null) {
|
||||
this.stages.addAll(stages);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件性添加Stage
|
||||
*/
|
||||
public PipelineBuilder<C> addStageIf(boolean condition, PipelineStage<C> stage) {
|
||||
if (condition && stage != null) {
|
||||
this.stages.add(stage);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按优先级排序Stage
|
||||
*/
|
||||
public PipelineBuilder<C> sortByPriority() {
|
||||
this.stages.sort(Comparator.comparingInt(PipelineStage::getPriority));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建Pipeline
|
||||
*/
|
||||
public Pipeline<C> build() {
|
||||
if (stages.isEmpty()) {
|
||||
throw new IllegalStateException("管线至少需要一个Stage");
|
||||
}
|
||||
return new Pipeline<>(name, stages);
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.ycwl.basic.image.pipeline.core;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
|
||||
/**
|
||||
* 管线处理阶段接口
|
||||
* 每个Stage负责一个独立的图片处理步骤
|
||||
*
|
||||
* @param <C> Context类型
|
||||
*/
|
||||
public interface PipelineStage<C extends PhotoProcessContext> {
|
||||
|
||||
/**
|
||||
* 获取Stage名称(用于日志和监控)
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* 判断是否需要执行此Stage
|
||||
* 支持条件性执行(如:只有竖图才需要旋转)
|
||||
*
|
||||
* @param context 管线上下文
|
||||
* @return true-执行, false-跳过
|
||||
*/
|
||||
boolean shouldExecute(C context);
|
||||
|
||||
/**
|
||||
* 执行Stage处理逻辑
|
||||
*
|
||||
* @param context 管线上下文
|
||||
* @return 执行结果
|
||||
*/
|
||||
StageResult<C> execute(C context);
|
||||
|
||||
/**
|
||||
* 获取Stage的执行优先级(用于排序)
|
||||
* 数值越小优先级越高,默认为100
|
||||
*/
|
||||
default int getPriority() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Stage配置注解(用于反射读取可选性控制信息)
|
||||
* @return Stage配置注解,如果未标注则返回null
|
||||
*/
|
||||
default StageConfig getStageConfig() {
|
||||
return this.getClass().getAnnotation(StageConfig.class);
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
package com.ycwl.basic.image.pipeline.core;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Stage执行结果
|
||||
*/
|
||||
@Getter
|
||||
public class StageResult<C extends PhotoProcessContext> {
|
||||
|
||||
public enum Status {
|
||||
SUCCESS, // 执行成功
|
||||
SKIPPED, // 跳过执行
|
||||
FAILED, // 执行失败
|
||||
DEGRADED // 降级执行
|
||||
}
|
||||
|
||||
private final Status status;
|
||||
private final String message;
|
||||
private final Throwable exception;
|
||||
private final List<PipelineStage<C>> nextStages;
|
||||
|
||||
private StageResult(Status status, String message, Throwable exception, List<PipelineStage<C>> nextStages) {
|
||||
this.status = status;
|
||||
this.message = message;
|
||||
this.exception = exception;
|
||||
this.nextStages = nextStages != null
|
||||
? Collections.unmodifiableList(new ArrayList<>(nextStages))
|
||||
: Collections.emptyList();
|
||||
}
|
||||
|
||||
public static <C extends PhotoProcessContext> StageResult<C> success() {
|
||||
return new StageResult<>(Status.SUCCESS, null, null, null);
|
||||
}
|
||||
|
||||
public static <C extends PhotoProcessContext> StageResult<C> success(String message) {
|
||||
return new StageResult<>(Status.SUCCESS, message, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功执行并动态添加后续Stage
|
||||
*/
|
||||
@SafeVarargs
|
||||
public static <C extends PhotoProcessContext> StageResult<C> successWithNext(String message, PipelineStage<C>... stages) {
|
||||
return new StageResult<>(Status.SUCCESS, message, null, Arrays.asList(stages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功执行并动态添加后续Stage列表
|
||||
*/
|
||||
public static <C extends PhotoProcessContext> StageResult<C> successWithNext(String message, List<PipelineStage<C>> stages) {
|
||||
return new StageResult<>(Status.SUCCESS, message, null, stages);
|
||||
}
|
||||
|
||||
public static <C extends PhotoProcessContext> StageResult<C> skipped() {
|
||||
return new StageResult<>(Status.SKIPPED, "条件不满足,跳过执行", null, null);
|
||||
}
|
||||
|
||||
public static <C extends PhotoProcessContext> StageResult<C> skipped(String reason) {
|
||||
return new StageResult<>(Status.SKIPPED, reason, null, null);
|
||||
}
|
||||
|
||||
public static <C extends PhotoProcessContext> StageResult<C> failed(String message) {
|
||||
return new StageResult<>(Status.FAILED, message, null, null);
|
||||
}
|
||||
|
||||
public static <C extends PhotoProcessContext> StageResult<C> failed(String message, Throwable exception) {
|
||||
return new StageResult<>(Status.FAILED, message, exception, null);
|
||||
}
|
||||
|
||||
public static <C extends PhotoProcessContext> StageResult<C> degraded(String message) {
|
||||
return new StageResult<>(Status.DEGRADED, message, null, null);
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return status == Status.SUCCESS;
|
||||
}
|
||||
|
||||
public boolean isSkipped() {
|
||||
return status == Status.SKIPPED;
|
||||
}
|
||||
|
||||
public boolean isFailed() {
|
||||
return status == Status.FAILED;
|
||||
}
|
||||
|
||||
public boolean isDegraded() {
|
||||
return status == Status.DEGRADED;
|
||||
}
|
||||
|
||||
public boolean canContinue() {
|
||||
return status == Status.SUCCESS || status == Status.SKIPPED || status == Status.DEGRADED;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.ycwl.basic.image.pipeline.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Stage可选性模式枚举
|
||||
* 定义Stage是否支持外部配置控制
|
||||
*/
|
||||
@Getter
|
||||
public enum StageOptionalMode {
|
||||
|
||||
/**
|
||||
* 不支持外部控制
|
||||
* Stage的执行完全由代码中的业务逻辑决定
|
||||
*/
|
||||
UNSUPPORT("不支持外部控制"),
|
||||
|
||||
/**
|
||||
* 支持外部控制
|
||||
* Stage可以通过景区配置或请求参数进行开启/关闭
|
||||
*/
|
||||
SUPPORT("支持外部控制"),
|
||||
|
||||
/**
|
||||
* 强制开启
|
||||
* Stage必须执行,不允许外部配置关闭
|
||||
*/
|
||||
FORCE_ON("强制开启");
|
||||
|
||||
private final String description;
|
||||
|
||||
StageOptionalMode(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.ycwl.basic.image.pipeline.exception;
|
||||
|
||||
/**
|
||||
* 管线处理异常基类
|
||||
*/
|
||||
public class PipelineException extends RuntimeException {
|
||||
|
||||
public PipelineException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public PipelineException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.enums.StageOptionalMode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.image.pipeline.enums.ImageType;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.utils.ImageUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.image.pipeline.enums.ImageType;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.enums.StageOptionalMode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import com.ycwl.basic.image.enhancer.adapter.BceImageEnhancer;
|
||||
import com.ycwl.basic.image.enhancer.entity.BceEnhancerConfig;
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.image.pipeline.enums.ImageSource;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.enums.StageOptionalMode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.enums.ImageSource;
|
||||
import com.ycwl.basic.model.Crop;
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.image.pipeline.enums.ImageSource;
|
||||
import com.ycwl.basic.image.pipeline.enums.ImageType;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.model.Crop;
|
||||
import com.ycwl.basic.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.utils.ImageUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.image.pipeline.enums.ImageType;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.utils.ImageUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import com.ycwl.basic.image.enhancer.adapter.BceImageSR;
|
||||
import com.ycwl.basic.image.enhancer.entity.BceEnhancerConfig;
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.image.pipeline.enums.ImageSource;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.enums.StageOptionalMode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
|
||||
public class NoOpStage extends AbstractPipelineStage<PhotoProcessContext> {
|
||||
@Override
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.image.pipeline.enums.ImageType;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.utils.ImageUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.image.pipeline.enums.ImageType;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.utils.ImageUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.service.pc.SourceService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.storage.StorageFactory;
|
||||
import com.ycwl.basic.storage.adapters.IStorageAdapter;
|
||||
import com.ycwl.basic.storage.enums.StorageAcl;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package com.ycwl.basic.image.pipeline.stages;
|
||||
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.enums.ImageType;
|
||||
import com.ycwl.basic.image.watermark.ImageWatermarkFactory;
|
||||
import com.ycwl.basic.image.watermark.entity.WatermarkInfo;
|
||||
import com.ycwl.basic.image.watermark.enums.ImageWatermarkOperatorEnum;
|
||||
import com.ycwl.basic.image.watermark.operator.IOperator;
|
||||
import com.ycwl.basic.image.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.image.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.image.pipeline.core.PhotoProcessContext;
|
||||
import com.ycwl.basic.image.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.image.pipeline.enums.ImageType;
|
||||
import com.ycwl.basic.image.pipeline.enums.StageOptionalMode;
|
||||
import com.ycwl.basic.pipeline.annotation.StageConfig;
|
||||
import com.ycwl.basic.pipeline.core.AbstractPipelineStage;
|
||||
import com.ycwl.basic.pipeline.core.StageResult;
|
||||
import com.ycwl.basic.pipeline.enums.StageOptionalMode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user