some changes
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
#include "oatpp/core/data/mapping/type/Object.hpp"
|
||||
#include "oatpp/core/macro/codegen.hpp"
|
||||
|
||||
namespace dto
|
||||
{
|
||||
#include "model/Models.h"
|
||||
|
||||
namespace dto {
|
||||
#include OATPP_CODEGEN_BEGIN(DTO)
|
||||
|
||||
class LoginResultDto : public oatpp::data::mapping::type::Object
|
||||
{
|
||||
class LoginResultDto : public oatpp::data::mapping::type::Object {
|
||||
DTO_INIT(LoginResultDto, Object)
|
||||
|
||||
DTO_FIELD(Int32, id);
|
||||
@@ -20,8 +20,15 @@ namespace dto
|
||||
DTO_FIELD(String, message);
|
||||
};
|
||||
|
||||
class UserDto : public oatpp::data::mapping::type::Object
|
||||
{
|
||||
class RegisterResultDto : public oatpp::data::mapping::type::Object {
|
||||
DTO_INIT(RegisterResultDto, Object)
|
||||
|
||||
DTO_FIELD(String, username);
|
||||
DTO_FIELD(Boolean, registered);
|
||||
DTO_FIELD(String, message);
|
||||
};
|
||||
|
||||
class UserDto : public oatpp::data::mapping::type::Object {
|
||||
DTO_INIT(UserDto, Object)
|
||||
|
||||
DTO_FIELD(Int32, userId);
|
||||
@@ -34,6 +41,7 @@ namespace dto
|
||||
};
|
||||
|
||||
#include OATPP_CODEGEN_END(DTO)
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "oatpp/core/data/mapping/type/Object.hpp"
|
||||
#include "oatpp/core/macro/codegen.hpp"
|
||||
|
||||
#include "model/Models.h"
|
||||
|
||||
namespace dto
|
||||
{
|
||||
#include OATPP_CODEGEN_BEGIN(DTO)
|
||||
@@ -24,6 +26,8 @@ namespace dto
|
||||
};
|
||||
|
||||
#include OATPP_CODEGEN_END(DTO)
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef DTOCONVERSIONS_H_
|
||||
#define DTOCONVERSIONS_H_
|
||||
|
||||
#include "dto/LoginResultDto.hpp"
|
||||
#include "dto/SongDto.hpp"
|
||||
#include "model/Models.h"
|
||||
|
||||
namespace dto { namespace conversion {
|
||||
class DtoConversions {
|
||||
public:
|
||||
static dto::LoginResultDto::ObjectWrapper toLoginResultDto(const model::User&, const model::Token&);
|
||||
|
||||
static dto::RegisterResultDto::ObjectWrapper toRegisterResultDto(
|
||||
const model::RegisterResult&);
|
||||
|
||||
static model::Song toSong(dto::SongDto::ObjectWrapper&);
|
||||
|
||||
static model::User toUser(dto::UserDto::ObjectWrapper&);
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user