refactor: 第一批低风险收敛——任务缓存服务泛型化 + 前端死代码清理与状态映射统一
This commit is contained in:
-23
@@ -1,23 +0,0 @@
|
||||
package com.nanri.aiimage.common.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Schema(description = "备选店铺列表单项")
|
||||
public class ProductRiskCandidateVo {
|
||||
|
||||
@Schema(description = "记录主键,删除备选时作为路径参数 id")
|
||||
private Long id;
|
||||
|
||||
@JsonProperty("shop_name")
|
||||
@Schema(description = "店铺名称(JSON 字段名 shop_name)", example = "测试店铺")
|
||||
private String shopName;
|
||||
|
||||
@JsonProperty("created_at")
|
||||
@Schema(description = "创建时间(JSON 字段名 created_at)")
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
package com.nanri.aiimage.common.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "用户五国处理偏好:按顺序的国家代码列表(ProductRiskCountryCode 名,如 DE、UK)")
|
||||
public class ProductRiskCountryPreferenceVo {
|
||||
|
||||
@JsonProperty("country_codes")
|
||||
@Schema(description = "已选国家代码,顺序即处理顺序;未保存偏好时返回当前业务模块配置的默认顺序")
|
||||
private List<String> countryCodes = new ArrayList<>();
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.nanri.aiimage.common.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "店铺任务统计看板(当前用户维度);商品风险和取款等复用模块按各自模块类型统计")
|
||||
public class ProductRiskDashboardVo {
|
||||
|
||||
@JsonProperty("candidateCount")
|
||||
@Schema(description = "备选店铺条数;按当前接口所属模块和当前用户统计")
|
||||
private long candidateCount;
|
||||
|
||||
@JsonProperty("processedTaskCount")
|
||||
@Schema(description = "已结束任务数:状态为 SUCCESS 或 FAILED 的任务总数")
|
||||
private long processedTaskCount;
|
||||
|
||||
@JsonProperty("successTaskCount")
|
||||
@Schema(description = "成功结束的任务数(状态 SUCCESS)")
|
||||
private long successTaskCount;
|
||||
|
||||
@JsonProperty("failedTaskCount")
|
||||
@Schema(description = "失败结束的任务数(状态 FAILED)")
|
||||
private long failedTaskCount;
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package com.nanri.aiimage.common.model.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "处理记录列表响应体:含进行中与已结束任务下的各店结果行")
|
||||
public class ProductRiskHistoryVo {
|
||||
|
||||
@Schema(description = "按店铺拆分的结果项列表,默认最多返回 100 条,按创建时间倒序")
|
||||
private List<ProductRiskResultItemVo> items = new ArrayList<>();
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package com.nanri.aiimage.common.model.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "批量匹配响应体:按规范化、过滤空项并去重后的有效店铺顺序返回")
|
||||
public class ProductRiskMatchShopsVo {
|
||||
|
||||
@Schema(description = "各店匹配结果列表,一项对应一个处理后的有效店铺名")
|
||||
private List<ProductRiskShopQueueItemVo> items = new ArrayList<>();
|
||||
}
|
||||
-90
@@ -1,90 +0,0 @@
|
||||
package com.nanri.aiimage.common.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAlias;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.nanri.aiimage.modules.shopkey.model.dto.SkipPriceAsinDetailDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Schema(description = "单店结果项:列表接口与任务详情中共用,对应 biz_file_result 一行 + 任务/请求衍生字段")
|
||||
public class ProductRiskResultItemVo {
|
||||
|
||||
@Schema(description = "结果行主键 biz_file_result.id;删除单条、下载 zip 时使用", example = "1001")
|
||||
private Long resultId;
|
||||
|
||||
@Schema(description = "所属任务 id biz_file_task.id", example = "200")
|
||||
private Long taskId;
|
||||
|
||||
@JsonProperty("shopName")
|
||||
@Schema(description = "店铺名称(列表接口中可能与库内规范化名一致;详情中会尽量合并创建任务时的展示名)")
|
||||
private String shopName;
|
||||
|
||||
@JsonProperty("shopId")
|
||||
@Schema(description = "店铺 ID(紫鸟)")
|
||||
private String shopId;
|
||||
|
||||
@Schema(description = "平台")
|
||||
private String platform;
|
||||
|
||||
@JsonProperty("companyName")
|
||||
@Schema(description = "公司名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "创建任务时是否已匹配(列表中一般为 true)")
|
||||
private boolean matched;
|
||||
|
||||
@JsonProperty("matchStatus")
|
||||
@Schema(description = "匹配状态码,含义同 ProductRiskShopQueueItemVo.matchStatus")
|
||||
private String matchStatus;
|
||||
|
||||
@JsonProperty("matchMessage")
|
||||
@Schema(description = "匹配说明文案")
|
||||
private String matchMessage;
|
||||
|
||||
@JsonProperty("taskStatus")
|
||||
@Schema(description = "所属任务当前状态:RUNNING / SUCCESS / FAILED,与各店行一致")
|
||||
private String taskStatus;
|
||||
|
||||
@Schema(description = "该店是否已成功生成结果文件;null 表示未出终态时可不按布尔处理")
|
||||
private Boolean success;
|
||||
|
||||
@Schema(description = "该店失败时的错误信息")
|
||||
private String error;
|
||||
|
||||
@JsonProperty("outputFilename")
|
||||
@Schema(description = "生成的 zip 文件名(成功后有值)")
|
||||
private String outputFilename;
|
||||
|
||||
@JsonProperty("downloadUrl")
|
||||
@Schema(description = "公开 OSS 直链下载 URL(列表里可能带;也可用 GET /results/{resultId}/download)")
|
||||
private String downloadUrl;
|
||||
private Long fileJobId;
|
||||
private String fileStatus;
|
||||
private String fileError;
|
||||
private Boolean fileReady;
|
||||
|
||||
@JsonProperty("scheduledAt")
|
||||
@Schema(description = "定时执行时间,未设置时为空")
|
||||
private String scheduledAt;
|
||||
|
||||
@JsonAlias("skip_asins_by_country")
|
||||
@JsonProperty("skipAsinsByCountry")
|
||||
private Map<String, List<String>> skipAsinsByCountry = new LinkedHashMap<>();
|
||||
|
||||
@JsonAlias("skip_asin_details_by_country")
|
||||
@JsonProperty("skipAsinDetailsByCountry")
|
||||
private Map<String, List<SkipPriceAsinDetailDto>> skipAsinDetailsByCountry = new LinkedHashMap<>();
|
||||
|
||||
@JsonProperty("createdAt")
|
||||
@Schema(description = "任务创建时间(biz_file_task.created_at,格式化字符串)")
|
||||
private String createdAt;
|
||||
|
||||
@JsonProperty("finishedAt")
|
||||
@Schema(description = "任务结束时间(biz_file_task.finished_at,未结束为 null)")
|
||||
private String finishedAt;
|
||||
}
|
||||
-69
@@ -1,69 +0,0 @@
|
||||
package com.nanri.aiimage.common.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAlias;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.nanri.aiimage.modules.queryasin.model.dto.QueryAsinCountryAsinsDto;
|
||||
import com.nanri.aiimage.modules.shopkey.model.dto.SkipPriceAsinDetailDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 与 Python 队列约定字段对齐,供前端原样推入 enqueue_json。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "单店匹配结果(队列项):与 /match-shops 及创建任务请求 items 元素结构一致,可嵌入队列 JSON data.items")
|
||||
public class ProductRiskShopQueueItemVo {
|
||||
|
||||
@JsonProperty("shopName")
|
||||
@Schema(description = "店铺名称", example = "某某店")
|
||||
private String shopName;
|
||||
|
||||
@Schema(description = "是否命中紫鸟索引;false 时不可用于创建任务")
|
||||
private boolean matched;
|
||||
|
||||
@JsonProperty("shopId")
|
||||
@Schema(description = "紫鸟侧店铺 ID(字符串),未命中时可能为空")
|
||||
private String shopId;
|
||||
|
||||
@Schema(description = "平台,例如亚马逊", example = "亚马逊")
|
||||
private String platform;
|
||||
|
||||
@JsonProperty("companyName")
|
||||
@Schema(description = "公司名称或主体标识")
|
||||
private String companyName;
|
||||
|
||||
@JsonProperty("openStoreUrl")
|
||||
@Schema(description = "打开店铺的地址(由 Python 侧消费)")
|
||||
private String openStoreUrl;
|
||||
|
||||
@JsonProperty("matchedUserId")
|
||||
@Schema(description = "索引关联到的用户 ID(若有)")
|
||||
private Long matchedUserId;
|
||||
|
||||
@JsonProperty("matchStatus")
|
||||
@Schema(description = "匹配状态码:如 MATCHED、PENDING、CONFLICT、INDEX_STALE 等,以后端为准")
|
||||
private String matchStatus;
|
||||
|
||||
@JsonProperty("matchMessage")
|
||||
@Schema(description = "人类可读说明,供前端展示")
|
||||
private String matchMessage;
|
||||
|
||||
@JsonProperty("queryAsins")
|
||||
@Schema(description = "查询 ASIN 模块返回的后台维护 ASIN 数据;按全表聚合返回,不按当前店铺过滤")
|
||||
private List<QueryAsinCountryAsinsDto> queryAsins = new ArrayList<>();
|
||||
|
||||
@JsonAlias("skip_asins_by_country")
|
||||
@JsonProperty("skipAsinsByCountry")
|
||||
@Schema(description = "按国家分组的跳过 ASIN 列表;跟价任务使用,取款任务通常可忽略")
|
||||
private Map<String, List<String>> skipAsinsByCountry = new LinkedHashMap<>();
|
||||
|
||||
@JsonAlias("skip_asin_details_by_country")
|
||||
@JsonProperty("skipAsinDetailsByCountry")
|
||||
@Schema(description = "按国家分组的跳过 ASIN 明细;包含数据库中维护的跳过跟价 ASIN 信息,取款任务通常可忽略")
|
||||
private Map<String, List<SkipPriceAsinDetailDto>> skipAsinDetailsByCountry = new LinkedHashMap<>();
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package com.nanri.aiimage.common.model.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "批量任务查询响应:每个 id 一条详情;无效 id 记入 missingTaskIds")
|
||||
public class ProductRiskTaskBatchVo {
|
||||
|
||||
@Schema(description = "与请求 taskIds 顺序不一定一致;仅包含存在且模块类型为商品风险的任务")
|
||||
private List<ProductRiskTaskDetailVo> items = new ArrayList<>();
|
||||
|
||||
@Schema(description = "请求中存在但数据库不存在或非商品风险模块的 taskId 列表")
|
||||
private List<Long> missingTaskIds = new ArrayList<>();
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package com.nanri.aiimage.common.model.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "单个任务详情:任务级概要 + 下属各店结果行")
|
||||
public class ProductRiskTaskDetailVo {
|
||||
|
||||
@Schema(description = "任务级字段:id、状态、错误信息、时间等")
|
||||
private ProductRiskTaskItemVo task = new ProductRiskTaskItemVo();
|
||||
|
||||
@Schema(description = "该任务下每个店铺一条结果记录,顺序一般按结果表 id 升序")
|
||||
private List<ProductRiskResultItemVo> items = new ArrayList<>();
|
||||
}
|
||||
-60
@@ -1,60 +0,0 @@
|
||||
package com.nanri.aiimage.common.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.nanri.aiimage.modules.shopmatch.model.vo.ShopMatchTaskStageVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "任务摘要:任务主表的基础状态、时间和调度信息")
|
||||
public class ProductRiskTaskItemVo {
|
||||
|
||||
@Schema(description = "任务主键 biz_file_task.id", example = "200")
|
||||
private Long id;
|
||||
|
||||
@JsonProperty("taskNo")
|
||||
@Schema(description = "任务编号")
|
||||
private String taskNo;
|
||||
|
||||
@Schema(description = "任务状态:RUNNING=执行中,SUCCESS=成功结束,FAILED=失败结束")
|
||||
private String status;
|
||||
|
||||
@JsonProperty("errorMessage")
|
||||
@Schema(description = "任务失败原因或异常信息")
|
||||
private String errorMessage;
|
||||
|
||||
@JsonProperty("createdAt")
|
||||
@Schema(description = "任务创建时间")
|
||||
private String createdAt;
|
||||
|
||||
@JsonProperty("updatedAt")
|
||||
@Schema(description = "任务最后更新时间")
|
||||
private String updatedAt;
|
||||
|
||||
@JsonProperty("finishedAt")
|
||||
@Schema(description = "任务完成时间")
|
||||
private String finishedAt;
|
||||
|
||||
@JsonProperty("scheduledAt")
|
||||
@Schema(description = "下次计划执行时间;未设置定时时为空")
|
||||
private String scheduledAt;
|
||||
|
||||
@JsonProperty("countryCodes")
|
||||
@Schema(description = "任务使用的国家/站点代码列表")
|
||||
private List<String> countryCodes = new ArrayList<>();
|
||||
|
||||
@JsonProperty("scheduleStages")
|
||||
@Schema(description = "分阶段调度信息;用于需要按阶段执行的店铺任务")
|
||||
private List<ShopMatchTaskStageVo> scheduleStages = new ArrayList<>();
|
||||
|
||||
@JsonProperty("currentStageIndex")
|
||||
@Schema(description = "下一个待执行阶段索引")
|
||||
private Integer currentStageIndex;
|
||||
|
||||
@JsonProperty("activeStageIndex")
|
||||
@Schema(description = "当前正在执行的阶段索引")
|
||||
private Integer activeStageIndex;
|
||||
}
|
||||
Reference in New Issue
Block a user