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.
- Loading branch information
1 parent
c18a357
commit 6dc7b31
Showing
17 changed files
with
122 additions
and
159 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 <userver/storages/postgres/io/composite_types.hpp> | ||
#include <models/admin_account/type.hpp> | ||
#include "userver/storages/postgres/io/pg_types.hpp" | ||
|
||
namespace userver::storages::postgres::io{ | ||
template <> | ||
struct CppToPg<models::AdminAccount>{ | ||
static constexpr DBTypeName postgres_name = "timetable_vsu.admin_account"; | ||
}; | ||
} |
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 <openapi/types/string.hpp> | ||
#include <openapi/types/uuid.hpp> | ||
|
||
namespace models{ | ||
using namespace openapi::types; | ||
using namespace openapi::preferences; | ||
struct AdminAccount | ||
{ | ||
Uuid<Name<"user_id">> user_id; | ||
Uuid<Name<"admin_id">> admin_id; | ||
String<Name<"login">> credentials; | ||
auto operator<=>(const AdminAccount&) const = default; | ||
}; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
SELECT | ||
u.id AS user_id, | ||
a.id AS admin_id, | ||
u.login AS user_login | ||
FROM timetable_vsu."admin" AS a | ||
LEFT JOIN timetable_vsu."user" AS u ON u.id = a.id_user | ||
WHERE a.id = $1 | ||
; |
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 @@ | ||
WITH admin_info as (SELECT | ||
a.id AS admin_id, | ||
a.id_user AS user_id, | ||
u.login AS login | ||
FROM timetable_vsu.admin AS a | ||
LEFT JOIN timetable_vsu.user AS u ON a.id_user = u.id | ||
) | ||
SELECT | ||
user_id, | ||
admin_id, | ||
login | ||
FROM admin_info | ||
WHERE | ||
($1.admin_ids IS null OR admin_id::text ILIKE ANY($1.admin_ids)) and | ||
($1.user_ids IS null OR user_id::text ILIKE ANY($1.user_ids)) and | ||
($1.logins IS null OR login ILIKE ANY($1.logins)) | ||
; |
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