generated from userver-framework/service_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs: update merge script + added to git unite_api.yaml
Docs: update merge script + added to git unite_api.yaml Login: fix errors responses
- Loading branch information
1 parent
b7226dd
commit 2b91e4a
Showing
22 changed files
with
943 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
type: integer | ||
type: string | ||
enum: | ||
- 1 | ||
- 2 | ||
- 3 | ||
- 4 | ||
- 5 | ||
- 6 | ||
- Monday | ||
- Tuesday | ||
- Wednesday | ||
- Thursday | ||
- Friday | ||
- Saturday |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
description: 'Тип подгруппы: 0 - для обеих, 1 - только для левой, 2 - только для правой' | ||
type: integer | ||
description: 'Тип подгруппы: All - для обеих' | ||
type: string | ||
enum: | ||
- 0 | ||
- 1 | ||
- 2 | ||
- All | ||
- First | ||
- Second |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
description: 'Тип пары' | ||
type: string | ||
enum: | ||
- Labaratory | ||
- Lection | ||
- Practice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
description: 'Тип недели: 0 - всегда, 1 - только по числителю, 2 - только по знаменателю' | ||
type: integer | ||
description: 'Тип недели: All - всегда, Even - только по числителю, Odd - только по знаменателю' | ||
type: string | ||
enum: | ||
- 0 | ||
- 1 | ||
- 2 | ||
- All | ||
- Even | ||
- Odd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
type: string | ||
enum: | ||
- 'student' | ||
- 'user' | ||
- 'teacher' | ||
- 'admin' | ||
- 'root' #may be unused |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
INSERT INTO vsu_timetable.user(login, password, user_type) | ||
VALUES('test_user', 'password123', 'user'); | ||
VALUES('some_nickname', 'some_password', 'user'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
#include "../utils/convert/base.hpp" | ||
#include "userver/server/http/http_status.hpp" | ||
|
||
namespace timetable_vsu_backend::http { | ||
namespace convert = timetable_vsu_backend::utils::convert; | ||
template <userver::server::http::HttpStatus code> | ||
struct ErrorV1 { | ||
static constexpr convert::TypeOfBody kTypeOfBody = | ||
convert::TypeOfBody::Json; | ||
static constexpr convert::PolicyFields kPolicyFields = | ||
convert::PolicyFields::ConvertAll; | ||
static constexpr userver::server::http::HttpStatus kStatusCode = code; | ||
convert::Property<std::string, "description"> description; | ||
convert::Property<std::string, "machine_id"> machine_id; | ||
}; | ||
} // namespace timetable_vsu_backend::http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
#include <boost/uuid/uuid.hpp> | ||
|
||
#include "utils/convert/base.hpp" | ||
|
||
namespace convert = timetable_vsu_backend::utils::convert; | ||
|
||
struct LessonV1 { | ||
convert::Property<boost::uuids::uuid, "room_id"> room_id; | ||
convert::Property<std::string, "room_name"> room_name; | ||
convert::Property<boost::uuids::uuid, "teacher_id"> teacher_id; | ||
convert::Property<std::string, "teacher_fio"> teacher_fio; | ||
convert::Property<boost::uuids::uuid, "subject_id"> subject_id; | ||
convert::Property<std::string, "subject_name"> subject_name; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "serialize.hpp" | ||
|
||
#include "userver/formats/json/value_builder.hpp" | ||
|
||
namespace timetable_vsu_backend::models { | ||
std::string Serialize(const UserType& value, | ||
userver::formats::serialize::To<std::string>) { | ||
switch (value) { | ||
case UserType::kUser: | ||
return "user"; | ||
case UserType::kAdmin: | ||
return "admin"; | ||
case UserType::kRoot: | ||
return "root"; | ||
case UserType::kTeacher: | ||
return "teacher"; | ||
} | ||
} | ||
userver::formats::json::Value Serialize( | ||
const UserType& value, | ||
userver::formats::serialize::To<userver::formats::json::Value>) { | ||
std::string str = | ||
Serialize(value, userver::formats::serialize::To<std::string>{}); | ||
return userver::formats::json::ValueBuilder(str).ExtractValue(); | ||
} | ||
} // namespace timetable_vsu_backend::models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
#include "type.hpp" | ||
#include "userver/formats/json/value.hpp" | ||
|
||
namespace timetable_vsu_backend::models { | ||
userver::formats::json::Value Serialize( | ||
const UserType& value, | ||
userver::formats::serialize::To<userver::formats::json::Value>); | ||
std::string Serialize(const UserType& value, | ||
userver::formats::serialize::To<std::string>); | ||
} // namespace timetable_vsu_backend::models |
Oops, something went wrong.