From ebabe6a21cad696307549db687ab08a66b85074a Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Fri, 19 Sep 2025 11:18:38 +0800 Subject: [PATCH] Changed backend from Rust to Go for fast development --- backend/Cargo.lock | 3011 ------------------------------------- backend/Cargo.toml | 13 - backend/go.mod | 37 + backend/go.sum | 82 + backend/main.go | 1469 ++++++++++++++++++ backend/src/api.rs | 43 - backend/src/main.rs | 50 - backend/static/index.html | 27 + 8 files changed, 1615 insertions(+), 3117 deletions(-) delete mode 100644 backend/Cargo.lock delete mode 100644 backend/Cargo.toml create mode 100644 backend/go.mod create mode 100644 backend/go.sum create mode 100644 backend/main.go delete mode 100644 backend/src/api.rs delete mode 100644 backend/src/main.rs create mode 100644 backend/static/index.html diff --git a/backend/Cargo.lock b/backend/Cargo.lock deleted file mode 100644 index 6fa5a73..0000000 --- a/backend/Cargo.lock +++ /dev/null @@ -1,3011 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "actix-codec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" -dependencies = [ - "bitflags", - "bytes", - "futures-core", - "futures-sink", - "memchr", - "pin-project-lite", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "actix-cors" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa239b93927be1ff123eebada5a3ff23e89f0124ccb8609234e5103d5a5ae6d" -dependencies = [ - "actix-utils", - "actix-web", - "derive_more", - "futures-util", - "log", - "once_cell", - "smallvec", -] - -[[package]] -name = "actix-governor" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0cb8586d3fa368d00ef643e8ef77f5d3d5dfe5c7b333415a556bc12eb1c41a" -dependencies = [ - "actix-http", - "actix-web", - "futures", - "governor", -] - -[[package]] -name = "actix-http" -version = "3.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cceded2fb55f3c4b67068fa64962e2ca59614edc5b03167de9ff82ae803da0" -dependencies = [ - "actix-codec", - "actix-rt", - "actix-service", - "actix-utils", - "base64", - "bitflags", - "brotli", - "bytes", - "bytestring", - "derive_more", - "encoding_rs", - "flate2", - "foldhash", - "futures-core", - "h2", - "http", - "httparse", - "httpdate", - "itoa", - "language-tags", - "local-channel", - "mime", - "percent-encoding", - "pin-project-lite", - "rand 0.9.2", - "sha1", - "smallvec", - "tokio", - "tokio-util", - "tracing", - "zstd", -] - -[[package]] -name = "actix-macros" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "actix-router" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8" -dependencies = [ - "bytestring", - "cfg-if", - "http", - "regex", - "regex-lite", - "serde", - "tracing", -] - -[[package]] -name = "actix-rt" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92589714878ca59a7626ea19734f0e07a6a875197eec751bb5d3f99e64998c63" -dependencies = [ - "futures-core", - "tokio", -] - -[[package]] -name = "actix-server" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a65064ea4a457eaf07f2fba30b4c695bf43b721790e9530d26cb6f9019ff7502" -dependencies = [ - "actix-rt", - "actix-service", - "actix-utils", - "futures-core", - "futures-util", - "mio", - "socket2 0.5.10", - "tokio", - "tracing", -] - -[[package]] -name = "actix-service" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e46f36bf0e5af44bdc4bdb36fbbd421aa98c79a9bce724e1edeb3894e10dc7f" -dependencies = [ - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "actix-utils" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" -dependencies = [ - "local-waker", - "pin-project-lite", -] - -[[package]] -name = "actix-web" -version = "4.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a597b77b5c6d6a1e1097fddde329a83665e25c5437c696a3a9a4aa514a614dea" -dependencies = [ - "actix-codec", - "actix-http", - "actix-macros", - "actix-router", - "actix-rt", - "actix-server", - "actix-service", - "actix-utils", - "actix-web-codegen", - "bytes", - "bytestring", - "cfg-if", - "cookie", - "derive_more", - "encoding_rs", - "foldhash", - "futures-core", - "futures-util", - "impl-more", - "itoa", - "language-tags", - "log", - "mime", - "once_cell", - "pin-project-lite", - "regex", - "regex-lite", - "serde", - "serde_json", - "serde_urlencoded", - "smallvec", - "socket2 0.5.10", - "time", - "tracing", - "url", -] - -[[package]] -name = "actix-web-codegen" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f591380e2e68490b5dfaf1dd1aa0ebe78d84ba7067078512b4ea6e4492d622b8" -dependencies = [ - "actix-router", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - -[[package]] -name = "atoi" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" -dependencies = [ - "num-traits", -] - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "backend" -version = "0.1.0" -dependencies = [ - "actix-cors", - "actix-governor", - "actix-web", - "dotenvy", - "mysql", - "serde", - "sqlx", -] - -[[package]] -name = "backtrace" -version = "0.3.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", -] - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64ct" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" - -[[package]] -name = "bitflags" -version = "2.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" -dependencies = [ - "serde", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "brotli" -version = "8.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd8b9603c7aa97359dbd97ecf258968c95f3adddd6db2f7e7a5bef101c84560" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - -[[package]] -name = "btoi" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" -dependencies = [ - "num-traits", -] - -[[package]] -name = "bufstream" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40e38929add23cdf8a366df9b0e088953150724bcbe5fc330b0d8eb3b328eec8" - -[[package]] -name = "bumpalo" -version = "3.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" - -[[package]] -name = "bytestring" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e465647ae23b2823b0753f50decb2d5a86d2bb2cac04788fafd1f80e45378e5f" -dependencies = [ - "bytes", -] - -[[package]] -name = "cc" -version = "1.2.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "590f9024a68a8c40351881787f1934dc11afd69090f5edb6831464694d836ea3" -dependencies = [ - "find-msvc-tools", - "jobserver", - "libc", - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" - -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "cookie" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" -dependencies = [ - "percent-encoding", - "time", - "version_check", -] - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" - -[[package]] -name = "crc32fast" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "darling" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "der" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d630bccd429a5bb5a64b5e94f693bfc48c9f8566418fda4c494cc94f911f87cc" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "derive_more" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "unicode-xid", -] - -[[package]] -name = "derive_utils" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccfae181bab5ab6c5478b2ccb69e4c68a02f8c3ec72f6616bfec9dbc599d2ee0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "dotenvy" -version = "0.15.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" -dependencies = [ - "serde", -] - -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "etcetera" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" -dependencies = [ - "cfg-if", - "home", - "windows-sys 0.48.0", -] - -[[package]] -name = "event-listener" -version = "5.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "find-msvc-tools" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e178e4fba8a2726903f6ba98a6d221e76f9c12c650d5dc0e6afdc50677b49650" - -[[package]] -name = "flate2" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" -dependencies = [ - "crc32fast", - "libz-sys", - "miniz_oxide", -] - -[[package]] -name = "flume" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" -dependencies = [ - "futures-core", - "futures-sink", - "spin", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foldhash" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" - -[[package]] -name = "form_urlencoded" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-executor" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-intrusive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" -dependencies = [ - "futures-core", - "lock_api", - "parking_lot", -] - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.1+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "r-efi", - "wasi 0.14.3+wasi-0.2.4", - "wasm-bindgen", -] - -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - -[[package]] -name = "governor" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be93b4ec2e4710b04d9264c0c7350cdd62a8c20e5e4ac732552ebb8f0debe8eb" -dependencies = [ - "cfg-if", - "dashmap", - "futures-sink", - "futures-timer", - "futures-util", - "getrandom 0.3.3", - "no-std-compat", - "nonzero_ext", - "parking_lot", - "portable-atomic", - "quanta", - "rand 0.9.2", - "smallvec", - "spinning_top", - "web-time", -] - -[[package]] -name = "h2" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", -] - -[[package]] -name = "hashlink" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" -dependencies = [ - "hashbrown 0.15.5", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "home" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "icu_collections" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" -dependencies = [ - "displaydoc", - "potential_utf", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locale_core" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_normalizer" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" - -[[package]] -name = "icu_properties" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locale_core", - "icu_properties_data", - "icu_provider", - "potential_utf", - "zerotrie", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" - -[[package]] -name = "icu_provider" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" -dependencies = [ - "displaydoc", - "icu_locale_core", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerotrie", - "zerovec", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "impl-more" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a5a9a0ff0086c7a148acb942baaabeadf9504d10400b5a05645853729b9cd2" - -[[package]] -name = "indexmap" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" -dependencies = [ - "equivalent", - "hashbrown 0.15.5", -] - -[[package]] -name = "io-enum" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d197db2f7ebf90507296df3aebaf65d69f5dce8559d8dbd82776a6cadab61bbf" -dependencies = [ - "derive_utils", -] - -[[package]] -name = "io-uring" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" -dependencies = [ - "bitflags", - "cfg-if", - "libc", -] - -[[package]] -name = "itoa" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" - -[[package]] -name = "jobserver" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" -dependencies = [ - "getrandom 0.3.3", - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "language-tags" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin", -] - -[[package]] -name = "libc" -version = "0.2.175" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" - -[[package]] -name = "libm" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" - -[[package]] -name = "libredox" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3" -dependencies = [ - "bitflags", - "libc", - "redox_syscall", -] - -[[package]] -name = "libsqlite3-sys" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" -dependencies = [ - "pkg-config", - "vcpkg", -] - -[[package]] -name = "libz-sys" -version = "1.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b70e7a7df205e92a1a4cd9aaae7898dac0aa555503cc0a649494d0d60e7651d" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "litemap" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" - -[[package]] -name = "local-channel" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" -dependencies = [ - "futures-core", - "futures-sink", - "local-waker", -] - -[[package]] -name = "local-waker" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" - -[[package]] -name = "lock_api" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" - -[[package]] -name = "lru" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" - -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest", -] - -[[package]] -name = "memchr" -version = "2.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", -] - -[[package]] -name = "mio" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" -dependencies = [ - "libc", - "log", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.59.0", -] - -[[package]] -name = "mysql" -version = "26.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce2510a735f601bab18202b07ea0a197bd1d130d3a5ce2edf4577d225f0c3ee4" -dependencies = [ - "bufstream", - "bytes", - "crossbeam-queue", - "crossbeam-utils", - "flate2", - "io-enum", - "libc", - "lru", - "mysql_common", - "named_pipe", - "pem", - "percent-encoding", - "socket2 0.5.10", - "twox-hash", - "url", -] - -[[package]] -name = "mysql-common-derive" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66f62cad7623a9cb6f8f64037f0c4f69c8db8e82914334a83c9788201c2c1bfa" -dependencies = [ - "darling", - "heck", - "num-bigint", - "proc-macro-crate", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn", - "termcolor", - "thiserror", -] - -[[package]] -name = "mysql_common" -version = "0.35.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb9f371618ce723f095c61fbcdc36e8936956d2b62832f9c7648689b338e052" -dependencies = [ - "base64", - "bitflags", - "btoi", - "byteorder", - "bytes", - "crc32fast", - "flate2", - "getrandom 0.3.3", - "mysql-common-derive", - "num-bigint", - "num-traits", - "regex", - "saturating", - "serde", - "serde_json", - "sha1", - "sha2", - "thiserror", - "uuid", -] - -[[package]] -name = "named_pipe" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad9c443cce91fc3e12f017290db75dde490d685cdaaf508d7159d7cf41f0eb2b" -dependencies = [ - "winapi", -] - -[[package]] -name = "no-std-compat" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" - -[[package]] -name = "nonzero_ext" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand 0.8.5", - "smallvec", - "zeroize", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" - -[[package]] -name = "parking" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" - -[[package]] -name = "parking_lot" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "pem" -version = "3.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3" -dependencies = [ - "base64", - "serde", -] - -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] - -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs1" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" -dependencies = [ - "der", - "pkcs8", - "spki", -] - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "pkg-config" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" - -[[package]] -name = "portable-atomic" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" - -[[package]] -name = "potential_utf" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" -dependencies = [ - "zerovec", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "proc-macro-crate" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" -dependencies = [ - "toml_edit", -] - -[[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" -dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "proc-macro2" -version = "1.0.101" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quanta" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3ab5a9d756f0d97bdc89019bd2e4ea098cf9cde50ee7564dde6b81ccc8f06c7" -dependencies = [ - "crossbeam-utils", - "libc", - "once_cell", - "raw-cpuid", - "wasi 0.11.1+wasi-snapshot-preview1", - "web-sys", - "winapi", -] - -[[package]] -name = "quote" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" -dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.3", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.3", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.16", -] - -[[package]] -name = "rand_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" -dependencies = [ - "getrandom 0.3.3", -] - -[[package]] -name = "raw-cpuid" -version = "11.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_syscall" -version = "0.5.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-lite" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943f41321c63ef1c92fd763bfe054d2668f7f225a5c29f0105903dc2fc04ba30" - -[[package]] -name = "regex-syntax" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" - -[[package]] -name = "ring" -version = "0.17.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" -dependencies = [ - "cc", - "cfg-if", - "getrandom 0.2.16", - "libc", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rsa" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78928ac1ed176a5ca1d17e578a1825f3d81ca54cf41053a592584b020cfd691b" -dependencies = [ - "const-oid", - "digest", - "num-bigint-dig", - "num-integer", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core 0.6.4", - "signature", - "spki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" - -[[package]] -name = "rustls" -version = "0.23.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643" -dependencies = [ - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pki-types" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" -dependencies = [ - "zeroize", -] - -[[package]] -name = "rustls-webpki" -version = "0.103.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - -[[package]] -name = "saturating" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece8e78b2f38ec51c51f5d475df0a7187ba5111b2a28bdc761ee05b075d40a71" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "serde" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.143" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signal-hook-registry" -version = "1.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest", - "rand_core 0.6.4", -] - -[[package]] -name = "slab" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" -dependencies = [ - "serde", -] - -[[package]] -name = "socket2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "socket2" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" -dependencies = [ - "libc", - "windows-sys 0.59.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "spinning_top" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" -dependencies = [ - "lock_api", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "sqlx" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc" -dependencies = [ - "sqlx-core", - "sqlx-macros", - "sqlx-mysql", - "sqlx-postgres", - "sqlx-sqlite", -] - -[[package]] -name = "sqlx-core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6" -dependencies = [ - "base64", - "bytes", - "crc", - "crossbeam-queue", - "either", - "event-listener", - "futures-core", - "futures-intrusive", - "futures-io", - "futures-util", - "hashbrown 0.15.5", - "hashlink", - "indexmap", - "log", - "memchr", - "once_cell", - "percent-encoding", - "rustls", - "serde", - "serde_json", - "sha2", - "smallvec", - "thiserror", - "tokio", - "tokio-stream", - "tracing", - "url", - "webpki-roots 0.26.11", -] - -[[package]] -name = "sqlx-macros" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d" -dependencies = [ - "proc-macro2", - "quote", - "sqlx-core", - "sqlx-macros-core", - "syn", -] - -[[package]] -name = "sqlx-macros-core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b" -dependencies = [ - "dotenvy", - "either", - "heck", - "hex", - "once_cell", - "proc-macro2", - "quote", - "serde", - "serde_json", - "sha2", - "sqlx-core", - "sqlx-mysql", - "sqlx-postgres", - "sqlx-sqlite", - "syn", - "tokio", - "url", -] - -[[package]] -name = "sqlx-mysql" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" -dependencies = [ - "atoi", - "base64", - "bitflags", - "byteorder", - "bytes", - "crc", - "digest", - "dotenvy", - "either", - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "generic-array", - "hex", - "hkdf", - "hmac", - "itoa", - "log", - "md-5", - "memchr", - "once_cell", - "percent-encoding", - "rand 0.8.5", - "rsa", - "serde", - "sha1", - "sha2", - "smallvec", - "sqlx-core", - "stringprep", - "thiserror", - "tracing", - "whoami", -] - -[[package]] -name = "sqlx-postgres" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" -dependencies = [ - "atoi", - "base64", - "bitflags", - "byteorder", - "crc", - "dotenvy", - "etcetera", - "futures-channel", - "futures-core", - "futures-util", - "hex", - "hkdf", - "hmac", - "home", - "itoa", - "log", - "md-5", - "memchr", - "once_cell", - "rand 0.8.5", - "serde", - "serde_json", - "sha2", - "smallvec", - "sqlx-core", - "stringprep", - "thiserror", - "tracing", - "whoami", -] - -[[package]] -name = "sqlx-sqlite" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea" -dependencies = [ - "atoi", - "flume", - "futures-channel", - "futures-core", - "futures-executor", - "futures-intrusive", - "futures-util", - "libsqlite3-sys", - "log", - "percent-encoding", - "serde", - "serde_urlencoded", - "sqlx-core", - "thiserror", - "tracing", - "url", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "stringprep" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" -dependencies = [ - "unicode-bidi", - "unicode-normalization", - "unicode-properties", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "2.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "2.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "time" -version = "0.3.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bde6f1ec10e72d583d91623c939f623002284ef622b87de38cfd546cbf2031" -dependencies = [ - "deranged", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" - -[[package]] -name = "time-macros" -version = "0.2.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinystr" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" -dependencies = [ - "displaydoc", - "zerovec", -] - -[[package]] -name = "tinyvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.47.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" -dependencies = [ - "backtrace", - "bytes", - "io-uring", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "slab", - "socket2 0.6.0", - "windows-sys 0.59.0", -] - -[[package]] -name = "tokio-stream" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml_datetime" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" - -[[package]] -name = "toml_edit" -version = "0.22.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tracing" -version = "0.1.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" -dependencies = [ - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" -dependencies = [ - "once_cell", -] - -[[package]] -name = "twox-hash" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b907da542cbced5261bd3256de1b3a1bf340a3d37f93425a07362a1d687de56" - -[[package]] -name = "typenum" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" - -[[package]] -name = "unicode-bidi" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" - -[[package]] -name = "unicode-ident" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-properties" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", -] - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - -[[package]] -name = "uuid" -version = "1.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasi" -version = "0.14.3+wasi-0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51ae83037bdd272a9e28ce236db8c07016dd0d50c27038b3f407533c030c95" -dependencies = [ - "wit-bindgen", -] - -[[package]] -name = "wasite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" - -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "web-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.26.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" -dependencies = [ - "webpki-roots 1.0.1", -] - -[[package]] -name = "webpki-roots" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8782dd5a41a24eed3a4f40b606249b3e236ca61adf1f25ea4d45c73de122b502" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "whoami" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d" -dependencies = [ - "libredox", - "wasite", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0978bf7171b3d90bac376700cb56d606feb40f251a475a5d6634613564460b22" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" -dependencies = [ - "memchr", -] - -[[package]] -name = "wit-bindgen" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052283831dbae3d879dc7f51f3d92703a316ca49f91540417d38591826127814" - -[[package]] -name = "writeable" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" - -[[package]] -name = "yoke" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerocopy" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zerofrom" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" - -[[package]] -name = "zerotrie" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", -] - -[[package]] -name = "zerovec" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zstd" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.15+zstd.1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/backend/Cargo.toml b/backend/Cargo.toml deleted file mode 100644 index 4f7c33b..0000000 --- a/backend/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "backend" -version = "0.1.0" -edition = "2024" - -[dependencies] -actix-cors = "0.7.1" -actix-governor = "0.8.0" -actix-web = "4.11.0" -dotenvy = "0.15.7" -mysql = "26.0.1" -serde = { version = "1.0.219", features = ["derive"] } -sqlx = { version = "0.8.6", features = ["mysql", "macros", "runtime-tokio-rustls"] } diff --git a/backend/go.mod b/backend/go.mod new file mode 100644 index 0000000..85064e7 --- /dev/null +++ b/backend/go.mod @@ -0,0 +1,37 @@ +module ocbo-esign-backend + +go 1.25.1 + +require ( + filippo.io/edwards25519 v1.1.0 // indirect + github.com/bytedance/gopkg v0.1.3 // indirect + github.com/bytedance/sonic v1.14.1 // indirect + github.com/bytedance/sonic/loader v0.3.0 // indirect + github.com/cloudwego/base64x v0.1.6 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.10 // indirect + github.com/gin-contrib/cors v1.7.6 // indirect + github.com/gin-contrib/sse v1.1.0 // indirect + github.com/gin-gonic/gin v1.10.1 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.27.0 // indirect + github.com/go-sql-driver/mysql v1.9.3 // indirect + github.com/goccy/go-json v0.10.5 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/cpuid/v2 v2.3.0 // indirect + github.com/leodido/go-urn v1.4.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.3.0 // indirect + golang.org/x/arch v0.21.0 // indirect + golang.org/x/crypto v0.42.0 // indirect + golang.org/x/net v0.44.0 // indirect + golang.org/x/sys v0.36.0 // indirect + golang.org/x/text v0.29.0 // indirect + google.golang.org/protobuf v1.36.9 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/backend/go.sum b/backend/go.sum new file mode 100644 index 0000000..6660bc1 --- /dev/null +++ b/backend/go.sum @@ -0,0 +1,82 @@ +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M= +github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM= +github.com/bytedance/sonic v1.14.1 h1:FBMC0zVz5XUmE4z9wF4Jey0An5FueFvOsTKKKtwIl7w= +github.com/bytedance/sonic v1.14.1/go.mod h1:gi6uhQLMbTdeP0muCnrjHLeCUPyb70ujhnNlhOylAFc= +github.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA= +github.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= +github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M= +github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0= +github.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s= +github.com/gin-contrib/cors v1.7.6 h1:3gQ8GMzs1Ylpf70y8bMw4fVpycXIeX1ZemuSQIsnQQY= +github.com/gin-contrib/cors v1.7.6/go.mod h1:Ulcl+xN4jel9t1Ry8vqph23a60FwH9xVLd+3ykmTjOk= +github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w= +github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM= +github.com/gin-gonic/gin v1.10.1 h1:T0ujvqyCSqRopADpgPgiTT63DUQVSfojyME59Ei63pQ= +github.com/gin-gonic/gin v1.10.1/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.27.0 h1:w8+XrWVMhGkxOaaowyKH35gFydVHOvC0/uWoy2Fzwn4= +github.com/go-playground/validator/v10 v10.27.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo= +github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo= +github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU= +github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= +github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y= +github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA= +github.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4= +golang.org/x/arch v0.21.0 h1:iTC9o7+wP6cPWpDWkivCvQFGAHDQ59SrSxsLPcnkArw= +golang.org/x/arch v0.21.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A= +golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI= +golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8= +golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= +golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= +golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= +golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= +google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw= +google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/backend/main.go b/backend/main.go new file mode 100644 index 0000000..3aa12be --- /dev/null +++ b/backend/main.go @@ -0,0 +1,1469 @@ +package main + +import ( + "database/sql" + "log" + "net/http" + + "strings" + + // "crypto/rand" + // "crypto/rsa" + // "crypto/x509" + // "encoding/base64" + // "encoding/pem" + // "errors" + // "os" + + "github.com/gin-contrib/cors" + "github.com/gin-gonic/gin" + _ "github.com/go-sql-driver/mysql" +) + +// DEV +var connection string = "root:superuser@tcp(localhost:3306)/iips" + +// SERVER +// var connection string = "iips:iipsuser@tcp(192.168.7.100:3306)/iips" + +func main() { + connect() +} + +func connect() { + db, err := sql.Open("mysql", connection) + + if err != nil { + panic(err) + } + + defer db.Close() + + router := gin.Default() + // router.Use(cors.Default()) + + //DEV + router.Use(cors.New(cors.Config{ + AllowOrigins: []string{"http://localhost"}, + AllowMethods: []string{"GET"}, + AllowHeaders: []string{"Origin", "OCBO-ShieldConnection"}, + ExposeHeaders: []string{"Content-Length"}, + AllowCredentials: true, + })) + + //SERVER + // router.Use(cors.New(cors.Config{ + // AllowOrigins: []string{"http://192.168.7.160:8080/inquiry"}, + // AllowMethods: []string{"GET"}, + // AllowHeaders: []string{"Origin", "OCBO-ShieldConnection"}, + // ExposeHeaders: []string{"Content-Length"}, + // AllowCredentials: true, + // })) + + router.StaticFile("/", "static/index.html") + + // shield := "inquiry" + + router.GET("/api/:method", func(c *gin.Context) { + var result string + method := c.Param("method") + + c.Writer.Header().Set("X-XSS-Protection", "1; mode=block") + c.Writer.Header().Set("X-Content-Type-Options", "nosniff") + c.Writer.Header().Set("X-DNS-Prefetch-Control", "off") + c.Writer.Header().Set("X-Frame-Options", "DENY") + c.Writer.Header().Set("X-Download-Options", "noopen") + c.Writer.Header().Set("Referrer-Policy", "no-referrer") + c.Writer.Header().Set("Server", "Batman") + + log.Println("Method", method) + // log.Println("Data", data) + + switch method { + case "test": + err = db.QueryRow("SELECT employeename FROM employee WHERE uname = 'TEST'").Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.String(http.StatusOK, "Connection is OK") + + case "check-connection": + err = db.QueryRow("SELECT 1 AS result").Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + + c.JSON(http.StatusOK, gin.H{ + "result": "Connection is OK", + }) + } + }) + + router.GET("/api/:method/:data", func(c *gin.Context) { + var result string + method := c.Param("method") + data := c.Param("data") + + c.Writer.Header().Set("X-XSS-Protection", "1; mode=block") + c.Writer.Header().Set("X-Content-Type-Options", "nosniff") + c.Writer.Header().Set("X-DNS-Prefetch-Control", "off") + c.Writer.Header().Set("X-Frame-Options", "DENY") + c.Writer.Header().Set("X-Download-Options", "noopen") + c.Writer.Header().Set("Referrer-Policy", "no-referrer") + + log.Println("Method", method) + log.Println("Data", data) + + switch method { + case "check-building": + err = db.QueryRow("SELECT COUNT(receivingid) AS result FROM receiving WHERE applicationNo = ?", data).Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + }) + + case "check-occupancy": + err = db.QueryRow("SELECT COUNT(occupancyid) AS result FROM occupancy WHERE controlNo = ?", data).Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + }) + + case "check-signage": + err = db.QueryRow("SELECT COUNT(signageid) AS result FROM signage WHERE signApplicationNo = ?", data).Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + }) + + case "check-electrical": + err = db.QueryRow("SELECT COUNT(electricalid) AS result FROM electrical WHERE electricalNo = ?", data).Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + }) + + case "check-mechanical": + err = db.QueryRow("SELECT COUNT(mechanicalid) AS result FROM mechanical WHERE mechApplicationNo = ?", data).Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + }) + + case "GetOwnerNameBuilding": + var result2, result3, result4, result5, result6 string + + err = db.QueryRow("SELECT IFNULL(c.firstName, '') AS result, IFNULL(c.middleInitial, '') AS result2, IFNULL(c.lastName, '') AS result3, IFNULL(rp.block, '') AS result4, IFNULL(rp.lot, '') AS result5, IFNULL(rp.address, '') AS result6 FROM customer c, receiving r, receiving_permitnoaddress rp WHERE r.customerid = c.customerid AND r.receivingid = rp.receivingid AND r.applicationNo = ?", data).Scan(&result, &result2, &result3, &result4, &result5, &result6) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + "result2": result2, + "result3": result3, + "result4": result4, + "result5": result5, + "result6": result6, + }) + + case "GetOwnerNameOccupancy": + var result2, result3, result4 string + + err = db.QueryRow("SELECT IFNULL(c.firstName, '') AS result, IFNULL(c.middleInitial, '') AS result2, IFNULL(c.lastName, '') AS result3, IFNULL(c.address, '') AS result4 FROM customer c, receiving r, occupancy o WHERE r.customerid = c.customerid AND r.applicationNo = o.bldgApplicationNo AND o.controlNo = ?", data).Scan(&result, &result2, &result3, &result4) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + "result2": result2, + "result3": result3, + "result4": result4, + }) + + // } else if method == "GetOwnerNameSignage" { + // var result2, result3, result4 string + + // err = db.QueryRow("SELECT c.firstName AS result, c.middleInitial AS result2, c.lastName AS result3, c.address AS result4 FROM customer c, signage s WHERE s.customerid = c.customerid AND s.signApplicationNo = ?", data).Scan(&result, &result2, &result3, &result4) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, err := encrypt(result) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + // result2, err := encrypt(result2) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + // result3, err := encrypt(result3) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + // result4, err := encrypt(result4) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // "result2": result2, + // "result3": result3, + // "result4": result4, + // }) + + case "GetOwnerNameElectrical": + var result2, result3, result4 string + + err = db.QueryRow("SELECT c.firstName AS result, c.middleInitial AS result2, c.lastName AS result3, c.address AS result4 FROM customer c, electrical e WHERE e.customerid = c.customerid AND e.electricalNo = ?", data).Scan(&result, &result2, &result3, &result4) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + "result2": result2, + "result3": result3, + "result4": result4, + }) + + // } else if method == "GetOwnerNameMech" { + // var result2, result3, result4 string + + // err = db.QueryRow("SELECT c.firstName AS result, c.middleInitial AS result2, c.lastName AS result3, c.address AS result4 FROM customer c, mechanical m WHERE m.customerid = c.customerid AND m.mechApplicationNo= ?", data).Scan(&result, &result2, &result3, &result4) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, err := encrypt(result) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + // result2, err := encrypt(result2) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + // result3, err := encrypt(result3) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + // result4, err := encrypt(result4) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // "result2": result2, + // "result3": result3, + // "result4": result4, + // }) + + case "GetStatusBuilding": + var result2 string + + array := []string{} + array2 := []string{} + + results, err := db.Query(`SELECT DATE_FORMAT(b.datetransac, '%M %d, %Y') AS result, REPLACE(REPLACE(b.remarks, 'RECEIVING', 'RECEIVED'), 'PERMIT ALREADY RELEASE', 'PERMIT RELEASED') AS result2 + FROM docflowtxn b, receiving r WHERE r.receivingid = b.receivingid AND r.applicationNo = ? ORDER BY b.docflowtxnid DESC`, data) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + for results.Next() { + err = results.Scan(&result, &result2) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + // result, err := encrypt(result) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + // result2, err := encrypt(result2) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + array = append(array, result) + array2 = append(array2, result2) + } + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + }) + + case "GetStatusOccupancy": + var result2 string + + array := []string{} + array2 := []string{} + + results, err := db.Query(`SELECT DATE_FORMAT(b.txndate, '%M %d, %Y') AS result, REPLACE(b.remarks, 'RECEIVE', 'RECEIVED') AS result2 + FROM occupancydocflowtxn b, occupancy o WHERE o.occupancyid = b.occupancyreceivingid AND o.controlNo = ? ORDER BY b.occupancydocflowtxnid DESC`, data) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + for results.Next() { + err = results.Scan(&result, &result2) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + array2 = append(array2, result2) + } + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + }) + + case "GetStatusSign": + var result2 string + + array := []string{} + array2 := []string{} + + results, err := db.Query(`SELECT DATE_FORMAT(b.txndate, '%M %d, %Y') AS result, b.remarks AS result2 + FROM signagedocflowtxn b, signage s WHERE s.signageid = b.signageid AND s.signApplicationNo = ? ORDER BY b.signagedocflowtxnid DESC`, data) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + for results.Next() { + err = results.Scan(&result, &result2) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + array2 = append(array2, result2) + } + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + }) + + case "GetStatusElectrical": + var result2 string + + array := []string{} + array2 := []string{} + + results, err := db.Query(`SELECT DATE_FORMAT(b.txndate, '%M %d, %Y') AS result, b.remarks AS result2 + FROM electricaldocflowtxn b, electrical e WHERE e.electricalid = b.electricalid AND e.electricalNo = ? ORDER BY b.electricaldocflowtxnid DESC`, data) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + for results.Next() { + err = results.Scan(&result, &result2) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + array2 = append(array2, result2) + } + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + }) + + // } else if method == "GetTableDataMech" { + // var result2 string + + // array := []string{} + // array2 := []string{} + + // results, err := db.Query(`SELECT DATE_FORMAT(b.txndate, '%M %d, %Y') AS result, b.remarks AS result2 + // FROM mechanicaldocflowtxn b, mechanical m WHERE m.mechanicalid = b.mechanicalid AND m.mechApplicationNo = ? ORDER BY b.mechanicaldocflowtxnid DESC`, data) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // for results.Next() { + // err = results.Scan(&result, &result2) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, err := encrypt(result) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + // result2, err := encrypt(result2) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + // array = append(array, result) + // array2 = append(array2, result2) + // } + // c.JSON(http.StatusOK, gin.H{ + // "result": array, + // "result2": array2, + // }) + + case "GetListOfClients": + var result2, result3, result4 string + + array := []string{} + array2 := []string{} + array3 := []string{} + array4 := []string{} + + results, err := db.Query(`SELECT IFNULL(IF(firstName = '', lastName, CONCAT(firstName, ' ', IF(middleInitial = '', lastName, CONCAT(middleInitial, '. ', lastName)))), "") AS result, IFNULL(address, '') AS result2, IFNULL(lastName, "") AS result3, IFNULL(firstName, "") AS result4 FROM customer WHERE (lastName LIKE ? OR firstName LIKE ?)`, "%"+data+"%", "%"+data+"%") + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + for results.Next() { + err = results.Scan(&result, &result2, &result3, &result4) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + array2 = append(array2, result2) + array3 = append(array3, result3) + array4 = append(array4, result4) + } + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + "result3": array3, + "result4": array4, + }) + + // } else if method == "GetBuilding2" { + // var result2, result3, result4 string + + // err := db.QueryRow(`SELECT e.applicationNo AS result, IF (c.firstName IS NULL or c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', c.middleInitial, '. ', c.lastName, c.lastName)) AS result2, e.locationofconstruction AS result3, d.remarks AS result4 FROM receiving e, customer c, docflowtxn d WHERE e.customerid = c.customerid AND e.receivingid = d.receivingid AND d.docflowtxnid = (SELECT MAX(docflowtxnid) FROM docflowtxn WHERE receivingid = ?)`, data).Scan(&result, &result2, &result3, &result4) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // "result2": result2, + // "result3": result3, + // "result4": result4, + // }) + + // } else if method == "GetOccupancy2" { + // var result2, result3, result4 string + + // err := db.QueryRow(`SELECT e.controlNo AS result, IF (c.firstName IS NULL or c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', c.middleInitial, '. ', c.lastName, c.lastName)) AS result2, r.locationofconstruction AS result3, d.remarks AS result4 FROM occupancy e, customer c, occupancydocflowtxn d, receiving r + // WHERE e.customerid = c.customerid AND e.bldgApplicationNo = r.applicationNo AND e.occupancyid = d.occupancyreceivingid AND d.occupancydocflowtxnid = (SELECT MAX(occupancydocflowtxnid) FROM occupancydocflowtxn WHERE occupancyreceivingid = ?)`, data).Scan(&result, &result2, &result3, &result4) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // "result2": result2, + // "result3": result3, + // "result4": result4, + // }) + + // } else if method == "GetElectrical2" { + // var result2, result3, result4 string + + // err := db.QueryRow(`SELECT e.electricalNo AS result, IF (c.firstName IS NULL or c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', c.middleInitial, '. ', c.lastName, c.lastName)) AS result2, e.locationofinstallation AS result3, d.remarks AS result4 FROM electrical e, customer c, electricaldocflowtxn d + // WHERE e.customerid = c.customerid AND e.electricalid = d.electricalid AND d.electricaldocflowtxnid = (SELECT MAX(electricaldocflowtxnid) FROM electricaldocflowtxn WHERE electricalid = ?)`, data).Scan(&result, &result2, &result3, &result4) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // "result2": result2, + // "result3": result3, + // "result4": result4, + // }) + + // } else if method == "Update" { + // err := db.QueryRow(`SELECT receivingid AS result FROM receiving`, data).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + // } else if method == "GetMax" { + // err := db.QueryRow(`SELECT MAX(docflowtxnid) AS result FROM docflowtxn WHERE receivingid = ?`, data).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + // } else if method == "GetAllYear" { + // var result2, result3, result4, result5 string + + // err := db.QueryRow(`SELECT r.applicationNo AS result, r.receivedate AS result2, IF(c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', c.middleInitial, '. ', c.lastName)) AS result3, c.address AS result4, w.whereabouts as result5 FROM receiving r, customer c, whereabouts w, building_laststatus l, docflowtxn d WHERE r.customerid = c.customerid AND r.receivingid = l.receivingid and l.statusid = d.docflowtxnid and d.tagword = w.tagword and r.applicationNo LIKE ?`, data+"%").Scan(&result, &result2, &result3, &result4, &result5) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // "result2": result2, + // "result3": result3, + // "result4": result4, + // "result5": result5, + // }) + + case "GetLastStatusBuilding": + err := db.QueryRow(`SELECT IFNULL(remarks, '') AS result FROM docflowtxn WHERE docflowtxnid = (SELECT MAX(docflowtxnid) FROM docflowtxn WHERE receivingid = ?)`, data).Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + return + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + }) + + case "GetLastStatusOccupancy": + err := db.QueryRow(`SELECT remarks AS result FROM occupancydocflowtxn WHERE occupancydocflowtxnid = (SELECT MAX(occupancydocflowtxnid) FROM occupancydocflowtxn WHERE occupancyreceivingid = ?)`, data).Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + }) + + case "GetLastStatusElectrical": + err := db.QueryRow(`SELECT remarks AS result FROM electricaldocflowtxn WHERE electricaldocflowtxnid = (SELECT MAX(electricaldocflowtxnid) FROM electricaldocflowtxn WHERE electricalid = ?)`, data).Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + }) + + // } else if method == "GetApplications" { + // err := db.QueryRow(`SELECT applicationNo AS result FROM receiving WHERE applicationNo LIKE ?`, data).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + // } else if method == "GetInformation" { + // err := db.QueryRow(`SELECT r.applicationNo AS result, IF (r.receivedate IS NULL, r.receivezoning, r.receivedate) AS result2, IF(c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', c.middleInitial, '. ', c.lastName)) AS result3, c.address + // AS result4, d.remarks AS result5 FROM receiving r, customer c, docflowtxn d WHERE r.customerid = c.customerid AND r.receivingid = d.receivingid + // AND d.docflowtxnid = (SELECT MAX(docflowtxnid) FROM docflowtxn WHERE receivingid = (SELECT receivingid FROM receiving WHERE applicationNo = ?))`, data).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + case "GetApplicationByID": + err := db.QueryRow(`SELECT applicationNo AS result FROM receiving WHERE receivingid = ?`, data).Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + }) + + case "GetOccupancyApplicationByID": + err := db.QueryRow(`SELECT controlNo AS result FROM occupancy WHERE occupancyid = ?`, data).Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + }) + + case "GetElectricalApplicationByID": + err := db.QueryRow(`SELECT electricalNo AS result FROM electrical WHERE electricalid = ?`, data).Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + c.JSON(http.StatusOK, gin.H{ + "result": result, + }) + + // } else if method == "GetIDByApplication" { + // err := db.QueryRow(`SELECT receivingid AS result FROM receiving WHERE applicationNo = ?`, data).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + // } else if method == "GetOrderofPayment" { + // var result2, result3, result4, result5, result6 string + // array := []string{} + // array2 := []string{} + // array3 := []string{} + // array4 := []string{} + // array5 := []string{} + // array6 := []string{} + + // results, err := db.Query(`SELECT bo.amount AS result, bo.is_approve AS result2, bo.for_approval AS result3, bo.is_paid AS result4, IFNULL(bo.orNo, "") AS result5, r.accountdescription AS result6 FROM building_orderofpayment bo, ref_bldgcomputationsheet r WHERE bo.bldgApplicationNo = ? AND bo.ref_bldgcomputationsheetid = r.ref_bldgcomputationsheetid`, data) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // for results.Next() { + // err = results.Scan(&result, &result2, &result3, &result4, &result5, &result6) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, _ := encrypt(result) + // result2, _ := encrypt(result2) + // result3, _ := encrypt(result3) + // result4, _ := encrypt(result4) + // result5, _ := encrypt(result5) + // result6, _ := encrypt(result6) + + // array = append(array, result) + // array2 = append(array2, result2) + // array3 = append(array3, result3) + // array4 = append(array4, result4) + // array5 = append(array5, result5) + // array6 = append(array6, result6) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": array, + // "result2": array2, + // "result3": array3, + // "result4": array4, + // "result5": array5, + // "result6": array6, + // }) + + case "GetFeesBuilding": + var result2, result3 string + array := []string{} + array2 := []string{} + array3 := []string{} + + results, err := db.Query(`SELECT r.accountdescription AS result, bo.amount AS result2, bo.is_paid AS result3 FROM building_orderofpayment bo, ref_bldgcomputationsheet r where bo.bldgApplicationNo = ? AND bo.ref_bldgcomputationsheetid = r.ref_bldgcomputationsheetid`, data) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + + for results.Next() { + err = results.Scan(&result, &result2, &result3) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + array2 = append(array2, result2) + array3 = append(array3, result3) + } + + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + "result3": array3, + }) + + case "GetFeesOccupancy": + var result2, result3 string + array := []string{} + array2 := []string{} + array3 := []string{} + + results, err := db.Query(`SELECT r.accountdescription AS result, oo.amount AS result2, oo.is_paid AS result3 FROM occupancy_orderofpayment oo, ref_bldgcomputationsheet r WHERE oo.ref_bldgcomputationsheetid = r.ref_bldgcomputationsheetid AND oo.occupancyid = (SELECT occupancyid FROM occupancy WHERE controlNo = ?)`, data) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + + for results.Next() { + err = results.Scan(&result, &result2, &result3) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + array2 = append(array2, result2) + array3 = append(array3, result3) + } + + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + "result3": array3, + }) + + case "GetFeesElectrical": + var result2, result3 string + array := []string{} + array2 := []string{} + array3 := []string{} + + results, err := db.Query(`SELECT r.accountdescription AS result, eo.amount AS result2, eo.is_paid AS result3 FROM electrical_orderofpayment_new eo, ref_bldgcomputationsheet r WHERE eo.ref_bldgcomputationsheetid = r.ref_bldgcomputationsheetid AND eo.electricalid = (SELECT electricalid FROM electrical WHERE electricalNo = ?)`, data) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + + for results.Next() { + err = results.Scan(&result, &result2, &result3) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + array2 = append(array2, result2) + array3 = append(array3, result3) + } + + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + "result3": array3, + }) + + // } else if method == "GetProgressFlowBuilding" { + // var result2, result3, result4 string + // array := []string{} + // array2 := []string{} + // array3 := []string{} + // array4 := []string{} + + // results, err := db.Query(`SELECT IFNULL(rp.progressflow, '') AS result, IFNULL(p.dateIn, '') AS result2, IFNULL(p.dateReturn, '') AS result3, IFNULL(p.accomplish, '') AS result4 FROM progressflow p, ref_progressflow rp WHERE p.bldgApplicationNo = ? AND p.ref_progressflowid BETWEEN 2 AND 9 AND p.ref_progressflowid = rp.ref_progressflowid`, data) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // for results.Next() { + // err = results.Scan(&result, &result2, &result3, &result4) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, _ := encrypt(result) + // result2, _ := encrypt(result2) + // result3, _ := encrypt(result3) + // result4, _ := encrypt(result4) + + // array = append(array, result) + // array2 = append(array2, result2) + // array3 = append(array3, result3) + // array4 = append(array4, result4) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": array, + // "result2": array2, + // "result3": array3, + // "result4": array4, + // }) + + // } else if method == "GetProgressFlowOccupancy" { + // var result2, result3, result4 string + // array := []string{} + // array2 := []string{} + // array3 := []string{} + // array4 := []string{} + + // results, err := db.Query(`SELECT IFNULL(rp.progressflow, '') AS result, IFNULL(p.datetimeStart, '') AS result2, IFNULL(p.datetimeEnd, '') AS result3, IFNULL(p.accomplish, '') AS result4 FROM occupancyprogressflow p, ref_progressflow rp WHERE p.ref_progressflowid BETWEEN 2 AND 9 AND p.ref_progressflowid = rp.ref_progressflowid AND p.occupancyid = (SELECT occupancyid FROM occupancy WHERE controlNo = ?)`, data) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // for results.Next() { + // err = results.Scan(&result, &result2, &result3, &result4) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, _ := encrypt(result) + // result2, _ := encrypt(result2) + // result3, _ := encrypt(result3) + // result4, _ := encrypt(result4) + + // array = append(array, result) + // array2 = append(array2, result2) + // array3 = append(array3, result3) + // array4 = append(array4, result4) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": array, + // "result2": array2, + // "result3": array3, + // "result4": array4, + // }) + + // } else if method == "GetProgressFlowElectrical" { + // var result2, result3 string + // array := []string{} + // array2 := []string{} + // array3 := []string{} + + // results, err := db.Query(`SELECT IFNULL(rp.progressflow, '') AS result, IFNULL(p.dateStart, '') AS result2, IFNULL(p.dateEnd, '') AS result3 FROM electricalprogressflow p, ref_progressflow rp WHERE p.ref_progressflowid = rp.ref_progressflowid AND p.electricalid = (SELECT electricalid FROM electrical WHERE electricalNo = ?)`, data) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // for results.Next() { + // err = results.Scan(&result, &result2, &result3) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, _ := encrypt(result) + // result2, _ := encrypt(result2) + // result3, _ := encrypt(result3) + + // array = append(array, result) + // array2 = append(array2, result2) + // array3 = append(array3, result3) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": array, + // "result2": array2, + // "result3": array3, + // }) + + case "GetPermitsBuilding": + var result2, result3, result4 string + array := []string{} + array2 := []string{} + array3 := []string{} + array4 := []string{} + + results, err := db.Query(`SELECT IFNULL(p.permitNo, '') AS result, IFNULL(rp.block, '') AS result2, IFNULL(rp.lot, '') AS result3, IFNULL(rp.address, '') AS result4 FROM receiving_permitnoaddress rp, permitnos p WHERE p.receiving_permitnoaddressid = rp.receiving_permitnoaddressid AND rp.receivingid = (SELECT receivingid FROM receiving WHERE applicationNo = ?)`, data) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + + for results.Next() { + err = results.Scan(&result, &result2, &result3, &result4) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + array2 = append(array2, result2) + array3 = append(array3, result3) + array4 = append(array4, result4) + } + + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + "result3": array3, + "result4": array4, + }) + + case "GetPermitsOccupancy": + var result2, result3, result4, result5, result6, result7 string + array := []string{} + array2 := []string{} + array3 := []string{} + array4 := []string{} + array5 := []string{} + array6 := []string{} + array7 := []string{} + + results, err := db.Query(`SELECT IFNULL(p.occupancyPermitNo, '') AS result, IFNULL(rp.block, '') AS result2, IFNULL(rp.lot, '') AS result3, IFNULL(rp.address, '') AS result4, IFNULL(rp.occblock, '') AS result5, IFNULL(rp.occlot, '') AS result6, IFNULL(rp.occaddress, '') AS result7 FROM occupancypermitnos p, receiving_permitnoaddress rp, receiving r, occupancy o WHERE p.occupancyid = o.occupancyid AND o.bldgApplicationNo = r.applicationNo AND r.receivingid = rp.receivingid AND o.occupancyid = (SELECT occupancyid FROM occupancy WHERE controlNo = ?)`, data) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + + for results.Next() { + err = results.Scan(&result, &result2, &result3, &result4, &result5, &result6, &result7) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + array2 = append(array2, result2) + array3 = append(array3, result3) + array4 = append(array4, result4) + array5 = append(array5, result5) + array6 = append(array6, result6) + array7 = append(array7, result7) + } + + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + "result3": array3, + "result4": array4, + "result5": array5, + "result6": array6, + "result7": array7, + }) + + case "GetPermitsElectrical": + var result2 string + array := []string{} + array2 := []string{} + + results, err := db.Query(`SELECT IFNULL(ceiNo, '') AS result, IFNULL(dateRelease,'') AS result2 FROM electrical_certificate WHERE electricalid = (SELECT electricalid FROM electrical WHERE electricalNo = ?)`, data) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + + for results.Next() { + err = results.Scan(&result, &result2) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + array2 = append(array2, result2) + } + + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + }) + + case "GetDailyReceived": + var result2, result3, result4 string + decodedString := strings.Replace(data, "~", "/", -1) + array := []string{} + array2 := []string{} + array3 := []string{} + array4 := []string{} + + results, err := db.Query(`SELECT r.applicationNo AS result, IF(c.firstName IS NULL OR c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', IF(c.middleInitial IS NULL OR c.middleInitial = '', '', CONCAT(c.middleInitial, '. ')), c.lastName)) AS result2, IFNULL(r.locationofconstruction, '') AS result3, IFNULL(CONCAT(ro.occupancy, ' - ', rot.occupancyType), '') AS result4 + FROM receiving r, customer c, ref_occupancy ro, ref_occupancy_type rot + WHERE (r.receivedate LIKE ? OR r.receivezoning LIKE ?) AND r.customerid = c.customerid AND r.ref_occupancy_typeid = rot.ref_occupancy_typeid AND rot.ref_occupancyid = ro.ref_occupancyid`, decodedString+"%", decodedString+"%") + + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + + for results.Next() { + err = results.Scan(&result, &result2, &result3, &result4) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + array2 = append(array2, result2) + array3 = append(array3, result3) + array4 = append(array4, result4) + } + + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + "result3": array3, + "result4": array4, + }) + + // } else if method == "GetDailyReceivedOccupancy" { + // var result2, result3, result4 string + // decodedString := strings.Replace(data, "~", "-", -1) + // array := []string{} + // array2 := []string{} + // array3 := []string{} + // array4 := []string{} + + // results, err := db.Query(`SELECT o.controlNo AS result, IF(c.firstName IS NULL OR c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', IF(c.middleInitial IS NULL OR c.middleInitial = '', '', CONCAT(c.middleInitial, '. ')), c.lastName)) AS result2, IFNULL(r.locationofconstruction, '') AS result3, IFNULL(CONCAT(ro.occupancy, ' - ', rot.occupancyType), '') AS result4 + // FROM occupancy o, receiving r, customer c, ref_occupancy ro, ref_occupancy_type rot + // WHERE o.dateEntered LIKE ? AND o.bldgApplicationNo = r.applicationNo AND r.customerid = c.customerid AND o.ref_occupancy_typeid = rot.ref_occupancy_typeid AND rot.ref_occupancyid = ro.ref_occupancyid`, decodedString+"%") + + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // for results.Next() { + // err = results.Scan(&result, &result2, &result3, &result4) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, _ := encrypt(result) + // result2, _ := encrypt(result2) + // result3, _ := encrypt(result3) + // result4, _ := encrypt(result4) + + // array = append(array, result) + // array2 = append(array2, result2) + // array3 = append(array3, result3) + // array4 = append(array4, result4) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": array, + // "result2": array2, + // "result3": array3, + // "result4": array4, + // }) + + // } else if method == "GetDailyReceivedElectrical" { + // var result2, result3, result4 string + // decodedString := strings.Replace(data, "~", "-", -1) + // array := []string{} + // array2 := []string{} + // array3 := []string{} + // array4 := []string{} + + // results, err := db.Query(`SELECT e.electricalNo AS result, IF(c.firstName IS NULL OR c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', IF(c.middleInitial IS NULL OR c.middleInitial = '', '', CONCAT(c.middleInitial, '. ')), c.lastName)) AS result2, IFNULL(e.locationofinstallation, '') AS result3, IFNULL(ro.occupancyoruse, '') AS result4 + // FROM electrical e, customer c, ref_elec_occupancy ro, electricaldocflowtxn ed + // WHERE e.customerid = c.customerid AND e.ref_elec_occupancyid = ro.ref_elec_occupancyid AND e.electricalid = ed.electricalid AND ed.remarks = 'RECEIVED FOR ELECTRICAL APPLICATION' AND ed.txndate LIKE ?`, decodedString+"%") + + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // for results.Next() { + // err = results.Scan(&result, &result2, &result3, &result4) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, _ := encrypt(result) + // result2, _ := encrypt(result2) + // result3, _ := encrypt(result3) + // result4, _ := encrypt(result4) + + // array = append(array, result) + // array2 = append(array2, result2) + // array3 = append(array3, result3) + // array4 = append(array4, result4) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": array, + // "result2": array2, + // "result3": array3, + // "result4": array4, + // }) + + // } else if method == "GetLatestStatusBuilding" { + // err = db.QueryRow("SELECT d.remarks AS result FROM docflowtxn d, receiving r WHERE r.receivingid = d.receivingid AND d.docflowtxnid = (SELECT MAX(docflowtxnid) FROM docflowtxn WHERE receivingid = (SELECT receivingid FROM receiving WHERE applicationNo = ?))", data).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, err := encrypt(result) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + // } else if method == "GetLatestStatusOccupancy" { + // err = db.QueryRow("SELECT d.remarks AS result FROM occupancydocflowtxn d, occupancy o WHERE d.occupancyreceivingid = o.occupancyid AND d.occupancydocflowtxnid = (SELECT MAX(occupancydocflowtxnid) FROM occupancydocflowtxn WHERE occupancyreceivingid = (SELECT occupancyid FROM occupancy WHERE controlNo = ?))", data).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, err := encrypt(result) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + // } else if method == "GetLatestStatusElectrical" { + // err = db.QueryRow("SELECT d.remarks AS result FROM electricaldocflowtxn d, electrical e WHERE e.electricalid = d.electricalid AND d.electricaldocflowtxnid = (SELECT MAX(electricaldocflowtxnid) FROM electricaldocflowtxn WHERE electricalid = (SELECT electricalid FROM electrical WHERE electricalNo = ?))", data).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, err := encrypt(result) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + // } else if method == "GetSumPaid" { + // err = db.QueryRow("SELECT IFNULL(SUM(amount), 0) AS result FROM building_orderofpayment WHERE bldgApplicationNo = ? AND is_paid = 1", data).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, err := encrypt(result) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + // } else if method == "GetSumPaidOccupancy" { + // err = db.QueryRow("SELECT IFNULL(SUM(amount), 0) AS result FROM occupancy_orderofpayment WHERE is_paid = 1 AND occupancyid = (SELECT occupancyid FROM occupancy WHERE controlNo = ?)", data).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, err := encrypt(result) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + // } else if method == "GetSumPaidElectrical" { + // err = db.QueryRow("SELECT IFNULL(SUM(amount), 0) AS result FROM electrical_orderofpayment_new WHERE is_paid = 1 AND electricalid = (SELECT electricalid FROM electrical WHERE electricalNo = ?)", data).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, err := encrypt(result) + // if err != nil { + // c.AbortWithError(http.StatusServiceUnavailable, err) + // c.String(http.StatusServiceUnavailable, err.Error()) + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + // } else if method == "GetApprovedPermits" { + // var result2 string + // decodedString := strings.Replace(data, "~", "-", -1) + // array := []string{} + // array2 := []string{} + + // results, err := db.Query("SELECT IFNULL(receivingid, '') AS result, IFNULL(datetransac, '') AS result2 FROM docflowtxn WHERE datetransac LIKE ? AND remarks = 'PERMIT ALREADY RELEASE'", decodedString+"%") + + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // for results.Next() { + // err = results.Scan(&result, &result2) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, _ := encrypt(result) + // result2, _ := encrypt(result2) + + // array = append(array, result) + // array2 = append(array2, result2) + + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": array, + // "result2": array2, + // }) + + // } else if method == "GetApprovedPermitsOccupancy" { + // var result2 string + // decodedString := strings.Replace(data, "~", "-", -1) + // array := []string{} + // array2 := []string{} + + // results, err := db.Query("SELECT IFNULL(occupancyreceivingid, '') AS result, IFNULL(txndate, '') AS result2 FROM occupancydocflowtxn WHERE txndate LIKE ? AND remarks LIKE 'OCCUPANCY PERMIT RELEASED%'", decodedString+"%") + + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // for results.Next() { + // err = results.Scan(&result, &result2) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, _ := encrypt(result) + // result2, _ := encrypt(result2) + + // array = append(array, result) + // array2 = append(array2, result2) + + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": array, + // "result2": array2, + // }) + + // } else if method == "GetApprovedPermitsElectrical" { + // var result2 string + // decodedString := strings.Replace(data, "~", "-", -1) + // array := []string{} + // array2 := []string{} + + // results, err := db.Query("SELECT IFNULL(electricalid, '') AS result, IFNULL(txndate, '') AS result2 FROM electricaldocflowtxn WHERE txndate LIKE ? AND remarks LIKE 'ELECTRICAL PERMIT RELEASED%'", decodedString+"%") + + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + + // for results.Next() { + // err = results.Scan(&result, &result2) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, _ := encrypt(result) + // result2, _ := encrypt(result2) + + // array = append(array, result) + // array2 = append(array2, result2) + + // } + + // c.JSON(http.StatusOK, gin.H{ + // "result": array, + // "result2": array2, + // }) + + // } else if method == "GetApprovedPermitsDetails" { + // var result2, result3, result4, result5, result6 string + // err = db.QueryRow(`SELECT r.applicationNo AS result, IF(c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', c.middleInitial, '. ', c.lastName)) AS result2, IFNULL(rp.block, '') AS result3, IFNULL(rp.lot, '') AS result4, IFNULL(rp.address, '') AS result5, IFNULL(pn.permitNo, '') AS result6 + // FROM receiving r, customer c, receiving_permitnoaddress rp, permitnos pn + // WHERE r.customerid = c.customerid AND r.receivingid = rp.receivingid AND rp.receiving_permitnoaddressid = pn.receiving_permitnoaddressid AND r.receivingid = ? AND pn.permitNo LIKE '%BU'`, data).Scan(&result, &result2, &result3, &result4, &result5, &result6) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, _ := encrypt(result) + // result2, _ := encrypt(result2) + // result3, _ := encrypt(result3) + // result4, _ := encrypt(result4) + // result5, _ := encrypt(result5) + // result6, _ := encrypt(result6) + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // "result2": result2, + // "result3": result3, + // "result4": result4, + // "result5": result5, + // "result6": result6, + // }) + // } else if method == "GetApprovedPermitsOccupancyDetails" { + // var result2, result3, result4, result5, result6 string + // err = db.QueryRow(`SELECT o.controlNo AS result, IF(c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', c.middleInitial, '. ', c.lastName)) AS result2, IFNULL(rp.block, '') AS result3, IFNULL(rp.lot, '') AS result4, IFNULL(rp.address, '') AS result5, IFNULL(pn.occupancyPermitNo, '') AS result6 + // FROM occupancy o, receiving r, customer c, receiving_permitnoaddress rp, occupancypermitnos pn + // WHERE o.customerid = c.customerid AND o.bldgApplicationNo = r.applicationNo AND r.receivingid = rp.receivingid AND o.occupancyid = pn.occupancyid AND o.occupancyid = ?`, data).Scan(&result, &result2, &result3, &result4, &result5, &result6) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, _ := encrypt(result) + // result2, _ := encrypt(result2) + // result3, _ := encrypt(result3) + // result4, _ := encrypt(result4) + // result5, _ := encrypt(result5) + // result6, _ := encrypt(result6) + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // "result2": result2, + // "result3": result3, + // "result4": result4, + // "result5": result5, + // "result6": result6, + // }) + + // } else if method == "GetApprovedPermitsElectricalDetails" { + // var result2, result3, result4, result5, result6 string + // err = db.QueryRow(`SELECT e.electricalNo AS result, IF(c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', c.middleInitial, '. ', c.lastName)) AS result2, '' AS result3, '' AS result4, IFNULL(e.locationofinstallation, '') AS result5, IFNULL(ec.ceiNo, '') AS result6 + // FROM electrical e, customer c, electrical_certificate ec + // WHERE e.customerid = c.customerid AND e.electricalid = ec.electricalid AND e.electricalid = ?`, data).Scan(&result, &result2, &result3, &result4, &result5, &result6) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // result, _ := encrypt(result) + // result2, _ := encrypt(result2) + // result3, _ := encrypt(result3) + // result4, _ := encrypt(result4) + // result5, _ := encrypt(result5) + // result6, _ := encrypt(result6) + + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // "result2": result2, + // "result3": result3, + // "result4": result4, + // "result5": result5, + // "result6": result6, + // }) + + } + }) + + // router.GET("/api/:method/:data/:data2", func(c *gin.Context) { + // var result string + // method := c.Param("method") + // data := c.Param("data") + // data2 := c.Param("data2") + + // c.Writer.Header().Set("X-XSS-Protection", "1; mode=block") + // c.Writer.Header().Set("X-Content-Type-Options", "nosniff") + // c.Writer.Header().Set("X-DNS-Prefetch-Control", "off") + // c.Writer.Header().Set("X-Frame-Options", "DENY") + // c.Writer.Header().Set("X-Download-Options", "noopen") + // c.Writer.Header().Set("Referrer-Policy", "no-referrer") + + // // fixedMethod := strings.Replace(method, "~", "/", -1) + // // fixedData := strings.Replace(data, "~", "/", -1) + // // fixedData2 := strings.Replace(data2, "~", "/", -1) + + // // method, err := decrypt(fixedMethod) + // // if err != nil { + // // c.AbortWithError(http.StatusBadGateway, err) + // // c.String(http.StatusBadGateway, err.Error()) + // // } + // // data, err := decrypt(fixedData) + // // if err != nil { + // // c.AbortWithError(http.StatusBadGateway, err) + // // c.String(http.StatusBadGateway, err.Error()) + // // } + // // data2, err := decrypt(fixedData2) + // // if err != nil { + // // c.AbortWithError(http.StatusBadGateway, err) + // // c.String(http.StatusBadGateway, err.Error()) + // // } + + // // log.Println("Method", method) + // // log.Println("Data", data) + // // log.Println("Data2", data2) + + // if method == "SearchByNameBuilding" { + // var newData string + // if data2 == "empty" { + // newData = "" + // } else { + // newData = data2 + // } + + // err := db.QueryRow("SELECT IFNULL(b.receivingid, '') AS result FROM receiving b, customer c WHERE c.customerid = b.customerid AND c.lastName LIKE ? AND c.firstName = ?", "%"+data+"%", newData).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + // } else if method == "SearchByNameOccupancy" { + // var newData string + // if data2 == "empty" { + // newData = "" + // } else { + // newData = data2 + // } + + // err := db.QueryRow("SELECT IFNULL(b.occupancyid, '') AS result FROM occupancy b, customer c WHERE c.customerid = b.customerid AND c.lastName LIKE ? AND c.firstName = ?", "%"+data+"%", newData).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + + // } else if method == "SearchByNameElectrical" { + // var newData string + // if data2 == "empty" { + // newData = "" + // } else { + // newData = data2 + // } + + // err := db.QueryRow("SELECT IFNULL(b.electricalid, '') AS result FROM electrical b, customer c WHERE c.customerid = b.customerid AND c.lastName LIKE ? AND c.firstName = ?", "%"+data+"%", newData).Scan(&result) + // if err != nil { + // c.AbortWithError(http.StatusBadRequest, err) + // c.String(http.StatusBadRequest, err.Error()) + // } + // c.JSON(http.StatusOK, gin.H{ + // "result": result, + // }) + // } + // }) + + router.Run(":4320") +} diff --git a/backend/src/api.rs b/backend/src/api.rs deleted file mode 100644 index 152605f..0000000 --- a/backend/src/api.rs +++ /dev/null @@ -1,43 +0,0 @@ -use actix_web::{HttpResponse, Responder, get, web::Data}; -use serde::Serialize; -use sqlx::FromRow; - -use crate::AppState; - -#[derive(Serialize, FromRow)] -struct Employee { - employeeid: i32, - employeename: String, - uname: String, - pword: String, - password: String, - ref_positionid: i32, - ref_designationid: i32, - is_approver: i32, - is_finalapprover: i32, - is_assessment: i32, - is_reviewer: i32, - is_evaluator: i32, - is_inspector: i32, - is_delete: i32, - imagepath: String, - sigimage: String, - is_supervisor: i32, - is_guest: i32, - is_online: i32, - is_head: i32, - is_reset: i32 -} - -#[get("/employee")] -pub async fn sample(app_state: Data) -> impl Responder { - let query = - sqlx::query_as::<_, Employee>("SELECT * FROM employee") - .fetch_all(&app_state.pool) - .await; - - match query { - Ok(result) => HttpResponse::Ok().json(result), - Err(_) => HttpResponse::BadRequest().into(), - } -} diff --git a/backend/src/main.rs b/backend/src/main.rs deleted file mode 100644 index 89bf9a5..0000000 --- a/backend/src/main.rs +++ /dev/null @@ -1,50 +0,0 @@ -use actix_web::{App, http, HttpServer, web::Data}; -// use actix_cors::Cors; -use actix_governor::{Governor, GovernorConfigBuilder}; -use dotenvy::dotenv; - -use sqlx::mysql::{MySqlPool, MySqlPoolOptions}; -use std::env; - -mod api; -use api::{sample}; - -#[derive(Clone, Debug)] -pub struct AppState { - pool: MySqlPool, -} - -#[actix_web::main] -async fn main() -> std::io::Result<()> { - dotenv().ok(); - let db_connection = env::var("DATABASE_URL").unwrap(); - let pool: MySqlPool = MySqlPoolOptions::new() - .connect(db_connection.as_str()) - .await - .unwrap(); - let app_state = AppState { pool }; - - HttpServer::new(move || { - // let cors = Cors::default() - // .allowed_origin("localhost:*") - // .allowed_methods(vec!["GET", "POST"]) - // .allowed_headers(vec![http::header::AUTHORIZATION, http::header::ACCEPT]) - // .allowed_header(http::header::CONTENT_TYPE) - // .max_age(3600); - - let governor_conf = GovernorConfigBuilder::default() - .seconds_per_request(2) - .burst_size(20) - .finish() - .unwrap(); - - App::new() - .app_data(Data::new(app_state.pool.clone())) - // .wrap(cors) - .wrap(Governor::new(&governor_conf)) - .service(sample) - }) - .bind(("127.0.0.1", 4320))? - .run() - .await -} diff --git a/backend/static/index.html b/backend/static/index.html new file mode 100644 index 0000000..1184893 --- /dev/null +++ b/backend/static/index.html @@ -0,0 +1,27 @@ + + + + + + OCBO e-Sign Server + + + + +

OCBO e-Sign Server is running

+ +