123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #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 HEADOFFICE_MICROSERVICES_CENTERCONFIG_URL_ST "http://centerconfig.paasst.cmbchina.cn"
- #define HEADOFFICE_MICROSERVICES_GRAYLAUNCH_URL_ST "https://rvcgray.paasst.cmbchina.cn"
- #define URLPATH_TERMINAL_REGISTER_INFO "/terminal/api/manage/regist/"
- #define URLPATH_GRAY_CHECK "/api/gray/way/"
- #define URLPATH_CENTERSETTING_UPDATE_CONFIG "/api/terminal/center/config"
- #define URLPATH_DEVICECONTROL_LOGIN "/api/login/sign/"
- #define URLPATH_REGISTER_FULL_LIST "/terminal/api/manage/regist/full/list"
- #define URLPATH_MANUFACTURE_GET_ALL "/terminal/api/v1/manufacture/getAll"
- namespace MicroServices
- {
- namespace API
- {
- struct CommResponse
- {
- bool success;
- std::string errorCode;
- std::string returnCode;
- std::string errorMsg;
- std::string message;
- virtual bool IsOperatedOK() const
- {
- return (returnCode == "SUC0000" || errorCode == "0"/*ACS_SUCCESS*/);
- }
- virtual bool IsNotEmpty() const
- {
- return (!errorCode.empty() || !returnCode.empty() || !errorMsg.empty() || !message.empty());
- }
- virtual std::string WhatError() const
- {
- std::string result("");
- if (!returnCode.empty()) {
- result += "[";
- result += returnCode;
- result += "]";
- }
- if (!errorCode.empty()) {
- result += "[";
- result += errorCode;
- result += "]";
- }
- if (!message.empty()) {
- result += " ";
- result += message;
- }
- if (!errorMsg.empty()) {
- result += " ";
- result += errorMsg;
- }
- return result;
- }
- };
- struct GrayResponseJson : public CommResponse
- {
- bool graySwitch;
- virtual bool IsOperatedOK() const
- {
- return (errorCode == "10000");
- }
- };
- }
- }
- #endif //MICROSERVICES_API_COMM_HEADER_
|