فهرست منبع

#IQBX #comment 调整接口放置位置

gifur 3 سال پیش
والد
کامیت
1cacc2dbb2
2فایلهای تغییر یافته به همراه98 افزوده شده و 48 حذف شده
  1. 46 0
      Module/include/microservices/api_comm.h
  2. 52 48
      Module/include/microservices/api_manage_regist.h

+ 46 - 0
Module/include/microservices/api_comm.h

@@ -0,0 +1,46 @@
+#ifndef MICROSERVICES_API_COMM_HEADER_
+#define MICROSERVICES_API_COMM_HEADER_
+
+#define HEADOFFICE_MICROSERVICES_URL_DEV "https://rvcgateway.paas.cmbchina.cn"
+#define HEADOFFICE_MICROSERVICES_URL_ST "https://rvcgateway.paasst.cmbchina.cn"
+#define HEADOFFICE_MICROSERVICES_URL_UAT "https://rvcgateway.paasuat.cmbchina.cn"
+#define HEADOFFICE_MICROSERVICES_URL_PRD "https://rvcgateway.paas.cmbchina.cn"
+
+
+#define URLPATH_TERMINAL_REGISTER_INFO "/terminal/api/manage/regist/"
+
+namespace MicroServices
+{
+
+namespace API
+{
+
+struct CommResponse
+{
+    bool success;
+    std::string errorCode;
+    std::string returnCode;
+    std::string errorMsg;
+    std::string message;
+
+    bool IsReqBusinessSucc() const
+    {
+        return (returnCode == "SUC0000");
+    }
+
+    bool IsPadded() const
+    {
+        return (!errorCode.empty() || !returnCode.empty() || !errorMsg.empty() || !message.empty());
+    }
+
+    std::string WhatError() const
+    {
+        return (std::string("[") + returnCode + "] " + errorMsg);
+    }
+};
+
+}
+
+}
+
+#endif //MICROSERVICES_API_COMM_HEADER_

+ 52 - 48
Module/include/microservices/api_manage_regist.h

@@ -1,71 +1,74 @@
 #ifndef MICROSERVICES_API_MANAGE_REGIST_HEADER_
 #define MICROSERVICES_API_MANAGE_REGIST_HEADER_
 
+#include "api_comm.h"
 #include <string>
 
+
 namespace MicroServices
 {
 
 namespace API
 {
 
-struct CommResponse
-{
-    bool success;
-    std::string errorCode;
-    std::string returnCode;
-    std::string errorMsg;
-    std::string message;
-};
 
 namespace Manage
 {
-//http://rvcterminal.paasst.cmbchina.cn/api/manage/regist/7555980103
 /*
+{
     "data": {
         "branchNo": "755",
-        "businessStructID": "1BFEB05100000000",
-        "businessStructInfo": {
-            "bActive": true,
-            "bDisplay": true,
-            "branchNo": "755598",
-            "commonName": "ShenZhenFenHangYingYeBu",
-            "description": null,
-            "editor": null,
-            "expTime": null,
-            "globalName": "CMB.ShenZhenFenHang.ShenZhenFenHangYingYeBu",
-            "nLayer": 3,
-            "nodeType": "B",
-            "parentId": "17A2113A0000000A",
-            "structFullName": "招商银行/深圳分行/深圳分行营业部",
-            "structId": "1BFEB05100000000",
-            "structName": "深圳分行营业部",
-            "structType": "102",
-            "topStruct": false
+        "businessStructID" : "1BFEB05100000000",
+        "businessStructInfo" : {
+        "bActive": true,
+        "bDisplay" : true,
+        "branchNo" : "755598",
+        "commonName" : "ShenZhenFenHangYingYeBu",
+        "description" : null,
+        "editor" : null,
+        "expTime" : null,
+        "globalName" : "CMB.ShenZhenFenHang.ShenZhenFenHangYingYeBu",
+        "nLayer" : 3,
+        "nodeType" : "B",
+        "parentId" : "17A2113A0000000A",
+        "structFullName" : "招商银行/深圳分行/深圳分行营业部",
+        "structId" : "1BFEB05100000000",
+        "structName" : "深圳分行营业部",
+        "structType" : "102",
+        "topStruct" : false
         },
-        "deviceNo": "D06255",
-        "grooveCount": 1,
-        "initIP": "99.12.22.197",
-        "line": "RVC_Branch_MarketingDeviceManage",
-        "lineDes": "市场条线",
-        "machineNo": "2021092215115721",
-        "machineType": "RVC.Stand2S",
-        "machineVersion": "5.0",
-        "outletNo": "755598",
-        "padDeviceId": "cw_00000000",
-        "pinPadId": "cw_1902BB2104258467",
-        "remark": "1",
-        "sites": "CMB.LIB",
-        "state": "1",
-        "stateName": "正常",
-        "structID": "1BFEB05100000000",
-        "structInfo": null,
-        "terminalNo": "7555980103",
-        "workFlowState": null
-    }
+            "deviceNo": "D06255",
+            "grooveCount" : 1,
+            "initIP" : "99.12.22.197",
+            "line" : "RVC_Branch_MarketingDeviceManage",
+            "lineDes" : "市场条线",
+            "machineNo" : "2021092215115721",
+            "machineType" : "RVC.Stand2S",
+            "machineVersion" : "5.0",
+            "outletNo" : "755598",
+            "padDeviceId" : "cw_00000000",
+            "pinPadId" : "cw_1902BB2104258467",
+            "remark" : "1",
+            "sites" : "CMB.LIB",
+            "state" : "1",
+            "stateName" : "正常",
+            "structID" : "1BFEB05100000000",
+            "structInfo" : null,
+            "terminalNo" : "7555980103",
+            "workFlowState" : null
+    },
+        "errorCode": "10000",
+        "errorMsg" : "获取成功",
+        "message" : "获取成功",
+        "page" : 0,
+        "pageSize" : 0,
+        "request" : "http://rvcterminal.paasst.cmbchina.cn/api/manage/regist/7555980103",
+        "returnCode" : "SUC0000",
+        "success" : true,
+        "total" : 0
+}
 */
 
-
 struct RegistInfo
 {
     std::string branchNo;
@@ -77,6 +80,7 @@ struct RegistInfo
     std::string sites;
     std::string terminalNo;
 };
+
 }
 
 }