refactor market and core modules

This commit is contained in:
creating2morrow 2023-06-04 05:40:25 -04:00
parent 224053360f
commit 84a7656616
7 changed files with 10 additions and 18 deletions

View file

@ -3,7 +3,7 @@ use log::{
error, error,
info, info,
}; };
use neveko_core::{ use crate::{
db, db,
models::*, models::*,
utils, utils,

View file

@ -1,12 +1,15 @@
pub mod args; // command line arguments pub mod args; // command line arguments
pub mod auth; // internal auth repo/service layer pub mod auth; // internal auth repo/service layer
pub mod contact; // contact repo/service layer pub mod contact; // contact repo/service layer
pub mod dispute; // Dispute repo/service layer
pub mod db; // lmdb interface pub mod db; // lmdb interface
pub mod gpg; // gpgme interface pub mod gpg; // gpgme interface
pub mod i2p; // i2p repo/service layer pub mod i2p; // i2p repo/service layer
pub mod message; // message repo/service layer pub mod message; // message repo/service layer
pub mod models; // db structs pub mod models; // db structs
pub mod monero; // monero-wallet-rpc interface pub mod monero; // monero-wallet-rpc interface
pub mod order; // Order repo/service layer
pub mod product; // Product repo/service layer
pub mod proof; // external auth/payment proof module pub mod proof; // external auth/payment proof module
pub mod reqres; // http request/responses pub mod reqres; // http request/responses
pub mod user; // misc. pub mod user; // misc.

View file

@ -3,7 +3,7 @@ use log::{
error, error,
info, info,
}; };
use neveko_core::{ use crate::{
db, db,
models::*, models::*,
monero, monero,
@ -33,9 +33,9 @@ impl StatusType {
/// Create a intial order /// Create a intial order
pub async fn create(j_order: Json<reqres::OrderRequest>) -> Order { pub async fn create(j_order: Json<reqres::OrderRequest>) -> Order {
info!("creating order"); info!("creating order");
let wallet_name = String::from(neveko_core::APP_NAME); let wallet_name = String::from(crate::APP_NAME);
let wallet_password = let wallet_password =
std::env::var(neveko_core::MONERO_WALLET_PASSWORD) std::env::var(crate::MONERO_WALLET_PASSWORD)
.unwrap_or(String::from("password")); .unwrap_or(String::from("password"));
monero::close_wallet(&wallet_name, &wallet_password).await; monero::close_wallet(&wallet_name, &wallet_password).await;
let ts = chrono::offset::Utc::now().timestamp(); let ts = chrono::offset::Utc::now().timestamp();

View file

@ -4,7 +4,7 @@ use log::{
error, error,
info, info,
}; };
use neveko_core::{ use crate::{
db, db,
models::*, models::*,
utils, utils,

View file

@ -9,12 +9,6 @@ use rocket::{
use neveko_core::*; use neveko_core::*;
use crate::{
dispute,
order,
product,
};
// JSON APIs // JSON APIs
/// Create a product by passings json product /// Create a product by passings json product

View file

@ -1,6 +1,2 @@
pub mod controller; // HTTP entry point // Keep complex logic in the core module
pub mod dispute; // Dispute repo/service layer pub mod controller;
pub mod order; // Order repo/service layer
pub mod product; // Product repo/service layer
// DO NOT EDIT BELOW THIS LINE

View file

@ -7,7 +7,6 @@ use rocket::{
}; };
use neveko_core::*; use neveko_core::*;
use neveko_market::*;
// JSON APIs exposed over i2p // JSON APIs exposed over i2p