-
Notifications
You must be signed in to change notification settings - Fork 3
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
6e1d8dc
commit 9b195ea
Showing
13 changed files
with
236 additions
and
31 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,11 +1,32 @@ | ||
use serde::Serialize; | ||
use modql::field::Fields; | ||
use serde::{Deserialize, Serialize}; | ||
use sqlx::prelude::FromRow; | ||
|
||
pub mod request; | ||
pub mod response; | ||
|
||
#[derive(Serialize, FromRow)] | ||
#[derive(Serialize, FromRow, Fields)] | ||
pub struct User { | ||
pub pk_user_id: i64, | ||
pub username: String, | ||
} | ||
|
||
#[derive(Serialize, FromRow, Fields)] | ||
pub struct Course { | ||
pub pk_course_id: i64, | ||
pub title: String, | ||
pub description: String, | ||
} | ||
|
||
#[derive(Deserialize, FromRow, Fields)] | ||
pub struct RequestCreateCourse { | ||
pub pk_course_id: i64, | ||
pub title: String, | ||
pub description: String, | ||
} | ||
|
||
#[derive(Serialize, FromRow, Fields)] | ||
pub struct ResponseCreateCourse { | ||
pub pk_course_id: i64, | ||
pub title: String, | ||
} |
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,6 +1,13 @@ | ||
CREATE SCHEMA IF NOT EXISTS "user"; | ||
CREATE SCHEMA IF NOT EXISTS "course"; | ||
|
||
CREATE TABLE IF NOT EXISTS "user"."tbl_users" ( | ||
pk_user_id SERIAL PRIMARY KEY NOT NULL, | ||
pk_user_id BIGINT PRIMARY KEY NOT NULL, | ||
username VARCHAR(150) NOT NULL | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS "course"."tbl_courses" ( | ||
pk_course_id BIGINT PRIMARY KEY NOT NULL, | ||
title VARCHAR(150) NOT NULL, | ||
description TEXT | ||
) |
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
Oops, something went wrong.