Browse Source

根据多个商品Id更新索引

Aslee 3 years ago
parent
commit
14c14d7dc9
1 changed files with 13 additions and 0 deletions
  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更新
      *