Преглед на файлове

迁移搜索索引更新到商品模块

chao преди 4 години
родител
ревизия
9484703539

+ 10 - 10
src/main/java/com/caimei/modules/opensearch/SearchUitls.java

@@ -17,49 +17,49 @@ public class SearchUitls {
 
     public void updateProductIndex(Integer productId){
         MultiValueMap<String, Integer> paramMap = new LinkedMultiValueMap<>();
-        paramMap.add("pid", productId);
+        paramMap.add("productId", productId);
         updatePost("/update/product", paramMap);
     }
 
     public void deleteProductIndex(Integer productId){
         MultiValueMap<String, Integer> paramMap = new LinkedMultiValueMap<>();
-        paramMap.add("pid", productId);
+        paramMap.add("productId", productId);
         updatePost("/delete/product", paramMap);
     }
 
     public void updateArticleIndex(Integer articleId){
         MultiValueMap<String, Integer> paramMap = new LinkedMultiValueMap<>();
-        paramMap.add("aid", articleId);
+        paramMap.add("articleId", articleId);
         updatePost("/update/article", paramMap);
     }
 
     public void deleteArticleIndex(Integer articleId){
         MultiValueMap<String, Integer> paramMap = new LinkedMultiValueMap<>();
-        paramMap.add("aid", articleId);
+        paramMap.add("articleId", articleId);
         updatePost("/delete/article", paramMap);
     }
 
     public void updateAllArticleIndex(){
-        updatePost("/update/article",null);
+        updatePost("/article/all",null);
     }
 
     public void updateShopIndex(Integer shopId){
         MultiValueMap<String, Integer> paramMap = new LinkedMultiValueMap<>();
-        paramMap.add("sid", shopId);
+        paramMap.add("shopId", shopId);
         updatePost("/update/supplier", paramMap);
     }
 
     public void updateEquipmentIndex(Integer equipmentId){
         MultiValueMap<String, Integer> paramMap = new LinkedMultiValueMap<>();
-        paramMap.add("eid", equipmentId);
+        paramMap.add("equipmentId", equipmentId);
         updatePost("/update/equipment", paramMap);
     }
 
     private void updatePost(String path, MultiValueMap<String, Integer> paramMap){
-        // 获取spi服务器地址
-        String spiServer = Global.getConfig("caimei.spi");
+        // 获取core服务器地址
+        String coreServer = Global.getConfig("caimei.core");
         RestTemplate restTemplate = new RestTemplate();
-        String uri = spiServer + "/search/manage" + path;
+        String uri = coreServer + "/commodity/search/index" + path;
         // 打印参数
         System.out.println("更新索引uri:" + uri +",参数:"+ paramMap.toString());
         // 发起Post请求

+ 1 - 0
src/main/resources/config/beta/caimei.properties

@@ -174,6 +174,7 @@ export.template=/mnt/newdatadrive/data/custom/manager-export-template
 
 # SPI-server(CKEditor5图片上传API,搜索更新索引)
 caimei.spi=https://spi-b.caimei365.com
+caimei.core=https://core-b.caimei365.com
 
 #阿里云oss存储
 aliyun.accessKeyId=LTAI4GBL3o4YkWnbKYgf2Xia

+ 1 - 1
src/main/resources/config/dev/caimei.properties

@@ -188,7 +188,7 @@ export.template=export
 
 # SPI-server(CKEditor5图片上传API,搜索更新索引)
 caimei.spi=http://localhost:8008
-
+caimei.core=https://localhost:18002
 #阿里云oss存储
 aliyun.accessKeyId=LTAI4GBL3o4YkWnbKYgf2Xia
 aliyun.accessKeySecret=dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK

+ 1 - 0
src/main/resources/config/product/caimei.properties

@@ -175,6 +175,7 @@ export.template=/mnt/newdatadrive/data/custom/manager-export-template
 
 # SPI-server(CKEditor5图片上传API,搜索更新索引)
 caimei.spi=https://spi.caimei365.com
+caimei.core=https://core.caimei365.com
 
 #阿里云oss存储
 aliyun.accessKeyId=LTAI4GBL3o4YkWnbKYgf2Xia

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/basesetting/helpPageEdit.jsp

@@ -88,6 +88,7 @@
 </form:form>
 <!-- 富文本编辑器 -->
 <% request.setAttribute("caimeiSpi", Global.getConfig("caimei.spi"));%>
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
 <script type="text/javascript" src="${ctxStatic}/ckeditor5-new/ckeditor.js"></script>
 <script type="text/javascript">
     //富文本框编辑

+ 3 - 2
src/main/webapp/WEB-INF/views/modules/cmpage/cmPageList.jsp

@@ -2,6 +2,7 @@
 <%@ page contentType="text/html;charset=UTF-8" %>
 <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
 <% request.setAttribute("caimeiSpi", Global.getConfig("caimei.spi"));%>
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
 <html>
 <head>
     <title>网页列表</title>
@@ -71,7 +72,7 @@
                 }
                 $("#searchForm").submit();
             },"JSON");//这里返回的类型有:json,html,xml,text*/
