#ifndef COMMUNICATION_CMD_HPP_
#define COMMUNICATION_CMD_HPP_
#include <string>
#include <vector>
#include <iostream>
#include <json/json.h>
#include "common/parameter_defination.hpp"

class JsonData {
public:

    void DataNodeStatusCheck();
    // mqtt command
    int JsonCmd_07(); //获取系统内存温度硬盘等信息
    std::string JsonCmd_20(Param_20 &param);
    std::string JsonCmd_22(Param_22 &param); //时区配置
    std::string JsonCmd_23(Param_23 &param); //服务器配置
    std::string JsonCmd_25(Param_25 &param);
    std::string JsonCmd_26(Param_26 &param);
    std::string JsonCmd_27(Json::Value &recvBody);
    int JsonCmd_29();       //系统配置信息
    int JsonCmd_30();       //传感器信息
    int JsonCmd_31();       //传感器任务调度信息
    int JsonCmd_32(std::string MeasurementID,int  status,int type,std::string Data,std::string Msg);
    std::string JsonCmd_50(Json::Value &recvBody); // download update file
    std::string JsonCmd_51(Json::Value &recvBody);
    std::string JsonCmd_52(); // upload static data
    std::string JsonCmd_53(Json::Value &recvBody);

    // web command parse
    std::string JsonCmd_Cgi_01(Param_01 &param); //用户操作处理
    std::string JsonCmd_Cgi_02(Param_02 &param); //时间校准接口
    std::string JsonCmd_Cgi_07();                //获取系统内存温度硬盘等信息
    std::string JsonCmd_Cgi_08();                //重启
    std::string JsonCmd_Cgi_09(Param_09 &param); //实时数据获取
    std::string JsonCmd_Cgi_10(Param_10 &param); //
    std::string JsonCmd_Cgi_20(Param_20 &param); //终端信息获取
    std::string JsonCmd_Cgi_22(Param_22 &param); //时区配置
    std::string JsonCmd_Cgi_23(Param_23 &param); //服务器配置
    std::string JsonCmd_Cgi_25(Param_25 &param); //网口配置

    // web command parse2
    std::string JsonCmd_Cgi_26(Param_26 &param);
    std::string JsonCmd_Cgi_27(std::vector<Param_27>  &param);
    std::string JsonCmd_Cgi_28(Param_28 &param);
    std::string JsonCmd_Cgi_29(Param_29 &param); //获取原始数据
    std::string JsonCmd_Cgi_30(Param_30 &param); //获取频域数据
    std::string JsonCmd_Cgi_31(Param_31 &param); //配置通信通道
    std::string JsonCmd_Cgi_32(Param_32 &param); //

    std::string JsonCmd_Cgi_40(Param_40 &param);                                //
    std::string JsonCmd_Cgi_41(std::vector<Param_41> &param, int isServer = 0); //
    std::string JsonCmd_Cgi_42(Param_42 &param);                                //从web端更新程序
    std::string JsonCmd_Cgi_43();                                               //检测网口状态

    // web command parse3
    std::string JsonCmd_Cgi_45(Param_45 &param); //国家区域配置
    std::string JsonCmd_Cgi_46(Param_46 &param); //升级固件
    std::string JsonCmd_Cgi_47(Param_47 &param); //替换Logo
    std::string JsonCmd_Cgi_50();                //
    std::string JsonCmd_Cgi_51(Param_51 &param); //
    std::string JsonCmd_Cgi_52(Param_52 &param);
    std::string JsonCmd_Cgi_53(std::vector<Param_53> &param);
    std::string JsonCmd_Cgi_54(Param_54 &param);

    std::string JsonCmd_Cgi_55(Param_55 &param);// 算积分只用低频加速度
    std::string JsonCmd_Cgi_56(Param_56 &param);
    std::string JsonCmd_Cgi_57(Param_57 &param);
    std::string JsonCmd_Cgi_58(Param_58 &param);
    std::string JsonCmd_Cgi_59(Param_59 &param);
    std::string JsonCmd_Cgi_60(Param_60 &param);
    std::string JsonCmd_Cgi_61(Param_61 &param);
    std::string JsonCmd_Cgi_62(Param_62 &param);
    std::string JsonCmd_Cgi_63(Param_63 &param);
    std::string JsonCmd_Cgi_64(Param_64 &param);
    std::string JsonCmd_Cgi_65(Param_65 &param);
    std::string JsonCmd_Cgi_66(Param_66 &param);
    std::string JsonCmd_Cgi_67(Param_67 &param);
    std::string JsonCmd_Cgi_68(Param_68 &param);
    std::string JsonCmd_Cgi_69(Param_69 &param);
    std::string JsonCmd_Cgi_70(Param_70 &param);
    std::string JsonCmd_Cgi_71(Param_71 &param);

    std::string JsonCmd_Cgi_default();

    //CMT tcp
   void  CmtCmd_80(char* send_data,int& return_length);
   void  CmtCmd_81(char* recv_body,int& count,char* send_data,int& return_length);
   void  CmtCmd_82(char* MeasurementID,char* send_data,int& channel,int& return_length);
   void  CmtCmd_83(char* recv_body,int& count,char* send_data,int& return_length);
   void  CmtCmd_84(char* filename,char* file_md5,char* send_data,int& send_length);
   void  CmtCmd_85(char* filename,char* file_md5,char* send_data,int& send_length);
   void  CmtCmd_86(char* recv_body,int& count,char* filename,char* file_md5,char* send_data,int& send_length);
   void  CmtCmd_87(char* MeasurementID,char* send_data,int& send_length);
   void  CmtCmd_88(char* recv_body,int& count,char* send_data,int& send_length);

private:
    Json::FastWriter show_value_;
};

#endif // COMMUNICATION_CMD_HPP_
