diff --git a/.gen/objs.txt b/.gen/objs.txt index defa0f92..c89a27a2 100644 --- a/.gen/objs.txt +++ b/.gen/objs.txt @@ -1,56 +1,6 @@ -src/views/timetable/get/view.hpp -src/views/timetable/get/view.cpp -src/views/timetable/get/Responses.hpp -src/views/timetable/get/Request.hpp src/views/test-openapi-view/view.hpp src/views/test-openapi-view/view.cpp src/views/test-openapi-view/declarations.hpp -src/views/teacher/request/list/view.hpp -src/views/teacher/request/list/view.cpp -src/views/teacher/request/list/Responses.hpp -src/views/teacher/request/list/Request.hpp -src/views/teacher/request/approve/new/view.hpp -src/views/teacher/request/approve/new/view.cpp -src/views/teacher/request/approve/new/Responses.hpp -src/views/teacher/request/approve/new/Request.hpp -src/views/teacher/request/approve/link/view.hpp -src/views/teacher/request/approve/link/view.cpp -src/views/teacher/request/approve/link/Responses.hpp -src/views/teacher/request/approve/link/Request.hpp -src/views/teacher/list/view.hpp -src/views/teacher/list/view.cpp -src/views/teacher/list/Responses.hpp -src/views/teacher/list/Request.hpp -src/views/teacher/create/view.hpp -src/views/teacher/create/view.cpp -src/views/teacher/create/Responses.hpp -src/views/teacher/create/Request.hpp -src/views/register/view.hpp -src/views/register/view.cpp -src/views/register/Responses.hpp -src/views/register/Request.hpp -src/views/login/view.hpp -src/views/login/view.cpp -src/views/login/Responses.hpp -src/views/login/Request.hpp -src/views/hello/view.hpp -src/views/hello/view.cpp -src/views/group-stage/list/view.hpp -src/views/group-stage/list/view.cpp -src/views/group-stage/list/Responses.hpp -src/views/group-stage/list/Request.hpp -src/views/faculty/list/view.hpp -src/views/faculty/list/view.cpp -src/views/faculty/list/Responses.hpp -src/views/faculty/list/Request.hpp -src/views/admin/list/view.hpp -src/views/admin/list/view.cpp -src/views/admin/list/Responses.hpp -src/views/admin/list/Request.hpp -src/views/admin/create/view.hpp -src/views/admin/create/view.cpp -src/views/admin/create/Responses.hpp -src/views/admin/create/Request.hpp src/utils/type_holder.hpp src/utils/tests_macros.hpp src/utils/shared_transaction.hpp @@ -169,147 +119,197 @@ src/openapi/as_tuple/optional.hpp src/openapi/as_tuple/default.hpp src/openapi/as_tuple/all.hpp src/openapi/all.hpp -src/models/user_type/type.hpp -src/models/user_type/serialize.hpp -src/models/user_type/serialize.cpp -src/models/user_type/postgre.hpp -src/models/user_type/parse.hpp -src/models/user_type/parse.cpp -src/models/user_credentials/type.hpp -src/models/user_credentials/postgre.hpp -src/models/user_credentials/fwd.hpp -src/models/user/type.hpp -src/models/user/serialize.hpp -src/models/user/postgre.hpp -src/models/user/parse.hpp -src/models/timestring/type.hpp -src/models/timestring/serialize.hpp -src/models/timestring/serialize.cpp -src/models/timestring/postgre.hpp -src/models/timestring/parse.hpp -src/models/timestring/parse.cpp -src/models/timestring/fwd.hpp -src/models/timestring/all.hpp -src/models/teacher_info/type.hpp -src/models/teacher_info/serialize.hpp -src/models/teacher_info/postgre.hpp -src/models/teacher_info/parse.hpp -src/models/teacher_filter/type.hpp -src/models/teacher_filter/postgre.hpp -src/models/teacher_filter/fwd.hpp -src/models/teacher/type.hpp -src/models/teacher/serialize.hpp -src/models/teacher/postgre.hpp -src/models/teacher/parse.hpp -src/models/substring/type.hpp -src/models/substring/serialize.hpp -src/models/substring/serialize.cpp -src/models/substring/postgre.hpp -src/models/substring/parse.hpp -src/models/substring/parse.cpp -src/models/substring/fwd.hpp -src/models/substring/all.hpp -src/models/subgroup/type.hpp -src/models/subgroup/serialize.hpp -src/models/subgroup/serialize.cpp -src/models/subgroup/postgre.hpp -src/models/subgroup/parse.hpp -src/models/subgroup/parse.cpp -src/models/subgroup/all.hpp -src/models/request_privileges/type.hpp -src/models/request_privileges/fwd.hpp -src/models/register_request/type.hpp -src/models/register_request/fwd.hpp -src/models/lesson_week_type/type.hpp -src/models/lesson_week_type/serialize.hpp -src/models/lesson_week_type/serialize.cpp -src/models/lesson_week_type/postgre.hpp -src/models/lesson_week_type/parse.hpp -src/models/lesson_week_type/parse.cpp -src/models/lesson_week_type/all.hpp -src/models/lesson_v1/type.hpp -src/models/lesson_v1/serialize.hpp -src/models/lesson_v1/postgre.hpp -src/models/lesson_v1/parse.hpp -src/models/lesson_type/type.hpp -src/models/lesson_type/serialize.hpp -src/models/lesson_type/serialize.cpp -src/models/lesson_type/postgre.hpp -src/models/lesson_type/parse.hpp -src/models/lesson_type/parse.cpp -src/models/lesson_type/all.hpp -src/models/lesson_filter/type.hpp -src/models/lesson_filter/postgre.hpp -src/models/lesson_filter/fwd.hpp -src/models/group_stage_filter/type.hpp -src/models/group_stage_filter/postgre.hpp -src/models/group_stage_filter/fwd.hpp -src/models/group_stage/type.hpp -src/models/group_stage/postgre.hpp -src/models/group_stage/fwd.hpp -src/models/faculty_filter/type.hpp -src/models/faculty_filter/postgre.hpp -src/models/faculty_filter/fwd.hpp -src/models/faculty/type.hpp -src/models/faculty/postgre.hpp -src/models/faculty/fwd.hpp -src/models/education_type/type.hpp -src/models/education_type/serialize.hpp -src/models/education_type/serialize.cpp -src/models/education_type/postgre.hpp -src/models/education_type/parse.hpp -src/models/education_type/parse.cpp -src/models/education_type/all.hpp -src/models/day/type.hpp -src/models/day/serialize.hpp -src/models/day/serialize.cpp -src/models/day/postgre.hpp -src/models/day/parse.hpp -src/models/day/parse.cpp -src/models/day/all.hpp -src/models/auth_token/type.hpp -src/models/auth_token/serialize.hpp -src/models/admin_filter/type.hpp -src/models/admin_filter/postgre.hpp -src/models/admin_filter/fwd.hpp -src/models/admin_account/type.hpp -src/models/admin_account/postgre.hpp +src/legacy/views/timetable/get/view.hpp +src/legacy/views/timetable/get/view.cpp +src/legacy/views/timetable/get/Responses.hpp +src/legacy/views/timetable/get/Request.hpp +src/legacy/views/teacher/request/list/view.hpp +src/legacy/views/teacher/request/list/view.cpp +src/legacy/views/teacher/request/list/Responses.hpp +src/legacy/views/teacher/request/list/Request.hpp +src/legacy/views/teacher/request/approve/new/view.hpp +src/legacy/views/teacher/request/approve/new/view.cpp +src/legacy/views/teacher/request/approve/new/Responses.hpp +src/legacy/views/teacher/request/approve/new/Request.hpp +src/legacy/views/teacher/request/approve/link/view.hpp +src/legacy/views/teacher/request/approve/link/view.cpp +src/legacy/views/teacher/request/approve/link/Responses.hpp +src/legacy/views/teacher/request/approve/link/Request.hpp +src/legacy/views/teacher/list/view.hpp +src/legacy/views/teacher/list/view.cpp +src/legacy/views/teacher/list/Responses.hpp +src/legacy/views/teacher/list/Request.hpp +src/legacy/views/teacher/create/view.hpp +src/legacy/views/teacher/create/view.cpp +src/legacy/views/teacher/create/Responses.hpp +src/legacy/views/teacher/create/Request.hpp +src/legacy/views/register/view.hpp +src/legacy/views/register/view.cpp +src/legacy/views/register/Responses.hpp +src/legacy/views/register/Request.hpp +src/legacy/views/login/view.hpp +src/legacy/views/login/view.cpp +src/legacy/views/login/Responses.hpp +src/legacy/views/login/Request.hpp +src/legacy/views/hello/view.hpp +src/legacy/views/hello/view.cpp +src/legacy/views/group-stage/list/view.hpp +src/legacy/views/group-stage/list/view.cpp +src/legacy/views/group-stage/list/Responses.hpp +src/legacy/views/group-stage/list/Request.hpp +src/legacy/views/faculty/list/view.hpp +src/legacy/views/faculty/list/view.cpp +src/legacy/views/faculty/list/Responses.hpp +src/legacy/views/faculty/list/Request.hpp +src/legacy/views/admin/list/view.hpp +src/legacy/views/admin/list/view.cpp +src/legacy/views/admin/list/Responses.hpp +src/legacy/views/admin/list/Request.hpp +src/legacy/views/admin/create/view.hpp +src/legacy/views/admin/create/view.cpp +src/legacy/views/admin/create/Responses.hpp +src/legacy/views/admin/create/Request.hpp +src/legacy/models/user_type/type.hpp +src/legacy/models/user_type/serialize.hpp +src/legacy/models/user_type/serialize.cpp +src/legacy/models/user_type/postgre.hpp +src/legacy/models/user_type/parse.hpp +src/legacy/models/user_type/parse.cpp +src/legacy/models/user_credentials/type.hpp +src/legacy/models/user_credentials/postgre.hpp +src/legacy/models/user_credentials/fwd.hpp +src/legacy/models/user/type.hpp +src/legacy/models/user/serialize.hpp +src/legacy/models/user/postgre.hpp +src/legacy/models/user/parse.hpp +src/legacy/models/timestring/type.hpp +src/legacy/models/timestring/serialize.hpp +src/legacy/models/timestring/serialize.cpp +src/legacy/models/timestring/postgre.hpp +src/legacy/models/timestring/parse.hpp +src/legacy/models/timestring/parse.cpp +src/legacy/models/timestring/fwd.hpp +src/legacy/models/timestring/all.hpp +src/legacy/models/teacher_info/type.hpp +src/legacy/models/teacher_info/serialize.hpp +src/legacy/models/teacher_info/postgre.hpp +src/legacy/models/teacher_info/parse.hpp +src/legacy/models/teacher_filter/type.hpp +src/legacy/models/teacher_filter/postgre.hpp +src/legacy/models/teacher_filter/fwd.hpp +src/legacy/models/teacher/type.hpp +src/legacy/models/teacher/serialize.hpp +src/legacy/models/teacher/postgre.hpp +src/legacy/models/teacher/parse.hpp +src/legacy/models/substring/type.hpp +src/legacy/models/substring/serialize.hpp +src/legacy/models/substring/serialize.cpp +src/legacy/models/substring/postgre.hpp +src/legacy/models/substring/parse.hpp +src/legacy/models/substring/parse.cpp +src/legacy/models/substring/fwd.hpp +src/legacy/models/substring/all.hpp +src/legacy/models/subgroup/type.hpp +src/legacy/models/subgroup/serialize.hpp +src/legacy/models/subgroup/serialize.cpp +src/legacy/models/subgroup/postgre.hpp +src/legacy/models/subgroup/parse.hpp +src/legacy/models/subgroup/parse.cpp +src/legacy/models/subgroup/all.hpp +src/legacy/models/request_privileges/type.hpp +src/legacy/models/request_privileges/fwd.hpp +src/legacy/models/register_request/type.hpp +src/legacy/models/register_request/fwd.hpp +src/legacy/models/lesson_week_type/type.hpp +src/legacy/models/lesson_week_type/serialize.hpp +src/legacy/models/lesson_week_type/serialize.cpp +src/legacy/models/lesson_week_type/postgre.hpp +src/legacy/models/lesson_week_type/parse.hpp +src/legacy/models/lesson_week_type/parse.cpp +src/legacy/models/lesson_week_type/all.hpp +src/legacy/models/lesson_v1/type.hpp +src/legacy/models/lesson_v1/serialize.hpp +src/legacy/models/lesson_v1/postgre.hpp +src/legacy/models/lesson_v1/parse.hpp +src/legacy/models/lesson_type/type.hpp +src/legacy/models/lesson_type/serialize.hpp +src/legacy/models/lesson_type/serialize.cpp +src/legacy/models/lesson_type/postgre.hpp +src/legacy/models/lesson_type/parse.hpp +src/legacy/models/lesson_type/parse.cpp +src/legacy/models/lesson_type/all.hpp +src/legacy/models/lesson_filter/type.hpp +src/legacy/models/lesson_filter/postgre.hpp +src/legacy/models/lesson_filter/fwd.hpp +src/legacy/models/group_stage_filter/type.hpp +src/legacy/models/group_stage_filter/postgre.hpp +src/legacy/models/group_stage_filter/fwd.hpp +src/legacy/models/group_stage/type.hpp +src/legacy/models/group_stage/postgre.hpp +src/legacy/models/group_stage/fwd.hpp +src/legacy/models/faculty_filter/type.hpp +src/legacy/models/faculty_filter/postgre.hpp +src/legacy/models/faculty_filter/fwd.hpp +src/legacy/models/faculty/type.hpp +src/legacy/models/faculty/postgre.hpp +src/legacy/models/faculty/fwd.hpp +src/legacy/models/education_type/type.hpp +src/legacy/models/education_type/serialize.hpp +src/legacy/models/education_type/serialize.cpp +src/legacy/models/education_type/postgre.hpp +src/legacy/models/education_type/parse.hpp +src/legacy/models/education_type/parse.cpp +src/legacy/models/education_type/all.hpp +src/legacy/models/day/type.hpp +src/legacy/models/day/serialize.hpp +src/legacy/models/day/serialize.cpp +src/legacy/models/day/postgre.hpp +src/legacy/models/day/parse.hpp +src/legacy/models/day/parse.cpp +src/legacy/models/day/all.hpp +src/legacy/models/auth_token/type.hpp +src/legacy/models/auth_token/serialize.hpp +src/legacy/models/admin_filter/type.hpp +src/legacy/models/admin_filter/postgre.hpp +src/legacy/models/admin_filter/fwd.hpp +src/legacy/models/admin_account/type.hpp +src/legacy/models/admin_account/postgre.hpp +src/legacy/components/controllers/postgres/user/sql_queries.hpp +src/legacy/components/controllers/postgres/user/fwd.hpp +src/legacy/components/controllers/postgres/user/fwd.cpp +src/legacy/components/controllers/postgres/user/controller.hpp +src/legacy/components/controllers/postgres/user/controller.cpp +src/legacy/components/controllers/postgres/user/config_schema.hpp +src/legacy/components/controllers/postgres/token/sql_queries.hpp +src/legacy/components/controllers/postgres/token/fwd.hpp +src/legacy/components/controllers/postgres/token/fwd.cpp +src/legacy/components/controllers/postgres/token/controller.hpp +src/legacy/components/controllers/postgres/token/controller.cpp +src/legacy/components/controllers/postgres/teacher/sql_queries.hpp +src/legacy/components/controllers/postgres/teacher/fwd.hpp +src/legacy/components/controllers/postgres/teacher/fwd.cpp +src/legacy/components/controllers/postgres/teacher/controller.hpp +src/legacy/components/controllers/postgres/teacher/controller.cpp +src/legacy/components/controllers/postgres/lesson/sql_queries.hpp +src/legacy/components/controllers/postgres/lesson/fwd.hpp +src/legacy/components/controllers/postgres/lesson/fwd.cpp +src/legacy/components/controllers/postgres/lesson/controller.hpp +src/legacy/components/controllers/postgres/lesson/controller.cpp +src/legacy/components/controllers/postgres/group_stage/sql_queries.hpp +src/legacy/components/controllers/postgres/group_stage/fwd.hpp +src/legacy/components/controllers/postgres/group_stage/fwd.cpp +src/legacy/components/controllers/postgres/group_stage/controller.hpp +src/legacy/components/controllers/postgres/group_stage/controller.cpp +src/legacy/components/controllers/postgres/faculty/sql_queries.hpp +src/legacy/components/controllers/postgres/faculty/fwd.hpp +src/legacy/components/controllers/postgres/faculty/fwd.cpp +src/legacy/components/controllers/postgres/faculty/controller.hpp +src/legacy/components/controllers/postgres/faculty/controller.cpp +src/legacy/components/controllers/postgres/admin/sql_queries.hpp +src/legacy/components/controllers/postgres/admin/fwd.hpp +src/legacy/components/controllers/postgres/admin/fwd.cpp +src/legacy/components/controllers/postgres/admin/controller.hpp +src/legacy/components/controllers/postgres/admin/controller.cpp src/http/legacy_handler_parsed.hpp src/http/handler_parsed.hpp src/http/ErrorV1.hpp -src/components/controllers/postgres/user/sql_queries.hpp -src/components/controllers/postgres/user/fwd.hpp -src/components/controllers/postgres/user/fwd.cpp -src/components/controllers/postgres/user/controller.hpp -src/components/controllers/postgres/user/controller.cpp -src/components/controllers/postgres/user/config_schema.hpp -src/components/controllers/postgres/token/sql_queries.hpp -src/components/controllers/postgres/token/fwd.hpp -src/components/controllers/postgres/token/fwd.cpp -src/components/controllers/postgres/token/controller.hpp -src/components/controllers/postgres/token/controller.cpp -src/components/controllers/postgres/teacher/sql_queries.hpp -src/components/controllers/postgres/teacher/fwd.hpp -src/components/controllers/postgres/teacher/fwd.cpp -src/components/controllers/postgres/teacher/controller.hpp -src/components/controllers/postgres/teacher/controller.cpp -src/components/controllers/postgres/lesson/sql_queries.hpp -src/components/controllers/postgres/lesson/fwd.hpp -src/components/controllers/postgres/lesson/fwd.cpp -src/components/controllers/postgres/lesson/controller.hpp -src/components/controllers/postgres/lesson/controller.cpp -src/components/controllers/postgres/group_stage/sql_queries.hpp -src/components/controllers/postgres/group_stage/fwd.hpp -src/components/controllers/postgres/group_stage/fwd.cpp -src/components/controllers/postgres/group_stage/controller.hpp -src/components/controllers/postgres/group_stage/controller.cpp -src/components/controllers/postgres/faculty/sql_queries.hpp -src/components/controllers/postgres/faculty/fwd.hpp -src/components/controllers/postgres/faculty/fwd.cpp -src/components/controllers/postgres/faculty/controller.hpp -src/components/controllers/postgres/faculty/controller.cpp -src/components/controllers/postgres/admin/sql_queries.hpp -src/components/controllers/postgres/admin/fwd.hpp -src/components/controllers/postgres/admin/fwd.cpp -src/components/controllers/postgres/admin/controller.hpp -src/components/controllers/postgres/admin/controller.cpp diff --git a/benchs/hello_benchmark.cpp b/benchs/hello_benchmark.cpp index 7e4ddaf2..f2160aa1 100644 --- a/benchs/hello_benchmark.cpp +++ b/benchs/hello_benchmark.cpp @@ -5,7 +5,7 @@ #include #include -#include "views/hello/view.hpp" +#include "legacy/views/hello/view.hpp" void HelloBenchmark(benchmark::State& state) { diff --git a/service/main.cpp b/service/main.cpp index a56c7252..eacc309f 100644 --- a/service/main.cpp +++ b/service/main.cpp @@ -11,31 +11,31 @@ #include #include -#include "components/controllers/postgres/admin/fwd.hpp" -#include "components/controllers/postgres/faculty/fwd.hpp" -#include "components/controllers/postgres/group_stage/fwd.hpp" -#include "components/controllers/postgres/lesson/fwd.hpp" -#include "components/controllers/postgres/teacher/fwd.hpp" -#include "components/controllers/postgres/token/fwd.hpp" -#include "components/controllers/postgres/user/fwd.hpp" -#include "views/admin/create/view.hpp" -#include "views/admin/list/view.hpp" -#include "views/faculty/list/view.hpp" -#include "views/group-stage/list/view.hpp" -#include "views/hello/view.hpp" -#include "views/login/view.hpp" -#include "views/register/view.hpp" -#include "views/teacher/create/view.hpp" -#include "views/teacher/list/view.hpp" -#include "views/teacher/request/approve/link/view.hpp" -#include "views/teacher/request/approve/new/view.hpp" -#include "views/teacher/request/list/view.hpp" +#include "legacy/components/controllers/postgres/admin/fwd.hpp" +#include "legacy/components/controllers/postgres/faculty/fwd.hpp" +#include "legacy/components/controllers/postgres/group_stage/fwd.hpp" +#include "legacy/components/controllers/postgres/lesson/fwd.hpp" +#include "legacy/components/controllers/postgres/teacher/fwd.hpp" +#include "legacy/components/controllers/postgres/token/fwd.hpp" +#include "legacy/components/controllers/postgres/user/fwd.hpp" +#include "legacy/views/admin/create/view.hpp" +#include "legacy/views/admin/list/view.hpp" +#include "legacy/views/faculty/list/view.hpp" +#include "legacy/views/group-stage/list/view.hpp" +#include "legacy/views/hello/view.hpp" +#include "legacy/views/login/view.hpp" +#include "legacy/views/register/view.hpp" +#include "legacy/views/teacher/create/view.hpp" +#include "legacy/views/teacher/list/view.hpp" +#include "legacy/views/teacher/request/approve/link/view.hpp" +#include "legacy/views/teacher/request/approve/new/view.hpp" +#include "legacy/views/teacher/request/list/view.hpp" #include "views/test-openapi-view/view.hpp" -#include "views/timetable/get/view.hpp" +#include "legacy/views/timetable/get/view.hpp" void AppendPgControllers(userver::components::ComponentList& component_list) { - using namespace components::controllers::postgres; + using namespace legacy::components::controllers::postgres; user::Append(component_list); token::Append(component_list); lesson::Append(component_list); @@ -47,6 +47,7 @@ void AppendPgControllers(userver::components::ComponentList& component_list) void AppendViews(userver::components::ComponentList& component_list) { + using namespace legacy::views; using namespace views; login::Append(component_list); register_::Append(component_list); diff --git a/src/components/controllers/postgres/admin/controller.cpp b/src/legacy/components/controllers/postgres/admin/controller.cpp similarity index 71% rename from src/components/controllers/postgres/admin/controller.cpp rename to src/legacy/components/controllers/postgres/admin/controller.cpp index bbfd9d88..37f82ee5 100644 --- a/src/components/controllers/postgres/admin/controller.cpp +++ b/src/legacy/components/controllers/postgres/admin/controller.cpp @@ -19,14 +19,14 @@ #include #include -#include "models/admin_account/postgre.hpp" -#include "models/admin_account/type.hpp" -#include "models/admin_filter/postgre.hpp" -#include "models/subgroup/serialize.hpp" -#include "models/user_credentials/postgre.hpp" +#include "legacy/models/admin_account/postgre.hpp" +#include "legacy/models/admin_account/type.hpp" +#include "legacy/models/admin_filter/postgre.hpp" +#include "legacy/models/subgroup/serialize.hpp" +#include "legacy/models/user_credentials/postgre.hpp" #include "sql_queries.hpp" -namespace components::controllers::postgres::admin +namespace legacy::components::controllers::postgres::admin { utils::SharedTransaction Controller::CreateTransaction() const { @@ -42,19 +42,19 @@ Controller::Controller(const userver::components::ComponentConfig& config, { } -std::optional Controller::GetAccountByAdminId( +std::optional Controller::GetAccountByAdminId( const boost::uuids::uuid& admin_id, ::utils::SharedTransaction transaction) const { ::utils::FillSharedTransaction(transaction, pg_cluster_); auto pg_result = transaction->transaction_.Execute( sql::qGetAdminAccountByAdminId, admin_id); - return utils::ConvertPgResultToOptionalItem( + return utils::ConvertPgResultToOptionalItem( pg_result); } -std::optional Controller::CreateAdmin( - const models::UserCredentials& user, +std::optional Controller::CreateAdmin( + const legacy::models::UserCredentials& user, ::utils::SharedTransaction transaction) const { ::utils::FillSharedTransaction(transaction, pg_cluster_); @@ -69,14 +69,14 @@ std::optional Controller::CreateAdmin( return GetAccountByAdminId(admin_id, transaction); } -std::vector Controller::GetByFilter( - std::optional& filter, +std::vector Controller::GetByFilter( + std::optional& filter, ::utils::SharedTransaction transaction) const { ::utils::FillSharedTransaction(transaction, pg_cluster_); auto pg_result = utils::PgExecute(transaction, sql::qGetAdminsByFilter, filter); - return utils::ConvertPgResultToArray(pg_result); + return utils::ConvertPgResultToArray(pg_result); } -} // namespace components::controllers::postgres::admin +} // namespace legacy::components::controllers::postgres::admin diff --git a/src/components/controllers/postgres/admin/controller.hpp b/src/legacy/components/controllers/postgres/admin/controller.hpp similarity index 63% rename from src/components/controllers/postgres/admin/controller.hpp rename to src/legacy/components/controllers/postgres/admin/controller.hpp index fb7be498..925e6262 100644 --- a/src/components/controllers/postgres/admin/controller.hpp +++ b/src/legacy/components/controllers/postgres/admin/controller.hpp @@ -6,31 +6,31 @@ #include #include -#include "models/admin_account/type.hpp" -#include "models/admin_filter/type.hpp" -#include "models/user_credentials/type.hpp" +#include "legacy/models/admin_account/type.hpp" +#include "legacy/models/admin_filter/type.hpp" +#include "legacy/models/user_credentials/type.hpp" -namespace components::controllers::postgres::admin +namespace legacy::components::controllers::postgres::admin { class Controller final : public userver::components::LoggableComponentBase { public: using userver::components::LoggableComponentBase::LoggableComponentBase; static constexpr inline std::string_view kName = "admin_controller"; - std::optional GetAccountByAdminId( + std::optional GetAccountByAdminId( const boost::uuids::uuid& admin_id, utils::SharedTransaction transaction = nullptr) const; - std::optional CreateAdmin( - const models::UserCredentials& user, + std::optional CreateAdmin( + const legacy::models::UserCredentials& user, utils::SharedTransaction transaction = nullptr) const; Controller(const userver::components::ComponentConfig& config, const userver::components::ComponentContext& context); - std::vector GetByFilter( - std::optional& filter, + std::vector GetByFilter( + std::optional& filter, utils::SharedTransaction transaction = nullptr) const; utils::SharedTransaction CreateTransaction() const; protected: userver::storages::postgres::ClusterPtr pg_cluster_; }; -} // namespace components::controllers::postgres::admin +} // namespace legacy::components::controllers::postgres::admin diff --git a/src/components/controllers/postgres/lesson/fwd.cpp b/src/legacy/components/controllers/postgres/admin/fwd.cpp similarity index 62% rename from src/components/controllers/postgres/lesson/fwd.cpp rename to src/legacy/components/controllers/postgres/admin/fwd.cpp index 4ae0b29b..3a3f3ab6 100644 --- a/src/components/controllers/postgres/lesson/fwd.cpp +++ b/src/legacy/components/controllers/postgres/admin/fwd.cpp @@ -4,10 +4,10 @@ #include "controller.hpp" -namespace components::controllers::postgres::lesson +namespace legacy::components::controllers::postgres::admin { void Append(userver::components::ComponentList& component_list) { component_list.Append(); } -} // namespace components::controllers::postgres::lesson +} // namespace legacy::components::controllers::postgres::admin diff --git a/src/components/controllers/postgres/lesson/fwd.hpp b/src/legacy/components/controllers/postgres/admin/fwd.hpp similarity index 52% rename from src/components/controllers/postgres/lesson/fwd.hpp rename to src/legacy/components/controllers/postgres/admin/fwd.hpp index 85fe0049..86c50a3d 100644 --- a/src/components/controllers/postgres/lesson/fwd.hpp +++ b/src/legacy/components/controllers/postgres/admin/fwd.hpp @@ -1,8 +1,8 @@ #pragma once #include -namespace components::controllers::postgres::lesson +namespace legacy::components::controllers::postgres::admin { class Controller; void Append(userver::components::ComponentList& component_list); -} // namespace components::controllers::postgres::lesson +} // namespace legacy::components::controllers::postgres::admin diff --git a/src/components/controllers/postgres/admin/sql_queries.hpp b/src/legacy/components/controllers/postgres/admin/sql_queries.hpp similarity index 94% rename from src/components/controllers/postgres/admin/sql_queries.hpp rename to src/legacy/components/controllers/postgres/admin/sql_queries.hpp index 6a7ccb7f..03be69ee 100644 --- a/src/components/controllers/postgres/admin/sql_queries.hpp +++ b/src/legacy/components/controllers/postgres/admin/sql_queries.hpp @@ -1,7 +1,7 @@ #pragma once #include -namespace components::controllers::postgres::admin::sql +namespace legacy::components::controllers::postgres::admin::sql { const userver::storages::postgres::Query qCreateAdminAccount(R"( WITH diff --git a/src/components/controllers/postgres/faculty/controller.cpp b/src/legacy/components/controllers/postgres/faculty/controller.cpp similarity index 67% rename from src/components/controllers/postgres/faculty/controller.cpp rename to src/legacy/components/controllers/postgres/faculty/controller.cpp index ffd23c16..67051e4b 100644 --- a/src/components/controllers/postgres/faculty/controller.cpp +++ b/src/legacy/components/controllers/postgres/faculty/controller.cpp @@ -22,17 +22,17 @@ #include #include -#include "models/admin_account/postgre.hpp" -#include "models/admin_filter/postgre.hpp" -#include "models/faculty/type.hpp" -#include "models/faculty_filter/postgre.hpp" -#include "models/request_privileges/type.hpp" -#include "models/subgroup/serialize.hpp" -#include "models/substring/postgre.hpp" -#include "models/user_credentials/postgre.hpp" +#include "legacy/models/admin_account/postgre.hpp" +#include "legacy/models/admin_filter/postgre.hpp" +#include "legacy/models/faculty/type.hpp" +#include "legacy/models/faculty_filter/postgre.hpp" +#include "legacy/models/request_privileges/type.hpp" +#include "legacy/models/subgroup/serialize.hpp" +#include "legacy/models/substring/postgre.hpp" +#include "legacy/models/user_credentials/postgre.hpp" #include "sql_queries.hpp" -namespace components::controllers::postgres::faculty +namespace legacy::components::controllers::postgres::faculty { ::utils::SharedTransaction Controller::CreateTransaction() { @@ -47,15 +47,15 @@ Controller::Controller(const userver::components::ComponentConfig& config, { } -std::vector Controller::GetByFilter( - const std::optional& filter, +std::vector Controller::GetByFilter( + const std::optional& filter, utils::SharedTransaction transaction) const { utils::FillSharedTransaction(transaction, pg_cluster_); auto pg_result = utils::PgExecute(transaction, sql::qGetFacultiesByFilter, filter); - return utils::ConvertPgResultToArray(pg_result); + return utils::ConvertPgResultToArray(pg_result); } -} // namespace components::controllers::postgres::faculty +} // namespace legacy::components::controllers::postgres::faculty // ::components::controllers::postgres::faculty diff --git a/src/components/controllers/postgres/faculty/controller.hpp b/src/legacy/components/controllers/postgres/faculty/controller.hpp similarity index 62% rename from src/components/controllers/postgres/faculty/controller.hpp rename to src/legacy/components/controllers/postgres/faculty/controller.hpp index e3aeefce..8e8fd1fa 100644 --- a/src/components/controllers/postgres/faculty/controller.hpp +++ b/src/legacy/components/controllers/postgres/faculty/controller.hpp @@ -6,14 +6,14 @@ #include #include -#include "models/faculty/type.hpp" -#include "models/faculty_filter/type.hpp" -#include "models/request_privileges/type.hpp" -#include "models/teacher/type.hpp" -#include "models/teacher_filter/type.hpp" -#include "models/teacher_info/type.hpp" +#include "legacy/models/faculty/type.hpp" +#include "legacy/models/faculty_filter/type.hpp" +#include "legacy/models/request_privileges/type.hpp" +#include "legacy/models/teacher/type.hpp" +#include "legacy/models/teacher_filter/type.hpp" +#include "legacy/models/teacher_info/type.hpp" -namespace components::controllers::postgres::faculty +namespace legacy::components::controllers::postgres::faculty { class Controller final : public userver::components::LoggableComponentBase { @@ -24,8 +24,8 @@ class Controller final : public userver::components::LoggableComponentBase Controller(const userver::components::ComponentConfig& config, const userver::components::ComponentContext& context); - std::vector GetByFilter( - const std::optional& filter, + std::vector GetByFilter( + const std::optional& filter, utils::SharedTransaction transaction = nullptr) const; public: @@ -34,5 +34,5 @@ class Controller final : public userver::components::LoggableComponentBase protected: userver::storages::postgres::ClusterPtr pg_cluster_; }; -} // namespace components::controllers::postgres::faculty +} // namespace legacy::components::controllers::postgres::faculty // ::components::controllers::postgres::faculty diff --git a/src/components/controllers/postgres/faculty/fwd.cpp b/src/legacy/components/controllers/postgres/faculty/fwd.cpp similarity index 66% rename from src/components/controllers/postgres/faculty/fwd.cpp rename to src/legacy/components/controllers/postgres/faculty/fwd.cpp index 1648c92d..b1d56bc7 100644 --- a/src/components/controllers/postgres/faculty/fwd.cpp +++ b/src/legacy/components/controllers/postgres/faculty/fwd.cpp @@ -4,11 +4,11 @@ #include "controller.hpp" -namespace components::controllers::postgres::faculty +namespace legacy::components::controllers::postgres::faculty { void Append(userver::components::ComponentList& component_list) { component_list.Append(); } -} // namespace components::controllers::postgres::faculty +} // namespace legacy::components::controllers::postgres::faculty // ::components::controllers::postgres::faculty diff --git a/src/components/controllers/postgres/faculty/fwd.hpp b/src/legacy/components/controllers/postgres/faculty/fwd.hpp similarity index 59% rename from src/components/controllers/postgres/faculty/fwd.hpp rename to src/legacy/components/controllers/postgres/faculty/fwd.hpp index 852da1b8..70855245 100644 --- a/src/components/controllers/postgres/faculty/fwd.hpp +++ b/src/legacy/components/controllers/postgres/faculty/fwd.hpp @@ -1,9 +1,9 @@ #pragma once #include -namespace components::controllers::postgres::faculty +namespace legacy::components::controllers::postgres::faculty { class Controller; void Append(userver::components::ComponentList& component_list); -} // namespace components::controllers::postgres::faculty +} // namespace legacy::components::controllers::postgres::faculty // ::components::controllers::postgres::faculty diff --git a/src/components/controllers/postgres/faculty/sql_queries.hpp b/src/legacy/components/controllers/postgres/faculty/sql_queries.hpp similarity index 83% rename from src/components/controllers/postgres/faculty/sql_queries.hpp rename to src/legacy/components/controllers/postgres/faculty/sql_queries.hpp index f1fdf94f..ba570470 100644 --- a/src/components/controllers/postgres/faculty/sql_queries.hpp +++ b/src/legacy/components/controllers/postgres/faculty/sql_queries.hpp @@ -1,7 +1,7 @@ #pragma once #include -namespace components::controllers::postgres::faculty::sql +namespace legacy::components::controllers::postgres::faculty::sql { const userver::storages::postgres::Query qGetFacultiesByFilter(R"( SELECT diff --git a/src/components/controllers/postgres/group_stage/controller.cpp b/src/legacy/components/controllers/postgres/group_stage/controller.cpp similarity index 67% rename from src/components/controllers/postgres/group_stage/controller.cpp rename to src/legacy/components/controllers/postgres/group_stage/controller.cpp index 5e02f03e..c7cd3c00 100644 --- a/src/components/controllers/postgres/group_stage/controller.cpp +++ b/src/legacy/components/controllers/postgres/group_stage/controller.cpp @@ -22,17 +22,17 @@ #include #include -#include "models/admin_account/postgre.hpp" -#include "models/admin_filter/postgre.hpp" -#include "models/group_stage/type.hpp" -#include "models/group_stage_filter/postgre.hpp" -#include "models/request_privileges/type.hpp" -#include "models/subgroup/serialize.hpp" -#include "models/substring/postgre.hpp" -#include "models/user_credentials/postgre.hpp" +#include "legacy/models/admin_account/postgre.hpp" +#include "legacy/models/admin_filter/postgre.hpp" +#include "legacy/models/group_stage/type.hpp" +#include "legacy/models/group_stage_filter/postgre.hpp" +#include "legacy/models/request_privileges/type.hpp" +#include "legacy/models/subgroup/serialize.hpp" +#include "legacy/models/substring/postgre.hpp" +#include "legacy/models/user_credentials/postgre.hpp" #include "sql_queries.hpp" -namespace components::controllers::postgres::group_stage +namespace legacy::components::controllers::postgres::group_stage { ::utils::SharedTransaction Controller::CreateTransaction() { @@ -47,15 +47,15 @@ Controller::Controller(const userver::components::ComponentConfig& config, { } -std::vector Controller::GetByFilter( - const std::optional& filter, +std::vector Controller::GetByFilter( + const std::optional& filter, utils::SharedTransaction transaction) const { utils::FillSharedTransaction(transaction, pg_cluster_); auto pg_result = utils::PgExecute(transaction, sql::qGetGroupStages, filter); - return utils::ConvertPgResultToArray(pg_result); + return utils::ConvertPgResultToArray(pg_result); } -} // namespace components::controllers::postgres::group_stage +} // namespace legacy::components::controllers::postgres::group_stage // ::components::controllers::postgres::group_stage diff --git a/src/components/controllers/postgres/group_stage/controller.hpp b/src/legacy/components/controllers/postgres/group_stage/controller.hpp similarity index 61% rename from src/components/controllers/postgres/group_stage/controller.hpp rename to src/legacy/components/controllers/postgres/group_stage/controller.hpp index 006217af..5664e59a 100644 --- a/src/components/controllers/postgres/group_stage/controller.hpp +++ b/src/legacy/components/controllers/postgres/group_stage/controller.hpp @@ -6,14 +6,14 @@ #include #include -#include "models/group_stage/type.hpp" -#include "models/group_stage_filter/type.hpp" -#include "models/request_privileges/type.hpp" -#include "models/teacher/type.hpp" -#include "models/teacher_filter/type.hpp" -#include "models/teacher_info/type.hpp" +#include "legacy/models/group_stage/type.hpp" +#include "legacy/models/group_stage_filter/type.hpp" +#include "legacy/models/request_privileges/type.hpp" +#include "legacy/models/teacher/type.hpp" +#include "legacy/models/teacher_filter/type.hpp" +#include "legacy/models/teacher_info/type.hpp" -namespace components::controllers::postgres::group_stage +namespace legacy::components::controllers::postgres::group_stage { class Controller final : public userver::components::LoggableComponentBase { @@ -24,8 +24,8 @@ class Controller final : public userver::components::LoggableComponentBase Controller(const userver::components::ComponentConfig& config, const userver::components::ComponentContext& context); - std::vector GetByFilter( - const std::optional& filter, + std::vector GetByFilter( + const std::optional& filter, utils::SharedTransaction transaction = nullptr) const; public: @@ -34,5 +34,5 @@ class Controller final : public userver::components::LoggableComponentBase protected: userver::storages::postgres::ClusterPtr pg_cluster_; }; -} // namespace components::controllers::postgres::group_stage +} // namespace legacy::components::controllers::postgres::group_stage // ::components::controllers::postgres::group_stage diff --git a/src/components/controllers/postgres/group_stage/fwd.cpp b/src/legacy/components/controllers/postgres/group_stage/fwd.cpp similarity index 65% rename from src/components/controllers/postgres/group_stage/fwd.cpp rename to src/legacy/components/controllers/postgres/group_stage/fwd.cpp index 9daef3c7..d97c306e 100644 --- a/src/components/controllers/postgres/group_stage/fwd.cpp +++ b/src/legacy/components/controllers/postgres/group_stage/fwd.cpp @@ -4,11 +4,11 @@ #include "controller.hpp" -namespace components::controllers::postgres::group_stage +namespace legacy::components::controllers::postgres::group_stage { void Append(userver::components::ComponentList& component_list) { component_list.Append(); } -} // namespace components::controllers::postgres::group_stage +} // namespace legacy::components::controllers::postgres::group_stage // ::components::controllers::postgres::group_stage diff --git a/src/components/controllers/postgres/group_stage/fwd.hpp b/src/legacy/components/controllers/postgres/group_stage/fwd.hpp similarity index 58% rename from src/components/controllers/postgres/group_stage/fwd.hpp rename to src/legacy/components/controllers/postgres/group_stage/fwd.hpp index fedae53c..40d55d45 100644 --- a/src/components/controllers/postgres/group_stage/fwd.hpp +++ b/src/legacy/components/controllers/postgres/group_stage/fwd.hpp @@ -1,9 +1,9 @@ #pragma once #include -namespace components::controllers::postgres::group_stage +namespace legacy::components::controllers::postgres::group_stage { class Controller; void Append(userver::components::ComponentList& component_list); -} // namespace components::controllers::postgres::group_stage +} // namespace legacy::components::controllers::postgres::group_stage // ::components::controllers::postgres::group_stage diff --git a/src/components/controllers/postgres/group_stage/sql_queries.hpp b/src/legacy/components/controllers/postgres/group_stage/sql_queries.hpp similarity index 95% rename from src/components/controllers/postgres/group_stage/sql_queries.hpp rename to src/legacy/components/controllers/postgres/group_stage/sql_queries.hpp index 61115ee1..4deb4eef 100644 --- a/src/components/controllers/postgres/group_stage/sql_queries.hpp +++ b/src/legacy/components/controllers/postgres/group_stage/sql_queries.hpp @@ -1,7 +1,7 @@ #pragma once #include -namespace components::controllers::postgres::group_stage::sql +namespace legacy::components::controllers::postgres::group_stage::sql { const userver::storages::postgres::Query qGetGroupStages(R"( WITH group_stages_info AS(SELECT diff --git a/src/components/controllers/postgres/lesson/controller.cpp b/src/legacy/components/controllers/postgres/lesson/controller.cpp similarity index 70% rename from src/components/controllers/postgres/lesson/controller.cpp rename to src/legacy/components/controllers/postgres/lesson/controller.cpp index 4129f168..5340fb20 100644 --- a/src/components/controllers/postgres/lesson/controller.cpp +++ b/src/legacy/components/controllers/postgres/lesson/controller.cpp @@ -18,22 +18,22 @@ #include #include -#include "models/lesson_filter/postgre.hpp" -#include "models/lesson_v1/postgre.hpp" -#include "models/lesson_v1/type.hpp" -#include "models/subgroup/serialize.hpp" +#include "legacy/models/lesson_filter/postgre.hpp" +#include "legacy/models/lesson_v1/postgre.hpp" +#include "legacy/models/lesson_v1/type.hpp" +#include "legacy/models/subgroup/serialize.hpp" #include "sql_queries.hpp" -namespace components::controllers::postgres::lesson +namespace legacy::components::controllers::postgres::lesson { -std::vector Controller::Search( - const std::optional& filter, +std::vector Controller::Search( + const std::optional& filter, ::utils::SharedTransaction transaction) const { ::utils::FillSharedTransaction(transaction, pg_cluster_); auto pg_result = utils::PgExecute(transaction, sql::qGetLessonsByFilter, filter); - return utils::ConvertPgResultToArray(pg_result); + return utils::ConvertPgResultToArray(pg_result); } Controller::Controller(const userver::components::ComponentConfig& config, const userver::components::ComponentContext& context) @@ -43,4 +43,4 @@ Controller::Controller(const userver::components::ComponentConfig& config, .GetCluster()) { } -} // namespace components::controllers::postgres::lesson +} // namespace legacy::components::controllers::postgres::lesson diff --git a/src/components/controllers/postgres/lesson/controller.hpp b/src/legacy/components/controllers/postgres/lesson/controller.hpp similarity index 69% rename from src/components/controllers/postgres/lesson/controller.hpp rename to src/legacy/components/controllers/postgres/lesson/controller.hpp index fe71baf4..c4fe8b2c 100644 --- a/src/components/controllers/postgres/lesson/controller.hpp +++ b/src/legacy/components/controllers/postgres/lesson/controller.hpp @@ -6,10 +6,10 @@ #include #include -#include "models/lesson_filter/fwd.hpp" -#include "models/lesson_v1/type.hpp" +#include "legacy/models/lesson_filter/fwd.hpp" +#include "legacy/models/lesson_v1/type.hpp" -namespace components::controllers::postgres::lesson +namespace legacy::components::controllers::postgres::lesson { class Controller final : public userver::components::LoggableComponentBase { @@ -17,8 +17,8 @@ class Controller final : public userver::components::LoggableComponentBase using userver::components::LoggableComponentBase::LoggableComponentBase; static constexpr inline std::string_view kName = "lesson_details_controller"; - std::vector Search( - const std::optional& filter, + std::vector Search( + const std::optional& filter, ::utils::SharedTransaction transaction = nullptr) const; Controller(const userver::components::ComponentConfig& config, const userver::components::ComponentContext& context); @@ -26,4 +26,4 @@ class Controller final : public userver::components::LoggableComponentBase protected: userver::storages::postgres::ClusterPtr pg_cluster_; }; -} // namespace components::controllers::postgres::lesson +} // namespace legacy::components::controllers::postgres::lesson diff --git a/src/components/controllers/postgres/user/fwd.cpp b/src/legacy/components/controllers/postgres/lesson/fwd.cpp similarity index 62% rename from src/components/controllers/postgres/user/fwd.cpp rename to src/legacy/components/controllers/postgres/lesson/fwd.cpp index 5fca45db..afde8c23 100644 --- a/src/components/controllers/postgres/user/fwd.cpp +++ b/src/legacy/components/controllers/postgres/lesson/fwd.cpp @@ -4,10 +4,10 @@ #include "controller.hpp" -namespace components::controllers::postgres::user +namespace legacy::components::controllers::postgres::lesson { void Append(userver::components::ComponentList& component_list) { component_list.Append(); } -} // namespace components::controllers::postgres::user +} // namespace legacy::components::controllers::postgres::lesson diff --git a/src/components/controllers/postgres/admin/fwd.hpp b/src/legacy/components/controllers/postgres/lesson/fwd.hpp similarity index 52% rename from src/components/controllers/postgres/admin/fwd.hpp rename to src/legacy/components/controllers/postgres/lesson/fwd.hpp index ab50b00d..bc1826eb 100644 --- a/src/components/controllers/postgres/admin/fwd.hpp +++ b/src/legacy/components/controllers/postgres/lesson/fwd.hpp @@ -1,8 +1,8 @@ #pragma once #include -namespace components::controllers::postgres::admin +namespace legacy::components::controllers::postgres::lesson { class Controller; void Append(userver::components::ComponentList& component_list); -} // namespace components::controllers::postgres::admin +} // namespace legacy::components::controllers::postgres::lesson diff --git a/src/components/controllers/postgres/lesson/sql_queries.hpp b/src/legacy/components/controllers/postgres/lesson/sql_queries.hpp similarity index 98% rename from src/components/controllers/postgres/lesson/sql_queries.hpp rename to src/legacy/components/controllers/postgres/lesson/sql_queries.hpp index b8ed943b..292f9fae 100644 --- a/src/components/controllers/postgres/lesson/sql_queries.hpp +++ b/src/legacy/components/controllers/postgres/lesson/sql_queries.hpp @@ -1,7 +1,7 @@ #pragma once #include -namespace components::controllers::postgres::lesson::sql +namespace legacy::components::controllers::postgres::lesson::sql { const userver::storages::postgres::Query qGetLessonsByFilter(R"( WITH lesson_info as (SELECT diff --git a/src/components/controllers/postgres/teacher/controller.cpp b/src/legacy/components/controllers/postgres/teacher/controller.cpp similarity index 82% rename from src/components/controllers/postgres/teacher/controller.cpp rename to src/legacy/components/controllers/postgres/teacher/controller.cpp index e8531dfc..ba2f4950 100644 --- a/src/components/controllers/postgres/teacher/controller.cpp +++ b/src/legacy/components/controllers/postgres/teacher/controller.cpp @@ -22,18 +22,18 @@ #include #include -#include "models/admin_account/postgre.hpp" -#include "models/admin_filter/postgre.hpp" -#include "models/request_privileges/type.hpp" -#include "models/subgroup/serialize.hpp" -#include "models/substring/postgre.hpp" -#include "models/teacher/postgre.hpp" -#include "models/teacher_filter/postgre.hpp" -#include "models/teacher_info/postgre.hpp" -#include "models/user_credentials/postgre.hpp" +#include "legacy/models/admin_account/postgre.hpp" +#include "legacy/models/admin_filter/postgre.hpp" +#include "legacy/models/request_privileges/type.hpp" +#include "legacy/models/subgroup/serialize.hpp" +#include "legacy/models/substring/postgre.hpp" +#include "legacy/models/teacher/postgre.hpp" +#include "legacy/models/teacher_filter/postgre.hpp" +#include "legacy/models/teacher_info/postgre.hpp" +#include "legacy/models/user_credentials/postgre.hpp" #include "sql_queries.hpp" -namespace components::controllers::postgres::teacher +namespace legacy::components::controllers::postgres::teacher { ::utils::SharedTransaction Controller::CreateTransaction() { @@ -47,18 +47,18 @@ Controller::Controller(const userver::components::ComponentConfig& config, .GetCluster()) { } -std::vector Controller::GetByFilter( - std::optional& filter, +std::vector Controller::GetByFilter( + std::optional& filter, ::utils::SharedTransaction transaction) const { ::utils::FillSharedTransaction(transaction, pg_cluster_); auto pg_result = utils::PgExecute(transaction, sql::qGetTeachersByFilter, filter); - return utils::ConvertPgResultToArray(pg_result); + return utils::ConvertPgResultToArray(pg_result); } std::optional Controller::CreateTeacher( - const models::TeacherInfo& teacher_info, + const legacy::models::TeacherInfo& teacher_info, ::utils::SharedTransaction transaction) const { try @@ -107,7 +107,7 @@ std::optional Controller::Link( std::optional Controller::ApproveAndCreateAccount( const boost::uuids::uuid& request_id, - const models::TeacherInfo& teacher_info, + const legacy::models::TeacherInfo& teacher_info, ::utils::SharedTransaction transaction) const { utils::FillSharedTransaction(transaction, pg_cluster_); @@ -131,12 +131,12 @@ std::optional Controller::ApproveAndCreateAccount( return Link(id_user.value(), created_teacher_id, transaction); } -std::vector Controller::GetAllRequests( +std::vector Controller::GetAllRequests( ::utils::SharedTransaction transaction) const { utils::FillSharedTransaction(transaction, pg_cluster_); auto pg_result = utils::PgExecute(transaction, sql::qGetAllRequests); - return utils::ConvertPgResultToArray(pg_result); + return utils::ConvertPgResultToArray(pg_result); } std::optional Controller::DropRequest( @@ -149,5 +149,5 @@ std::optional Controller::DropRequest( return utils::ConvertPgResultToOptionalItem(pg_result); } -} // namespace components::controllers::postgres::teacher +} // namespace legacy::components::controllers::postgres::teacher // ::components::controllers::postgres::teacher diff --git a/src/components/controllers/postgres/teacher/controller.hpp b/src/legacy/components/controllers/postgres/teacher/controller.hpp similarity index 74% rename from src/components/controllers/postgres/teacher/controller.hpp rename to src/legacy/components/controllers/postgres/teacher/controller.hpp index f826353b..d5e1e83f 100644 --- a/src/components/controllers/postgres/teacher/controller.hpp +++ b/src/legacy/components/controllers/postgres/teacher/controller.hpp @@ -6,12 +6,12 @@ #include #include -#include "models/request_privileges/type.hpp" -#include "models/teacher/type.hpp" -#include "models/teacher_filter/type.hpp" -#include "models/teacher_info/type.hpp" +#include "legacy/models/request_privileges/type.hpp" +#include "legacy/models/teacher/type.hpp" +#include "legacy/models/teacher_filter/type.hpp" +#include "legacy/models/teacher_info/type.hpp" -namespace components::controllers::postgres::teacher +namespace legacy::components::controllers::postgres::teacher { class Controller final : public userver::components::LoggableComponentBase { @@ -26,7 +26,7 @@ class Controller final : public userver::components::LoggableComponentBase std::optional DropRequest( const boost::uuids::uuid& request_id, ::utils::SharedTransaction transaction = nullptr) const; - std::vector GetAllRequests( + std::vector GetAllRequests( ::utils::SharedTransaction transaction = nullptr) const; std::optional ApproveAndLink( const boost::uuids::uuid& request_id, @@ -35,19 +35,19 @@ class Controller final : public userver::components::LoggableComponentBase std::optional ApproveAndCreateAccount( const boost::uuids::uuid& request_id, - const models::TeacherInfo& teacher_info, + const legacy::models::TeacherInfo& teacher_info, ::utils::SharedTransaction transaction = nullptr) const; std::optional Link( const boost::uuids::uuid& user_id, const boost::uuids::uuid& teacher_id, ::utils::SharedTransaction transaction = nullptr) const; - std::vector GetByFilter( - std::optional& filter, + std::vector GetByFilter( + std::optional& filter, ::utils::SharedTransaction transaction = nullptr) const; std::optional CreateTeacher( - const models::TeacherInfo& teacher_info, + const legacy::models::TeacherInfo& teacher_info, ::utils::SharedTransaction transaction = nullptr) const; ::utils::SharedTransaction CreateTransaction(); @@ -55,5 +55,5 @@ class Controller final : public userver::components::LoggableComponentBase protected: userver::storages::postgres::ClusterPtr pg_cluster_; }; -} // namespace components::controllers::postgres::teacher +} // namespace legacy::components::controllers::postgres::teacher // ::components::controllers::postgres::teacher diff --git a/src/components/controllers/postgres/teacher/fwd.cpp b/src/legacy/components/controllers/postgres/teacher/fwd.cpp similarity index 66% rename from src/components/controllers/postgres/teacher/fwd.cpp rename to src/legacy/components/controllers/postgres/teacher/fwd.cpp index 89af2130..0e79986a 100644 --- a/src/components/controllers/postgres/teacher/fwd.cpp +++ b/src/legacy/components/controllers/postgres/teacher/fwd.cpp @@ -4,11 +4,11 @@ #include "controller.hpp" -namespace components::controllers::postgres::teacher +namespace legacy::components::controllers::postgres::teacher { void Append(userver::components::ComponentList& component_list) { component_list.Append(); } -} // namespace components::controllers::postgres::teacher +} // namespace legacy::components::controllers::postgres::teacher // ::components::controllers::postgres::teacher diff --git a/src/components/controllers/postgres/teacher/fwd.hpp b/src/legacy/components/controllers/postgres/teacher/fwd.hpp similarity index 62% rename from src/components/controllers/postgres/teacher/fwd.hpp rename to src/legacy/components/controllers/postgres/teacher/fwd.hpp index 7ec58ac2..77aef0e7 100644 --- a/src/components/controllers/postgres/teacher/fwd.hpp +++ b/src/legacy/components/controllers/postgres/teacher/fwd.hpp @@ -1,7 +1,7 @@ #pragma once #include -namespace components::controllers::postgres +namespace legacy::components::controllers::postgres { namespace teacher { @@ -9,4 +9,4 @@ class Controller; void Append(userver::components::ComponentList& component_list); } // namespace teacher -} // namespace components::controllers::postgres +} // namespace legacy::components::controllers::postgres diff --git a/src/components/controllers/postgres/teacher/sql_queries.hpp b/src/legacy/components/controllers/postgres/teacher/sql_queries.hpp similarity index 96% rename from src/components/controllers/postgres/teacher/sql_queries.hpp rename to src/legacy/components/controllers/postgres/teacher/sql_queries.hpp index 729726ef..2800fa88 100644 --- a/src/components/controllers/postgres/teacher/sql_queries.hpp +++ b/src/legacy/components/controllers/postgres/teacher/sql_queries.hpp @@ -1,7 +1,7 @@ #pragma once #include -namespace components::controllers::postgres::teacher::sql +namespace legacy::components::controllers::postgres::teacher::sql { const userver::storages::postgres::Query qGetTeachersByFilter(R"( WITH teacher_info as (SELECT diff --git a/src/components/controllers/postgres/token/controller.cpp b/src/legacy/components/controllers/postgres/token/controller.cpp similarity index 81% rename from src/components/controllers/postgres/token/controller.cpp rename to src/legacy/components/controllers/postgres/token/controller.cpp index c38464ae..d35ca916 100644 --- a/src/components/controllers/postgres/token/controller.cpp +++ b/src/legacy/components/controllers/postgres/token/controller.cpp @@ -16,12 +16,12 @@ #include #include -#include "models/user/postgre.hpp" -#include "models/user/type.hpp" -#include "models/user_type/postgre.hpp" +#include "legacy/models/user/postgre.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/postgre.hpp" #include "sql_queries.hpp" -namespace components::controllers::postgres::token +namespace legacy::components::controllers::postgres::token { Controller::Controller(const userver::components::ComponentConfig& config, const userver::components::ComponentContext& context) @@ -31,13 +31,13 @@ Controller::Controller(const userver::components::ComponentConfig& config, .GetCluster()) { } -std::optional Controller::GetById( +std::optional Controller::GetById( std::string_view id, utils::SharedTransaction transaction) const { utils::FillSharedTransaction(transaction, pg_cluster_); auto result = utils::PgExecute(transaction, sql::qGetUserByTokenId, id, userver::utils::datetime::Now()); - return utils::ConvertPgResultToOptionalItem(result); + return utils::ConvertPgResultToOptionalItem(result); } std::optional Controller::CreateNew( @@ -52,4 +52,4 @@ std::optional Controller::CreateNew( auto result = utils::PgExecute(transaction, sql::qAddToken, user_id, time); return utils::ConvertPgResultToOptionalItem(result); } -} // namespace components::controllers::postgres::token +} // namespace legacy::components::controllers::postgres::token diff --git a/src/components/controllers/postgres/token/controller.hpp b/src/legacy/components/controllers/postgres/token/controller.hpp similarity index 82% rename from src/components/controllers/postgres/token/controller.hpp rename to src/legacy/components/controllers/postgres/token/controller.hpp index 835bd344..29ea1f52 100644 --- a/src/components/controllers/postgres/token/controller.hpp +++ b/src/legacy/components/controllers/postgres/token/controller.hpp @@ -5,9 +5,9 @@ #include #include -#include "models/user/type.hpp" +#include "legacy/models/user/type.hpp" -namespace components::controllers::postgres::token +namespace legacy::components::controllers::postgres::token { class Controller final : public userver::components::LoggableComponentBase { @@ -16,7 +16,7 @@ class Controller final : public userver::components::LoggableComponentBase static constexpr inline std::string_view kName = "token_controller"; - std::optional GetById( + std::optional GetById( std::string_view id, utils::SharedTransaction transaction = nullptr) const; @@ -31,4 +31,4 @@ class Controller final : public userver::components::LoggableComponentBase protected: userver::storages::postgres::ClusterPtr pg_cluster_; }; -} // namespace components::controllers::postgres::token +} // namespace legacy::components::controllers::postgres::token diff --git a/src/components/controllers/postgres/admin/fwd.cpp b/src/legacy/components/controllers/postgres/token/fwd.cpp similarity index 62% rename from src/components/controllers/postgres/admin/fwd.cpp rename to src/legacy/components/controllers/postgres/token/fwd.cpp index 00da49df..5f6f28f8 100644 --- a/src/components/controllers/postgres/admin/fwd.cpp +++ b/src/legacy/components/controllers/postgres/token/fwd.cpp @@ -4,10 +4,10 @@ #include "controller.hpp" -namespace components::controllers::postgres::admin +namespace legacy::components::controllers::postgres::token { void Append(userver::components::ComponentList& component_list) { component_list.Append(); } -} // namespace components::controllers::postgres::admin +} // namespace legacy::components::controllers::postgres::token diff --git a/src/components/controllers/postgres/token/fwd.hpp b/src/legacy/components/controllers/postgres/token/fwd.hpp similarity index 61% rename from src/components/controllers/postgres/token/fwd.hpp rename to src/legacy/components/controllers/postgres/token/fwd.hpp index e76bb02c..fd284eaa 100644 --- a/src/components/controllers/postgres/token/fwd.hpp +++ b/src/legacy/components/controllers/postgres/token/fwd.hpp @@ -1,10 +1,10 @@ #pragma once #include -namespace components::controllers::postgres +namespace legacy::components::controllers::postgres { namespace token { class Controller; void Append(userver::components::ComponentList& component_list); } // namespace token -} // namespace components::controllers::postgres +} // namespace legacy::components::controllers::postgres diff --git a/src/components/controllers/postgres/token/sql_queries.hpp b/src/legacy/components/controllers/postgres/token/sql_queries.hpp similarity index 88% rename from src/components/controllers/postgres/token/sql_queries.hpp rename to src/legacy/components/controllers/postgres/token/sql_queries.hpp index 35f9cb0c..9373b6fd 100644 --- a/src/components/controllers/postgres/token/sql_queries.hpp +++ b/src/legacy/components/controllers/postgres/token/sql_queries.hpp @@ -1,5 +1,5 @@ #include -namespace components::controllers::postgres::token::sql +namespace legacy::components::controllers::postgres::token::sql { const userver::storages::postgres::Query qGetUserByTokenId(R"( WITH found_token AS (select id_user diff --git a/src/components/controllers/postgres/user/config_schema.hpp b/src/legacy/components/controllers/postgres/user/config_schema.hpp similarity index 93% rename from src/components/controllers/postgres/user/config_schema.hpp rename to src/legacy/components/controllers/postgres/user/config_schema.hpp index 02efc074..21c9a8c2 100644 --- a/src/components/controllers/postgres/user/config_schema.hpp +++ b/src/legacy/components/controllers/postgres/user/config_schema.hpp @@ -1,6 +1,6 @@ #pragma once #include -namespace components::controllers::postgres::user::config +namespace legacy::components::controllers::postgres::user::config { const std::string schema = R"( diff --git a/src/components/controllers/postgres/user/controller.cpp b/src/legacy/components/controllers/postgres/user/controller.cpp similarity index 83% rename from src/components/controllers/postgres/user/controller.cpp rename to src/legacy/components/controllers/postgres/user/controller.cpp index 2d2cffa8..21d66088 100644 --- a/src/components/controllers/postgres/user/controller.cpp +++ b/src/legacy/components/controllers/postgres/user/controller.cpp @@ -21,13 +21,13 @@ #include #include -#include "components/controllers/postgres/user/sql_queries.hpp" +#include "legacy/components/controllers/postgres/user/sql_queries.hpp" #include "config_schema.hpp" -#include "models/user/postgre.hpp" -#include "models/user/type.hpp" -#include "models/user_credentials/postgre.hpp" +#include "legacy/models/user/postgre.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_credentials/postgre.hpp" -namespace components::controllers::postgres::user +namespace legacy::components::controllers::postgres::user { Controller::Controller(const userver::components::ComponentConfig& config, const userver::components::ComponentContext& context) @@ -36,7 +36,7 @@ Controller::Controller(const userver::components::ComponentConfig& config, context.FindComponent("postgres-db-1") .GetCluster()) { - models::UserCredentials root; + legacy::models::UserCredentials root; root.login() = config["root"]["login"].As(); root.password() = config["root"]["password"].As(); root_id = boost::lexical_cast( @@ -59,7 +59,7 @@ utils::SharedTransaction Controller::CreateTransaction() } void Controller::InternalForceCreateUser( - const boost::uuids::uuid&, const models::UserCredentials& user_credentials, + const boost::uuids::uuid&, const legacy::models::UserCredentials& user_credentials, utils::SharedTransaction transaction) { utils::FillSharedTransaction(transaction, pg_cluster_); @@ -90,17 +90,17 @@ std::optional Controller::CreateRequestAdmin( return utils::ConvertPgResultToOptionalItem(pg_result); } -std::optional Controller::HandleUserFromPg( +std::optional Controller::HandleUserFromPg( userver::storages::postgres::ResultSet& result) const { if (result.IsEmpty()) { return std::nullopt; } - std::optional user = std::nullopt; + std::optional user = std::nullopt; if (result.Size() == 1) { - user = utils::ConvertPgResultToItem(result); + user = utils::ConvertPgResultToItem(result); } else if (result.Size() != 0) { @@ -109,13 +109,13 @@ std::optional Controller::HandleUserFromPg( } if (user && user->id() == root_id) { - user->type() = models::UserType::kRoot; + user->type() = legacy::models::UserType::kRoot; } return user; } -std::optional Controller::GetByCredentials( - const models::UserCredentials& user_credentials, +std::optional Controller::GetByCredentials( + const legacy::models::UserCredentials& user_credentials, utils::SharedTransaction transaction) const { utils::FillSharedTransaction(transaction, pg_cluster_); @@ -125,7 +125,7 @@ std::optional Controller::GetByCredentials( return HandleUserFromPg(result); } -std::optional Controller::GetByToken( +std::optional Controller::GetByToken( const boost::uuids::uuid& token, utils::SharedTransaction transaction) const { utils::FillSharedTransaction(transaction, pg_cluster_); @@ -140,7 +140,7 @@ utils::SharedTransaction Controller::CreateTransaction() const } std::optional Controller::TryToAdd( - const models::UserCredentials& user_credentials, + const legacy::models::UserCredentials& user_credentials, utils::SharedTransaction transaction) const { utils::FillSharedTransaction(transaction, pg_cluster_); @@ -164,4 +164,4 @@ userver::yaml_config::Schema Controller::GetStaticConfigSchema() return userver::yaml_config::MergeSchemas< userver::components::LoggableComponentBase>(config::schema); } -} // namespace components::controllers::postgres::user +} // namespace legacy::components::controllers::postgres::user diff --git a/src/components/controllers/postgres/user/controller.hpp b/src/legacy/components/controllers/postgres/user/controller.hpp similarity index 74% rename from src/components/controllers/postgres/user/controller.hpp rename to src/legacy/components/controllers/postgres/user/controller.hpp index 1f4b0cba..ebf02a30 100644 --- a/src/components/controllers/postgres/user/controller.hpp +++ b/src/legacy/components/controllers/postgres/user/controller.hpp @@ -5,11 +5,11 @@ #include #include -#include "models/user/type.hpp" -#include "models/user_credentials/fwd.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_credentials/fwd.hpp" +#include "legacy/models/user_type/type.hpp" -namespace components::controllers::postgres::user +namespace legacy::components::controllers::postgres::user { class Controller final : public userver::components::LoggableComponentBase { @@ -20,12 +20,12 @@ class Controller final : public userver::components::LoggableComponentBase void InternalForceCreateUser( const boost::uuids::uuid&, - const models::UserCredentials& user_credentials, + const legacy::models::UserCredentials& user_credentials, utils::SharedTransaction transaction = nullptr); utils::SharedTransaction CreateTransaction(); - std::optional GetByToken( + std::optional GetByToken( const boost::uuids::uuid& token, utils::SharedTransaction transaction = nullptr) const; @@ -37,12 +37,12 @@ class Controller final : public userver::components::LoggableComponentBase const boost::uuids::uuid& user_id, const std::string& description, utils::SharedTransaction transaction = nullptr) const; - std::optional GetByCredentials( - const models::UserCredentials& user_credentials, + std::optional GetByCredentials( + const legacy::models::UserCredentials& user_credentials, utils::SharedTransaction transaction = nullptr) const; std::optional TryToAdd( - const models::UserCredentials& user_credentials, + const legacy::models::UserCredentials& user_credentials, utils::SharedTransaction transaction = nullptr) const; static userver::yaml_config::Schema GetStaticConfigSchema(); @@ -55,11 +55,11 @@ class Controller final : public userver::components::LoggableComponentBase ~Controller(); protected: - std::optional HandleUserFromPg( + std::optional HandleUserFromPg( userver::storages::postgres::ResultSet& result) const; private: std::optional root_id; userver::storages::postgres::ClusterPtr pg_cluster_; }; -} // namespace components::controllers::postgres::user +} // namespace legacy::components::controllers::postgres::user diff --git a/src/components/controllers/postgres/token/fwd.cpp b/src/legacy/components/controllers/postgres/user/fwd.cpp similarity index 63% rename from src/components/controllers/postgres/token/fwd.cpp rename to src/legacy/components/controllers/postgres/user/fwd.cpp index fd9e7363..be2a7c21 100644 --- a/src/components/controllers/postgres/token/fwd.cpp +++ b/src/legacy/components/controllers/postgres/user/fwd.cpp @@ -4,10 +4,10 @@ #include "controller.hpp" -namespace components::controllers::postgres::token +namespace legacy::components::controllers::postgres::user { void Append(userver::components::ComponentList& component_list) { component_list.Append(); } -} // namespace components::controllers::postgres::token +} // namespace legacy::components::controllers::postgres::user diff --git a/src/components/controllers/postgres/user/fwd.hpp b/src/legacy/components/controllers/postgres/user/fwd.hpp similarity index 61% rename from src/components/controllers/postgres/user/fwd.hpp rename to src/legacy/components/controllers/postgres/user/fwd.hpp index 69b1772c..845b0cc2 100644 --- a/src/components/controllers/postgres/user/fwd.hpp +++ b/src/legacy/components/controllers/postgres/user/fwd.hpp @@ -1,6 +1,6 @@ #pragma once #include -namespace components::controllers::postgres +namespace legacy::components::controllers::postgres { namespace user { @@ -8,4 +8,4 @@ class Controller; void Append(userver::components::ComponentList& component_list); } // namespace user -} // namespace components::controllers::postgres +} // namespace legacy::components::controllers::postgres diff --git a/src/components/controllers/postgres/user/sql_queries.hpp b/src/legacy/components/controllers/postgres/user/sql_queries.hpp similarity index 97% rename from src/components/controllers/postgres/user/sql_queries.hpp rename to src/legacy/components/controllers/postgres/user/sql_queries.hpp index b505425a..b1a6d8f7 100644 --- a/src/components/controllers/postgres/user/sql_queries.hpp +++ b/src/legacy/components/controllers/postgres/user/sql_queries.hpp @@ -2,7 +2,7 @@ #include -namespace components::controllers::postgres::user::sql +namespace legacy::components::controllers::postgres::user::sql { const userver::storages::postgres::Query qGetUserByCredentials(R"( WITH all_user AS ( SELECT diff --git a/src/models/admin_account/postgre.hpp b/src/legacy/models/admin_account/postgre.hpp similarity index 74% rename from src/models/admin_account/postgre.hpp rename to src/legacy/models/admin_account/postgre.hpp index de767f50..9b2b3b4f 100644 --- a/src/models/admin_account/postgre.hpp +++ b/src/legacy/models/admin_account/postgre.hpp @@ -4,17 +4,17 @@ #include #include -#include "models/admin_account/type.hpp" -namespace models +#include "legacy/models/admin_account/type.hpp" +namespace legacy::models { using AdminAccountTuple = ::utils::convert::drop_properties_to_ref_mut_t; -} // namespace models +} // namespace legacy::models namespace userver::storages::postgres::io { template <> -struct CppToUserPg<::models::AdminAccountTuple> +struct CppToUserPg<::legacy::models::AdminAccountTuple> { static constexpr DBTypeName postgres_name = "timetable_vsu.admin_account"; }; diff --git a/src/models/admin_account/type.hpp b/src/legacy/models/admin_account/type.hpp similarity index 88% rename from src/models/admin_account/type.hpp rename to src/legacy/models/admin_account/type.hpp index 566b51d6..6ae0d687 100644 --- a/src/models/admin_account/type.hpp +++ b/src/legacy/models/admin_account/type.hpp @@ -3,7 +3,7 @@ #include #include -namespace models +namespace legacy::models { using namespace utils::convert; struct AdminAccount @@ -14,4 +14,4 @@ struct AdminAccount static constexpr auto kPolicyFields = PolicyFields::ConvertAll; }; static_assert(JsonSeriazable); -} // namespace models +} // namespace legacy::models diff --git a/src/models/admin_filter/fwd.hpp b/src/legacy/models/admin_filter/fwd.hpp similarity index 60% rename from src/models/admin_filter/fwd.hpp rename to src/legacy/models/admin_filter/fwd.hpp index 9f9c1319..4c99b7a0 100644 --- a/src/models/admin_filter/fwd.hpp +++ b/src/legacy/models/admin_filter/fwd.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { struct AdminFilter; } diff --git a/src/models/admin_filter/postgre.hpp b/src/legacy/models/admin_filter/postgre.hpp similarity index 65% rename from src/models/admin_filter/postgre.hpp rename to src/legacy/models/admin_filter/postgre.hpp index dd4f121e..a13e7be6 100644 --- a/src/models/admin_filter/postgre.hpp +++ b/src/legacy/models/admin_filter/postgre.hpp @@ -1,18 +1,18 @@ #include #include -#include "models/admin_filter/type.hpp" -#include "models/education_type/postgre.hpp" -namespace models +#include "legacy/models/admin_filter/type.hpp" +#include "legacy/models/education_type/postgre.hpp" +namespace legacy::models { using TupleAdminFilter = ::utils::convert::drop_properties_to_ref_const_t; -} // namespace models +} // namespace legacy::models namespace userver::storages::postgres::io { template <> -struct CppToUserPg<::models::TupleAdminFilter> +struct CppToUserPg<::legacy::models::TupleAdminFilter> { static constexpr DBTypeName postgres_name = "timetable_vsu.admin_filter_v2"; }; diff --git a/src/models/admin_filter/type.hpp b/src/legacy/models/admin_filter/type.hpp similarity index 58% rename from src/models/admin_filter/type.hpp rename to src/legacy/models/admin_filter/type.hpp index 58f80531..9cabe683 100644 --- a/src/models/admin_filter/type.hpp +++ b/src/legacy/models/admin_filter/type.hpp @@ -4,15 +4,15 @@ #include #include -#include "models/day/type.hpp" -#include "models/education_type/type.hpp" -#include "models/lesson_type/type.hpp" -#include "models/lesson_week_type/type.hpp" -#include "models/subgroup/type.hpp" -#include "models/substring/type.hpp" -#include "models/timestring/type.hpp" +#include "legacy/models/day/type.hpp" +#include "legacy/models/education_type/type.hpp" +#include "legacy/models/lesson_type/type.hpp" +#include "legacy/models/lesson_week_type/type.hpp" +#include "legacy/models/subgroup/type.hpp" +#include "legacy/models/substring/type.hpp" +#include "legacy/models/timestring/type.hpp" -namespace models +namespace legacy::models { namespace convert = utils::convert; struct AdminFilter @@ -23,4 +23,4 @@ struct AdminFilter static constexpr utils::convert::PolicyFields kPolicyFields = utils::convert::PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/models/auth_token/serialize.hpp b/src/legacy/models/auth_token/serialize.hpp similarity index 90% rename from src/models/auth_token/serialize.hpp rename to src/legacy/models/auth_token/serialize.hpp index 14bbdbf2..9d7281d0 100644 --- a/src/models/auth_token/serialize.hpp +++ b/src/legacy/models/auth_token/serialize.hpp @@ -9,7 +9,7 @@ #include "type.hpp" -namespace models +namespace legacy::models { inline userver::formats::json::Value Serialize( const AuthToken& token, @@ -19,4 +19,4 @@ inline userver::formats::json::Value Serialize( json["token"] = boost::uuids::to_string(token.id); return json.ExtractValue(); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/auth_token/type.hpp b/src/legacy/models/auth_token/type.hpp similarity index 63% rename from src/models/auth_token/type.hpp rename to src/legacy/models/auth_token/type.hpp index 3d64a29c..043fc687 100644 --- a/src/models/auth_token/type.hpp +++ b/src/legacy/models/auth_token/type.hpp @@ -1,10 +1,10 @@ #pragma once #include -namespace models +namespace legacy::models { struct AuthToken { boost::uuids::uuid id; }; -} // namespace models +} // namespace legacy::models diff --git a/src/legacy/models/day/all.hpp b/src/legacy/models/day/all.hpp new file mode 100644 index 00000000..5f763647 --- /dev/null +++ b/src/legacy/models/day/all.hpp @@ -0,0 +1,4 @@ +#pragma once +#include "legacy/models/day/parse.hpp" +#include "legacy/models/day/postgre.hpp" +#include "legacy/models/day/serialize.hpp" diff --git a/src/models/day/parse.cpp b/src/legacy/models/day/parse.cpp similarity index 95% rename from src/models/day/parse.cpp rename to src/legacy/models/day/parse.cpp index 6eb93491..f2e4e0eb 100644 --- a/src/models/day/parse.cpp +++ b/src/legacy/models/day/parse.cpp @@ -8,7 +8,7 @@ #include "type.hpp" -namespace models +namespace legacy::models { Day Parse(std::string_view str, userver::formats::parse::To) { @@ -51,4 +51,4 @@ Day Parse(const userver::formats::json::Value& value, auto raw_value = value.As(); return Parse(raw_value, userver::formats::parse::To{}); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/day/parse.hpp b/src/legacy/models/day/parse.hpp similarity index 84% rename from src/models/day/parse.hpp rename to src/legacy/models/day/parse.hpp index 9405d54b..2430aa53 100644 --- a/src/models/day/parse.hpp +++ b/src/legacy/models/day/parse.hpp @@ -5,9 +5,9 @@ #include "type.hpp" -namespace models +namespace legacy::models { Day Parse(std::string_view str, userver::formats::parse::To); Day Parse(const userver::formats::json::Value& value, userver::formats::parse::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/day/postgre.hpp b/src/legacy/models/day/postgre.hpp similarity index 96% rename from src/models/day/postgre.hpp rename to src/legacy/models/day/postgre.hpp index 75d9e212..8a9d2027 100644 --- a/src/models/day/postgre.hpp +++ b/src/legacy/models/day/postgre.hpp @@ -7,7 +7,7 @@ namespace userver::storages::postgres::io { -using ::models::Day; +using ::legacy::models::Day; template <> struct CppToUserPg : EnumMappingBase { diff --git a/src/models/day/serialize.cpp b/src/legacy/models/day/serialize.cpp similarity index 93% rename from src/models/day/serialize.cpp rename to src/legacy/models/day/serialize.cpp index ee70df60..876fa762 100644 --- a/src/models/day/serialize.cpp +++ b/src/legacy/models/day/serialize.cpp @@ -2,7 +2,7 @@ #include -namespace models +namespace legacy::models { std::string Serialize(const Day& value, userver::formats::serialize::To) @@ -31,4 +31,4 @@ userver::formats::json::Value Serialize( Serialize(value, userver::formats::serialize::To{}); return userver::formats::json::ValueBuilder(str).ExtractValue(); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/day/serialize.hpp b/src/legacy/models/day/serialize.hpp similarity index 85% rename from src/models/day/serialize.hpp rename to src/legacy/models/day/serialize.hpp index b1635bf3..e83528eb 100644 --- a/src/models/day/serialize.hpp +++ b/src/legacy/models/day/serialize.hpp @@ -3,11 +3,11 @@ #include "type.hpp" -namespace models +namespace legacy::models { userver::formats::json::Value Serialize( const Day& value, userver::formats::serialize::To); std::string Serialize(const Day& value, userver::formats::serialize::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/day/type.hpp b/src/legacy/models/day/type.hpp similarity index 83% rename from src/models/day/type.hpp rename to src/legacy/models/day/type.hpp index 033216a5..0ce750b8 100644 --- a/src/models/day/type.hpp +++ b/src/legacy/models/day/type.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { enum struct Day { diff --git a/src/legacy/models/education_type/all.hpp b/src/legacy/models/education_type/all.hpp new file mode 100644 index 00000000..09491ddc --- /dev/null +++ b/src/legacy/models/education_type/all.hpp @@ -0,0 +1,4 @@ +#pragma once +#include "legacy/models/education_type/parse.hpp" +#include "legacy/models/education_type/postgre.hpp" +#include "legacy/models/education_type/serialize.hpp" diff --git a/src/models/education_type/parse.cpp b/src/legacy/models/education_type/parse.cpp similarity index 95% rename from src/models/education_type/parse.cpp rename to src/legacy/models/education_type/parse.cpp index 69dd3ad4..542dcfbf 100644 --- a/src/models/education_type/parse.cpp +++ b/src/legacy/models/education_type/parse.cpp @@ -8,7 +8,7 @@ #include "type.hpp" -namespace models +namespace legacy::models { EducationType Parse(std::string_view str, userver::formats::parse::To) @@ -44,4 +44,4 @@ EducationType Parse(const userver::formats::json::Value& value, auto raw_value = value.As(); return Parse(raw_value, userver::formats::parse::To{}); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/education_type/parse.hpp b/src/legacy/models/education_type/parse.hpp similarity index 87% rename from src/models/education_type/parse.hpp rename to src/legacy/models/education_type/parse.hpp index e888bc89..081a00e1 100644 --- a/src/models/education_type/parse.hpp +++ b/src/legacy/models/education_type/parse.hpp @@ -5,10 +5,10 @@ #include "type.hpp" -namespace models +namespace legacy::models { EducationType Parse(std::string_view str, userver::formats::parse::To); EducationType Parse(const userver::formats::json::Value& value, userver::formats::parse::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/education_type/postgre.hpp b/src/legacy/models/education_type/postgre.hpp similarity index 95% rename from src/models/education_type/postgre.hpp rename to src/legacy/models/education_type/postgre.hpp index 164d1a7e..632fbaea 100644 --- a/src/models/education_type/postgre.hpp +++ b/src/legacy/models/education_type/postgre.hpp @@ -7,7 +7,7 @@ namespace userver::storages::postgres::io { -using ::models::EducationType; +using ::legacy::models::EducationType; template <> struct CppToUserPg : EnumMappingBase { diff --git a/src/models/education_type/serialize.cpp b/src/legacy/models/education_type/serialize.cpp similarity index 93% rename from src/models/education_type/serialize.cpp rename to src/legacy/models/education_type/serialize.cpp index c303277e..c7725cf3 100644 --- a/src/models/education_type/serialize.cpp +++ b/src/legacy/models/education_type/serialize.cpp @@ -2,7 +2,7 @@ #include -namespace models +namespace legacy::models { std::string Serialize(const EducationType& value, userver::formats::serialize::To) @@ -27,4 +27,4 @@ userver::formats::json::Value Serialize( Serialize(value, userver::formats::serialize::To{}); return userver::formats::json::ValueBuilder(str).ExtractValue(); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/education_type/serialize.hpp b/src/legacy/models/education_type/serialize.hpp similarity index 85% rename from src/models/education_type/serialize.hpp rename to src/legacy/models/education_type/serialize.hpp index 48eed26a..cdfc9459 100644 --- a/src/models/education_type/serialize.hpp +++ b/src/legacy/models/education_type/serialize.hpp @@ -3,11 +3,11 @@ #include "type.hpp" -namespace models +namespace legacy::models { userver::formats::json::Value Serialize( const EducationType& value, userver::formats::serialize::To); std::string Serialize(const EducationType& value, userver::formats::serialize::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/education_type/type.hpp b/src/legacy/models/education_type/type.hpp similarity index 82% rename from src/models/education_type/type.hpp rename to src/legacy/models/education_type/type.hpp index 7bf4ade1..bf987d0d 100644 --- a/src/models/education_type/type.hpp +++ b/src/legacy/models/education_type/type.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { enum struct EducationType { diff --git a/src/models/faculty/fwd.hpp b/src/legacy/models/faculty/fwd.hpp similarity index 57% rename from src/models/faculty/fwd.hpp rename to src/legacy/models/faculty/fwd.hpp index e04dbdd5..74b8a781 100644 --- a/src/models/faculty/fwd.hpp +++ b/src/legacy/models/faculty/fwd.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { struct Faculty; } diff --git a/src/models/faculty/postgre.hpp b/src/legacy/models/faculty/postgre.hpp similarity index 65% rename from src/models/faculty/postgre.hpp rename to src/legacy/models/faculty/postgre.hpp index 8fed8d36..20da2fe7 100644 --- a/src/models/faculty/postgre.hpp +++ b/src/legacy/models/faculty/postgre.hpp @@ -1,17 +1,17 @@ #include #include -#include "models/education_type/postgre.hpp" -#include "models/faculty/type.hpp" -namespace models +#include "legacy/models/education_type/postgre.hpp" +#include "legacy/models/faculty/type.hpp" +namespace legacy::models { using TupleFaculty = ::utils::convert::drop_properties_to_ref_const_t; -} // namespace models +} // namespace legacy::models namespace userver::storages::postgres::io { template <> -struct CppToUserPg<::models::TupleFaculty> +struct CppToUserPg<::legacy::models::TupleFaculty> { static constexpr DBTypeName postgres_name = "timetable_vsu.faculty_tuple"; }; diff --git a/src/models/faculty/type.hpp b/src/legacy/models/faculty/type.hpp similarity index 52% rename from src/models/faculty/type.hpp rename to src/legacy/models/faculty/type.hpp index 46368264..4bf8a96c 100644 --- a/src/models/faculty/type.hpp +++ b/src/legacy/models/faculty/type.hpp @@ -4,15 +4,15 @@ #include #include -#include "models/day/type.hpp" -#include "models/education_type/type.hpp" -#include "models/lesson_type/type.hpp" -#include "models/lesson_week_type/type.hpp" -#include "models/subgroup/type.hpp" -#include "models/substring/type.hpp" -#include "models/timestring/type.hpp" +#include "legacy/models/day/type.hpp" +#include "legacy/models/education_type/type.hpp" +#include "legacy/models/lesson_type/type.hpp" +#include "legacy/models/lesson_week_type/type.hpp" +#include "legacy/models/subgroup/type.hpp" +#include "legacy/models/substring/type.hpp" +#include "legacy/models/timestring/type.hpp" -namespace models +namespace legacy::models { namespace convert = utils::convert; struct Faculty @@ -22,4 +22,4 @@ struct Faculty static constexpr utils::convert::PolicyFields kPolicyFields = utils::convert::PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/models/faculty_filter/fwd.hpp b/src/legacy/models/faculty_filter/fwd.hpp similarity index 61% rename from src/models/faculty_filter/fwd.hpp rename to src/legacy/models/faculty_filter/fwd.hpp index 69829d75..bb3afd3c 100644 --- a/src/models/faculty_filter/fwd.hpp +++ b/src/legacy/models/faculty_filter/fwd.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { struct FacultyFilter; } diff --git a/src/models/faculty_filter/postgre.hpp b/src/legacy/models/faculty_filter/postgre.hpp similarity index 65% rename from src/models/faculty_filter/postgre.hpp rename to src/legacy/models/faculty_filter/postgre.hpp index dd596b29..f1bced56 100644 --- a/src/models/faculty_filter/postgre.hpp +++ b/src/legacy/models/faculty_filter/postgre.hpp @@ -1,18 +1,18 @@ #include #include -#include "models/education_type/postgre.hpp" -#include "models/faculty_filter/type.hpp" -namespace models +#include "legacy/models/education_type/postgre.hpp" +#include "legacy/models/faculty_filter/type.hpp" +namespace legacy::models { using TupleFacultyFilter = ::utils::convert::drop_properties_to_ref_const_t; -} // namespace models +} // namespace legacy::models namespace userver::storages::postgres::io { template <> -struct CppToUserPg<::models::TupleFacultyFilter> +struct CppToUserPg<::legacy::models::TupleFacultyFilter> { static constexpr DBTypeName postgres_name = "timetable_vsu.faculty_filter"; }; diff --git a/src/models/faculty_filter/type.hpp b/src/legacy/models/faculty_filter/type.hpp similarity index 54% rename from src/models/faculty_filter/type.hpp rename to src/legacy/models/faculty_filter/type.hpp index 070f6748..7f4a9b6d 100644 --- a/src/models/faculty_filter/type.hpp +++ b/src/legacy/models/faculty_filter/type.hpp @@ -4,15 +4,15 @@ #include #include -#include "models/day/type.hpp" -#include "models/education_type/type.hpp" -#include "models/lesson_type/type.hpp" -#include "models/lesson_week_type/type.hpp" -#include "models/subgroup/type.hpp" -#include "models/substring/type.hpp" -#include "models/timestring/type.hpp" +#include "legacy/models/day/type.hpp" +#include "legacy/models/education_type/type.hpp" +#include "legacy/models/lesson_type/type.hpp" +#include "legacy/models/lesson_week_type/type.hpp" +#include "legacy/models/subgroup/type.hpp" +#include "legacy/models/substring/type.hpp" +#include "legacy/models/timestring/type.hpp" -namespace models +namespace legacy::models { namespace convert = utils::convert; struct FacultyFilter @@ -22,4 +22,4 @@ struct FacultyFilter static constexpr utils::convert::PolicyFields kPolicyFields = utils::convert::PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/models/group_stage/fwd.hpp b/src/legacy/models/group_stage/fwd.hpp similarity index 59% rename from src/models/group_stage/fwd.hpp rename to src/legacy/models/group_stage/fwd.hpp index 5aad3746..1fd7629a 100644 --- a/src/models/group_stage/fwd.hpp +++ b/src/legacy/models/group_stage/fwd.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { struct GroupStage; } diff --git a/src/models/group_stage/postgre.hpp b/src/legacy/models/group_stage/postgre.hpp similarity index 65% rename from src/models/group_stage/postgre.hpp rename to src/legacy/models/group_stage/postgre.hpp index 9a445e4d..f10b7cc2 100644 --- a/src/models/group_stage/postgre.hpp +++ b/src/legacy/models/group_stage/postgre.hpp @@ -1,18 +1,18 @@ #include #include -#include "models/education_type/postgre.hpp" -#include "models/group_stage/type.hpp" -namespace models +#include "legacy/models/education_type/postgre.hpp" +#include "legacy/models/group_stage/type.hpp" +namespace legacy::models { using TupleGroupStage = ::utils::convert::drop_properties_to_ref_const_t; -} // namespace models +} // namespace legacy::models namespace userver::storages::postgres::io { template <> -struct CppToUserPg<::models::TupleGroupStage> +struct CppToUserPg<::legacy::models::TupleGroupStage> { static constexpr DBTypeName postgres_name = "timetable_vsu.group_stage_tuple"; diff --git a/src/models/group_stage/type.hpp b/src/legacy/models/group_stage/type.hpp similarity index 72% rename from src/models/group_stage/type.hpp rename to src/legacy/models/group_stage/type.hpp index 28bb8251..ef0e4a50 100644 --- a/src/models/group_stage/type.hpp +++ b/src/legacy/models/group_stage/type.hpp @@ -6,15 +6,15 @@ #include #include -#include "models/day/type.hpp" -#include "models/education_type/type.hpp" -#include "models/lesson_type/type.hpp" -#include "models/lesson_week_type/type.hpp" -#include "models/subgroup/type.hpp" -#include "models/substring/type.hpp" -#include "models/timestring/type.hpp" +#include "legacy/models/day/type.hpp" +#include "legacy/models/education_type/type.hpp" +#include "legacy/models/lesson_type/type.hpp" +#include "legacy/models/lesson_week_type/type.hpp" +#include "legacy/models/subgroup/type.hpp" +#include "legacy/models/substring/type.hpp" +#include "legacy/models/timestring/type.hpp" -namespace models +namespace legacy::models { namespace convert = utils::convert; struct GroupStage @@ -31,4 +31,4 @@ struct GroupStage static constexpr utils::convert::PolicyFields kPolicyFields = utils::convert::PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/models/group_stage_filter/fwd.hpp b/src/legacy/models/group_stage_filter/fwd.hpp similarity index 63% rename from src/models/group_stage_filter/fwd.hpp rename to src/legacy/models/group_stage_filter/fwd.hpp index e7a8aee8..c59f5736 100644 --- a/src/models/group_stage_filter/fwd.hpp +++ b/src/legacy/models/group_stage_filter/fwd.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { struct GroupStageFilter; } diff --git a/src/models/group_stage_filter/postgre.hpp b/src/legacy/models/group_stage_filter/postgre.hpp similarity index 65% rename from src/models/group_stage_filter/postgre.hpp rename to src/legacy/models/group_stage_filter/postgre.hpp index 792611db..566561f3 100644 --- a/src/models/group_stage_filter/postgre.hpp +++ b/src/legacy/models/group_stage_filter/postgre.hpp @@ -1,18 +1,18 @@ #include #include -#include "models/education_type/postgre.hpp" -#include "models/group_stage_filter/type.hpp" -namespace models +#include "legacy/models/education_type/postgre.hpp" +#include "legacy/models/group_stage_filter/type.hpp" +namespace legacy::models { using TupleGroupStageFilter = ::utils::convert::drop_properties_to_ref_const_t; -} // namespace models +} // namespace legacy::models namespace userver::storages::postgres::io { template <> -struct CppToUserPg<::models::TupleGroupStageFilter> +struct CppToUserPg<::legacy::models::TupleGroupStageFilter> { static constexpr DBTypeName postgres_name = "timetable_vsu.group_stage_filter"; diff --git a/src/models/group_stage_filter/type.hpp b/src/legacy/models/group_stage_filter/type.hpp similarity index 74% rename from src/models/group_stage_filter/type.hpp rename to src/legacy/models/group_stage_filter/type.hpp index 2e2fa187..806da590 100644 --- a/src/models/group_stage_filter/type.hpp +++ b/src/legacy/models/group_stage_filter/type.hpp @@ -5,15 +5,15 @@ #include #include -#include "models/day/type.hpp" -#include "models/education_type/type.hpp" -#include "models/lesson_type/type.hpp" -#include "models/lesson_week_type/type.hpp" -#include "models/subgroup/type.hpp" -#include "models/substring/type.hpp" -#include "models/timestring/type.hpp" +#include "legacy/models/day/type.hpp" +#include "legacy/models/education_type/type.hpp" +#include "legacy/models/lesson_type/type.hpp" +#include "legacy/models/lesson_week_type/type.hpp" +#include "legacy/models/subgroup/type.hpp" +#include "legacy/models/substring/type.hpp" +#include "legacy/models/timestring/type.hpp" -namespace models +namespace legacy::models { namespace convert = utils::convert; struct GroupStageFilter @@ -33,4 +33,4 @@ struct GroupStageFilter static constexpr utils::convert::PolicyFields kPolicyFields = utils::convert::PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/models/lesson_filter/fwd.hpp b/src/legacy/models/lesson_filter/fwd.hpp similarity index 60% rename from src/models/lesson_filter/fwd.hpp rename to src/legacy/models/lesson_filter/fwd.hpp index 747b3419..dcc6eaa3 100644 --- a/src/models/lesson_filter/fwd.hpp +++ b/src/legacy/models/lesson_filter/fwd.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { struct LessonFilter; } diff --git a/src/models/lesson_filter/postgre.hpp b/src/legacy/models/lesson_filter/postgre.hpp similarity index 65% rename from src/models/lesson_filter/postgre.hpp rename to src/legacy/models/lesson_filter/postgre.hpp index c65d000c..de1ab6d3 100644 --- a/src/models/lesson_filter/postgre.hpp +++ b/src/legacy/models/lesson_filter/postgre.hpp @@ -1,18 +1,18 @@ #include #include -#include "models/education_type/postgre.hpp" -#include "models/lesson_filter/type.hpp" -namespace models +#include "legacy/models/education_type/postgre.hpp" +#include "legacy/models/lesson_filter/type.hpp" +namespace legacy::models { using TupleLessonFilter = ::utils::convert::drop_properties_to_ref_const_t; -} // namespace models +} // namespace legacy::models namespace userver::storages::postgres::io { template <> -struct CppToUserPg<::models::TupleLessonFilter> +struct CppToUserPg<::legacy::models::TupleLessonFilter> { static constexpr DBTypeName postgres_name = "timetable_vsu.lesson_filter_v2"; diff --git a/src/models/lesson_filter/type.hpp b/src/legacy/models/lesson_filter/type.hpp similarity index 80% rename from src/models/lesson_filter/type.hpp rename to src/legacy/models/lesson_filter/type.hpp index ca88bb68..8fe57c71 100644 --- a/src/models/lesson_filter/type.hpp +++ b/src/legacy/models/lesson_filter/type.hpp @@ -4,15 +4,15 @@ #include #include -#include "models/day/type.hpp" -#include "models/education_type/type.hpp" -#include "models/lesson_type/type.hpp" -#include "models/lesson_week_type/type.hpp" -#include "models/subgroup/type.hpp" -#include "models/substring/type.hpp" -#include "models/timestring/type.hpp" +#include "legacy/models/day/type.hpp" +#include "legacy/models/education_type/type.hpp" +#include "legacy/models/lesson_type/type.hpp" +#include "legacy/models/lesson_week_type/type.hpp" +#include "legacy/models/subgroup/type.hpp" +#include "legacy/models/substring/type.hpp" +#include "legacy/models/timestring/type.hpp" -namespace models +namespace legacy::models { namespace convert = utils::convert; struct LessonFilter @@ -29,7 +29,7 @@ struct LessonFilter convert::OptionalArrayProperty group_ids; convert::OptionalArrayProperty group_names; convert::OptionalArrayProperty group_courses; - convert::OptionalArrayProperty + convert::OptionalArrayProperty group_types; convert::OptionalArrayProperty room_ids; convert::OptionalArrayProperty room_names; @@ -45,4 +45,4 @@ struct LessonFilter static constexpr utils::convert::PolicyFields kPolicyFields = utils::convert::PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/legacy/models/lesson_type/all.hpp b/src/legacy/models/lesson_type/all.hpp new file mode 100644 index 00000000..34ba8eda --- /dev/null +++ b/src/legacy/models/lesson_type/all.hpp @@ -0,0 +1,4 @@ +#pragma once +#include "legacy/models/lesson_type/parse.hpp" +#include "legacy/models/lesson_type/postgre.hpp" +#include "legacy/models/lesson_type/serialize.hpp" diff --git a/src/models/lesson_type/parse.cpp b/src/legacy/models/lesson_type/parse.cpp similarity index 94% rename from src/models/lesson_type/parse.cpp rename to src/legacy/models/lesson_type/parse.cpp index 887a2c35..8730e129 100644 --- a/src/models/lesson_type/parse.cpp +++ b/src/legacy/models/lesson_type/parse.cpp @@ -8,7 +8,7 @@ #include "type.hpp" -namespace models +namespace legacy::models { LessonType Parse(std::string_view str, userver::formats::parse::To) { @@ -40,4 +40,4 @@ LessonType Parse(const userver::formats::json::Value& value, return Parse(std::string_view{raw_value}, userver::formats::parse::To{}); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/lesson_type/parse.hpp b/src/legacy/models/lesson_type/parse.hpp similarity index 85% rename from src/models/lesson_type/parse.hpp rename to src/legacy/models/lesson_type/parse.hpp index 155cedb8..2fdcb14c 100644 --- a/src/models/lesson_type/parse.hpp +++ b/src/legacy/models/lesson_type/parse.hpp @@ -5,9 +5,9 @@ #include "type.hpp" -namespace models +namespace legacy::models { LessonType Parse(std::string_view str, userver::formats::parse::To); LessonType Parse(const userver::formats::json::Value& value, userver::formats::parse::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/lesson_type/postgre.hpp b/src/legacy/models/lesson_type/postgre.hpp similarity index 95% rename from src/models/lesson_type/postgre.hpp rename to src/legacy/models/lesson_type/postgre.hpp index 0c9e4ec6..efbe9a65 100644 --- a/src/models/lesson_type/postgre.hpp +++ b/src/legacy/models/lesson_type/postgre.hpp @@ -7,7 +7,7 @@ namespace userver::storages::postgres::io { -using ::models::LessonType; +using ::legacy::models::LessonType; template <> struct CppToUserPg : EnumMappingBase { diff --git a/src/models/lesson_type/serialize.cpp b/src/legacy/models/lesson_type/serialize.cpp similarity index 92% rename from src/models/lesson_type/serialize.cpp rename to src/legacy/models/lesson_type/serialize.cpp index 416d8cdd..731e8394 100644 --- a/src/models/lesson_type/serialize.cpp +++ b/src/legacy/models/lesson_type/serialize.cpp @@ -2,7 +2,7 @@ #include -namespace models +namespace legacy::models { std::string Serialize(const LessonType& value, userver::formats::serialize::To) @@ -25,4 +25,4 @@ userver::formats::json::Value Serialize( Serialize(value, userver::formats::serialize::To{}); return userver::formats::json::ValueBuilder(str).ExtractValue(); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/lesson_type/serialize.hpp b/src/legacy/models/lesson_type/serialize.hpp similarity index 85% rename from src/models/lesson_type/serialize.hpp rename to src/legacy/models/lesson_type/serialize.hpp index ccf13bbc..d7fa19d2 100644 --- a/src/models/lesson_type/serialize.hpp +++ b/src/legacy/models/lesson_type/serialize.hpp @@ -3,11 +3,11 @@ #include "type.hpp" -namespace models +namespace legacy::models { userver::formats::json::Value Serialize( const LessonType& value, userver::formats::serialize::To); std::string Serialize(const LessonType& value, userver::formats::serialize::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/lesson_type/type.hpp b/src/legacy/models/lesson_type/type.hpp similarity index 78% rename from src/models/lesson_type/type.hpp rename to src/legacy/models/lesson_type/type.hpp index dae464e2..b57888e8 100644 --- a/src/models/lesson_type/type.hpp +++ b/src/legacy/models/lesson_type/type.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { enum struct LessonType { diff --git a/src/legacy/models/lesson_v1/parse.hpp b/src/legacy/models/lesson_v1/parse.hpp new file mode 100644 index 00000000..aec56f4e --- /dev/null +++ b/src/legacy/models/lesson_v1/parse.hpp @@ -0,0 +1,8 @@ +#pragma once +#include "legacy/models/day/parse.hpp" +#include "legacy/models/education_type/parse.hpp" +#include "legacy/models/lesson_type/parse.hpp" +#include "legacy/models/lesson_week_type/parse.hpp" +#include "legacy/models/subgroup/parse.hpp" +#include "legacy/models/timestring/parse.hpp" +#include "type.hpp" diff --git a/src/legacy/models/lesson_v1/postgre.hpp b/src/legacy/models/lesson_v1/postgre.hpp new file mode 100644 index 00000000..dbad21bf --- /dev/null +++ b/src/legacy/models/lesson_v1/postgre.hpp @@ -0,0 +1,14 @@ +#include +#include + +#include "legacy/models/day/postgre.hpp" +#include "legacy/models/education_type/postgre.hpp" +#include "legacy/models/lesson_type/postgre.hpp" +#include "legacy/models/lesson_v1/type.hpp" +#include "legacy/models/lesson_week_type/postgre.hpp" +#include "legacy/models/subgroup/postgre.hpp" +#include "legacy/models/timestring/postgre.hpp" +namespace legacy::models +{ +using TupleLessonV1 = ::utils::convert::drop_properties_to_ref_mut_t; +} diff --git a/src/legacy/models/lesson_v1/serialize.hpp b/src/legacy/models/lesson_v1/serialize.hpp new file mode 100644 index 00000000..12af7fc9 --- /dev/null +++ b/src/legacy/models/lesson_v1/serialize.hpp @@ -0,0 +1,8 @@ +#pragma once +#include "legacy/models/day/serialize.hpp" +#include "legacy/models/education_type/serialize.hpp" +#include "legacy/models/lesson_type/serialize.hpp" +#include "legacy/models/lesson_week_type/serialize.hpp" +#include "legacy/models/subgroup/serialize.hpp" +#include "legacy/models/timestring/serialize.hpp" +#include "type.hpp" diff --git a/src/models/lesson_v1/type.hpp b/src/legacy/models/lesson_v1/type.hpp similarity index 84% rename from src/models/lesson_v1/type.hpp rename to src/legacy/models/lesson_v1/type.hpp index 6ef061f3..fbb19415 100644 --- a/src/models/lesson_v1/type.hpp +++ b/src/legacy/models/lesson_v1/type.hpp @@ -3,16 +3,16 @@ #include #include -#include "models/day/type.hpp" -#include "models/education_type/type.hpp" -#include "models/lesson_type/type.hpp" -#include "models/lesson_week_type/type.hpp" -#include "models/subgroup/type.hpp" -#include "models/timestring/type.hpp" +#include "legacy/models/day/type.hpp" +#include "legacy/models/education_type/type.hpp" +#include "legacy/models/lesson_type/type.hpp" +#include "legacy/models/lesson_week_type/type.hpp" +#include "legacy/models/subgroup/type.hpp" +#include "legacy/models/timestring/type.hpp" namespace convert = ::utils::convert; -namespace models +namespace legacy::models { //Пара со всей дополнительной информацией struct LessonV1 @@ -43,4 +43,4 @@ struct LessonV1 static constexpr utils::convert::PolicyFields kPolicyFields = utils::convert::PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/legacy/models/lesson_week_type/all.hpp b/src/legacy/models/lesson_week_type/all.hpp new file mode 100644 index 00000000..745275b9 --- /dev/null +++ b/src/legacy/models/lesson_week_type/all.hpp @@ -0,0 +1,4 @@ +#pragma once +#include "legacy/models/lesson_week_type/parse.hpp" +#include "legacy/models/lesson_week_type/postgre.hpp" +#include "legacy/models/lesson_week_type/serialize.hpp" diff --git a/src/models/lesson_week_type/parse.cpp b/src/legacy/models/lesson_week_type/parse.cpp similarity index 94% rename from src/models/lesson_week_type/parse.cpp rename to src/legacy/models/lesson_week_type/parse.cpp index 5588b9b9..82b10b04 100644 --- a/src/models/lesson_week_type/parse.cpp +++ b/src/legacy/models/lesson_week_type/parse.cpp @@ -8,7 +8,7 @@ #include "type.hpp" -namespace models +namespace legacy::models { LessonWeekType Parse(std::string_view str, userver::formats::parse::To) @@ -40,4 +40,4 @@ LessonWeekType Parse(const userver::formats::json::Value& value, auto raw_value = value.As(); return Parse(raw_value, userver::formats::parse::To{}); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/lesson_week_type/parse.hpp b/src/legacy/models/lesson_week_type/parse.hpp similarity index 87% rename from src/models/lesson_week_type/parse.hpp rename to src/legacy/models/lesson_week_type/parse.hpp index e4598177..880d7ad7 100644 --- a/src/models/lesson_week_type/parse.hpp +++ b/src/legacy/models/lesson_week_type/parse.hpp @@ -5,10 +5,10 @@ #include "type.hpp" -namespace models +namespace legacy::models { LessonWeekType Parse(std::string_view str, userver::formats::parse::To); LessonWeekType Parse(const userver::formats::json::Value& value, userver::formats::parse::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/lesson_week_type/postgre.hpp b/src/legacy/models/lesson_week_type/postgre.hpp similarity index 95% rename from src/models/lesson_week_type/postgre.hpp rename to src/legacy/models/lesson_week_type/postgre.hpp index 69e2c495..603f667a 100644 --- a/src/models/lesson_week_type/postgre.hpp +++ b/src/legacy/models/lesson_week_type/postgre.hpp @@ -7,7 +7,7 @@ namespace userver::storages::postgres::io { -using ::models::LessonWeekType; +using ::legacy::models::LessonWeekType; template <> struct CppToUserPg : EnumMappingBase { diff --git a/src/models/lesson_week_type/serialize.cpp b/src/legacy/models/lesson_week_type/serialize.cpp similarity index 92% rename from src/models/lesson_week_type/serialize.cpp rename to src/legacy/models/lesson_week_type/serialize.cpp index fd465ed1..36910dfe 100644 --- a/src/models/lesson_week_type/serialize.cpp +++ b/src/legacy/models/lesson_week_type/serialize.cpp @@ -2,7 +2,7 @@ #include -namespace models +namespace legacy::models { std::string Serialize(const LessonWeekType& value, userver::formats::serialize::To) @@ -25,4 +25,4 @@ userver::formats::json::Value Serialize( Serialize(value, userver::formats::serialize::To{}); return userver::formats::json::ValueBuilder(str).ExtractValue(); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/lesson_week_type/serialize.hpp b/src/legacy/models/lesson_week_type/serialize.hpp similarity index 85% rename from src/models/lesson_week_type/serialize.hpp rename to src/legacy/models/lesson_week_type/serialize.hpp index 02971420..9b32730f 100644 --- a/src/models/lesson_week_type/serialize.hpp +++ b/src/legacy/models/lesson_week_type/serialize.hpp @@ -3,11 +3,11 @@ #include "type.hpp" -namespace models +namespace legacy::models { userver::formats::json::Value Serialize( const LessonWeekType& value, userver::formats::serialize::To); std::string Serialize(const LessonWeekType& value, userver::formats::serialize::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/lesson_week_type/type.hpp b/src/legacy/models/lesson_week_type/type.hpp similarity index 76% rename from src/models/lesson_week_type/type.hpp rename to src/legacy/models/lesson_week_type/type.hpp index fad4c1ae..823764ac 100644 --- a/src/models/lesson_week_type/type.hpp +++ b/src/legacy/models/lesson_week_type/type.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { enum struct LessonWeekType { diff --git a/src/models/register_request/fwd.hpp b/src/legacy/models/register_request/fwd.hpp similarity index 62% rename from src/models/register_request/fwd.hpp rename to src/legacy/models/register_request/fwd.hpp index ba928e39..7ac35a5c 100644 --- a/src/models/register_request/fwd.hpp +++ b/src/legacy/models/register_request/fwd.hpp @@ -1,5 +1,5 @@ #pragma once -namespace models +namespace legacy::models { struct RegisterRequest; } diff --git a/src/models/register_request/type.hpp b/src/legacy/models/register_request/type.hpp similarity index 72% rename from src/models/register_request/type.hpp rename to src/legacy/models/register_request/type.hpp index 8be53826..03107128 100644 --- a/src/models/register_request/type.hpp +++ b/src/legacy/models/register_request/type.hpp @@ -4,14 +4,14 @@ #include #include -#include "models/user_credentials/type.hpp" -#include "models/user_type/type.hpp" -namespace models +#include "legacy/models/user_credentials/type.hpp" +#include "legacy/models/user_type/type.hpp" +namespace legacy::models { using namespace utils::convert; struct RegisterRequest { - Property user_credentials; + Property user_credentials; OptionalProperty description; OptionalProperty desired_type; static constexpr TypeOfBody kTypeOfBody = @@ -19,4 +19,4 @@ struct RegisterRequest //запрос static constexpr PolicyFields kPolicyFields = PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/models/request_privileges/fwd.hpp b/src/legacy/models/request_privileges/fwd.hpp similarity index 63% rename from src/models/request_privileges/fwd.hpp rename to src/legacy/models/request_privileges/fwd.hpp index 8564c98d..38a02c3a 100644 --- a/src/models/request_privileges/fwd.hpp +++ b/src/legacy/models/request_privileges/fwd.hpp @@ -1,5 +1,5 @@ #pragma once -namespace models +namespace legacy::models { struct RequestPrivileges; } diff --git a/src/models/request_privileges/type.hpp b/src/legacy/models/request_privileges/type.hpp similarity index 88% rename from src/models/request_privileges/type.hpp rename to src/legacy/models/request_privileges/type.hpp index 709c2331..cb436d84 100644 --- a/src/models/request_privileges/type.hpp +++ b/src/legacy/models/request_privileges/type.hpp @@ -1,7 +1,7 @@ #pragma once #include #include -namespace models +namespace legacy::models { struct RequestPrivileges { @@ -11,4 +11,4 @@ struct RequestPrivileges static constexpr utils::convert::PolicyFields kPolicyFields = utils::convert::PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/legacy/models/subgroup/all.hpp b/src/legacy/models/subgroup/all.hpp new file mode 100644 index 00000000..80b02848 --- /dev/null +++ b/src/legacy/models/subgroup/all.hpp @@ -0,0 +1,4 @@ +#pragma once +#include "legacy/models/subgroup/parse.hpp" +#include "legacy/models/subgroup/postgre.hpp" +#include "legacy/models/subgroup/serialize.hpp" diff --git a/src/models/subgroup/parse.cpp b/src/legacy/models/subgroup/parse.cpp similarity index 94% rename from src/models/subgroup/parse.cpp rename to src/legacy/models/subgroup/parse.cpp index 4ba2399b..048413b5 100644 --- a/src/models/subgroup/parse.cpp +++ b/src/legacy/models/subgroup/parse.cpp @@ -8,7 +8,7 @@ #include "type.hpp" -namespace models +namespace legacy::models { Subgroup Parse(std::string_view str, userver::formats::parse::To) { @@ -39,4 +39,4 @@ Subgroup Parse(const userver::formats::json::Value& value, auto raw_value = value.As(); return Parse(raw_value, userver::formats::parse::To{}); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/subgroup/parse.hpp b/src/legacy/models/subgroup/parse.hpp similarity index 85% rename from src/models/subgroup/parse.hpp rename to src/legacy/models/subgroup/parse.hpp index 93ac56a6..4e9ed3fc 100644 --- a/src/models/subgroup/parse.hpp +++ b/src/legacy/models/subgroup/parse.hpp @@ -5,9 +5,9 @@ #include "type.hpp" -namespace models +namespace legacy::models { Subgroup Parse(std::string_view str, userver::formats::parse::To); Subgroup Parse(const userver::formats::json::Value& value, userver::formats::parse::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/subgroup/postgre.hpp b/src/legacy/models/subgroup/postgre.hpp similarity index 95% rename from src/models/subgroup/postgre.hpp rename to src/legacy/models/subgroup/postgre.hpp index 2e47d943..3875a861 100644 --- a/src/models/subgroup/postgre.hpp +++ b/src/legacy/models/subgroup/postgre.hpp @@ -7,7 +7,7 @@ namespace userver::storages::postgres::io { -using ::models::Subgroup; +using ::legacy::models::Subgroup; template <> struct CppToUserPg : EnumMappingBase { diff --git a/src/models/subgroup/serialize.cpp b/src/legacy/models/subgroup/serialize.cpp similarity index 92% rename from src/models/subgroup/serialize.cpp rename to src/legacy/models/subgroup/serialize.cpp index 1fdd5918..2f2b9620 100644 --- a/src/models/subgroup/serialize.cpp +++ b/src/legacy/models/subgroup/serialize.cpp @@ -2,7 +2,7 @@ #include -namespace models +namespace legacy::models { std::string Serialize(const Subgroup& value, userver::formats::serialize::To) @@ -25,4 +25,4 @@ userver::formats::json::Value Serialize( Serialize(value, userver::formats::serialize::To{}); return userver::formats::json::ValueBuilder(str).ExtractValue(); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/subgroup/serialize.hpp b/src/legacy/models/subgroup/serialize.hpp similarity index 85% rename from src/models/subgroup/serialize.hpp rename to src/legacy/models/subgroup/serialize.hpp index bc23d4b9..ea554e9d 100644 --- a/src/models/subgroup/serialize.hpp +++ b/src/legacy/models/subgroup/serialize.hpp @@ -3,11 +3,11 @@ #include "type.hpp" -namespace models +namespace legacy::models { userver::formats::json::Value Serialize( const Subgroup& value, userver::formats::serialize::To); std::string Serialize(const Subgroup& value, userver::formats::serialize::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/subgroup/type.hpp b/src/legacy/models/subgroup/type.hpp similarity index 75% rename from src/models/subgroup/type.hpp rename to src/legacy/models/subgroup/type.hpp index 388e7c29..f668bca4 100644 --- a/src/models/subgroup/type.hpp +++ b/src/legacy/models/subgroup/type.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { enum struct Subgroup { diff --git a/src/legacy/models/substring/all.hpp b/src/legacy/models/substring/all.hpp new file mode 100644 index 00000000..1784e558 --- /dev/null +++ b/src/legacy/models/substring/all.hpp @@ -0,0 +1,4 @@ +#pragma once +#include "legacy/models/substring/parse.hpp" +#include "legacy/models/substring/postgre.hpp" +#include "legacy/models/substring/serialize.hpp" diff --git a/src/models/substring/fwd.hpp b/src/legacy/models/substring/fwd.hpp similarity index 58% rename from src/models/substring/fwd.hpp rename to src/legacy/models/substring/fwd.hpp index 1650d757..030b332e 100644 --- a/src/models/substring/fwd.hpp +++ b/src/legacy/models/substring/fwd.hpp @@ -1,5 +1,5 @@ #pragma once -namespace models +namespace legacy::models { struct SubString; } diff --git a/src/models/substring/parse.cpp b/src/legacy/models/substring/parse.cpp similarity index 93% rename from src/models/substring/parse.cpp rename to src/legacy/models/substring/parse.cpp index a559267c..22f8109f 100644 --- a/src/models/substring/parse.cpp +++ b/src/legacy/models/substring/parse.cpp @@ -9,7 +9,7 @@ #include "type.hpp" -namespace models +namespace legacy::models { SubString Parse(const std::string& str, userver::formats::parse::To) { @@ -29,4 +29,4 @@ SubString Parse(const userver::formats::json::Value& value, auto raw_value = value.As(); return Parse(raw_value, userver::formats::parse::To{}); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/substring/parse.hpp b/src/legacy/models/substring/parse.hpp similarity index 85% rename from src/models/substring/parse.hpp rename to src/legacy/models/substring/parse.hpp index 632ed933..b0dcb48f 100644 --- a/src/models/substring/parse.hpp +++ b/src/legacy/models/substring/parse.hpp @@ -5,9 +5,9 @@ #include "type.hpp" -namespace models +namespace legacy::models { SubString Parse(const std::string& str, userver::formats::parse::To); SubString Parse(const userver::formats::json::Value& value, userver::formats::parse::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/substring/postgre.hpp b/src/legacy/models/substring/postgre.hpp similarity index 90% rename from src/models/substring/postgre.hpp rename to src/legacy/models/substring/postgre.hpp index 538f7ea3..0facfacd 100644 --- a/src/models/substring/postgre.hpp +++ b/src/legacy/models/substring/postgre.hpp @@ -6,7 +6,7 @@ namespace userver::storages::postgres::io { -using ::models::SubString; +using ::legacy::models::SubString; template <> struct CppToSystemPg : PredefinedOid { diff --git a/src/models/substring/serialize.cpp b/src/legacy/models/substring/serialize.cpp similarity index 91% rename from src/models/substring/serialize.cpp rename to src/legacy/models/substring/serialize.cpp index 9a30dcc2..48c2670e 100644 --- a/src/models/substring/serialize.cpp +++ b/src/legacy/models/substring/serialize.cpp @@ -3,7 +3,7 @@ #include #include -namespace models +namespace legacy::models { std::string Serialize(const SubString& value, userver::formats::serialize::To) @@ -18,4 +18,4 @@ userver::formats::json::Value Serialize( Serialize(value, userver::formats::serialize::To{}); return userver::formats::json::ValueBuilder(str).ExtractValue(); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/substring/serialize.hpp b/src/legacy/models/substring/serialize.hpp similarity index 85% rename from src/models/substring/serialize.hpp rename to src/legacy/models/substring/serialize.hpp index c5ccdad1..daa8f5de 100644 --- a/src/models/substring/serialize.hpp +++ b/src/legacy/models/substring/serialize.hpp @@ -3,11 +3,11 @@ #include "type.hpp" -namespace models +namespace legacy::models { userver::formats::json::Value Serialize( const SubString& value, userver::formats::serialize::To); std::string Serialize(const SubString& value, userver::formats::serialize::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/substring/type.hpp b/src/legacy/models/substring/type.hpp similarity index 86% rename from src/models/substring/type.hpp rename to src/legacy/models/substring/type.hpp index 5c9c8961..38c2a33a 100644 --- a/src/models/substring/type.hpp +++ b/src/legacy/models/substring/type.hpp @@ -1,10 +1,10 @@ #pragma once #include #include -namespace models +namespace legacy::models { //расставляет % с обоих сторон строки, чтобы запросы в постгресе с //использованием ILIKE работали как поиск подстроки using SubString = userver::utils::StrongTypedef; -} // namespace models +} // namespace legacy::models diff --git a/src/legacy/models/teacher/parse.hpp b/src/legacy/models/teacher/parse.hpp new file mode 100644 index 00000000..70f26430 --- /dev/null +++ b/src/legacy/models/teacher/parse.hpp @@ -0,0 +1,2 @@ +#pragma once +#include "legacy/models/user_type/parse.hpp" diff --git a/src/models/teacher/postgre.hpp b/src/legacy/models/teacher/postgre.hpp similarity index 73% rename from src/models/teacher/postgre.hpp rename to src/legacy/models/teacher/postgre.hpp index 38c53677..bd84eab5 100644 --- a/src/models/teacher/postgre.hpp +++ b/src/legacy/models/teacher/postgre.hpp @@ -3,18 +3,18 @@ #include #include -#include "models/teacher/type.hpp" -namespace models +#include "legacy/models/teacher/type.hpp" +namespace legacy::models { using ConstTupleTeacher = ::utils::convert::drop_properties_to_ref_const_t; -} // namespace models +} // namespace legacy::models namespace userver::storages::postgres::io { template <> -struct CppToUserPg<::models::ConstTupleTeacher> +struct CppToUserPg<::legacy::models::ConstTupleTeacher> { static constexpr DBTypeName postgres_name = "timetable_vsu.teacher_filter"; }; diff --git a/src/models/teacher/serialize.hpp b/src/legacy/models/teacher/serialize.hpp similarity index 100% rename from src/models/teacher/serialize.hpp rename to src/legacy/models/teacher/serialize.hpp diff --git a/src/models/teacher/type.hpp b/src/legacy/models/teacher/type.hpp similarity index 87% rename from src/models/teacher/type.hpp rename to src/legacy/models/teacher/type.hpp index 86e00cb9..3a61bd90 100644 --- a/src/models/teacher/type.hpp +++ b/src/legacy/models/teacher/type.hpp @@ -3,9 +3,9 @@ #include #include -#include "models/user_type/type.hpp" +#include "legacy/models/user_type/type.hpp" -namespace models +namespace legacy::models { namespace convert = utils::convert; struct Teacher @@ -20,4 +20,4 @@ struct Teacher static constexpr convert::PolicyFields kPolicyFields = convert::PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/models/teacher_filter/fwd.hpp b/src/legacy/models/teacher_filter/fwd.hpp similarity index 61% rename from src/models/teacher_filter/fwd.hpp rename to src/legacy/models/teacher_filter/fwd.hpp index 17441c95..48bbda36 100644 --- a/src/models/teacher_filter/fwd.hpp +++ b/src/legacy/models/teacher_filter/fwd.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { struct TeacherFilter; } diff --git a/src/models/teacher_filter/postgre.hpp b/src/legacy/models/teacher_filter/postgre.hpp similarity index 65% rename from src/models/teacher_filter/postgre.hpp rename to src/legacy/models/teacher_filter/postgre.hpp index 67110089..4f61a409 100644 --- a/src/models/teacher_filter/postgre.hpp +++ b/src/legacy/models/teacher_filter/postgre.hpp @@ -1,18 +1,18 @@ #include #include -#include "models/education_type/postgre.hpp" -#include "models/teacher_filter/type.hpp" -namespace models +#include "legacy/models/education_type/postgre.hpp" +#include "legacy/models/teacher_filter/type.hpp" +namespace legacy::models { using TupleTeacherFilter = ::utils::convert::drop_properties_to_ref_const_t; -} // namespace models +} // namespace legacy::models namespace userver::storages::postgres::io { template <> -struct CppToUserPg<::models::TupleTeacherFilter> +struct CppToUserPg<::legacy::models::TupleTeacherFilter> { static constexpr DBTypeName postgres_name = "timetable_vsu.teacher_filter"; }; diff --git a/src/models/teacher_filter/type.hpp b/src/legacy/models/teacher_filter/type.hpp similarity index 68% rename from src/models/teacher_filter/type.hpp rename to src/legacy/models/teacher_filter/type.hpp index 670292ae..4774d001 100644 --- a/src/models/teacher_filter/type.hpp +++ b/src/legacy/models/teacher_filter/type.hpp @@ -6,16 +6,16 @@ #include #include -#include "models/day/type.hpp" -#include "models/education_type/type.hpp" -#include "models/lesson_type/type.hpp" -#include "models/lesson_week_type/type.hpp" -#include "models/subgroup/type.hpp" -#include "models/substring/postgre.hpp" -#include "models/substring/type.hpp" -#include "models/timestring/type.hpp" +#include "legacy/models/day/type.hpp" +#include "legacy/models/education_type/type.hpp" +#include "legacy/models/lesson_type/type.hpp" +#include "legacy/models/lesson_week_type/type.hpp" +#include "legacy/models/subgroup/type.hpp" +#include "legacy/models/substring/postgre.hpp" +#include "legacy/models/substring/type.hpp" +#include "legacy/models/timestring/type.hpp" -namespace models +namespace legacy::models { namespace convert = utils::convert; struct TeacherFilter @@ -31,4 +31,4 @@ struct TeacherFilter static constexpr utils::convert::PolicyFields kPolicyFields = utils::convert::PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/legacy/models/teacher_info/parse.hpp b/src/legacy/models/teacher_info/parse.hpp new file mode 100644 index 00000000..70f26430 --- /dev/null +++ b/src/legacy/models/teacher_info/parse.hpp @@ -0,0 +1,2 @@ +#pragma once +#include "legacy/models/user_type/parse.hpp" diff --git a/src/models/teacher_info/postgre.hpp b/src/legacy/models/teacher_info/postgre.hpp similarity index 72% rename from src/models/teacher_info/postgre.hpp rename to src/legacy/models/teacher_info/postgre.hpp index b1d0528e..7b60d209 100644 --- a/src/models/teacher_info/postgre.hpp +++ b/src/legacy/models/teacher_info/postgre.hpp @@ -3,18 +3,18 @@ #include #include -#include "models/teacher_info/type.hpp" -namespace models +#include "legacy/models/teacher_info/type.hpp" +namespace legacy::models { using ConstTupleTeacherInfo = ::utils::convert::drop_properties_to_ref_const_t; -} // namespace models +} // namespace legacy::models namespace userver::storages::postgres::io { template <> -struct CppToUserPg<::models::ConstTupleTeacherInfo> +struct CppToUserPg<::legacy::models::ConstTupleTeacherInfo> { static constexpr DBTypeName postgres_name = "timetable_vsu.teacher_info"; }; diff --git a/src/models/teacher_info/serialize.hpp b/src/legacy/models/teacher_info/serialize.hpp similarity index 100% rename from src/models/teacher_info/serialize.hpp rename to src/legacy/models/teacher_info/serialize.hpp diff --git a/src/models/teacher_info/type.hpp b/src/legacy/models/teacher_info/type.hpp similarity index 82% rename from src/models/teacher_info/type.hpp rename to src/legacy/models/teacher_info/type.hpp index c60384ae..15df759c 100644 --- a/src/models/teacher_info/type.hpp +++ b/src/legacy/models/teacher_info/type.hpp @@ -3,9 +3,9 @@ #include #include -#include "models/user_type/type.hpp" +#include "legacy/models/user_type/type.hpp" -namespace models +namespace legacy::models { namespace convert = utils::convert; struct TeacherInfo @@ -16,4 +16,4 @@ struct TeacherInfo static constexpr convert::PolicyFields kPolicyFields = convert::PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/legacy/models/timestring/all.hpp b/src/legacy/models/timestring/all.hpp new file mode 100644 index 00000000..9e9d7b23 --- /dev/null +++ b/src/legacy/models/timestring/all.hpp @@ -0,0 +1,4 @@ +#pragma once +#include "legacy/models/timestring/parse.hpp" +#include "legacy/models/timestring/postgre.hpp" +#include "legacy/models/timestring/serialize.hpp" diff --git a/src/models/timestring/fwd.hpp b/src/legacy/models/timestring/fwd.hpp similarity index 59% rename from src/models/timestring/fwd.hpp rename to src/legacy/models/timestring/fwd.hpp index 9da51794..80111fc1 100644 --- a/src/models/timestring/fwd.hpp +++ b/src/legacy/models/timestring/fwd.hpp @@ -1,5 +1,5 @@ #pragma once -namespace models +namespace legacy::models { struct TimeString; } diff --git a/src/models/timestring/parse.cpp b/src/legacy/models/timestring/parse.cpp similarity index 93% rename from src/models/timestring/parse.cpp rename to src/legacy/models/timestring/parse.cpp index 1866d3e2..bbafef34 100644 --- a/src/models/timestring/parse.cpp +++ b/src/legacy/models/timestring/parse.cpp @@ -8,7 +8,7 @@ #include "type.hpp" -namespace models +namespace legacy::models { TimeString Parse(const std::string& str, userver::formats::parse::To) @@ -27,4 +27,4 @@ TimeString Parse(const userver::formats::json::Value& value, auto raw_value = value.As(); return Parse(raw_value, userver::formats::parse::To{}); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/timestring/parse.hpp b/src/legacy/models/timestring/parse.hpp similarity index 86% rename from src/models/timestring/parse.hpp rename to src/legacy/models/timestring/parse.hpp index 6872da3e..76133e53 100644 --- a/src/models/timestring/parse.hpp +++ b/src/legacy/models/timestring/parse.hpp @@ -5,10 +5,10 @@ #include "type.hpp" -namespace models +namespace legacy::models { TimeString Parse(const std::string& str, userver::formats::parse::To); TimeString Parse(const userver::formats::json::Value& value, userver::formats::parse::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/timestring/postgre.hpp b/src/legacy/models/timestring/postgre.hpp similarity index 90% rename from src/models/timestring/postgre.hpp rename to src/legacy/models/timestring/postgre.hpp index 857eee7a..2d8fa9c8 100644 --- a/src/models/timestring/postgre.hpp +++ b/src/legacy/models/timestring/postgre.hpp @@ -6,7 +6,7 @@ namespace userver::storages::postgres::io { -using ::models::TimeString; +using ::legacy::models::TimeString; template <> struct CppToSystemPg : PredefinedOid { diff --git a/src/models/timestring/serialize.cpp b/src/legacy/models/timestring/serialize.cpp similarity index 91% rename from src/models/timestring/serialize.cpp rename to src/legacy/models/timestring/serialize.cpp index d6f47a05..c860412a 100644 --- a/src/models/timestring/serialize.cpp +++ b/src/legacy/models/timestring/serialize.cpp @@ -3,7 +3,7 @@ #include #include -namespace models +namespace legacy::models { std::string Serialize(const TimeString& value, userver::formats::serialize::To) @@ -18,4 +18,4 @@ userver::formats::json::Value Serialize( Serialize(value, userver::formats::serialize::To{}); return userver::formats::json::ValueBuilder(str).ExtractValue(); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/timestring/serialize.hpp b/src/legacy/models/timestring/serialize.hpp similarity index 85% rename from src/models/timestring/serialize.hpp rename to src/legacy/models/timestring/serialize.hpp index 925b5f3a..c6e292e2 100644 --- a/src/models/timestring/serialize.hpp +++ b/src/legacy/models/timestring/serialize.hpp @@ -3,11 +3,11 @@ #include "type.hpp" -namespace models +namespace legacy::models { userver::formats::json::Value Serialize( const TimeString& value, userver::formats::serialize::To); std::string Serialize(const TimeString& value, userver::formats::serialize::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/timestring/type.hpp b/src/legacy/models/timestring/type.hpp similarity index 90% rename from src/models/timestring/type.hpp rename to src/legacy/models/timestring/type.hpp index 1f7ab93f..7c1094b8 100644 --- a/src/models/timestring/type.hpp +++ b/src/legacy/models/timestring/type.hpp @@ -1,7 +1,7 @@ #pragma once #include #include -namespace models +namespace legacy::models { using TimeString = userver::utils::StrongTypedef #include -#include "models/user/type.hpp" -#include "models/user_type/postgre.hpp" -namespace models +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/postgre.hpp" +namespace legacy::models { using TupleUserRaw = ::utils::convert::drop_properties_to_ref_const_t; @@ -13,12 +13,12 @@ using TupleUserRaw = ::utils::convert::drop_properties_to_ref_const_t; // userver::utils::StrongTypedef; using TupleUser = TupleUserRaw; -} // namespace models +} // namespace legacy::models namespace userver::storages::postgres::io { template <> -struct CppToUserPg<::models::TupleUser> +struct CppToUserPg<::legacy::models::TupleUser> { static constexpr DBTypeName postgres_name = "timetable_vsu.userV1"; }; diff --git a/src/models/user/serialize.hpp b/src/legacy/models/user/serialize.hpp similarity index 54% rename from src/models/user/serialize.hpp rename to src/legacy/models/user/serialize.hpp index 37f190fb..d2f66229 100644 --- a/src/models/user/serialize.hpp +++ b/src/legacy/models/user/serialize.hpp @@ -1,4 +1,4 @@ #pragma once #include -#include "models/user_type/serialize.hpp" +#include "legacy/models/user_type/serialize.hpp" diff --git a/src/models/user/type.hpp b/src/legacy/models/user/type.hpp similarity index 70% rename from src/models/user/type.hpp rename to src/legacy/models/user/type.hpp index 948d659d..1400567b 100644 --- a/src/models/user/type.hpp +++ b/src/legacy/models/user/type.hpp @@ -3,18 +3,18 @@ #include #include -#include "models/user_type/type.hpp" +#include "legacy/models/user_type/type.hpp" -namespace models +namespace legacy::models { namespace convert = utils::convert; struct User { convert::Property id; - convert::Property type; + convert::Property type; static constexpr convert::PolicyFields kPolicyFields = convert::PolicyFields::ConvertAll; }; static_assert(utils::convert::IsConvertAll); -} // namespace models +} // namespace legacy::models diff --git a/src/models/user_credentials/fwd.hpp b/src/legacy/models/user_credentials/fwd.hpp similarity index 62% rename from src/models/user_credentials/fwd.hpp rename to src/legacy/models/user_credentials/fwd.hpp index 85c5d71c..8e21a7bb 100644 --- a/src/models/user_credentials/fwd.hpp +++ b/src/legacy/models/user_credentials/fwd.hpp @@ -1,5 +1,5 @@ #pragma once -namespace models +namespace legacy::models { struct UserCredentials; } diff --git a/src/models/user_credentials/postgre.hpp b/src/legacy/models/user_credentials/postgre.hpp similarity index 74% rename from src/models/user_credentials/postgre.hpp rename to src/legacy/models/user_credentials/postgre.hpp index b096b3d6..9836029d 100644 --- a/src/models/user_credentials/postgre.hpp +++ b/src/legacy/models/user_credentials/postgre.hpp @@ -2,19 +2,19 @@ #include #include -#include "models/user_credentials/type.hpp" +#include "legacy/models/user_credentials/type.hpp" -namespace models +namespace legacy::models { using TupleUserCredentialsRaw = ::utils::convert::drop_properties_to_ref_const_t; using TupleUserCredentials = TupleUserCredentialsRaw; -} // namespace models +} // namespace legacy::models namespace userver::storages::postgres::io { template <> -struct CppToUserPg<::models::TupleUserCredentials> +struct CppToUserPg<::legacy::models::TupleUserCredentials> { static constexpr DBTypeName postgres_name = "timetable_vsu.user_credentials"; diff --git a/src/models/user_credentials/type.hpp b/src/legacy/models/user_credentials/type.hpp similarity index 90% rename from src/models/user_credentials/type.hpp rename to src/legacy/models/user_credentials/type.hpp index 4597145f..9c4aa99e 100644 --- a/src/models/user_credentials/type.hpp +++ b/src/legacy/models/user_credentials/type.hpp @@ -1,7 +1,7 @@ #pragma once #include #include -namespace models +namespace legacy::models { using namespace utils::convert; struct UserCredentials @@ -13,4 +13,4 @@ struct UserCredentials //запрос static constexpr PolicyFields kPolicyFields = PolicyFields::ConvertAll; }; -} // namespace models +} // namespace legacy::models diff --git a/src/models/user_type/parse.cpp b/src/legacy/models/user_type/parse.cpp similarity index 95% rename from src/models/user_type/parse.cpp rename to src/legacy/models/user_type/parse.cpp index 684a9c22..1827ed22 100644 --- a/src/models/user_type/parse.cpp +++ b/src/legacy/models/user_type/parse.cpp @@ -8,7 +8,7 @@ #include "type.hpp" -namespace models +namespace legacy::models { UserType Parse(std::string_view str, userver::formats::parse::To) { @@ -44,4 +44,4 @@ UserType Parse(const userver::formats::json::Value& value, return Parse(std::string_view{raw_value}, userver::formats::parse::To{}); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/user_type/parse.hpp b/src/legacy/models/user_type/parse.hpp similarity index 85% rename from src/models/user_type/parse.hpp rename to src/legacy/models/user_type/parse.hpp index e2442cb6..a070d9eb 100644 --- a/src/models/user_type/parse.hpp +++ b/src/legacy/models/user_type/parse.hpp @@ -5,9 +5,9 @@ #include "type.hpp" -namespace models +namespace legacy::models { UserType Parse(std::string_view str, userver::formats::parse::To); UserType Parse(const userver::formats::json::Value& value, userver::formats::parse::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/user_type/postgre.hpp b/src/legacy/models/user_type/postgre.hpp similarity index 95% rename from src/models/user_type/postgre.hpp rename to src/legacy/models/user_type/postgre.hpp index d132d6dd..a86346c5 100644 --- a/src/models/user_type/postgre.hpp +++ b/src/legacy/models/user_type/postgre.hpp @@ -7,7 +7,7 @@ namespace userver::storages::postgres::io { -using ::models::UserType; +using ::legacy::models::UserType; template <> struct CppToUserPg : EnumMappingBase { diff --git a/src/models/user_type/serialize.cpp b/src/legacy/models/user_type/serialize.cpp similarity index 93% rename from src/models/user_type/serialize.cpp rename to src/legacy/models/user_type/serialize.cpp index 9bae0559..672e2cb6 100644 --- a/src/models/user_type/serialize.cpp +++ b/src/legacy/models/user_type/serialize.cpp @@ -2,7 +2,7 @@ #include -namespace models +namespace legacy::models { std::string Serialize(const UserType& value, userver::formats::serialize::To) @@ -27,4 +27,4 @@ userver::formats::json::Value Serialize( Serialize(value, userver::formats::serialize::To{}); return userver::formats::json::ValueBuilder(str).ExtractValue(); } -} // namespace models +} // namespace legacy::models diff --git a/src/models/user_type/serialize.hpp b/src/legacy/models/user_type/serialize.hpp similarity index 85% rename from src/models/user_type/serialize.hpp rename to src/legacy/models/user_type/serialize.hpp index 4d0d9b3e..4b293965 100644 --- a/src/models/user_type/serialize.hpp +++ b/src/legacy/models/user_type/serialize.hpp @@ -3,11 +3,11 @@ #include "type.hpp" -namespace models +namespace legacy::models { userver::formats::json::Value Serialize( const UserType& value, userver::formats::serialize::To); std::string Serialize(const UserType& value, userver::formats::serialize::To); -} // namespace models +} // namespace legacy::models diff --git a/src/models/user_type/type.hpp b/src/legacy/models/user_type/type.hpp similarity index 78% rename from src/models/user_type/type.hpp rename to src/legacy/models/user_type/type.hpp index 288a1138..59076659 100644 --- a/src/models/user_type/type.hpp +++ b/src/legacy/models/user_type/type.hpp @@ -1,6 +1,6 @@ #pragma once -namespace models +namespace legacy::models { enum struct UserType { diff --git a/src/views/admin/create/Request.hpp b/src/legacy/views/admin/create/Request.hpp similarity index 77% rename from src/views/admin/create/Request.hpp rename to src/legacy/views/admin/create/Request.hpp index 89946e02..ba21581a 100644 --- a/src/views/admin/create/Request.hpp +++ b/src/legacy/views/admin/create/Request.hpp @@ -8,17 +8,17 @@ #include #include -#include "models/user_credentials/type.hpp" -namespace views::admin::create +#include "legacy/models/user_credentials/type.hpp" +namespace legacy::views::admin::create { using namespace utils::convert; struct Request { - Property credentials; + Property credentials; HeaderProperty token; static constexpr auto kPolicyFields = PolicyFields::ConvertAll; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; //открываем возможность использовать структуру, как //запрос }; -} // namespace views::admin::create +} // namespace legacy::views::admin::create diff --git a/src/views/admin/create/Responses.hpp b/src/legacy/views/admin/create/Responses.hpp similarity index 71% rename from src/views/admin/create/Responses.hpp rename to src/legacy/views/admin/create/Responses.hpp index 84f5ca55..dde7fc20 100644 --- a/src/views/admin/create/Responses.hpp +++ b/src/legacy/views/admin/create/Responses.hpp @@ -8,16 +8,16 @@ #include #include "http/ErrorV1.hpp" -#include "models/admin_account/type.hpp" -#include "models/user/type.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" -namespace views::admin::create +#include "legacy/models/admin_account/type.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" +namespace legacy::views::admin::create { using namespace utils::convert; struct Response200 { - Property<::models::AdminAccount, "created_account"> created_account; + Property<::legacy::models::AdminAccount, "created_account"> created_account; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; static constexpr PolicyFields kPolicyFields = PolicyFields::ConvertAll; static constexpr userver::server::http::HttpStatus kStatusCode = @@ -32,4 +32,4 @@ using Response403 = utils::common_errors::Response403; using Response500 = utils::common_errors::Response500; -} // namespace views::admin::create +} // namespace legacy::views::admin::create diff --git a/src/views/admin/create/view.cpp b/src/legacy/views/admin/create/view.cpp similarity index 77% rename from src/views/admin/create/view.cpp rename to src/legacy/views/admin/create/view.cpp index e9b4848c..5c44a73c 100644 --- a/src/views/admin/create/view.cpp +++ b/src/legacy/views/admin/create/view.cpp @@ -11,19 +11,19 @@ #include "Request.hpp" #include "Responses.hpp" -#include "components/controllers/postgres/admin/controller.hpp" -#include "components/controllers/postgres/user/controller.hpp" +#include "legacy/components/controllers/postgres/admin/controller.hpp" +#include "legacy/components/controllers/postgres/user/controller.hpp" #include "http/handler_parsed.hpp" -#include "models/auth_token/serialize.hpp" -#include "models/user/serialize.hpp" -#include "models/user_type/serialize.hpp" -namespace views::admin::create +#include "legacy/models/auth_token/serialize.hpp" +#include "legacy/models/user/serialize.hpp" +#include "legacy/models/user_type/serialize.hpp" +namespace legacy::views::admin::create { static_assert(userver::formats::common::impl::kHasSerialize< - userver::formats::json::Value, ::models::User>); + userver::formats::json::Value, ::legacy::models::User>); namespace { -namespace pg = components::controllers::postgres; +namespace pg = legacy::components::controllers::postgres; class Handler final : public http::HandlerParsed @@ -46,7 +46,7 @@ class Handler final { return utils::common_errors::PerformInvalidToken(); } - if (user->type() != models::UserType::kRoot) + if (user->type() != legacy::models::UserType::kRoot) { return utils::common_errors::PerformForbidden(); } @@ -71,4 +71,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::admin::create +} // namespace legacy::views::admin::create diff --git a/src/views/group-stage/list/view.hpp b/src/legacy/views/admin/create/view.hpp similarity index 75% rename from src/views/group-stage/list/view.hpp rename to src/legacy/views/admin/create/view.hpp index bc3d81a3..7b83bb22 100644 --- a/src/views/group-stage/list/view.hpp +++ b/src/legacy/views/admin/create/view.hpp @@ -1,6 +1,6 @@ #pragma once #include -namespace views::group::stage::list +namespace legacy::views::admin::create { void Append(userver::components::ComponentList& component_list); diff --git a/src/views/admin/list/Request.hpp b/src/legacy/views/admin/list/Request.hpp similarity index 76% rename from src/views/admin/list/Request.hpp rename to src/legacy/views/admin/list/Request.hpp index 8600b954..38155c7c 100644 --- a/src/views/admin/list/Request.hpp +++ b/src/legacy/views/admin/list/Request.hpp @@ -7,17 +7,17 @@ #include #include -#include "models/admin_filter/postgre.hpp" -namespace views::admin::list +#include "legacy/models/admin_filter/postgre.hpp" +namespace legacy::views::admin::list { using namespace utils::convert; struct Request { - OptionalProperty filter; + OptionalProperty filter; HeaderProperty token; static constexpr auto kPolicyFields = PolicyFields::ConvertAll; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; //открываем возможность использовать структуру, как //запрос }; -} // namespace views::admin::list +} // namespace legacy::views::admin::list diff --git a/src/views/admin/list/Responses.hpp b/src/legacy/views/admin/list/Responses.hpp similarity index 73% rename from src/views/admin/list/Responses.hpp rename to src/legacy/views/admin/list/Responses.hpp index 9d5e7cf6..3ea0f200 100644 --- a/src/views/admin/list/Responses.hpp +++ b/src/legacy/views/admin/list/Responses.hpp @@ -9,17 +9,17 @@ #include #include "http/ErrorV1.hpp" -#include "models/admin_account/type.hpp" -#include "models/user/type.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/admin_account/type.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" -namespace views::admin::list +namespace legacy::views::admin::list { using namespace utils::convert; struct Response200 { - ArrayProperty<::models::AdminAccount, "admins"> admins; + ArrayProperty<::legacy::models::AdminAccount, "admins"> admins; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; static constexpr PolicyFields kPolicyFields = PolicyFields::ConvertAll; static constexpr userver::server::http::HttpStatus kStatusCode = @@ -33,4 +33,4 @@ using Response401 = utils::common_errors::Response401; using Response403 = utils::common_errors::Response403; using Response500 = utils::common_errors::Response500; -} // namespace views::admin::list +} // namespace legacy::views::admin::list diff --git a/src/views/admin/list/view.cpp b/src/legacy/views/admin/list/view.cpp similarity index 77% rename from src/views/admin/list/view.cpp rename to src/legacy/views/admin/list/view.cpp index 67f5aa93..093878fe 100644 --- a/src/views/admin/list/view.cpp +++ b/src/legacy/views/admin/list/view.cpp @@ -13,19 +13,19 @@ #include "Request.hpp" #include "Responses.hpp" -#include "components/controllers/postgres/admin/controller.hpp" -#include "components/controllers/postgres/user/controller.hpp" +#include "legacy/components/controllers/postgres/admin/controller.hpp" +#include "legacy/components/controllers/postgres/user/controller.hpp" #include "http/handler_parsed.hpp" -#include "models/auth_token/serialize.hpp" -#include "models/user/serialize.hpp" -#include "models/user_type/serialize.hpp" -namespace views::admin::list +#include "legacy/models/auth_token/serialize.hpp" +#include "legacy/models/user/serialize.hpp" +#include "legacy/models/user_type/serialize.hpp" +namespace legacy::views::admin::list { static_assert(userver::formats::common::impl::kHasSerialize< - userver::formats::json::Value, ::models::User>); + userver::formats::json::Value, ::legacy::models::User>); namespace { -namespace pg = components::controllers::postgres; +namespace pg = legacy::components::controllers::postgres; class Handler final : public http::HandlerParsed @@ -48,7 +48,7 @@ class Handler final { return utils::common_errors::PerformInvalidToken(); } - if (user->type() != models::UserType::kRoot) + if (user->type() != legacy::models::UserType::kRoot) { return utils::common_errors::PerformForbidden(); } @@ -69,4 +69,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::admin::list +} // namespace legacy::views::admin::list diff --git a/src/views/faculty/list/view.hpp b/src/legacy/views/admin/list/view.hpp similarity index 76% rename from src/views/faculty/list/view.hpp rename to src/legacy/views/admin/list/view.hpp index aeb1d9ab..fd11d2ac 100644 --- a/src/views/faculty/list/view.hpp +++ b/src/legacy/views/admin/list/view.hpp @@ -1,6 +1,6 @@ #pragma once #include -namespace views::faculty::list +namespace legacy::views::admin::list { void Append(userver::components::ComponentList& component_list); diff --git a/src/views/group-stage/list/Request.hpp b/src/legacy/views/faculty/list/Request.hpp similarity index 74% rename from src/views/group-stage/list/Request.hpp rename to src/legacy/views/faculty/list/Request.hpp index 309ecbed..bac33b55 100644 --- a/src/views/group-stage/list/Request.hpp +++ b/src/legacy/views/faculty/list/Request.hpp @@ -7,16 +7,16 @@ #include #include -#include "models/group_stage_filter/type.hpp" -namespace views::group::stage::list +#include "legacy/models/faculty_filter/type.hpp" +namespace legacy::views::faculty::list { using namespace utils::convert; struct Request { - OptionalProperty filter; + OptionalProperty filter; static constexpr auto kPolicyFields = PolicyFields::ConvertAll; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; //открываем возможность использовать структуру, как //запрос }; -} // namespace views::group::stage::list +} // namespace legacy::views::faculty::list diff --git a/src/views/teacher/list/Responses.hpp b/src/legacy/views/faculty/list/Responses.hpp similarity index 64% rename from src/views/teacher/list/Responses.hpp rename to src/legacy/views/faculty/list/Responses.hpp index 5558fd30..5611afd1 100644 --- a/src/views/teacher/list/Responses.hpp +++ b/src/legacy/views/faculty/list/Responses.hpp @@ -8,22 +8,22 @@ #include #include "http/ErrorV1.hpp" -#include "models/admin_account/type.hpp" -#include "models/teacher/type.hpp" -#include "models/user/type.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/admin_account/type.hpp" +#include "legacy/models/faculty/type.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" -namespace views::teacher::list +namespace legacy::views::faculty::list { using namespace utils::convert; struct Response200 { - ArrayProperty<::models::Teacher, "teachers"> teachers; + ArrayProperty faculties; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; static constexpr PolicyFields kPolicyFields = PolicyFields::ConvertAll; static constexpr userver::server::http::HttpStatus kStatusCode = userver::server::http::HttpStatus::kOk; }; -} // namespace views::teacher::list +} // namespace legacy::views::faculty::list diff --git a/src/views/faculty/list/view.cpp b/src/legacy/views/faculty/list/view.cpp similarity index 79% rename from src/views/faculty/list/view.cpp rename to src/legacy/views/faculty/list/view.cpp index 4b4ea739..f02df830 100644 --- a/src/views/faculty/list/view.cpp +++ b/src/legacy/views/faculty/list/view.cpp @@ -13,16 +13,16 @@ #include "Request.hpp" #include "Responses.hpp" -#include "components/controllers/postgres/faculty/controller.hpp" +#include "legacy/components/controllers/postgres/faculty/controller.hpp" #include "http/handler_parsed.hpp" -#include "models/auth_token/serialize.hpp" -#include "models/user/serialize.hpp" -#include "models/user_type/serialize.hpp" -namespace views::faculty::list +#include "legacy/models/auth_token/serialize.hpp" +#include "legacy/models/user/serialize.hpp" +#include "legacy/models/user_type/serialize.hpp" +namespace legacy::views::faculty::list { namespace { -namespace pg = components::controllers::postgres; +namespace pg = legacy::components::controllers::postgres; class Handler final : public http::HandlerParsed { public: @@ -53,4 +53,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::faculty::list +} // namespace legacy::views::faculty::list diff --git a/src/legacy/views/faculty/list/view.hpp b/src/legacy/views/faculty/list/view.hpp new file mode 100644 index 00000000..07cdb87a --- /dev/null +++ b/src/legacy/views/faculty/list/view.hpp @@ -0,0 +1,7 @@ +#pragma once +#include +namespace legacy::views::faculty::list +{ +void Append(userver::components::ComponentList& component_list); + +} diff --git a/src/views/teacher/list/Request.hpp b/src/legacy/views/group-stage/list/Request.hpp similarity index 73% rename from src/views/teacher/list/Request.hpp rename to src/legacy/views/group-stage/list/Request.hpp index 8fcf17aa..6c6b4733 100644 --- a/src/views/teacher/list/Request.hpp +++ b/src/legacy/views/group-stage/list/Request.hpp @@ -7,16 +7,16 @@ #include #include -#include "models/teacher_filter/type.hpp" -namespace views::teacher::list +#include "legacy/models/group_stage_filter/type.hpp" +namespace legacy::views::group::stage::list { using namespace utils::convert; struct Request { - OptionalProperty filter; + OptionalProperty filter; static constexpr auto kPolicyFields = PolicyFields::ConvertAll; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; //открываем возможность использовать структуру, как //запрос }; -} // namespace views::teacher::list +} // namespace legacy::views::group::stage::list diff --git a/src/views/faculty/list/Responses.hpp b/src/legacy/views/group-stage/list/Responses.hpp similarity index 60% rename from src/views/faculty/list/Responses.hpp rename to src/legacy/views/group-stage/list/Responses.hpp index 54c211a1..ce3ab5a9 100644 --- a/src/views/faculty/list/Responses.hpp +++ b/src/legacy/views/group-stage/list/Responses.hpp @@ -8,22 +8,23 @@ #include #include "http/ErrorV1.hpp" -#include "models/admin_account/type.hpp" -#include "models/faculty/type.hpp" -#include "models/user/type.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/admin_account/type.hpp" +#include "legacy/models/faculty/type.hpp" +#include "legacy/models/group_stage/type.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" -namespace views::faculty::list +namespace legacy::views::group::stage::list { using namespace utils::convert; struct Response200 { - ArrayProperty faculties; + ArrayProperty group_stages; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; static constexpr PolicyFields kPolicyFields = PolicyFields::ConvertAll; static constexpr userver::server::http::HttpStatus kStatusCode = userver::server::http::HttpStatus::kOk; }; -} // namespace views::faculty::list +} // namespace legacy::views::group::stage::list diff --git a/src/views/group-stage/list/view.cpp b/src/legacy/views/group-stage/list/view.cpp similarity index 74% rename from src/views/group-stage/list/view.cpp rename to src/legacy/views/group-stage/list/view.cpp index e2cca120..e5d45482 100644 --- a/src/views/group-stage/list/view.cpp +++ b/src/legacy/views/group-stage/list/view.cpp @@ -13,18 +13,18 @@ #include "Request.hpp" #include "Responses.hpp" -#include "components/controllers/postgres/faculty/controller.hpp" -#include "components/controllers/postgres/group_stage/controller.hpp" +#include "legacy/components/controllers/postgres/faculty/controller.hpp" +#include "legacy/components/controllers/postgres/group_stage/controller.hpp" #include "http/handler_parsed.hpp" -#include "models/auth_token/serialize.hpp" -#include "models/education_type/all.hpp" -#include "models/user/serialize.hpp" -#include "models/user_type/serialize.hpp" -namespace views::group::stage::list +#include "legacy/models/auth_token/serialize.hpp" +#include "legacy/models/education_type/all.hpp" +#include "legacy/models/user/serialize.hpp" +#include "legacy/models/user_type/serialize.hpp" +namespace legacy::views::group::stage::list { namespace { -namespace pg = components::controllers::postgres; +namespace pg = legacy::components::controllers::postgres; class Handler final : public http::HandlerParsed { public: @@ -57,4 +57,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::group::stage::list +} // namespace legacy::views::group::stage::list diff --git a/src/legacy/views/group-stage/list/view.hpp b/src/legacy/views/group-stage/list/view.hpp new file mode 100644 index 00000000..5e66d079 --- /dev/null +++ b/src/legacy/views/group-stage/list/view.hpp @@ -0,0 +1,7 @@ +#pragma once +#include +namespace legacy::views::group::stage::list +{ +void Append(userver::components::ComponentList& component_list); + +} diff --git a/src/views/hello/view.cpp b/src/legacy/views/hello/view.cpp similarity index 100% rename from src/views/hello/view.cpp rename to src/legacy/views/hello/view.cpp diff --git a/src/views/hello/view.hpp b/src/legacy/views/hello/view.hpp similarity index 100% rename from src/views/hello/view.hpp rename to src/legacy/views/hello/view.hpp diff --git a/src/legacy/views/login/Request.hpp b/src/legacy/views/login/Request.hpp new file mode 100644 index 00000000..c898a668 --- /dev/null +++ b/src/legacy/views/login/Request.hpp @@ -0,0 +1,9 @@ +#pragma once +#include +#include + +#include "legacy/models/user_credentials/type.hpp" +namespace legacy::views::login +{ +using Request = legacy::models::UserCredentials; +} // namespace legacy::views::login diff --git a/src/views/login/Responses.hpp b/src/legacy/views/login/Responses.hpp similarity index 79% rename from src/views/login/Responses.hpp rename to src/legacy/views/login/Responses.hpp index a8e8d228..f8ee3e04 100644 --- a/src/views/login/Responses.hpp +++ b/src/legacy/views/login/Responses.hpp @@ -6,17 +6,17 @@ #include #include "http/ErrorV1.hpp" -#include "models/user/type.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" -namespace views::login +namespace legacy::views::login { using namespace utils::convert; struct Response200 { Property id; - Property<::models::User, "user"> user; + Property<::legacy::models::User, "user"> user; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; static constexpr PolicyFields kPolicyFields = PolicyFields::ConvertAll; static constexpr userver::server::http::HttpStatus kStatusCode = @@ -31,4 +31,4 @@ struct Response500 static constexpr userver::server::http::HttpStatus kStatusCode = userver::server::http::HttpStatus::kInternalServerError; }; -} // namespace views::login +} // namespace legacy::views::login diff --git a/src/views/login/view.cpp b/src/legacy/views/login/view.cpp similarity index 81% rename from src/views/login/view.cpp rename to src/legacy/views/login/view.cpp index 17d7c4a4..29ad3ab6 100644 --- a/src/views/login/view.cpp +++ b/src/legacy/views/login/view.cpp @@ -11,20 +11,20 @@ #include "Request.hpp" #include "Responses.hpp" -#include "components/controllers/postgres/token/controller.hpp" -#include "components/controllers/postgres/user/controller.hpp" +#include "legacy/components/controllers/postgres/token/controller.hpp" +#include "legacy/components/controllers/postgres/user/controller.hpp" #include "http/handler_parsed.hpp" -#include "models/auth_token/serialize.hpp" -#include "models/user/serialize.hpp" -#include "models/user_type/serialize.hpp" +#include "legacy/models/auth_token/serialize.hpp" +#include "legacy/models/user/serialize.hpp" +#include "legacy/models/user_type/serialize.hpp" -namespace views::login +namespace legacy::views::login { static_assert(userver::formats::common::impl::kHasSerialize< - userver::formats::json::Value, ::models::User>); + userver::formats::json::Value, ::legacy::models::User>); namespace { -namespace pg = components::controllers::postgres; +namespace pg = legacy::components::controllers::postgres; class Handler final : public http::HandlerParsed { @@ -80,4 +80,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::login +} // namespace legacy::views::login diff --git a/src/views/admin/create/view.hpp b/src/legacy/views/login/view.hpp similarity index 79% rename from src/views/admin/create/view.hpp rename to src/legacy/views/login/view.hpp index b5dd4a14..12c14e0d 100644 --- a/src/views/admin/create/view.hpp +++ b/src/legacy/views/login/view.hpp @@ -1,6 +1,6 @@ #pragma once #include -namespace views::admin::create +namespace legacy::views::login { void Append(userver::components::ComponentList& component_list); diff --git a/src/legacy/views/register/Request.hpp b/src/legacy/views/register/Request.hpp new file mode 100644 index 00000000..5f6b36e2 --- /dev/null +++ b/src/legacy/views/register/Request.hpp @@ -0,0 +1,9 @@ +#pragma once +#include +#include + +#include "legacy/models/register_request/type.hpp" +namespace legacy::views::register_ +{ +using Request = legacy::models::RegisterRequest; +} // namespace legacy::views::register_ diff --git a/src/views/register/Responses.hpp b/src/legacy/views/register/Responses.hpp similarity index 79% rename from src/views/register/Responses.hpp rename to src/legacy/views/register/Responses.hpp index c2951a20..216f4d75 100644 --- a/src/views/register/Responses.hpp +++ b/src/legacy/views/register/Responses.hpp @@ -6,17 +6,17 @@ #include #include "http/ErrorV1.hpp" -#include "models/user/type.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" -namespace views::register_ +namespace legacy::views::register_ { using namespace utils::convert; struct Response200 { Property id; - Property<::models::User, "user"> user; + Property<::legacy::models::User, "user"> user; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; static constexpr PolicyFields kPolicyFields = PolicyFields::ConvertAll; static constexpr userver::server::http::HttpStatus kStatusCode = @@ -31,4 +31,4 @@ struct Response500 static constexpr userver::server::http::HttpStatus kStatusCode = userver::server::http::HttpStatus::kInternalServerError; }; -} // namespace views::register_ +} // namespace legacy::views::register_ diff --git a/src/views/register/view.cpp b/src/legacy/views/register/view.cpp similarity index 83% rename from src/views/register/view.cpp rename to src/legacy/views/register/view.cpp index 8e561cd4..4acde507 100644 --- a/src/views/register/view.cpp +++ b/src/legacy/views/register/view.cpp @@ -17,21 +17,21 @@ #include #include "Request.hpp" -#include "components/controllers/postgres/token/controller.hpp" -#include "components/controllers/postgres/user/controller.hpp" +#include "legacy/components/controllers/postgres/token/controller.hpp" +#include "legacy/components/controllers/postgres/user/controller.hpp" #include "http/handler_parsed.hpp" -#include "models/auth_token/serialize.hpp" -#include "models/user/serialize.hpp" -#include "models/user_type/parse.hpp" -#include "models/user_type/type.hpp" -#include "views/register/Responses.hpp" +#include "legacy/models/auth_token/serialize.hpp" +#include "legacy/models/user/serialize.hpp" +#include "legacy/models/user_type/parse.hpp" +#include "legacy/models/user_type/type.hpp" +#include "legacy/views/register/Responses.hpp" -namespace views::register_ +namespace legacy::views::register_ { namespace { -namespace pg = components::controllers::postgres; -using Response = models::AuthToken; +namespace pg = legacy::components::controllers::postgres; +using Response = legacy::models::AuthToken; class Handler final : public http::HandlerParsed { @@ -63,7 +63,7 @@ class Handler final const Request& request, const boost::uuids::uuid& user_id) const { - using enum models::UserType; + using enum legacy::models::UserType; switch (request.desired_type().value_or(kUser)) { case kAdmin: @@ -98,7 +98,7 @@ class Handler final Response200 resp; resp.id() = *id; resp.user() = - models::User{.id = {*user_id}, .type = {models::UserType::kUser}}; + legacy::models::User{.id = {*user_id}, .type = {legacy::models::UserType::kUser}}; return resp; } @@ -113,4 +113,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::register_ +} // namespace legacy::views::register_ diff --git a/src/views/admin/list/view.hpp b/src/legacy/views/register/view.hpp similarity index 77% rename from src/views/admin/list/view.hpp rename to src/legacy/views/register/view.hpp index dc81d9b9..0dfcfcb8 100644 --- a/src/views/admin/list/view.hpp +++ b/src/legacy/views/register/view.hpp @@ -1,6 +1,6 @@ #pragma once #include -namespace views::admin::list +namespace legacy::views::register_ { void Append(userver::components::ComponentList& component_list); diff --git a/src/views/teacher/create/Request.hpp b/src/legacy/views/teacher/create/Request.hpp similarity index 73% rename from src/views/teacher/create/Request.hpp rename to src/legacy/views/teacher/create/Request.hpp index 9bdc2a5f..1be223ae 100644 --- a/src/views/teacher/create/Request.hpp +++ b/src/legacy/views/teacher/create/Request.hpp @@ -8,18 +8,18 @@ #include #include -#include "models/auth_token/type.hpp" -#include "models/teacher_info/type.hpp" -namespace views::teacher::create +#include "legacy/models/auth_token/type.hpp" +#include "legacy/models/teacher_info/type.hpp" +namespace legacy::views::teacher::create { using namespace utils::convert; struct Request { - Property teacher_info; + Property teacher_info; HeaderProperty token; static constexpr auto kPolicyFields = PolicyFields::ConvertAll; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; //открываем возможность использовать структуру, как //запрос }; -} // namespace views::teacher::create +} // namespace legacy::views::teacher::create diff --git a/src/views/teacher/create/Responses.hpp b/src/legacy/views/teacher/create/Responses.hpp similarity index 75% rename from src/views/teacher/create/Responses.hpp rename to src/legacy/views/teacher/create/Responses.hpp index 291e8a05..16f2bcb8 100644 --- a/src/views/teacher/create/Responses.hpp +++ b/src/legacy/views/teacher/create/Responses.hpp @@ -9,13 +9,13 @@ #include #include "http/ErrorV1.hpp" -#include "models/admin_account/type.hpp" -#include "models/teacher/type.hpp" -#include "models/user/type.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/admin_account/type.hpp" +#include "legacy/models/teacher/type.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" -namespace views::teacher::create +namespace legacy::views::teacher::create { using namespace utils::convert; struct Response200 @@ -31,4 +31,4 @@ using Response400 = utils::common_errors::Response400; using Response401 = utils::common_errors::Response401; using Response403 = utils::common_errors::Response403; -} // namespace views::teacher::create +} // namespace legacy::views::teacher::create diff --git a/src/views/teacher/create/view.cpp b/src/legacy/views/teacher/create/view.cpp similarity index 77% rename from src/views/teacher/create/view.cpp rename to src/legacy/views/teacher/create/view.cpp index f5c8c369..8ceca283 100644 --- a/src/views/teacher/create/view.cpp +++ b/src/legacy/views/teacher/create/view.cpp @@ -13,18 +13,18 @@ #include "Request.hpp" #include "Responses.hpp" -#include "components/controllers/postgres/teacher/controller.hpp" -#include "components/controllers/postgres/user/controller.hpp" +#include "legacy/components/controllers/postgres/teacher/controller.hpp" +#include "legacy/components/controllers/postgres/user/controller.hpp" #include "http/handler_parsed.hpp" -#include "models/auth_token/serialize.hpp" -#include "models/user/serialize.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" -namespace views::teacher::create +#include "legacy/models/auth_token/serialize.hpp" +#include "legacy/models/user/serialize.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" +namespace legacy::views::teacher::create { namespace { -namespace pg = components::controllers::postgres; +namespace pg = legacy::components::controllers::postgres; class Handler final : public http::HandlerParsed @@ -47,8 +47,8 @@ class Handler final { return utils::common_errors::PerformInvalidToken(); } - if (user->type() == models::UserType::kUser || - user->type() == models::UserType::kTeacher) + if (user->type() == legacy::models::UserType::kUser || + user->type() == legacy::models::UserType::kTeacher) { return utils::common_errors::PerformForbidden(); } @@ -76,4 +76,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::teacher::create +} // namespace legacy::views::teacher::create diff --git a/src/legacy/views/teacher/create/view.hpp b/src/legacy/views/teacher/create/view.hpp new file mode 100644 index 00000000..fe4c594a --- /dev/null +++ b/src/legacy/views/teacher/create/view.hpp @@ -0,0 +1,7 @@ +#pragma once +#include +namespace legacy::views::teacher::create +{ +void Append(userver::components::ComponentList& component_list); + +} diff --git a/src/views/faculty/list/Request.hpp b/src/legacy/views/teacher/list/Request.hpp similarity index 74% rename from src/views/faculty/list/Request.hpp rename to src/legacy/views/teacher/list/Request.hpp index befb2c8c..4cdc95fb 100644 --- a/src/views/faculty/list/Request.hpp +++ b/src/legacy/views/teacher/list/Request.hpp @@ -7,16 +7,16 @@ #include #include -#include "models/faculty_filter/type.hpp" -namespace views::faculty::list +#include "legacy/models/teacher_filter/type.hpp" +namespace legacy::views::teacher::list { using namespace utils::convert; struct Request { - OptionalProperty filter; + OptionalProperty filter; static constexpr auto kPolicyFields = PolicyFields::ConvertAll; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; //открываем возможность использовать структуру, как //запрос }; -} // namespace views::faculty::list +} // namespace legacy::views::teacher::list diff --git a/src/views/group-stage/list/Responses.hpp b/src/legacy/views/teacher/list/Responses.hpp similarity index 64% rename from src/views/group-stage/list/Responses.hpp rename to src/legacy/views/teacher/list/Responses.hpp index 437420d3..b9c0aec9 100644 --- a/src/views/group-stage/list/Responses.hpp +++ b/src/legacy/views/teacher/list/Responses.hpp @@ -8,23 +8,22 @@ #include #include "http/ErrorV1.hpp" -#include "models/admin_account/type.hpp" -#include "models/faculty/type.hpp" -#include "models/group_stage/type.hpp" -#include "models/user/type.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/admin_account/type.hpp" +#include "legacy/models/teacher/type.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" -namespace views::group::stage::list +namespace legacy::views::teacher::list { using namespace utils::convert; struct Response200 { - ArrayProperty group_stages; + ArrayProperty<::legacy::models::Teacher, "teachers"> teachers; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; static constexpr PolicyFields kPolicyFields = PolicyFields::ConvertAll; static constexpr userver::server::http::HttpStatus kStatusCode = userver::server::http::HttpStatus::kOk; }; -} // namespace views::group::stage::list +} // namespace legacy::views::teacher::list diff --git a/src/views/teacher/list/view.cpp b/src/legacy/views/teacher/list/view.cpp similarity index 79% rename from src/views/teacher/list/view.cpp rename to src/legacy/views/teacher/list/view.cpp index b11a5c13..fcb8ec68 100644 --- a/src/views/teacher/list/view.cpp +++ b/src/legacy/views/teacher/list/view.cpp @@ -13,16 +13,16 @@ #include "Request.hpp" #include "Responses.hpp" -#include "components/controllers/postgres/teacher/controller.hpp" +#include "legacy/components/controllers/postgres/teacher/controller.hpp" #include "http/handler_parsed.hpp" -#include "models/auth_token/serialize.hpp" -#include "models/user/serialize.hpp" -#include "models/user_type/serialize.hpp" -namespace views::teacher::list +#include "legacy/models/auth_token/serialize.hpp" +#include "legacy/models/user/serialize.hpp" +#include "legacy/models/user_type/serialize.hpp" +namespace legacy::views::teacher::list { namespace { -namespace pg = components::controllers::postgres; +namespace pg = legacy::components::controllers::postgres; class Handler final : public http::HandlerParsed { public: @@ -53,4 +53,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::teacher::list +} // namespace legacy::views::teacher::list diff --git a/src/legacy/views/teacher/list/view.hpp b/src/legacy/views/teacher/list/view.hpp new file mode 100644 index 00000000..5e7954b4 --- /dev/null +++ b/src/legacy/views/teacher/list/view.hpp @@ -0,0 +1,7 @@ +#pragma once +#include +namespace legacy::views::teacher::list +{ +void Append(userver::components::ComponentList& component_list); + +} diff --git a/src/views/teacher/request/approve/link/Request.hpp b/src/legacy/views/teacher/request/approve/link/Request.hpp similarity index 86% rename from src/views/teacher/request/approve/link/Request.hpp rename to src/legacy/views/teacher/request/approve/link/Request.hpp index e20ab1df..c7944d3f 100644 --- a/src/views/teacher/request/approve/link/Request.hpp +++ b/src/legacy/views/teacher/request/approve/link/Request.hpp @@ -6,7 +6,7 @@ #include #include #include -namespace views::teacher::requests::approve::link +namespace legacy::views::teacher::requests::approve::link { using namespace utils::convert; struct Request @@ -19,4 +19,4 @@ struct Request TypeOfBody::Json; //открываем возможность использовать структуру, как //запрос }; -} // namespace views::teacher::requests::approve::link +} // namespace legacy::views::teacher::requests::approve::link diff --git a/src/views/teacher/request/approve/link/Responses.hpp b/src/legacy/views/teacher/request/approve/link/Responses.hpp similarity index 69% rename from src/views/teacher/request/approve/link/Responses.hpp rename to src/legacy/views/teacher/request/approve/link/Responses.hpp index c1e80eda..3092a4d8 100644 --- a/src/views/teacher/request/approve/link/Responses.hpp +++ b/src/legacy/views/teacher/request/approve/link/Responses.hpp @@ -9,14 +9,14 @@ #include #include "http/ErrorV1.hpp" -#include "models/admin_account/type.hpp" -#include "models/request_privileges/type.hpp" -#include "models/teacher/type.hpp" -#include "models/user/type.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/admin_account/type.hpp" +#include "legacy/models/request_privileges/type.hpp" +#include "legacy/models/teacher/type.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" -namespace views::teacher::requests::approve::link +namespace legacy::views::teacher::requests::approve::link { using namespace utils::convert; struct Response200 @@ -34,4 +34,4 @@ using Response401 = utils::common_errors::Response401; using Response403 = utils::common_errors::Response403; -} // namespace views::teacher::requests::approve::link +} // namespace legacy::views::teacher::requests::approve::link diff --git a/src/views/teacher/request/approve/link/view.cpp b/src/legacy/views/teacher/request/approve/link/view.cpp similarity index 77% rename from src/views/teacher/request/approve/link/view.cpp rename to src/legacy/views/teacher/request/approve/link/view.cpp index 8f7be9ba..e3efc934 100644 --- a/src/views/teacher/request/approve/link/view.cpp +++ b/src/legacy/views/teacher/request/approve/link/view.cpp @@ -15,18 +15,18 @@ #include "Request.hpp" #include "Responses.hpp" -#include "components/controllers/postgres/teacher/controller.hpp" -#include "components/controllers/postgres/user/controller.hpp" +#include "legacy/components/controllers/postgres/teacher/controller.hpp" +#include "legacy/components/controllers/postgres/user/controller.hpp" #include "http/handler_parsed.hpp" -#include "models/auth_token/serialize.hpp" -#include "models/user/serialize.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" -namespace views::teacher::requests::approve::link +#include "legacy/models/auth_token/serialize.hpp" +#include "legacy/models/user/serialize.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" +namespace legacy::views::teacher::requests::approve::link { namespace { -namespace pg = components::controllers::postgres; +namespace pg = legacy::components::controllers::postgres; class Handler final : public http::HandlerParsed @@ -49,8 +49,8 @@ class Handler final { return utils::common_errors::PerformInvalidToken(); } - if (user->type() != models::UserType::kAdmin && - user->type() != models::UserType::kRoot) + if (user->type() != legacy::models::UserType::kAdmin && + user->type() != legacy::models::UserType::kRoot) { return utils::common_errors::PerformForbidden(); } @@ -76,4 +76,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::teacher::requests::approve::link +} // namespace legacy::views::teacher::requests::approve::link diff --git a/src/legacy/views/teacher/request/approve/link/view.hpp b/src/legacy/views/teacher/request/approve/link/view.hpp new file mode 100644 index 00000000..044f1242 --- /dev/null +++ b/src/legacy/views/teacher/request/approve/link/view.hpp @@ -0,0 +1,7 @@ +#pragma once +#include +namespace legacy::views::teacher::requests::approve::link +{ +void Append(userver::components::ComponentList& component_list); + +} diff --git a/src/views/teacher/request/approve/new/Request.hpp b/src/legacy/views/teacher/request/approve/new/Request.hpp similarity index 74% rename from src/views/teacher/request/approve/new/Request.hpp rename to src/legacy/views/teacher/request/approve/new/Request.hpp index 7353c738..50437771 100644 --- a/src/views/teacher/request/approve/new/Request.hpp +++ b/src/legacy/views/teacher/request/approve/new/Request.hpp @@ -7,18 +7,18 @@ #include #include -#include "models/teacher_info/type.hpp" -namespace views::teacher::requests::approve::new_ +#include "legacy/models/teacher_info/type.hpp" +namespace legacy::views::teacher::requests::approve::new_ { using namespace utils::convert; struct Request { HeaderProperty token; Property request_id; - Property teacher_info; + Property teacher_info; static constexpr auto kPolicyFields = PolicyFields::ConvertAll; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; //открываем возможность использовать структуру, //как запрос }; -} // namespace views::teacher::requests::approve::new_ +} // namespace legacy::views::teacher::requests::approve::new_ diff --git a/src/views/teacher/request/approve/new/Responses.hpp b/src/legacy/views/teacher/request/approve/new/Responses.hpp similarity index 69% rename from src/views/teacher/request/approve/new/Responses.hpp rename to src/legacy/views/teacher/request/approve/new/Responses.hpp index 24f157b2..2322aad1 100644 --- a/src/views/teacher/request/approve/new/Responses.hpp +++ b/src/legacy/views/teacher/request/approve/new/Responses.hpp @@ -9,14 +9,14 @@ #include #include "http/ErrorV1.hpp" -#include "models/admin_account/type.hpp" -#include "models/request_privileges/type.hpp" -#include "models/teacher/type.hpp" -#include "models/user/type.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/admin_account/type.hpp" +#include "legacy/models/request_privileges/type.hpp" +#include "legacy/models/teacher/type.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" -namespace views::teacher::requests::approve::new_ +namespace legacy::views::teacher::requests::approve::new_ { using namespace utils::convert; struct Response200 @@ -34,4 +34,4 @@ using Response401 = utils::common_errors::Response401; using Response403 = utils::common_errors::Response403; -} // namespace views::teacher::requests::approve::new_ +} // namespace legacy::views::teacher::requests::approve::new_ diff --git a/src/views/teacher/request/approve/new/view.cpp b/src/legacy/views/teacher/request/approve/new/view.cpp similarity index 76% rename from src/views/teacher/request/approve/new/view.cpp rename to src/legacy/views/teacher/request/approve/new/view.cpp index 83829c99..9e920d72 100644 --- a/src/views/teacher/request/approve/new/view.cpp +++ b/src/legacy/views/teacher/request/approve/new/view.cpp @@ -15,18 +15,18 @@ #include "Request.hpp" #include "Responses.hpp" -#include "components/controllers/postgres/teacher/controller.hpp" -#include "components/controllers/postgres/user/controller.hpp" +#include "legacy/components/controllers/postgres/teacher/controller.hpp" +#include "legacy/components/controllers/postgres/user/controller.hpp" #include "http/handler_parsed.hpp" -#include "models/auth_token/serialize.hpp" -#include "models/user/serialize.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" -namespace views::teacher::requests::approve::new_ +#include "legacy/models/auth_token/serialize.hpp" +#include "legacy/models/user/serialize.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" +namespace legacy::views::teacher::requests::approve::new_ { namespace { -namespace pg = components::controllers::postgres; +namespace pg = legacy::components::controllers::postgres; class Handler final : public http::HandlerParsed @@ -49,8 +49,8 @@ class Handler final { return utils::common_errors::PerformInvalidToken(); } - if (user->type() != models::UserType::kAdmin && - user->type() != models::UserType::kRoot) + if (user->type() != legacy::models::UserType::kAdmin && + user->type() != legacy::models::UserType::kRoot) { return utils::common_errors::PerformForbidden(); } @@ -76,4 +76,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::teacher::requests::approve::new_ +} // namespace legacy::views::teacher::requests::approve::new_ diff --git a/src/legacy/views/teacher/request/approve/new/view.hpp b/src/legacy/views/teacher/request/approve/new/view.hpp new file mode 100644 index 00000000..85edad25 --- /dev/null +++ b/src/legacy/views/teacher/request/approve/new/view.hpp @@ -0,0 +1,7 @@ +#pragma once +#include +namespace legacy::views::teacher::requests::approve::new_ +{ +void Append(userver::components::ComponentList& component_list); + +} diff --git a/src/views/teacher/request/list/Request.hpp b/src/legacy/views/teacher/request/list/Request.hpp similarity index 81% rename from src/views/teacher/request/list/Request.hpp rename to src/legacy/views/teacher/request/list/Request.hpp index fa4bb70d..5c7816d3 100644 --- a/src/views/teacher/request/list/Request.hpp +++ b/src/legacy/views/teacher/request/list/Request.hpp @@ -7,8 +7,8 @@ #include #include -#include "models/teacher_filter/type.hpp" -namespace views::teacher::requests::list +#include "legacy/models/teacher_filter/type.hpp" +namespace legacy::views::teacher::requests::list { using namespace utils::convert; struct Request @@ -19,4 +19,4 @@ struct Request TypeOfBody::Empty; //открываем возможность использовать структуру, как //запрос }; -} // namespace views::teacher::requests::list +} // namespace legacy::views::teacher::requests::list diff --git a/src/views/teacher/request/list/Responses.hpp b/src/legacy/views/teacher/request/list/Responses.hpp similarity index 64% rename from src/views/teacher/request/list/Responses.hpp rename to src/legacy/views/teacher/request/list/Responses.hpp index 4a5418c8..95224543 100644 --- a/src/views/teacher/request/list/Responses.hpp +++ b/src/legacy/views/teacher/request/list/Responses.hpp @@ -9,19 +9,19 @@ #include #include "http/ErrorV1.hpp" -#include "models/admin_account/type.hpp" -#include "models/request_privileges/type.hpp" -#include "models/teacher/type.hpp" -#include "models/user/type.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/admin_account/type.hpp" +#include "legacy/models/request_privileges/type.hpp" +#include "legacy/models/teacher/type.hpp" +#include "legacy/models/user/type.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" -namespace views::teacher::requests::list +namespace legacy::views::teacher::requests::list { using namespace utils::convert; struct Response200 { - ArrayProperty requests; + ArrayProperty requests; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; static constexpr PolicyFields kPolicyFields = PolicyFields::ConvertAll; static constexpr userver::server::http::HttpStatus kStatusCode = @@ -32,4 +32,4 @@ using Response401 = utils::common_errors::Response401; using Response403 = utils::common_errors::Response403; -} // namespace views::teacher::requests::list +} // namespace legacy::views::teacher::requests::list diff --git a/src/views/teacher/request/list/view.cpp b/src/legacy/views/teacher/request/list/view.cpp similarity index 75% rename from src/views/teacher/request/list/view.cpp rename to src/legacy/views/teacher/request/list/view.cpp index d8dc63f3..556eb3e0 100644 --- a/src/views/teacher/request/list/view.cpp +++ b/src/legacy/views/teacher/request/list/view.cpp @@ -15,18 +15,18 @@ #include "Request.hpp" #include "Responses.hpp" -#include "components/controllers/postgres/teacher/controller.hpp" -#include "components/controllers/postgres/user/controller.hpp" +#include "legacy/components/controllers/postgres/teacher/controller.hpp" +#include "legacy/components/controllers/postgres/user/controller.hpp" #include "http/handler_parsed.hpp" -#include "models/auth_token/serialize.hpp" -#include "models/user/serialize.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" -namespace views::teacher::requests::list +#include "legacy/models/auth_token/serialize.hpp" +#include "legacy/models/user/serialize.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" +namespace legacy::views::teacher::requests::list { namespace { -namespace pg = components::controllers::postgres; +namespace pg = legacy::components::controllers::postgres; class Handler final : public http::HandlerParsed { @@ -48,8 +48,8 @@ class Handler final { return utils::common_errors::PerformInvalidToken(); } - if (user->type() != models::UserType::kAdmin && - user->type() != models::UserType::kRoot) + if (user->type() != legacy::models::UserType::kAdmin && + user->type() != legacy::models::UserType::kRoot) { return utils::common_errors::PerformForbidden(); } @@ -70,4 +70,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::teacher::requests::list +} // namespace legacy::views::teacher::requests::list diff --git a/src/legacy/views/teacher/request/list/view.hpp b/src/legacy/views/teacher/request/list/view.hpp new file mode 100644 index 00000000..4884e48f --- /dev/null +++ b/src/legacy/views/teacher/request/list/view.hpp @@ -0,0 +1,7 @@ +#pragma once +#include +namespace legacy::views::teacher::requests::list +{ +void Append(userver::components::ComponentList& component_list); + +} diff --git a/src/views/timetable/get/Request.hpp b/src/legacy/views/timetable/get/Request.hpp similarity index 68% rename from src/views/timetable/get/Request.hpp rename to src/legacy/views/timetable/get/Request.hpp index 04e56c61..cf4b126f 100644 --- a/src/views/timetable/get/Request.hpp +++ b/src/legacy/views/timetable/get/Request.hpp @@ -8,16 +8,16 @@ #include #include -#include "models/lesson_filter/type.hpp" -#include "models/substring/parse.hpp" +#include "legacy/models/lesson_filter/type.hpp" +#include "legacy/models/substring/parse.hpp" -namespace views::timetable::get +namespace legacy::views::timetable::get { using namespace utils::convert; struct Request { - OptionalProperty filter; + OptionalProperty filter; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; static constexpr PolicyFields kPolicyFields = PolicyFields::ConvertAll; }; -} // namespace views::timetable::get +} // namespace legacy::views::timetable::get diff --git a/src/views/timetable/get/Responses.hpp b/src/legacy/views/timetable/get/Responses.hpp similarity index 66% rename from src/views/timetable/get/Responses.hpp rename to src/legacy/views/timetable/get/Responses.hpp index 8e839448..e506d97e 100644 --- a/src/views/timetable/get/Responses.hpp +++ b/src/legacy/views/timetable/get/Responses.hpp @@ -10,16 +10,16 @@ #include #include "http/ErrorV1.hpp" -#include "models/lesson_v1/type.hpp" -#include "models/user_type/serialize.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/lesson_v1/type.hpp" +#include "legacy/models/user_type/serialize.hpp" +#include "legacy/models/user_type/type.hpp" -namespace views::timetable::get +namespace legacy::views::timetable::get { using namespace utils::convert; struct Response200 { - ArrayProperty lessons; + ArrayProperty lessons; static constexpr TypeOfBody kTypeOfBody = TypeOfBody::Json; static constexpr PolicyFields kPolicyFields = PolicyFields::ConvertAll; static constexpr userver::server::http::HttpStatus kStatusCode = @@ -27,8 +27,8 @@ struct Response200 }; static_assert(userver::formats::common::impl::kHasSerialize< - userver::formats::json::Value, models::LessonV1>); + userver::formats::json::Value, legacy::models::LessonV1>); static_assert(userver::formats::common::impl::kHasSerialize< - userver::formats::json::Value, std::vector>); + userver::formats::json::Value, std::vector>); -} // namespace views::timetable::get +} // namespace legacy::views::timetable::get diff --git a/src/views/timetable/get/view.cpp b/src/legacy/views/timetable/get/view.cpp similarity index 79% rename from src/views/timetable/get/view.cpp rename to src/legacy/views/timetable/get/view.cpp index 39968c45..bf79da0d 100644 --- a/src/views/timetable/get/view.cpp +++ b/src/legacy/views/timetable/get/view.cpp @@ -18,21 +18,21 @@ #include "Request.hpp" #include "Responses.hpp" -#include "components/controllers/postgres/lesson/controller.hpp" +#include "legacy/components/controllers/postgres/lesson/controller.hpp" #include "http/handler_parsed.hpp" -#include "models/day/all.hpp" -#include "models/education_type/all.hpp" -#include "models/lesson_v1/parse.hpp" -#include "models/lesson_v1/serialize.hpp" -#include "models/user_type/type.hpp" +#include "legacy/models/day/all.hpp" +#include "legacy/models/education_type/all.hpp" +#include "legacy/models/lesson_v1/parse.hpp" +#include "legacy/models/lesson_v1/serialize.hpp" +#include "legacy/models/user_type/type.hpp" static_assert(userver::formats::common::impl::kHasSerialize< - userver::formats::json::Value, ::models::LessonType>); -namespace views::timetable::get + userver::formats::json::Value, ::legacy::models::LessonType>); +namespace legacy::views::timetable::get { namespace { -namespace pg = components::controllers::postgres; +namespace pg = legacy::components::controllers::postgres; class Handler final : public http::HandlerParsed { public: @@ -71,4 +71,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::timetable::get +} // namespace legacy::views::timetable::get diff --git a/src/legacy/views/timetable/get/view.hpp b/src/legacy/views/timetable/get/view.hpp new file mode 100644 index 00000000..ae374732 --- /dev/null +++ b/src/legacy/views/timetable/get/view.hpp @@ -0,0 +1,7 @@ +#pragma once +#include +namespace legacy::views::timetable::get +{ +void Append(userver::components::ComponentList& component_list); + +} diff --git a/src/models/day/all.hpp b/src/models/day/all.hpp deleted file mode 100644 index 79e8d9dd..00000000 --- a/src/models/day/all.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include "models/day/parse.hpp" -#include "models/day/postgre.hpp" -#include "models/day/serialize.hpp" diff --git a/src/models/education_type/all.hpp b/src/models/education_type/all.hpp deleted file mode 100644 index 70d37443..00000000 --- a/src/models/education_type/all.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include "models/education_type/parse.hpp" -#include "models/education_type/postgre.hpp" -#include "models/education_type/serialize.hpp" diff --git a/src/models/lesson_type/all.hpp b/src/models/lesson_type/all.hpp deleted file mode 100644 index 382480ec..00000000 --- a/src/models/lesson_type/all.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include "models/lesson_type/parse.hpp" -#include "models/lesson_type/postgre.hpp" -#include "models/lesson_type/serialize.hpp" diff --git a/src/models/lesson_v1/parse.hpp b/src/models/lesson_v1/parse.hpp deleted file mode 100644 index 9b53ac07..00000000 --- a/src/models/lesson_v1/parse.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include "models/day/parse.hpp" -#include "models/education_type/parse.hpp" -#include "models/lesson_type/parse.hpp" -#include "models/lesson_week_type/parse.hpp" -#include "models/subgroup/parse.hpp" -#include "models/timestring/parse.hpp" -#include "type.hpp" diff --git a/src/models/lesson_v1/postgre.hpp b/src/models/lesson_v1/postgre.hpp deleted file mode 100644 index 36134974..00000000 --- a/src/models/lesson_v1/postgre.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include - -#include "models/day/postgre.hpp" -#include "models/education_type/postgre.hpp" -#include "models/lesson_type/postgre.hpp" -#include "models/lesson_v1/type.hpp" -#include "models/lesson_week_type/postgre.hpp" -#include "models/subgroup/postgre.hpp" -#include "models/timestring/postgre.hpp" -namespace models -{ -using TupleLessonV1 = ::utils::convert::drop_properties_to_ref_mut_t; -} diff --git a/src/models/lesson_v1/serialize.hpp b/src/models/lesson_v1/serialize.hpp deleted file mode 100644 index 019fa27d..00000000 --- a/src/models/lesson_v1/serialize.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include "models/day/serialize.hpp" -#include "models/education_type/serialize.hpp" -#include "models/lesson_type/serialize.hpp" -#include "models/lesson_week_type/serialize.hpp" -#include "models/subgroup/serialize.hpp" -#include "models/timestring/serialize.hpp" -#include "type.hpp" diff --git a/src/models/lesson_week_type/all.hpp b/src/models/lesson_week_type/all.hpp deleted file mode 100644 index f7060391..00000000 --- a/src/models/lesson_week_type/all.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include "models/lesson_week_type/parse.hpp" -#include "models/lesson_week_type/postgre.hpp" -#include "models/lesson_week_type/serialize.hpp" diff --git a/src/models/subgroup/all.hpp b/src/models/subgroup/all.hpp deleted file mode 100644 index a6cfacf2..00000000 --- a/src/models/subgroup/all.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include "models/subgroup/parse.hpp" -#include "models/subgroup/postgre.hpp" -#include "models/subgroup/serialize.hpp" diff --git a/src/models/substring/all.hpp b/src/models/substring/all.hpp deleted file mode 100644 index 4470b28e..00000000 --- a/src/models/substring/all.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include "models/substring/parse.hpp" -#include "models/substring/postgre.hpp" -#include "models/substring/serialize.hpp" diff --git a/src/models/teacher/parse.hpp b/src/models/teacher/parse.hpp deleted file mode 100644 index 37de745d..00000000 --- a/src/models/teacher/parse.hpp +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "models/user_type/parse.hpp" diff --git a/src/models/teacher_info/parse.hpp b/src/models/teacher_info/parse.hpp deleted file mode 100644 index 37de745d..00000000 --- a/src/models/teacher_info/parse.hpp +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "models/user_type/parse.hpp" diff --git a/src/models/timestring/all.hpp b/src/models/timestring/all.hpp deleted file mode 100644 index b7ef3910..00000000 --- a/src/models/timestring/all.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include "models/timestring/parse.hpp" -#include "models/timestring/postgre.hpp" -#include "models/timestring/serialize.hpp" diff --git a/src/models/user/parse.hpp b/src/models/user/parse.hpp deleted file mode 100644 index 37de745d..00000000 --- a/src/models/user/parse.hpp +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "models/user_type/parse.hpp" diff --git a/src/views/login/Request.hpp b/src/views/login/Request.hpp deleted file mode 100644 index 437f144b..00000000 --- a/src/views/login/Request.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once -#include -#include - -#include "models/user_credentials/type.hpp" -namespace views::login -{ -using Request = models::UserCredentials; -} // namespace views::login diff --git a/src/views/login/view.hpp b/src/views/login/view.hpp deleted file mode 100644 index 62b0e657..00000000 --- a/src/views/login/view.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include -namespace views::login -{ -void Append(userver::components::ComponentList& component_list); - -} diff --git a/src/views/register/Request.hpp b/src/views/register/Request.hpp deleted file mode 100644 index d7df87cb..00000000 --- a/src/views/register/Request.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once -#include -#include - -#include "models/register_request/type.hpp" -namespace views::register_ -{ -using Request = models::RegisterRequest; -} // namespace views::register_ diff --git a/src/views/register/view.hpp b/src/views/register/view.hpp deleted file mode 100644 index bf84f646..00000000 --- a/src/views/register/view.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include -namespace views::register_ -{ -void Append(userver::components::ComponentList& component_list); - -} diff --git a/src/views/teacher/create/view.hpp b/src/views/teacher/create/view.hpp deleted file mode 100644 index 3c20c9df..00000000 --- a/src/views/teacher/create/view.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include -namespace views::teacher::create -{ -void Append(userver::components::ComponentList& component_list); - -} diff --git a/src/views/teacher/list/view.hpp b/src/views/teacher/list/view.hpp deleted file mode 100644 index 5e44dc32..00000000 --- a/src/views/teacher/list/view.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include -namespace views::teacher::list -{ -void Append(userver::components::ComponentList& component_list); - -} diff --git a/src/views/teacher/request/approve/link/view.hpp b/src/views/teacher/request/approve/link/view.hpp deleted file mode 100644 index 82132a30..00000000 --- a/src/views/teacher/request/approve/link/view.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include -namespace views::teacher::requests::approve::link -{ -void Append(userver::components::ComponentList& component_list); - -} diff --git a/src/views/teacher/request/approve/new/view.hpp b/src/views/teacher/request/approve/new/view.hpp deleted file mode 100644 index 127bfba5..00000000 --- a/src/views/teacher/request/approve/new/view.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include -namespace views::teacher::requests::approve::new_ -{ -void Append(userver::components::ComponentList& component_list); - -} diff --git a/src/views/teacher/request/list/view.hpp b/src/views/teacher/request/list/view.hpp deleted file mode 100644 index cfa97bc3..00000000 --- a/src/views/teacher/request/list/view.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include -namespace views::teacher::requests::list -{ -void Append(userver::components::ComponentList& component_list); - -} diff --git a/src/views/test-openapi-view/declarations.hpp b/src/views/test-openapi-view/declarations.hpp index 55559092..d46f0ca4 100644 --- a/src/views/test-openapi-view/declarations.hpp +++ b/src/views/test-openapi-view/declarations.hpp @@ -35,4 +35,4 @@ struct Response auto operator<=>(const Response&) const = default; }; -} // namespace views::test::login +} // namespace legacy::views::test::login diff --git a/src/views/test-openapi-view/view.cpp b/src/views/test-openapi-view/view.cpp index 6e9de4f7..0644fc58 100644 --- a/src/views/test-openapi-view/view.cpp +++ b/src/views/test-openapi-view/view.cpp @@ -40,4 +40,4 @@ void Append(userver::components::ComponentList& component_list) component_list.Append(); } -} // namespace views::test::login +} // namespace legacy::views::test::login diff --git a/src/views/timetable/get/view.hpp b/src/views/timetable/get/view.hpp deleted file mode 100644 index e3cb0544..00000000 --- a/src/views/timetable/get/view.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include -namespace views::timetable::get -{ -void Append(userver::components::ComponentList& component_list); - -} diff --git a/utests/hello_test.cpp b/utests/hello_test.cpp index 8bc3898c..5c6aafd7 100644 --- a/utests/hello_test.cpp +++ b/utests/hello_test.cpp @@ -1,7 +1,7 @@ #include #include -#include "views/hello/view.hpp" +#include "legacy/views/hello/view.hpp" UTEST(SayHelloTo, Basic) { diff --git a/utests/openapi/doc/serialize/basic.cpp b/utests/openapi/doc/serialize/basic.cpp index 81a6e033..98dda1ee 100644 --- a/utests/openapi/doc/serialize/basic.cpp +++ b/utests/openapi/doc/serialize/basic.cpp @@ -16,8 +16,6 @@ #include #include -#include "views/hello/view.hpp" - using namespace openapi; using namespace types; using namespace preferences; diff --git a/utests/openapi/doc/serialize/basic_request.cpp b/utests/openapi/doc/serialize/basic_request.cpp index 0ba6e139..593178aa 100644 --- a/utests/openapi/doc/serialize/basic_request.cpp +++ b/utests/openapi/doc/serialize/basic_request.cpp @@ -8,7 +8,6 @@ #include #include -#include "views/hello/view.hpp" using namespace openapi; using namespace types; diff --git a/utests/openapi/json/parse/basic_array.cpp b/utests/openapi/json/parse/basic_array.cpp index 645f87a3..561037de 100644 --- a/utests/openapi/json/parse/basic_array.cpp +++ b/utests/openapi/json/parse/basic_array.cpp @@ -11,8 +11,6 @@ #include #include -#include "views/hello/view.hpp" - using namespace openapi; UTEST(Openapi_Json_Parse, BasicArrayProperty) diff --git a/utests/openapi/json/parse/basic_object.cpp b/utests/openapi/json/parse/basic_object.cpp index e07c1573..1e1472c1 100644 --- a/utests/openapi/json/parse/basic_object.cpp +++ b/utests/openapi/json/parse/basic_object.cpp @@ -9,8 +9,6 @@ #include #include -#include "views/hello/view.hpp" - using namespace openapi; using namespace openapi::types; using namespace openapi::preferences; diff --git a/utests/openapi/json/parse/basic_string.cpp b/utests/openapi/json/parse/basic_string.cpp index a4675b38..02eaf077 100644 --- a/utests/openapi/json/parse/basic_string.cpp +++ b/utests/openapi/json/parse/basic_string.cpp @@ -10,8 +10,6 @@ #include #include -#include "views/hello/view.hpp" - using namespace openapi; UTEST(Openapi_Json_Parse, BasicStringPattern) diff --git a/utests/openapi/json/serialize/basic_array.cpp b/utests/openapi/json/serialize/basic_array.cpp index 8aa3212d..6a87d45f 100644 --- a/utests/openapi/json/serialize/basic_array.cpp +++ b/utests/openapi/json/serialize/basic_array.cpp @@ -13,8 +13,6 @@ #include #include -#include "views/hello/view.hpp" - using namespace openapi::types; using namespace openapi::preferences; diff --git a/utests/openapi/json/serialize/basic_object.cpp b/utests/openapi/json/serialize/basic_object.cpp index c64f27a8..ecb7b6b2 100644 --- a/utests/openapi/json/serialize/basic_object.cpp +++ b/utests/openapi/json/serialize/basic_object.cpp @@ -12,7 +12,6 @@ #include #include -#include "views/hello/view.hpp" using namespace openapi; using namespace openapi::types; using namespace openapi::preferences; diff --git a/utests/openapi/json/serialize/basic_optional.cpp b/utests/openapi/json/serialize/basic_optional.cpp index cb63daac..8e7ac0c5 100644 --- a/utests/openapi/json/serialize/basic_optional.cpp +++ b/utests/openapi/json/serialize/basic_optional.cpp @@ -20,7 +20,6 @@ // #include // #include // #include -// #include "views/hello/view.hpp" // using namespace openapi::types; // using namespace openapi::preferences; diff --git a/utests/openapi/json/serialize/basic_string.cpp b/utests/openapi/json/serialize/basic_string.cpp index ca6a232d..977bb6d9 100644 --- a/utests/openapi/json/serialize/basic_string.cpp +++ b/utests/openapi/json/serialize/basic_string.cpp @@ -11,8 +11,6 @@ #include #include -#include "views/hello/view.hpp" - using namespace openapi::preferences; using namespace openapi::types;