From baebb04f17f809c2a87e5545ce696f509ee4fd65 Mon Sep 17 00:00:00 2001
From: wuxw7 <wuxw7@asiainfo.com>
Date: 星期一, 18 九月 2017 15:34:39 +0800
Subject: [PATCH] 公用接口方法 为其他服务提供公用入口 相当于实现协议转换 路由功能 还可以加入授权 白黑名单控制 等功能
---
UserService/src/main/java/com/java110/user/rest/UserServiceRest.java | 69 +++++++++++++++++++++++++++++++++-
1 files changed, 66 insertions(+), 3 deletions(-)
diff --git a/UserService/src/main/java/com/java110/user/rest/UserServiceRest.java b/UserService/src/main/java/com/java110/user/rest/UserServiceRest.java
index 5fca5d9..883d175 100644
--- a/UserService/src/main/java/com/java110/user/rest/UserServiceRest.java
+++ b/UserService/src/main/java/com/java110/user/rest/UserServiceRest.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.common.log.LoggerEngine;
+import com.java110.common.util.Assert;
import com.java110.common.util.ProtocolUtil;
import com.java110.core.base.controller.BaseController;
import com.java110.entity.user.Cust;
@@ -52,6 +53,66 @@
}
}
+ /**
+ * 鏍规嵁璐墿杞︿俊鎭煡璇�
+ *
+ * 杩欓噷杩斿洖data淇℃伅
+ * @param busiOrder
+ * @return
+ */
+ @Override
+ @RequestMapping("/userService/queryCustInfoByOlId")
+ public String queryCustInfoByOlId(@RequestParam("busiOrder") String busiOrder) {
+
+
+ LoggerEngine.debug("queryUserInfo鍏ュ弬锛�" + busiOrder);
+
+
+ String resultUserInfo = null;
+
+ try {
+ this.simpleValidateJSON(busiOrder);
+ resultUserInfo = iUserServiceSMO.queryCustInfoByOlId(busiOrder);
+
+ } catch (Exception e) {
+ LoggerEngine.error("鏈嶅姟澶勭悊鍑虹幇寮傚父锛�", e);
+ resultUserInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"鏈嶅姟澶勭悊鍑虹幇寮傚父"+e,null);
+ } finally {
+ LoggerEngine.debug("鐢ㄦ埛鏈嶅姟鎿嶄綔瀹㈡埛鍑哄弬锛�" + resultUserInfo);
+ return resultUserInfo;
+ }
+ }
+
+ /**
+ * 鏍规嵁璐墿杞︿俊鎭煡璇� 闇�瑕佷綔搴熺殑鍙戣捣鐨勬姤鏂�
+ *
+ * 杩欓噷杩斿洖data淇℃伅
+ * @param busiOrder
+ * @return
+ */
+ @Override
+ @RequestMapping("/userService/queryNeedDeleteCustInfoByOlId")
+ public String queryNeedDeleteCustInfoByOlId(@RequestParam("busiOrder") String busiOrder) {
+
+
+ LoggerEngine.debug("queryUserInfo鍏ュ弬锛�" + busiOrder);
+
+
+ String resultUserInfo = null;
+
+ try {
+ this.simpleValidateJSON(busiOrder);
+ resultUserInfo = iUserServiceSMO.queryNeedDeleteCustInfoByOlId(busiOrder);
+
+ } catch (Exception e) {
+ LoggerEngine.error("鏈嶅姟澶勭悊鍑虹幇寮傚父锛�", e);
+ resultUserInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"鏈嶅姟澶勭悊鍑虹幇寮傚父"+e,null);
+ } finally {
+ LoggerEngine.debug("鐢ㄦ埛鏈嶅姟鎿嶄綔瀹㈡埛鍑哄弬锛�" + resultUserInfo);
+ return resultUserInfo;
+ }
+ }
+
/**
* 鐢ㄦ埛鏈嶅姟淇℃伅鍙楃悊
@@ -75,10 +136,8 @@
reqUserJSON = this.simpleValidateJSON(data);
//1.0瑙勫垯鏍¢獙锛屾姤鏂囨槸鍚﹀悎娉�
-
//2.0 鍙楃悊瀹㈡埛淇℃伅
resultUserInfo = iUserServiceSMO.soUserService(reqUserJSON);
-
} catch (Exception e) {
LoggerEngine.error("鏈嶅姟澶勭悊鍑虹幇寮傚父锛�", e);
@@ -88,6 +147,7 @@
return resultUserInfo;
}
}
+
/**
* 杩欎釜鎺ュ彛涓撻棬鐢ㄤ簬璁㈠崟鏈嶅姟鍙楃悊鐢紝鍏ュ弬涓� JSONObject
@@ -284,7 +344,10 @@
try{
reqParam = this.simpleValidateJSON(data);
- //resultUserInfo = iUserServiceSMO.soBoCustAttr(data);
+
+ Assert.isNull(reqParam,"data","浼犲叆鎶ユ枃閿欒锛屾病鏈夊寘鍚玠ata鑺傜偣"+reqParam);
+
+ resultUserInfo = iUserServiceSMO.soDeleteCustInfo(reqParam.getJSONArray("data"));
}catch (Exception e){
LoggerEngine.error("鏈嶅姟澶勭悊鍑虹幇寮傚父锛�", e);
--
Gitblit v1.8.0