//
// Created by Ht on 2020/8/24.
//

#ifndef LIBDEVCPP_MGBUSMESSAGEUTIL_H
#define LIBDEVCPP_MGBUSMESSAGEUTIL_H

#include "ChannelOperator.h"

namespace jedge {

    class JE_API MgbusMessageUtil {

    public:

        static bool SetMessageCallInfoFromUri(jedge::ChannelOperator& opr, qlibc::QData &msg, const std::string &uri);

        static bool parseRequestInfoFromUri(const std::string &uri, std::string &mod, std::string &real_uri);
    };


    //生成一个Echo的respnose，参数1 为qlibc::QData, 参数2为qlibc::QData*类型
#define PingRsp(rsp) \
    MkRsp((rsp), 200, StringUtils::formatString("Ping from %s", __FUNCTION__))

#define DbgSvcCallMark(msg,rsp) \
    QDLog("Call in %s by %s : %s", __FUNCTION__, rsp!= nullptr?"Request":"Respnose", (msg).toJSONString().c_str())

}

#endif //LIBDEVCPP_MGBUSMESSAGEUTIL_H
