feat(admin): 最低价ASIN列表操作列新增整条删除按钮——后端DELETE /skip-price-asins/{id}(权限校验+日志),前端确认弹窗+删空页回退,补单测与对齐测试
This commit is contained in:
+10
@@ -165,6 +165,16 @@ public class SkipPriceAsinController {
|
||||
isSuper(operator)));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "删除整条跳过跟价 ASIN 记录", description = "按主键删除店铺的全部站点 ASIN 与最低价配置。")
|
||||
public ApiResponse<Void> delete(
|
||||
HttpServletRequest request,
|
||||
@Parameter(description = "主键 ID", required = true) @PathVariable Long id) {
|
||||
AdminUserEntity operator = requireOperator(request);
|
||||
skipPriceAsinService.delete(id, operator.getId(), isSuper(operator));
|
||||
return ApiResponse.success("删除成功", null);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}/countries/{country}")
|
||||
@Operation(summary = "删除指定国家的跳过跟价 ASIN")
|
||||
public ApiResponse<Void> deleteCountry(
|
||||
|
||||
+10
@@ -336,6 +336,16 @@ public class SkipPriceAsinService {
|
||||
skipPriceAsinMapper.updateById(entity);
|
||||
}
|
||||
|
||||
/** 删除整条最低价 ASIN 记录(该店铺全部站点的配置)。 */
|
||||
@Transactional
|
||||
public void delete(Long id, Long operatorId, boolean superAdmin) {
|
||||
SkipPriceAsinEntity entity = getById(id);
|
||||
validateGroupAccess(entity, operatorId, superAdmin);
|
||||
skipPriceAsinMapper.deleteById(entity.getId());
|
||||
log.info("[skip-price-asin] delete record id={} shopName={} groupId={} operatorId={}",
|
||||
entity.getId(), entity.getShopName(), entity.getGroupId(), operatorId);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public SkipPriceAsinItemVo updateCountry(Long id, String country, String asin, BigDecimal minimumPrice,
|
||||
Long operatorId, boolean superAdmin) {
|
||||
|
||||
Reference in New Issue
Block a user