...
|
...
|
@@ -337,4 +337,28 @@ public class ProductController { |
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 商家修改状态:1:上架 2:下架
|
|
|
@RequestMapping(params = "method=ufo.product.sellerBatchUpdatePrice")
|
|
|
public ApiResponse sellerBatchUpdatePrice(@RequestParam(value = "skupList", required = true) List<Integer> skupList,
|
|
|
@RequestParam(value = "price", required = true) Double price){
|
|
|
LOG.info("in method=ufo.product.sellerBatchUpdatePrice skupList is {}, price is {}", skupList, price);
|
|
|
if(null == price || price <= 0) {
|
|
|
throw new ServiceException(400, "价格只能是非负数");
|
|
|
}
|
|
|
|
|
|
|
|
|
try {
|
|
|
productService.sellerBatchUpdatePrice(skupList, price);
|
|
|
//清缓存
|
|
|
LOG.info("sellerBatchUpdatePrice success and async clearProductCache skupList = {}", skupList);
|
|
|
clearBatchProductCache(skupList);
|
|
|
|
|
|
return new ApiResponse(200, "更新成功!", Boolean.TRUE);
|
|
|
} catch (Exception e) {
|
|
|
LOG.error("sellerBatchUpdatePrice失败!", e);
|
|
|
int code = (e instanceof ServiceException) ? ((ServiceException) e).getCode() : 500;
|
|
|
return new ApiResponse(code, e.getMessage(), Boolean.FALSE);
|
|
|
}
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|