refactoring
This commit is contained in:
parent
93569bc247
commit
d01a9d2ea4
|
@ -29,7 +29,7 @@ tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
||||||
tokio-cron-scheduler = { version = "*" }
|
tokio-cron-scheduler = { version = "*" }
|
||||||
uuid = { version = "0", features = ["serde", "v4", "v5"] }
|
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-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.58-snapshot" }
|
beteran-common-rust = { git = "https://gitlab.loafle.net/bet/beteran-common-rust.git", tag = "v0.1.62-snapshot" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
|
|
@ -108,7 +108,7 @@ pub struct FindAllSearch {
|
||||||
pub struct FindAll {
|
pub struct FindAll {
|
||||||
pub search: Option<FindAllSearch>,
|
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>>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ impl Repository {
|
||||||
if let Some(orderbys) = &find_all.sorts {
|
if let Some(orderbys) = &find_all.sorts {
|
||||||
for s in orderbys {
|
for s in orderbys {
|
||||||
match s {
|
match s {
|
||||||
bcr::models::pagination::Sort::ASC(property) => match property.as_str() {
|
bcr::pagination::Sort::ASC(property) => match property.as_str() {
|
||||||
"vendor_id" => {
|
"vendor_id" => {
|
||||||
q = q.order_by(api_kgon_games::vendor_id.asc());
|
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" => {
|
"vendor_id" => {
|
||||||
q = q.order_by(api_kgon_games::vendor_id.desc());
|
q = q.order_by(api_kgon_games::vendor_id.desc());
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ pub struct FindAllSearch {
|
||||||
pub struct FindAll {
|
pub struct FindAll {
|
||||||
pub search: Option<FindAllSearch>,
|
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>>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,7 @@ impl Repository {
|
||||||
if let Some(orderbys) = &find_all.sorts {
|
if let Some(orderbys) = &find_all.sorts {
|
||||||
for s in orderbys {
|
for s in orderbys {
|
||||||
match s {
|
match s {
|
||||||
bcr::models::pagination::Sort::ASC(property) => match property.as_str() {
|
bcr::pagination::Sort::ASC(property) => match property.as_str() {
|
||||||
"balance" => {
|
"balance" => {
|
||||||
q = q.order_by(api_kgon_members::balance.asc());
|
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" => {
|
"balance" => {
|
||||||
q = q.order_by(api_kgon_members::balance.desc());
|
q = q.order_by(api_kgon_members::balance.desc());
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ pub struct FindAllSearch {
|
||||||
pub struct FindAll {
|
pub struct FindAll {
|
||||||
pub search: Option<FindAllSearch>,
|
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>>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ impl Repository {
|
||||||
if let Some(orderbys) = &find_all.sorts {
|
if let Some(orderbys) = &find_all.sorts {
|
||||||
for s in orderbys {
|
for s in orderbys {
|
||||||
match s {
|
match s {
|
||||||
bcr::models::pagination::Sort::ASC(property) => match property.as_str() {
|
bcr::pagination::Sort::ASC(property) => match property.as_str() {
|
||||||
"item" => {
|
"item" => {
|
||||||
q = q.order_by(api_kgon_synchronization_history::item.asc());
|
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" => {
|
"item" => {
|
||||||
q = q.order_by(api_kgon_synchronization_history::item.desc());
|
q = q.order_by(api_kgon_synchronization_history::item.desc());
|
||||||
}
|
}
|
||||||
|
|
4
src/repositories/vendor/models.rs
vendored
4
src/repositories/vendor/models.rs
vendored
|
@ -128,7 +128,7 @@ pub struct FindAllSearch {
|
||||||
pub struct FindAll {
|
pub struct FindAll {
|
||||||
pub search: Option<FindAllSearch>,
|
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>>,
|
||||||
}
|
}
|
||||||
|
|
4
src/repositories/vendor/repository.rs
vendored
4
src/repositories/vendor/repository.rs
vendored
|
@ -158,7 +158,7 @@ impl Repository {
|
||||||
if let Some(orderbys) = &find_all.sorts {
|
if let Some(orderbys) = &find_all.sorts {
|
||||||
for s in orderbys {
|
for s in orderbys {
|
||||||
match s {
|
match s {
|
||||||
bcr::models::pagination::Sort::ASC(property) => match property.as_str() {
|
bcr::pagination::Sort::ASC(property) => match property.as_str() {
|
||||||
"company_id" => {
|
"company_id" => {
|
||||||
q = q.order_by(api_kgon_vendors::company_id.asc());
|
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" => {
|
"company_id" => {
|
||||||
q = q.order_by(api_kgon_vendors::company_id.desc());
|
q = q.order_by(api_kgon_vendors::company_id.desc());
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,12 +115,12 @@ impl Service {
|
||||||
pagination: request
|
pagination: request
|
||||||
.pagination
|
.pagination
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(bcr::models::pagination::Pagination::from),
|
.map(bcr::pagination::Pagination::from),
|
||||||
sorts: Some(
|
sorts: Some(
|
||||||
request
|
request
|
||||||
.sorts
|
.sorts
|
||||||
.iter()
|
.iter()
|
||||||
.map(beteran_common_rust::models::pagination::Sort::from)
|
.map(bcr::pagination::Sort::from)
|
||||||
.collect(),
|
.collect(),
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
4
src/services/vendor/service.rs
vendored
4
src/services/vendor/service.rs
vendored
|
@ -116,12 +116,12 @@ impl Service {
|
||||||
pagination: request
|
pagination: request
|
||||||
.pagination
|
.pagination
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(bcr::models::pagination::Pagination::from),
|
.map(bcr::pagination::Pagination::from),
|
||||||
sorts: Some(
|
sorts: Some(
|
||||||
request
|
request
|
||||||
.sorts
|
.sorts
|
||||||
.iter()
|
.iter()
|
||||||
.map(beteran_common_rust::models::pagination::Sort::from)
|
.map(bcr::pagination::Sort::from)
|
||||||
.collect(),
|
.collect(),
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user