finish some dto
This commit is contained in:
parent
5115687aa4
commit
8116a12608
@ -5,9 +5,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <dto/basic/Enmus.h>
|
||||
#include <oatpp/core/Types.hpp>
|
||||
#include <oatpp/core/macro/codegen.hpp>
|
||||
#include <dtos/basic/Enmus.h>
|
||||
|
||||
#include OATPP_CODEGEN_BEGIN(DTO)
|
||||
|
||||
@ -37,6 +37,6 @@ class Content : public oatpp::DTO {
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace AnonExam::dto::basic
|
||||
|
||||
#include OATPP_CODEGEN_END(DTO)
|
@ -29,6 +29,6 @@ ENUM(QuestionType,
|
||||
VALUE(long_answer, 4, "long-answer"),
|
||||
VALUE(file_upload, 5, "file-upload"))
|
||||
|
||||
} // namespace AnonExam::dto
|
||||
} // namespace AnonExam::dto::basic
|
||||
|
||||
#include OATPP_CODEGEN_END(DTO)
|
@ -5,10 +5,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <dto/basic/Content.h>
|
||||
#include <dto/basic/Enmus.h>
|
||||
#include <oatpp/core/Types.hpp>
|
||||
#include <oatpp/core/macro/codegen.hpp>
|
||||
#include <dtos/basic/Enmus.h>
|
||||
#include <dtos/basic/Content.h>
|
||||
|
||||
#include OATPP_CODEGEN_BEGIN(DTO)
|
||||
|
||||
@ -37,6 +37,6 @@ class AnswerContents : public basic::Content {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace AnonExam::dto
|
||||
} // namespace AnonExam::dto::db
|
||||
|
||||
#include OATPP_CODEGEN_END(DTO)
|
@ -5,9 +5,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <dtos/db/Answer.h>
|
||||
#include <dtos/basic/Enmus.h>
|
||||
#include <dtos/basic/Content.h>
|
||||
#include <dto/basic/Content.h>
|
||||
#include <dto/basic/Enmus.h>
|
||||
#include <dto/db/Answer.h>
|
||||
#include <oatpp/core/Types.hpp>
|
||||
#include <oatpp/core/macro/codegen.hpp>
|
||||
|
||||
@ -86,6 +86,25 @@ class QuestionSubQuestions : public oatpp::DTO {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace AnonExam::dto
|
||||
class QuestionTag : public oatpp::DTO {
|
||||
DTO_INIT(QuestionTag, DTO)
|
||||
|
||||
DTO_FIELD(Int32, id);
|
||||
DTO_FIELD_INFO(id) {
|
||||
info->description = "Map id";
|
||||
}
|
||||
|
||||
DTO_FIELD(Int32, question_id);
|
||||
DTO_FIELD_INFO(question_id) {
|
||||
info->description = "Question id";
|
||||
}
|
||||
|
||||
DTO_FIELD(Int32, tag_id);
|
||||
DTO_FIELD_INFO(tag_id) {
|
||||
info->description = "Tag id";
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace AnonExam::dto::db
|
||||
|
||||
#include OATPP_CODEGEN_END(DTO)
|
19
src/dto/db/Quiz.h
Normal file
19
src/dto/db/Quiz.h
Normal file
@ -0,0 +1,19 @@
|
||||
//
|
||||
// AnonExam
|
||||
// Created on 2023/12/19.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <oatpp/core/Types.hpp>
|
||||
#include <oatpp/core/macro/codegen.hpp>
|
||||
|
||||
#include OATPP_CODEGEN_BEGIN(DTO)
|
||||
|
||||
namespace AnonExam::dto::db {
|
||||
|
||||
class Quiz : public oatpp::DTO {};
|
||||
|
||||
} // namespace AnonExam::dto::db
|
||||
|
||||
#include OATPP_CODEGEN_END(DTO)
|
36
src/dto/db/Tag.h
Normal file
36
src/dto/db/Tag.h
Normal file
@ -0,0 +1,36 @@
|
||||
//
|
||||
// AnonExam
|
||||
// Created on 2023/12/19.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <oatpp/core/Types.hpp>
|
||||
#include <oatpp/core/macro/codegen.hpp>
|
||||
|
||||
#include OATPP_CODEGEN_BEGIN(DTO)
|
||||
|
||||
namespace AnonExam::dto::db {
|
||||
|
||||
class Tag : public oatpp::DTO {
|
||||
DTO_INIT(Tag, DTO)
|
||||
|
||||
DTO_FIELD(Int32, id);
|
||||
DTO_FIELD_INFO(id) {
|
||||
info->description = "Tag id";
|
||||
}
|
||||
|
||||
DTO_FIELD(String, name);
|
||||
DTO_FIELD_INFO(name) {
|
||||
info->description = "Tag name";
|
||||
}
|
||||
|
||||
DTO_FIELD(Int32, hex_color);
|
||||
DTO_FIELD_INFO(hex_color) {
|
||||
info->description = "Tag color in hex";
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace AnonExam::dto::db
|
||||
|
||||
#include OATPP_CODEGEN_END(DTO)
|
Loading…
Reference in New Issue
Block a user