-            $.post("${caimeiSpi}/search/manage/update/equipment", {eid: id}, function(res){
+            $.post("${caimeiCore}/commodity/search/index/update/equipment", {equipmentId: id}, function(res){
                 $.jBox.tip(res.msg, 'info');
                 $("#searchForm").submit();
             });
@@ -90,7 +91,7 @@
                         $("#searchForm").submit();
                     },"JSON");//这里返回的类型有:json,html,xml,text
                     */
-                    $.post("${caimeiSpi}/search/manage/update/equipment/all", function(res){
+                    $.post("${caimeiCore}/commodity/search/index/equipment/all", function(res){
                         $.jBox.tip(res.msg, 'info');
                         $("#searchForm").submit();
                     });

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/info/infoForm.jsp

@@ -153,6 +153,7 @@
 	</form:form>
 <!-- 富文本编辑器 -->
 <% request.setAttribute("caimeiSpi", Global.getConfig("caimei.spi"));%>
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
 <script type="text/javascript" src="${ctxStatic}/ckeditor5-new/ckeditor.js"></script>
 <script type="text/javascript">
 		$(document).ready(function() {

+ 3 - 2
src/main/webapp/WEB-INF/views/modules/info/infoList.jsp

@@ -16,6 +16,7 @@
 	}
 	</style>
 	<% request.setAttribute("caimeiSpi", Global.getConfig("caimei.spi"));%>
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
 	<script type="text/javascript">
 		$(document).ready(function() {
 			show_title(16);
@@ -97,14 +98,14 @@
 
 		// 更新索引
 		function updateIndex(id) {
-			$.post("${caimeiSpi}/search/manage/update/article", {aid: id}, function(res){
+			$.post("${caimeiCore}/commodity/search/index/update/article", {articleId: id}, function(res){
 				$.jBox.tip(res.msg, 'info');
 			});
 		}
 		function updateAllIndex(){
 			var submit = function (v, h, f) {
 				if (v == true){
-					$.post("${caimeiSpi}/search/manage/update/article/all", function(res){
+					$.post("${caimeiCore}/commodity/search/index/article/all", function(res){
 						$.jBox.tip(res.msg, 'info');
 					});
 				}

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp

@@ -390,6 +390,7 @@
 </form:form>
 <!-- 富文本编辑器 -->
 <% request.setAttribute("caimeiSpi", Global.getConfig("caimei.spi"));%>
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
 <script type="text/javascript" src="${ctxStatic}/ckeditor5-new/ckeditor.js"></script>
 <script type="text/javascript">
     $(document).ready(function() {

+ 3 - 2
src/main/webapp/WEB-INF/views/modules/product-new/productList.jsp

@@ -285,6 +285,7 @@
 	</table>
 	<div class="pagination">${page}</div>
 <% request.setAttribute("caimeiSpi", Global.getConfig("caimei.spi"));%>
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
 <script type="text/javascript">
     var num = '';
     function page(n,s){
@@ -355,14 +356,14 @@
 
     // 更新索引
     function updateIndex(id) {
-		$.post("${caimeiSpi}/search/manage/update/product", {pid: id}, function(res){
+		$.post("${caimeiCore}/commodity/search/index/update/product", {productId: id}, function(res){
 			$.jBox.tip(res.msg, 'info');
 		});
     }
     function updateAllIndex(){
             var submit = function (v, h, f) {
                 if (v == true){
-                    $.post("${caimeiSpi}/search/manage/update/product/all", function(res){
+                    $.post("${caimeiCore}/commodity/search/index/product/all", function(res){
                         $.jBox.tip(res.msg, 'info');
                     });
                 }

+ 2 - 1
src/main/webapp/WEB-INF/views/modules/product-new/secondHand.jsp

@@ -293,6 +293,7 @@
 </table>
 <div class="pagination">${page}</div>
 <% request.setAttribute("caimeiSpi", Global.getConfig("caimei.spi"));%>
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
 <script type="text/javascript">
     var num = '';
     function page(n,s){
@@ -359,7 +360,7 @@
 
     // 更新索引
     function updateIndex(id) {
-        $.post("${caimeiSpi}/search/manage/update/product", {pid: id}, function(res){
+        $.post("${caimeiCore}/commodity/search/index/update/product", {productId: id}, function(res){
             $.jBox.tip(res.msg, 'info');
         });
     }