380 lines
8.3 KiB
C++
380 lines
8.3 KiB
C++
|
|
#pragma once
|
|
|
|
#include "oatpp/core/macro/codegen.hpp"
|
|
#include "oatpp/core/Types.hpp"
|
|
#include <QString>
|
|
#include OATPP_CODEGEN_BEGIN( DTO )
|
|
|
|
namespace web_server
|
|
{
|
|
namespace module_app
|
|
{
|
|
|
|
/**
|
|
* Data Transfer Object. Object containing fields only.
|
|
* Used in API for serialization/deserialization and validation
|
|
*/
|
|
|
|
|
|
|
|
class almCountDataDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( almCountDataDTO, DTO )
|
|
DTO_FIELD( Int32, ack ) = 0;
|
|
DTO_FIELD( Int32, unAck ) = 0;
|
|
DTO_FIELD( Int32, total ) = 0;
|
|
};
|
|
|
|
class almCountDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( almCountDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD(String, message );
|
|
DTO_FIELD(Object<almCountDataDTO> , data );
|
|
|
|
};
|
|
|
|
|
|
class txCodeUnitDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( txCodeUnitDTO, DTO )
|
|
DTO_FIELD( String, code ) ;
|
|
DTO_FIELD( String, name ) ;
|
|
DTO_FIELD( String, TxCode ) ;
|
|
};
|
|
|
|
class txCodeDataDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( txCodeDataDTO, DTO )
|
|
DTO_FIELD( Int32, pageNo ) = 0;
|
|
DTO_FIELD( Int32, pageSize ) = 0;
|
|
DTO_FIELD( Int32, records ) = 0;
|
|
DTO_FIELD( Int32, total ) = 0;
|
|
DTO_FIELD(List<Object<txCodeUnitDTO>>, dataMap);
|
|
};
|
|
|
|
class txCodeDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( txCodeDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD(String, message );
|
|
DTO_FIELD(Object<txCodeDataDTO> , data );
|
|
};
|
|
|
|
|
|
|
|
class deviceCodeUnitDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( deviceCodeUnitDTO, DTO )
|
|
DTO_FIELD( String, treePcode ) ;
|
|
DTO_FIELD( String, code ) ;
|
|
DTO_FIELD( String, unitName ) ;
|
|
DTO_FIELD( String, unitCode ) ;
|
|
DTO_FIELD( String, sname ) ;
|
|
DTO_FIELD( String, name ) ;
|
|
DTO_FIELD( String, keyValue ) ;
|
|
DTO_FIELD( String, diNum ) ;
|
|
DTO_FIELD( String, type ) ;
|
|
|
|
};
|
|
|
|
class deviceCodeDataDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( deviceCodeDataDTO, DTO )
|
|
DTO_FIELD( Int32, pageNo ) = 0;
|
|
DTO_FIELD( Int32, pageSize ) = 0;
|
|
DTO_FIELD( Int32, records ) = 0;
|
|
DTO_FIELD( Int32, total ) = 0;
|
|
DTO_FIELD(List<Object<deviceCodeUnitDTO>>, dataMap);
|
|
};
|
|
|
|
class deviceCodeDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( deviceCodeDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD(String, message );
|
|
DTO_FIELD(Object<deviceCodeDataDTO> , data );
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class deviceTPUnitDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( deviceTPUnitDTO, DTO )
|
|
DTO_FIELD( String, treePcode ) ;
|
|
DTO_FIELD( String, code ) ;
|
|
DTO_FIELD( String, name ) ;
|
|
DTO_FIELD( String, keyValue ) ;
|
|
DTO_FIELD( String, type ) ;
|
|
|
|
};
|
|
|
|
class deviceTPDataDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( deviceTPDataDTO, DTO )
|
|
DTO_FIELD( Int32, pageNo ) = 0;
|
|
DTO_FIELD( Int32, pageSize ) = 0;
|
|
DTO_FIELD( Int32, records ) = 0;
|
|
DTO_FIELD( Int32, total ) = 0;
|
|
DTO_FIELD(List<Object<deviceTPUnitDTO>>, dataMap);
|
|
};
|
|
|
|
class deviceTPDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( deviceTPDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD(String, message );
|
|
DTO_FIELD(Object<deviceTPDataDTO> , data );
|
|
};
|
|
|
|
|
|
class setDevceTPDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( setDevceTPDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD(String, message );
|
|
};
|
|
|
|
|
|
class setDevceTPReqUnitDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( setDevceTPReqUnitDTO, DTO )
|
|
DTO_FIELD(String, deviceCode );
|
|
DTO_FIELD(String, code );
|
|
DTO_FIELD(String, keyValue );
|
|
DTO_FIELD(String, type );
|
|
};
|
|
|
|
class setDevceTPReqDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( setDevceTPReqDTO, DTO )
|
|
DTO_FIELD( Int32, total ) ;
|
|
DTO_FIELD(List<Object<setDevceTPReqUnitDTO>> , data );
|
|
};
|
|
|
|
|
|
|
|
class rtDataUnitDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( rtDataUnitDTO, DTO )
|
|
DTO_FIELD( String, key_id_tag ) ;
|
|
DTO_FIELD( Float64, value ) ;
|
|
DTO_FIELD( Int32, status ) ;
|
|
};
|
|
|
|
|
|
class rtDataDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( rtDataDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD( String, message );
|
|
DTO_FIELD( String, time ) ;
|
|
DTO_FIELD(List<Object<rtDataUnitDTO>>, data );
|
|
};
|
|
|
|
|
|
class rtReqDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( rtReqDTO, DTO )
|
|
DTO_FIELD( String, code );
|
|
};
|
|
|
|
|
|
class confirmAlmUnitReqDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( confirmAlmUnitReqDTO, DTO )
|
|
DTO_FIELD( String, key_id_tag ) ;
|
|
DTO_FIELD( Int64, timestamp ) ;
|
|
DTO_FIELD( String, uuid_base64 ) ;
|
|
DTO_FIELD( Int32, alm_type ) ;
|
|
DTO_FIELD( Int32, app_id ) ;
|
|
};
|
|
|
|
|
|
class confirmAlmReqDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( confirmAlmReqDTO, DTO )
|
|
DTO_FIELD( Int32, total ) ;
|
|
DTO_FIELD(List<Object<confirmAlmUnitReqDTO>> , data );
|
|
};
|
|
|
|
class confirmAlmRepDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( confirmAlmRepDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD(String, message );
|
|
};
|
|
|
|
|
|
class deleteAlmReqDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( deleteAlmReqDTO, DTO )
|
|
DTO_FIELD( Int32, total ) ;
|
|
DTO_FIELD(List<String> , data );
|
|
};
|
|
|
|
class deviceTempUnitDTO : public oatpp::DTO
|
|
{
|
|
DTO_INIT( deviceTempUnitDTO, DTO )
|
|
DTO_FIELD( String, tag_name ) ;
|
|
DTO_FIELD( String, desc ) ;
|
|
|
|
};
|
|
|
|
|
|
class allDeviceTempDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( allDeviceTempDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD( String, message );
|
|
DTO_FIELD(List<Object<deviceTempUnitDTO>> , data );
|
|
};
|
|
|
|
class deleteAlmRepDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( deleteAlmRepDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD(String, message );
|
|
};
|
|
|
|
class realTimeDataDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( realTimeDataDTO, DTO )
|
|
DTO_FIELD(String, tagName );
|
|
DTO_FIELD(String, desc );
|
|
DTO_FIELD( Float64, value );
|
|
DTO_FIELD( Int32, status );
|
|
DTO_FIELD(String, unitName );
|
|
|
|
};
|
|
|
|
class historyDataDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT(historyDataDTO, DTO )
|
|
DTO_FIELD(String, tagName );
|
|
DTO_FIELD(String, desc );
|
|
DTO_FIELD( Float64, value );
|
|
DTO_FIELD( Int32, status );
|
|
DTO_FIELD(String, unitName );
|
|
DTO_FIELD(Int32, type );
|
|
DTO_FIELD(String, stateTxt );
|
|
};
|
|
|
|
|
|
|
|
class locationDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( locationDTO, DTO )
|
|
DTO_FIELD(String, locationName );
|
|
DTO_FIELD( Int32, id );
|
|
DTO_FIELD( Int32, devCnt );
|
|
DTO_FIELD( String, tagName );
|
|
DTO_FIELD(List<Object<historyDataDTO>> , data );
|
|
};
|
|
|
|
class locationListDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( locationListDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD( String, message );
|
|
DTO_FIELD( Int32, total );
|
|
DTO_FIELD( Int32, page );
|
|
DTO_FIELD( Int32, pageSize );
|
|
DTO_FIELD(List<Object<locationDTO>> , rows );
|
|
};
|
|
|
|
|
|
class locationDetailDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( locationDetailDTO, DTO )
|
|
DTO_FIELD(String, locationName );
|
|
DTO_FIELD( Int32, id );
|
|
DTO_FIELD( String, tagName );
|
|
DTO_FIELD(List<Object<historyDataDTO>> , data );
|
|
};
|
|
|
|
class locationDetailResponseDTO:public oatpp::DTO
|
|
{
|
|
DTO_INIT( locationDetailResponseDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD( String, message );
|
|
DTO_FIELD(Object<locationDetailDTO> , data );
|
|
};
|
|
|
|
|
|
|
|
|
|
class deviceGroupDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( deviceGroupDTO, DTO )
|
|
DTO_FIELD(String, deviceGroupName );
|
|
DTO_FIELD( String, deviceGroupTag );
|
|
DTO_FIELD(List<Object<historyDataDTO>> , data );
|
|
};
|
|
class deviceGroupListDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( deviceGroupListDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD( String, message );
|
|
DTO_FIELD( Int32, total );
|
|
DTO_FIELD( Int32, page );
|
|
DTO_FIELD( Int32, pageSize );
|
|
DTO_FIELD(List<Object<deviceGroupDTO>> , rows );
|
|
};
|
|
|
|
|
|
struct TagTuple {
|
|
int unitId;
|
|
QString description;
|
|
QString stateTxt;
|
|
};
|
|
|
|
class deviceDTO:public oatpp::DTO
|
|
{
|
|
DTO_INIT( deviceDTO, DTO )
|
|
DTO_FIELD( String, deviceTag );
|
|
DTO_FIELD( String, desc );
|
|
};
|
|
|
|
class deviceGroupInfoDTO:public oatpp::DTO
|
|
{
|
|
DTO_INIT( deviceGroupInfoDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD( String, message );
|
|
DTO_FIELD(List<Object<deviceDTO>> , rows );
|
|
};
|
|
|
|
|
|
class pointCodeDTO:public oatpp::DTO
|
|
{
|
|
DTO_INIT( pointCodeDTO, DTO )
|
|
DTO_FIELD(String, tagName );
|
|
DTO_FIELD(String, desc );
|
|
DTO_FIELD(String, unitName );
|
|
DTO_FIELD(Int32, type );
|
|
DTO_FIELD(String, stateTxt );
|
|
};
|
|
|
|
class devicePointCodeListDTO: public oatpp::DTO
|
|
{
|
|
DTO_INIT( devicePointCodeListDTO, DTO )
|
|
DTO_FIELD( Int32, code ) = 200;
|
|
DTO_FIELD( String, message );
|
|
DTO_FIELD( Int32, total );
|
|
DTO_FIELD( Int32, page );
|
|
DTO_FIELD( Int32, pageSize );
|
|
DTO_FIELD(List<Object<pointCodeDTO>> , rows );
|
|
};
|
|
|
|
|
|
|
|
|
|
} //namespace module_app
|
|
} //namespace web_server
|
|
|
|
|
|
#include OATPP_CODEGEN_END( DTO )
|