Update Rust crate sqlx to 0.6 - autoclosed #11
237
Cargo.lock
generated
237
Cargo.lock
generated
@ -312,15 +312,6 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "atoi"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "616896e05fc0e2649463a93a15183c6a16bf03413a7af88ef1285ddedfa9cda5"
|
|
||||||
dependencies = [
|
|
||||||
"num-traits",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "atoi"
|
name = "atoi"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
@ -660,7 +651,7 @@ dependencies = [
|
|||||||
"rand_core",
|
"rand_core",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sqlx 0.6.1",
|
"sqlx",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tower",
|
"tower",
|
||||||
"tower-http",
|
"tower-http",
|
||||||
@ -691,7 +682,7 @@ dependencies = [
|
|||||||
"rand_core",
|
"rand_core",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sqlx 0.6.1",
|
"sqlx",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tower-http",
|
"tower-http",
|
||||||
"tracing",
|
"tracing",
|
||||||
@ -713,7 +704,7 @@ dependencies = [
|
|||||||
"rust-argon2",
|
"rust-argon2",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sqlx 0.5.13",
|
"sqlx",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"time 0.2.27",
|
"time 0.2.27",
|
||||||
"tokio",
|
"tokio",
|
||||||
@ -752,7 +743,7 @@ dependencies = [
|
|||||||
"rand_core",
|
"rand_core",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sqlx 0.6.1",
|
"sqlx",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tower-http",
|
"tower-http",
|
||||||
"tracing",
|
"tracing",
|
||||||
@ -779,7 +770,7 @@ dependencies = [
|
|||||||
"rand_core",
|
"rand_core",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sqlx 0.6.1",
|
"sqlx",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tower-http",
|
"tower-http",
|
||||||
"tracing",
|
"tracing",
|
||||||
@ -832,30 +823,15 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "crc"
|
|
||||||
version = "2.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23"
|
|
||||||
dependencies = [
|
|
||||||
"crc-catalog 1.1.1",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crc"
|
name = "crc"
|
||||||
version = "3.0.0"
|
version = "3.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3"
|
checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crc-catalog 2.1.0",
|
"crc-catalog",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "crc-catalog"
|
|
||||||
version = "1.1.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crc-catalog"
|
name = "crc-catalog"
|
||||||
version = "2.1.0"
|
version = "2.1.0"
|
||||||
@ -1253,15 +1229,6 @@ dependencies = [
|
|||||||
"polyval",
|
"polyval",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "hashbrown"
|
|
||||||
version = "0.11.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
|
|
||||||
dependencies = [
|
|
||||||
"ahash",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.12.3"
|
version = "0.12.3"
|
||||||
@ -1271,22 +1238,13 @@ dependencies = [
|
|||||||
"ahash",
|
"ahash",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "hashlink"
|
|
||||||
version = "0.7.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf"
|
|
||||||
dependencies = [
|
|
||||||
"hashbrown 0.11.2",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashlink"
|
name = "hashlink"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d452c155cb93fecdfb02a73dd57b5d8e442c2063bd7aac72f1bc5e4263a43086"
|
checksum = "d452c155cb93fecdfb02a73dd57b5d8e442c2063bd7aac72f1bc5e4263a43086"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hashbrown 0.12.3",
|
"hashbrown",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1472,7 +1430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
|
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"hashbrown 0.12.3",
|
"hashbrown",
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -2095,19 +2053,6 @@ dependencies = [
|
|||||||
"semver",
|
"semver",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rustls"
|
|
||||||
version = "0.19.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7"
|
|
||||||
dependencies = [
|
|
||||||
"base64",
|
|
||||||
"log",
|
|
||||||
"ring",
|
|
||||||
"sct 0.6.1",
|
|
||||||
"webpki 0.21.4",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls"
|
name = "rustls"
|
||||||
version = "0.20.6"
|
version = "0.20.6"
|
||||||
@ -2116,8 +2061,8 @@ checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"ring",
|
"ring",
|
||||||
"sct 0.7.0",
|
"sct",
|
||||||
"webpki 0.22.0",
|
"webpki",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2141,16 +2086,6 @@ version = "1.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "sct"
|
|
||||||
version = "0.6.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce"
|
|
||||||
dependencies = [
|
|
||||||
"ring",
|
|
||||||
"untrusted",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sct"
|
name = "sct"
|
||||||
version = "0.7.0"
|
version = "0.7.0"
|
||||||
@ -2346,77 +2281,14 @@ dependencies = [
|
|||||||
"unicode_categories",
|
"unicode_categories",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "sqlx"
|
|
||||||
version = "0.5.13"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "551873805652ba0d912fec5bbb0f8b4cdd96baf8e2ebf5970e5671092966019b"
|
|
||||||
dependencies = [
|
|
||||||
"sqlx-core 0.5.13",
|
|
||||||
"sqlx-macros 0.5.13",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sqlx"
|
name = "sqlx"
|
||||||
version = "0.6.1"
|
version = "0.6.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "788841def501aabde58d3666fcea11351ec3962e6ea75dbcd05c84a71d68bcd1"
|
checksum = "788841def501aabde58d3666fcea11351ec3962e6ea75dbcd05c84a71d68bcd1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sqlx-core 0.6.1",
|
"sqlx-core",
|
||||||
"sqlx-macros 0.6.1",
|
"sqlx-macros",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "sqlx-core"
|
|
||||||
version = "0.5.13"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e48c61941ccf5ddcada342cd59e3e5173b007c509e1e8e990dafc830294d9dc5"
|
|
||||||
dependencies = [
|
|
||||||
"ahash",
|
|
||||||
"atoi 0.4.0",
|
|
||||||
"base64",
|
|
||||||
"bitflags",
|
|
||||||
"byteorder",
|
|
||||||
"bytes",
|
|
||||||
"crc 2.1.0",
|
|
||||||
"crossbeam-queue",
|
|
||||||
"dirs",
|
|
||||||
"either",
|
|
||||||
"event-listener",
|
|
||||||
"futures-channel",
|
|
||||||
"futures-core",
|
|
||||||
"futures-intrusive",
|
|
||||||
"futures-util",
|
|
||||||
"hashlink 0.7.0",
|
|
||||||
"hex",
|
|
||||||
"hkdf",
|
|
||||||
"hmac 0.12.1",
|
|
||||||
"indexmap",
|
|
||||||
"itoa",
|
|
||||||
"libc",
|
|
||||||
"log",
|
|
||||||
"md-5",
|
|
||||||
"memchr",
|
|
||||||
"once_cell",
|
|
||||||
"paste",
|
|
||||||
"percent-encoding",
|
|
||||||
"rand",
|
|
||||||
"rustls 0.19.1",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"sha-1",
|
|
||||||
"sha2 0.10.2",
|
|
||||||
"smallvec",
|
|
||||||
"sqlformat",
|
|
||||||
"sqlx-rt 0.5.13",
|
|
||||||
"stringprep",
|
|
||||||
"thiserror",
|
|
||||||
"time 0.2.27",
|
|
||||||
"tokio-stream",
|
|
||||||
"url",
|
|
||||||
"webpki 0.21.4",
|
|
||||||
"webpki-roots 0.21.1",
|
|
||||||
"whoami",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2426,12 +2298,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "8c21d3b5e7cadfe9ba7cdc1295f72cc556c750b4419c27c219c0693198901f8e"
|
checksum = "8c21d3b5e7cadfe9ba7cdc1295f72cc556c750b4419c27c219c0693198901f8e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash",
|
"ahash",
|
||||||
"atoi 1.0.0",
|
"atoi",
|
||||||
"base64",
|
"base64",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"bytes",
|
"bytes",
|
||||||
"crc 3.0.0",
|
"crc",
|
||||||
"crossbeam-queue",
|
"crossbeam-queue",
|
||||||
"dirs",
|
"dirs",
|
||||||
"dotenvy",
|
"dotenvy",
|
||||||
@ -2441,7 +2313,7 @@ dependencies = [
|
|||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-intrusive",
|
"futures-intrusive",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"hashlink 0.8.0",
|
"hashlink",
|
||||||
"hex",
|
"hex",
|
||||||
"hkdf",
|
"hkdf",
|
||||||
"hmac 0.12.1",
|
"hmac 0.12.1",
|
||||||
@ -2455,7 +2327,7 @@ dependencies = [
|
|||||||
"paste",
|
"paste",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"rand",
|
"rand",
|
||||||
"rustls 0.20.6",
|
"rustls",
|
||||||
"rustls-pemfile",
|
"rustls-pemfile",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@ -2463,35 +2335,17 @@ dependencies = [
|
|||||||
"sha2 0.10.2",
|
"sha2 0.10.2",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"sqlformat",
|
"sqlformat",
|
||||||
"sqlx-rt 0.6.1",
|
"sqlx-rt",
|
||||||
"stringprep",
|
"stringprep",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
"time 0.3.14",
|
||||||
"tokio-stream",
|
"tokio-stream",
|
||||||
"url",
|
"url",
|
||||||
"uuid",
|
"uuid",
|
||||||
"webpki-roots 0.22.4",
|
"webpki-roots",
|
||||||
"whoami",
|
"whoami",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "sqlx-macros"
|
|
||||||
version = "0.5.13"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bc0fba2b0cae21fc00fe6046f8baa4c7fcb49e379f0f592b04696607f69ed2e1"
|
|
||||||
dependencies = [
|
|
||||||
"dotenv",
|
|
||||||
"either",
|
|
||||||
"heck",
|
|
||||||
"once_cell",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"sha2 0.10.2",
|
|
||||||
"sqlx-core 0.5.13",
|
|
||||||
"sqlx-rt 0.5.13",
|
|
||||||
"syn",
|
|
||||||
"url",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sqlx-macros"
|
name = "sqlx-macros"
|
||||||
version = "0.6.1"
|
version = "0.6.1"
|
||||||
@ -2508,23 +2362,12 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2 0.10.2",
|
"sha2 0.10.2",
|
||||||
"sqlx-core 0.6.1",
|
"sqlx-core",
|
||||||
"sqlx-rt 0.6.1",
|
"sqlx-rt",
|
||||||
"syn",
|
"syn",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "sqlx-rt"
|
|
||||||
version = "0.5.13"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4db708cd3e459078f85f39f96a00960bd841f66ee2a669e90bf36907f5a79aae"
|
|
||||||
dependencies = [
|
|
||||||
"once_cell",
|
|
||||||
"tokio",
|
|
||||||
"tokio-rustls 0.22.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sqlx-rt"
|
name = "sqlx-rt"
|
||||||
version = "0.6.1"
|
version = "0.6.1"
|
||||||
@ -2533,7 +2376,7 @@ checksum = "7be52fc7c96c136cedea840ed54f7d446ff31ad670c9dea95ebcb998530971a3"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls 0.23.4",
|
"tokio-rustls",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2806,26 +2649,15 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tokio-rustls"
|
|
||||||
version = "0.22.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6"
|
|
||||||
dependencies = [
|
|
||||||
"rustls 0.19.1",
|
|
||||||
"tokio",
|
|
||||||
"webpki 0.21.4",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio-rustls"
|
name = "tokio-rustls"
|
||||||
version = "0.23.4"
|
version = "0.23.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
|
checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rustls 0.20.6",
|
"rustls",
|
||||||
"tokio",
|
"tokio",
|
||||||
"webpki 0.22.0",
|
"webpki",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3253,16 +3085,6 @@ dependencies = [
|
|||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "webpki"
|
|
||||||
version = "0.21.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea"
|
|
||||||
dependencies = [
|
|
||||||
"ring",
|
|
||||||
"untrusted",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webpki"
|
name = "webpki"
|
||||||
version = "0.22.0"
|
version = "0.22.0"
|
||||||
@ -3273,22 +3095,13 @@ dependencies = [
|
|||||||
"untrusted",
|
"untrusted",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "webpki-roots"
|
|
||||||
version = "0.21.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940"
|
|
||||||
dependencies = [
|
|
||||||
"webpki 0.21.4",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webpki-roots"
|
name = "webpki-roots"
|
||||||
version = "0.22.4"
|
version = "0.22.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf"
|
checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"webpki 0.22.0",
|
"webpki",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -12,7 +12,7 @@ use crate::controllers::graphql::GraphQLController;
|
|||||||
pub struct Api;
|
pub struct Api;
|
||||||
|
|
||||||
impl Api {
|
impl Api {
|
||||||
pub async fn new(
|
pub async fn run_api(
|
||||||
port: u32,
|
port: u32,
|
||||||
cors_origin: &str,
|
cors_origin: &str,
|
||||||
service_register: ServiceRegister,
|
service_register: ServiceRegister,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
use axum::{http::StatusCode, response::IntoResponse, Json};
|
use axum::{http::StatusCode, response::IntoResponse, Json};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum AppError {
|
pub enum AppError {
|
||||||
WrongCredentials,
|
WrongCredentials,
|
||||||
|
@ -29,7 +29,7 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
|
|
||||||
let service_register = ServiceRegister::new(pool, config.clone());
|
let service_register = ServiceRegister::new(pool, config.clone());
|
||||||
|
|
||||||
Api::new(
|
Api::run_api(
|
||||||
config.api_port,
|
config.api_port,
|
||||||
&config.cors_origin,
|
&config.cors_origin,
|
||||||
service_register.clone(),
|
service_register.clone(),
|
||||||
|
@ -12,7 +12,7 @@ axum = "0.5.1"
|
|||||||
|
|
||||||
# utilty crates
|
# utilty crates
|
||||||
serde = { version = "1.0.136", features = ["derive"] }
|
serde = { version = "1.0.136", features = ["derive"] }
|
||||||
sqlx = { version = "0.5", features = [
|
sqlx = { version = "0.6", features = [
|
||||||
"runtime-tokio-rustls",
|
"runtime-tokio-rustls",
|
||||||
"postgres",
|
"postgres",
|
||||||
"time",
|
"time",
|
||||||
|
@ -2,7 +2,7 @@ pub mod queries;
|
|||||||
pub mod requests;
|
pub mod requests;
|
||||||
pub mod responses;
|
pub mod responses;
|
||||||
|
|
||||||
use async_graphql::{Enum, InputObject, SimpleObject};
|
use async_graphql::{Enum, InputObject};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
|
@ -4,8 +4,6 @@ use como_domain::{
|
|||||||
item::{
|
item::{
|
||||||
queries::{GetItemQuery, GetItemsQuery},
|
queries::{GetItemQuery, GetItemsQuery},
|
||||||
requests::CreateItemDto,
|
requests::CreateItemDto,
|
||||||
responses::CreatedItemDto,
|
|
||||||
ItemDto,
|
|
||||||
},
|
},
|
||||||
projects::{
|
projects::{
|
||||||
queries::{GetProjectQuery, GetProjectsQuery},
|
queries::{GetProjectQuery, GetProjectsQuery},
|
||||||
|
@ -35,19 +35,19 @@ pub struct Item {
|
|||||||
#[Object]
|
#[Object]
|
||||||
impl Item {
|
impl Item {
|
||||||
pub async fn id(&self, _ctx: &Context<'_>) -> anyhow::Result<Uuid> {
|
pub async fn id(&self, _ctx: &Context<'_>) -> anyhow::Result<Uuid> {
|
||||||
return Ok(self.id);
|
Ok(self.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn title(&self, _ctx: &Context<'_>) -> anyhow::Result<String> {
|
pub async fn title(&self, _ctx: &Context<'_>) -> anyhow::Result<String> {
|
||||||
return Ok(self.title.clone());
|
Ok(self.title.clone())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn description(&self, _ctx: &Context<'_>) -> anyhow::Result<Option<String>> {
|
pub async fn description(&self, _ctx: &Context<'_>) -> anyhow::Result<Option<String>> {
|
||||||
return Ok(self.description.clone());
|
Ok(self.description.clone())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn state(&self, _ctx: &Context<'_>) -> anyhow::Result<ItemState> {
|
pub async fn state(&self, _ctx: &Context<'_>) -> anyhow::Result<ItemState> {
|
||||||
return Ok(self.state);
|
Ok(self.state)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn project(&self, ctx: &Context<'_>) -> anyhow::Result<Project> {
|
pub async fn project(&self, ctx: &Context<'_>) -> anyhow::Result<Project> {
|
||||||
|
@ -7,8 +7,7 @@ use crate::{
|
|||||||
configs::AppConfig,
|
configs::AppConfig,
|
||||||
database::ConnectionPool,
|
database::ConnectionPool,
|
||||||
services::{
|
services::{
|
||||||
item_service::{DefaultItemService, MemoryItemService},
|
item_service::MemoryItemService, project_service::MemoryProjectService,
|
||||||
project_service::{DefaultProjectService, MemoryProjectService},
|
|
||||||
user_service::DefaultUserService,
|
user_service::DefaultUserService,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -26,14 +25,14 @@ impl ServiceRegister {
|
|||||||
|
|
||||||
let item_service = Arc::new(MemoryItemService::new()) as DynItemService;
|
let item_service = Arc::new(MemoryItemService::new()) as DynItemService;
|
||||||
let project_service = Arc::new(MemoryProjectService::new()) as DynProjectService;
|
let project_service = Arc::new(MemoryProjectService::new()) as DynProjectService;
|
||||||
let user_service = Arc::new(DefaultUserService::new(pool.clone())) as DynUserService;
|
let user_service = Arc::new(DefaultUserService::new(pool)) as DynUserService;
|
||||||
|
|
||||||
info!("services created succesfully");
|
info!("services created succesfully");
|
||||||
|
|
||||||
return Self {
|
Self {
|
||||||
item_service,
|
item_service,
|
||||||
user_service,
|
user_service,
|
||||||
project_service,
|
project_service,
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ use std::{
|
|||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use anyhow::Context;
|
||||||
use axum::async_trait;
|
use axum::async_trait;
|
||||||
use como_core::items::ItemService;
|
use como_core::items::ItemService;
|
||||||
use como_domain::item::{
|
use como_domain::item::{
|
||||||
@ -21,6 +22,12 @@ impl DefaultItemService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for DefaultItemService {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl ItemService for DefaultItemService {
|
impl ItemService for DefaultItemService {
|
||||||
async fn add_item(&self, _item: CreateItemDto) -> anyhow::Result<CreatedItemDto> {
|
async fn add_item(&self, _item: CreateItemDto) -> anyhow::Result<CreatedItemDto> {
|
||||||
@ -48,6 +55,12 @@ impl MemoryItemService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for MemoryItemService {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl ItemService for MemoryItemService {
|
impl ItemService for MemoryItemService {
|
||||||
async fn add_item(&self, create_item: CreateItemDto) -> anyhow::Result<CreatedItemDto> {
|
async fn add_item(&self, create_item: CreateItemDto) -> anyhow::Result<CreatedItemDto> {
|
||||||
@ -71,7 +84,7 @@ impl ItemService for MemoryItemService {
|
|||||||
if let Ok(item_store) = self.item_store.lock() {
|
if let Ok(item_store) = self.item_store.lock() {
|
||||||
let item = item_store
|
let item = item_store
|
||||||
.get(&query.item_id.to_string())
|
.get(&query.item_id.to_string())
|
||||||
.ok_or(anyhow::anyhow!("could not find item"))?;
|
.context("could not find item")?;
|
||||||
return Ok(item.clone());
|
return Ok(item.clone());
|
||||||
} else {
|
} else {
|
||||||
Err(anyhow::anyhow!("could not unlock item_store"))
|
Err(anyhow::anyhow!("could not unlock item_store"))
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use std::{collections::HashMap, sync::Arc};
|
use std::{collections::HashMap, sync::Arc};
|
||||||
|
|
||||||
|
use anyhow::Context;
|
||||||
use axum::async_trait;
|
use axum::async_trait;
|
||||||
use como_core::projects::ProjectService;
|
use como_core::projects::ProjectService;
|
||||||
use como_domain::projects::{
|
use como_domain::projects::{
|
||||||
@ -16,6 +17,12 @@ impl DefaultProjectService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for DefaultProjectService {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl ProjectService for DefaultProjectService {
|
impl ProjectService for DefaultProjectService {
|
||||||
async fn get_project(&self, _query: GetProjectQuery) -> anyhow::Result<ProjectDto> {
|
async fn get_project(&self, _query: GetProjectQuery) -> anyhow::Result<ProjectDto> {
|
||||||
@ -38,6 +45,12 @@ impl MemoryProjectService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for MemoryProjectService {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl ProjectService for MemoryProjectService {
|
impl ProjectService for MemoryProjectService {
|
||||||
async fn get_project(&self, query: GetProjectQuery) -> anyhow::Result<ProjectDto> {
|
async fn get_project(&self, query: GetProjectQuery) -> anyhow::Result<ProjectDto> {
|
||||||
@ -45,7 +58,7 @@ impl ProjectService for MemoryProjectService {
|
|||||||
if let Some(item_id) = query.item_id {
|
if let Some(item_id) = query.item_id {
|
||||||
Ok(ps
|
Ok(ps
|
||||||
.get(&item_id.to_string())
|
.get(&item_id.to_string())
|
||||||
.ok_or(anyhow::anyhow!("could not find project"))?
|
.context("could not find project")?
|
||||||
.clone())
|
.clone())
|
||||||
} else {
|
} else {
|
||||||
Err(anyhow::anyhow!("could not find project"))
|
Err(anyhow::anyhow!("could not find project"))
|
||||||
|
3
renovate.json
Normal file
3
renovate.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user