From f11317925fe0319bbacf6c4bc32a3a87d6c1ee9b Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 16 七月 2024 17:19:13 +0800
Subject: [PATCH] 提交
---
server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java | 136 ++++++++++++++++++++++++++++++++++++++------
1 files changed, 116 insertions(+), 20 deletions(-)
diff --git a/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java b/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java
index 576a902..2837a38 100644
--- a/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomZhongTaiServiceImpl.java
@@ -16,6 +16,7 @@
import com.doumee.dao.business.MemberMapper;
import com.doumee.dao.business.model.CrmInterfaceLog;
import com.doumee.dao.business.model.InterfaceLog;
+import com.doumee.dao.web.response.ZSZXCatalogResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -52,11 +53,37 @@
ZTConstants.IntegerName.USER_GET_TOKEN_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<ZTUserGetTokenResponse>>(){});
if(result!=null){
return result.getData();
}
return null;
+ }
+ /**
+ * 鑾峰彇鐢ㄦ埛鐧婚檰token
+ * @return
+ */
+ @Override
+ public ZSZXCatalogResponse getZSZXCatalogs(){
+ ZSZXCatalogResponse response = new ZSZXCatalogResponse();
+ ZTCatalogListRequest param = new ZTCatalogListRequest();
+ param.setCatalogCode(ZTConstants.CatalogCode.ZHISHUO_ZHUANGXIU);
+ List<ZTCatalogInfoResponse> cataList = getCatalogList(param);
+ if(cataList!=null ){
+ for(ZTCatalogInfoResponse data : cataList){
+ if(StringUtils.equals(data.getCode(), ZTConstants.CatalogCode.JIADE_ID)){
+ response.setJdId(data);
+ }else if(StringUtils.equals(data.getCode(), ZTConstants.CatalogCode.CHUFANGSHEJI)){
+ response.setCfsj(data);
+ }else if(StringUtils.equals(data.getCode(), ZTConstants.CatalogCode.QW_SHEJI)){
+ response.setQwsj(data);
+ }else if(StringUtils.equals(data.getCode(), ZTConstants.CatalogCode.SHOUNASHEJI)){
+ response.setSnsj(data);
+ }
+ }
+ }
+ return response;
}
/**
* 鐢ㄦ埛淇℃伅鍚屾
@@ -70,7 +97,8 @@
ZTConstants.IntegerName.USER_UPDATE_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<ZTUserGetTokenResponse>>(){});
if(result!=null){
return result.getData();
}
@@ -88,7 +116,8 @@
ZTConstants.IntegerName.USER_LOGOUT_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<Object>>(){});
if(result!=null ){
return true;
}
@@ -102,12 +131,14 @@
*/
@Override
public List<ZTCatalogInfoResponse> getCatalogList(ZTCatalogListRequest param){
- ZTBaseResponse<List<ZTCatalogInfoResponse>> result = sendHttpRequest(
+
+ ZTBaseResponse<List<ZTCatalogInfoResponse>> result = sendHttpRequest(
ZTConstants.IntegerUrl.CATALOG_LIST_URL,
ZTConstants.IntegerName.CATALOG_LIST_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<List<ZTCatalogInfoResponse>>>(){});
if(result!=null){
return result.getData();
}
@@ -125,7 +156,8 @@
ZTConstants.IntegerName.TAG_LIST_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<List<ZTTagInfoResponse>>>(){});
if(result!=null){
return result.getData();
}
@@ -144,7 +176,8 @@
ZTConstants.IntegerName.CONTENT_LIST_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTContentListResponse>>>(){});
if(result!=null){
return result.getData();
}
@@ -162,7 +195,8 @@
ZTConstants.IntegerName.CONTENT_INFO_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<ZTContentInfoResponse>>(){});
if(result!=null){
return result.getData();
}
@@ -180,7 +214,8 @@
ZTConstants.IntegerName.COLLECT_DO_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<Object>>(){});
if(result!=null ){
return true;
}
@@ -198,7 +233,8 @@
ZTConstants.IntegerName.LIKE_DO_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<Object>>(){});
if(result!=null ){
return true;
}
@@ -216,7 +252,8 @@
ZTConstants.IntegerName.SHARE_DO_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<Object>>(){});
if(result!=null ){
return true;
}
@@ -234,7 +271,27 @@
ZTConstants.IntegerName.VIEW_DO_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<Object>>(){});
+ if(result!=null ){
+ return true;
+ }
+ return false;
+ }
+ /**
+ * 鐢ㄦ埛缁戝畾瀹㈡埛鍠滄娓呭崟锛屽彲缁戝畾澶氫釜鍐呭
+ * @param param
+ * @return
+ */
+ @Override
+ public boolean bindCustomerFavorites(ZTBindCusFavoriteDoRequest param){
+ ZTBaseResponse result = sendHttpRequest(
+ ZTConstants.IntegerUrl.BIND_CUSTOMER_FAVORITES_URL,
+ ZTConstants.IntegerName.BIND_CUSTOMER_FAVORITES_NAME,
+ param.getToken(),
+ param.getUserType(),
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<Object>>(){});
if(result!=null ){
return true;
}
@@ -246,13 +303,52 @@
* @return
*/
@Override
- public ZTBasePageResponse<ZTContentListResponse> pageCollectList(ZTContentListRequest param){
- ZTBaseResponse< ZTBasePageResponse<ZTContentListResponse>> result = sendHttpRequest(
+ public ZTBasePageResponse<ZTCollectInfoResponse> pageCollectList(ZTContentListRequest param){
+ ZTBaseResponse< ZTBasePageResponse<ZTCollectInfoResponse>> result = sendHttpRequest(
ZTConstants.IntegerUrl.COLLECT_LIST_URL,
ZTConstants.IntegerName.COLLECT_LIST_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTCollectInfoResponse>>>(){});
+ if(result!=null){
+ return result.getData();
+ }
+ return null;
+ }
+ /**
+ * 鑾峰彇鎴戠殑鏀惰棌鍒楄〃鍒嗛〉
+ * @param param
+ * @return
+ */
+ @Override
+ public ZTBasePageResponse<ZTBehaviorInfoResponse> pageBehavoirList(ZTContentListRequest param){
+ ZTBaseResponse< ZTBasePageResponse<ZTBehaviorInfoResponse>> result = sendHttpRequest(
+ ZTConstants.IntegerUrl.BEHAVIOR_LIST_URL,
+ ZTConstants.IntegerName.BEHAVIOR_LIST_NAME,
+ param.getToken(),
+ param.getUserType(),
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTBehaviorInfoResponse>>>(){});
+ if(result!=null){
+ return result.getData();
+ }
+ return null;
+ }
+ /**
+ * 鑾峰彇瀹㈡埛鍠滄
+ * @param param
+ * @return
+ */
+ @Override
+ public ZTBasePageResponse<ZTCusFavoritesInfoResponse> pageCusFavoriteList(ZTContentListRequest param){
+ ZTBaseResponse< ZTBasePageResponse<ZTCusFavoritesInfoResponse>> result = sendHttpRequest(
+ ZTConstants.IntegerUrl.CUSTOMER_FAVORITES_LIST_URL,
+ ZTConstants.IntegerName.CUSTOMER_FAVORITES_LIST_NAME,
+ param.getToken(),
+ param.getUserType(),
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTCusFavoritesInfoResponse>>>(){});
if(result!=null){
return result.getData();
}
@@ -271,7 +367,8 @@
ZTConstants.IntegerName.LIKE_LIST_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<ZTBasePageResponse<ZTContentListResponse>>>(){});
if(result!=null){
return result.getData();
}
@@ -293,7 +390,8 @@
ZTConstants.IntegerName.AREA_LIST_NAME,
param.getToken(),
param.getUserType(),
- JSONObject.toJSONString(param ));
+ JSONObject.toJSONString(param ),
+ new TypeReference<ZTBaseResponse<List<ZTAreaInfoResponse>>>(){});
if(result!=null){
return result.getData();
}
@@ -301,7 +399,7 @@
}
- public <T> ZTBaseResponse<T> sendHttpRequest(String url,String name,String token,String userType,String param){
+ public <T> ZTBaseResponse<T> sendHttpRequest(String url,String name,String token,String userType,String param,TypeReference<ZTBaseResponse<T>> typeReference){
log.info("銆�"+name+"銆�================寮�濮�===="+ JSONObject.toJSONString(param));
String res = null;
int success = 0;
@@ -312,8 +410,6 @@
headers.put(ZTConstants.HEADER_USERTYPE,userType);
String index = (String) redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_ZHONGTAI_API_URL);
res = HttpsUtil.postJsonWithHeaders(index+url,param,headers);
- TypeReference typeReference =
- new TypeReference<ZTBaseResponse<T>>(){};
ZTBaseResponse<T> result = JSONObject.parseObject(res, typeReference.getType());
logResult(result,name);
if(Constants.equalsInteger(result.getCode(),ZTConstants.CODE_SUCCESS)){
--
Gitblit v1.9.3