refactoring

This commit is contained in:
병준 박 2022-08-27 07:29:59 +00:00
parent 93569bc247
commit d01a9d2ea4
11 changed files with 22 additions and 22 deletions

View File

@ -29,7 +29,7 @@ tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
tokio-cron-scheduler = { version = "*" }
uuid = { version = "0", features = ["serde", "v4", "v5"] }
beteran-protobuf-rust = { git = "https://gitlab.loafle.net/bet/beteran-protobuf-rust.git", tag = "v0.1.74-snapshot" }
beteran-common-rust = { git = "https://gitlab.loafle.net/bet/beteran-common-rust.git", tag = "v0.1.58-snapshot" }
beteran-protobuf-rust = { git = "https://gitlab.loafle.net/bet/beteran-protobuf-rust.git", tag = "v0.1.77-snapshot" }
beteran-common-rust = { git = "https://gitlab.loafle.net/bet/beteran-common-rust.git", tag = "v0.1.62-snapshot" }
[build-dependencies]

View File

@ -108,7 +108,7 @@ pub struct FindAllSearch {
pub struct FindAll {
pub search: Option<FindAllSearch>,
///
pub pagination: Option<bcr::models::pagination::Pagination>,
pub pagination: Option<bcr::pagination::Pagination>,
///
pub sorts: Option<Vec<bcr::models::pagination::Sort>>,
pub sorts: Option<Vec<bcr::pagination::Sort>>,
}

View File

@ -147,7 +147,7 @@ impl Repository {
if let Some(orderbys) = &find_all.sorts {
for s in orderbys {
match s {
bcr::models::pagination::Sort::ASC(property) => match property.as_str() {
bcr::pagination::Sort::ASC(property) => match property.as_str() {
"vendor_id" => {
q = q.order_by(api_kgon_games::vendor_id.asc());
}
@ -171,7 +171,7 @@ impl Repository {
}
_ => {}
},
bcr::models::pagination::Sort::DESC(property) => match property.as_str() {
bcr::pagination::Sort::DESC(property) => match property.as_str() {
"vendor_id" => {
q = q.order_by(api_kgon_games::vendor_id.desc());
}

View File

@ -72,7 +72,7 @@ pub struct FindAllSearch {
pub struct FindAll {
pub search: Option<FindAllSearch>,
///
pub pagination: Option<bcr::models::pagination::Pagination>,
pub pagination: Option<bcr::pagination::Pagination>,
///
pub sorts: Option<Vec<bcr::models::pagination::Sort>>,
pub sorts: Option<Vec<bcr::pagination::Sort>>,
}

View File

@ -119,7 +119,7 @@ impl Repository {
if let Some(orderbys) = &find_all.sorts {
for s in orderbys {
match s {
bcr::models::pagination::Sort::ASC(property) => match property.as_str() {
bcr::pagination::Sort::ASC(property) => match property.as_str() {
"balance" => {
q = q.order_by(api_kgon_members::balance.asc());
}
@ -143,7 +143,7 @@ impl Repository {
}
_ => {}
},
bcr::models::pagination::Sort::DESC(property) => match property.as_str() {
bcr::pagination::Sort::DESC(property) => match property.as_str() {
"balance" => {
q = q.order_by(api_kgon_members::balance.desc());
}

View File

@ -50,7 +50,7 @@ pub struct FindAllSearch {
pub struct FindAll {
pub search: Option<FindAllSearch>,
///
pub pagination: Option<bcr::models::pagination::Pagination>,
pub pagination: Option<bcr::pagination::Pagination>,
///
pub sorts: Option<Vec<bcr::models::pagination::Sort>>,
pub sorts: Option<Vec<bcr::pagination::Sort>>,
}

View File

@ -106,7 +106,7 @@ impl Repository {
if let Some(orderbys) = &find_all.sorts {
for s in orderbys {
match s {
bcr::models::pagination::Sort::ASC(property) => match property.as_str() {
bcr::pagination::Sort::ASC(property) => match property.as_str() {
"item" => {
q = q.order_by(api_kgon_synchronization_history::item.asc());
}
@ -124,7 +124,7 @@ impl Repository {
}
_ => {}
},
bcr::models::pagination::Sort::DESC(property) => match property.as_str() {
bcr::pagination::Sort::DESC(property) => match property.as_str() {
"item" => {
q = q.order_by(api_kgon_synchronization_history::item.desc());
}

View File

@ -128,7 +128,7 @@ pub struct FindAllSearch {
pub struct FindAll {
pub search: Option<FindAllSearch>,
///
pub pagination: Option<bcr::models::pagination::Pagination>,
pub pagination: Option<bcr::pagination::Pagination>,
///
pub sorts: Option<Vec<bcr::models::pagination::Sort>>,
pub sorts: Option<Vec<bcr::pagination::Sort>>,
}

View File

@ -158,7 +158,7 @@ impl Repository {
if let Some(orderbys) = &find_all.sorts {
for s in orderbys {
match s {
bcr::models::pagination::Sort::ASC(property) => match property.as_str() {
bcr::pagination::Sort::ASC(property) => match property.as_str() {
"company_id" => {
q = q.order_by(api_kgon_vendors::company_id.asc());
}
@ -194,7 +194,7 @@ impl Repository {
}
_ => {}
},
bcr::models::pagination::Sort::DESC(property) => match property.as_str() {
bcr::pagination::Sort::DESC(property) => match property.as_str() {
"company_id" => {
q = q.order_by(api_kgon_vendors::company_id.desc());
}

View File

@ -115,12 +115,12 @@ impl Service {
pagination: request
.pagination
.as_ref()
.map(bcr::models::pagination::Pagination::from),
.map(bcr::pagination::Pagination::from),
sorts: Some(
request
.sorts
.iter()
.map(beteran_common_rust::models::pagination::Sort::from)
.map(bcr::pagination::Sort::from)
.collect(),
),
};

View File

@ -116,12 +116,12 @@ impl Service {
pagination: request
.pagination
.as_ref()
.map(bcr::models::pagination::Pagination::from),
.map(bcr::pagination::Pagination::from),
sorts: Some(
request
.sorts
.iter()
.map(beteran_common_rust::models::pagination::Sort::from)
.map(bcr::pagination::Sort::from)
.collect(),
),
};