瀏覽代碼

根据多个商品Id更新索引

Aslee 3 年之前
父節點
當前提交
14c14d7dc9
共有 1 個文件被更改,包括 13 次插入0 次删除
  1. 13 0
      src/main/java/com/caimei365/commodity/controller/SearchIndexApi.java

+ 13 - 0
src/main/java/com/caimei365/commodity/controller/SearchIndexApi.java

@@ -105,6 +105,19 @@ public class SearchIndexApi {
         return searchIndexService.updateProductIndexById(updateIndexDto.getProductId());
     }
 
+    /**
+     * 根据多个商品Id更新
+     */
+    @ApiOperation("根据多个商品Id更新")
+    @PostMapping("/update/products")
+    public ResponseJson updateProductsIndex(String productIds) {
+        String[] productIdArr = productIds.split(",");
+        for (String productId : productIdArr) {
+            searchIndexService.updateProductIndexById(Integer.parseInt(productId));
+        }
+        return ResponseJson.success();
+    }
+
     /**
      * 根据供应商Id更新
      *