Эх сурвалжийг харах

✨ feat(models): 删除不再使用的SeaORM实体模型及相关模块

陈雪 2 долоо хоног өмнө
parent
commit
722afea618

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 3 - 688
src-tauri/Cargo.lock


+ 0 - 6
src-tauri/Cargo.toml

@@ -18,11 +18,6 @@ crate-type = ["staticlib", "cdylib", "rlib"]
 tauri-build = { version = "2", features = [] }
 
 [dependencies]
-sea-orm = { version = "1.1.0", features = [
-    "sqlx-sqlite",
-    "runtime-tokio-rustls",
-    "macros",
-] }
 tauri = { version = "2", features = [] }
 tauri-plugin-opener = "2"
 serde = { version = "1", features = ["derive"] }
@@ -31,7 +26,6 @@ tauri-plugin-store = "2"
 tauri-plugin-http = "2"
 tauri-plugin-upload = "2"
 tauri-plugin-os = "2"
-tokio = { version = "1.44.0", features = ["full"] }
 anyhow = "1.0.97"
 
 [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]

+ 0 - 1
src-tauri/src/lib.rs

@@ -17,7 +17,6 @@ pub fn run() {
         .plugin(tauri_plugin_http::init())
         .plugin(tauri_plugin_store::Builder::new().build())
         .plugin(tauri_plugin_opener::init())
-        .invoke_handler(tauri::generate_handler![commands::async_fetch])
         .run(tauri::generate_context!())
         .expect("error while running tauri application");
 }

+ 0 - 30
src-tauri/src/models/menu_cate.rs

@@ -1,30 +0,0 @@
-//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
-
-use sea_orm::entity::prelude::*;
-
-#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
-#[sea_orm(table_name = "menu_cate")]
-pub struct Model {
-    #[sea_orm(primary_key, auto_increment = true)]
-    pub id: i32,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub name: Option<String>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub logo: Option<String>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub local_logo: Option<String>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub description: Option<String>,
-    #[sea_orm(column_type = "custom(\"DATETIME\")", nullable)]
-    pub create_time: Option<String>,
-    #[sea_orm(column_type = "custom(\"DATETIME\")", nullable)]
-    pub update_time: Option<String>,
-    pub sort: Option<i32>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub status: Option<String>,
-}
-
-#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
-pub enum Relation {}
-
-impl ActiveModelBehavior for ActiveModel {}

+ 0 - 55
src-tauri/src/models/menu_commodity.rs

@@ -1,55 +0,0 @@
-//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
-
-use sea_orm::entity::prelude::*;
-
-#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
-#[sea_orm(table_name = "menu_commodity")]
-pub struct Model {
-    #[sea_orm(primary_key, auto_increment = true)]
-    pub id: i32,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub r#type: Option<String>,
-    pub merchant_id: Option<i32>,
-    pub store_id: Option<i32>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub name: Option<String>,
-    pub cate_id: Option<i32>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub goods_no: Option<String>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub is_single_spec: Option<String>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub logo: Option<String>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub images: Option<String>,
-    pub price: Option<Decimal>,
-    pub line_price: Option<Decimal>,
-    pub stock: Option<i32>,
-    pub weight: Option<Decimal>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub coupon_ids: Option<String>,
-    pub service_time: Option<i32>,
-    pub init_sale: Option<i32>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub sale_point: Option<String>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub can_use_point: Option<String>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub is_member_discount: Option<String>,
-    pub sort: Option<i32>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub description: Option<String>,
-    #[sea_orm(column_type = "custom(\"DATETIME\")", nullable)]
-    pub create_time: Option<String>,
-    #[sea_orm(column_type = "custom(\"DATETIME\")", nullable)]
-    pub update_time: Option<String>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub operator: Option<String>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub status: Option<String>,
-}
-
-#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
-pub enum Relation {}
-
-impl ActiveModelBehavior for ActiveModel {}

+ 0 - 44
src-tauri/src/models/menu_sku.rs

@@ -1,44 +0,0 @@
-//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
-
-use sea_orm::entity::prelude::*;
-
-#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
-#[sea_orm(table_name = "menu_sku")]
-pub struct Model {
-    #[sea_orm(primary_key)]
-    pub id: i32,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub sku_no: Option<String>,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub logo: Option<String>,
-    pub goods_id: i32,
-    pub stock: i32,
-    pub price: Decimal,
-    pub line_price: Decimal,
-    pub weight: Option<Decimal>,
-    #[sea_orm(column_type = "Text")]
-    pub status: String,
-}
-
-#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
-pub enum Relation {
-    #[sea_orm(has_many = "super::menu_sku_spec::Entity")]
-    MenuSkuSpec,
-}
-
-impl Related<super::menu_sku_spec::Entity> for Entity {
-    fn to() -> RelationDef {
-        Relation::MenuSkuSpec.def()
-    }
-}
-
-impl Related<super::menu_spec::Entity> for Entity {
-    fn to() -> RelationDef {
-        super::menu_sku_spec::Relation::MenuSpec.def()
-    }
-    fn via() -> Option<RelationDef> {
-        Some(super::menu_sku_spec::Relation::MenuSku.def().rev())
-    }
-}
-
-impl ActiveModelBehavior for ActiveModel {}

+ 0 - 46
src-tauri/src/models/menu_sku_spec.rs

@@ -1,46 +0,0 @@
-//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
-
-use sea_orm::entity::prelude::*;
-
-#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
-#[sea_orm(table_name = "menu_sku_spec")]
-pub struct Model {
-    #[sea_orm(primary_key, auto_increment = false)]
-    pub sku_id: i32,
-    #[sea_orm(primary_key, auto_increment = false)]
-    pub spec_id: i32,
-}
-
-#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
-pub enum Relation {
-    #[sea_orm(
-        belongs_to = "super::menu_sku::Entity",
-        from = "Column::SkuId",
-        to = "super::menu_sku::Column::Id",
-        on_update = "NoAction",
-        on_delete = "NoAction"
-    )]
-    MenuSku,
-    #[sea_orm(
-        belongs_to = "super::menu_spec::Entity",
-        from = "Column::SpecId",
-        to = "super::menu_spec::Column::Id",
-        on_update = "NoAction",
-        on_delete = "NoAction"
-    )]
-    MenuSpec,
-}
-
-impl Related<super::menu_sku::Entity> for Entity {
-    fn to() -> RelationDef {
-        Relation::MenuSku.def()
-    }
-}
-
-impl Related<super::menu_spec::Entity> for Entity {
-    fn to() -> RelationDef {
-        Relation::MenuSpec.def()
-    }
-}
-
-impl ActiveModelBehavior for ActiveModel {}

+ 0 - 40
src-tauri/src/models/menu_spec.rs

@@ -1,40 +0,0 @@
-//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
-
-use sea_orm::entity::prelude::*;
-
-#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
-#[sea_orm(table_name = "menu_spec")]
-pub struct Model {
-    #[sea_orm(primary_key, auto_increment = true)]
-    pub id: i32,
-    pub goods_id: i32,
-    #[sea_orm(column_type = "Text")]
-    pub name: String,
-    #[sea_orm(column_type = "Text")]
-    pub value: String,
-    #[sea_orm(column_type = "Text", nullable)]
-    pub status: Option<String>,
-}
-
-#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
-pub enum Relation {
-    #[sea_orm(has_many = "super::menu_sku_spec::Entity")]
-    MenuSkuSpec,
-}
-
-impl Related<super::menu_sku_spec::Entity> for Entity {
-    fn to() -> RelationDef {
-        Relation::MenuSkuSpec.def()
-    }
-}
-
-impl Related<super::menu_sku::Entity> for Entity {
-    fn to() -> RelationDef {
-        super::menu_sku_spec::Relation::MenuSku.def()
-    }
-    fn via() -> Option<RelationDef> {
-        Some(super::menu_sku_spec::Relation::MenuSpec.def().rev())
-    }
-}
-
-impl ActiveModelBehavior for ActiveModel {}

+ 0 - 9
src-tauri/src/models/mod.rs

@@ -1,9 +0,0 @@
-//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
-
-pub mod prelude;
-
-pub mod menu_cate;
-pub mod menu_commodity;
-pub mod menu_sku;
-pub mod menu_sku_spec;
-pub mod menu_spec;

+ 0 - 7
src-tauri/src/models/prelude.rs

@@ -1,7 +0,0 @@
-//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
-
-pub use super::menu_cate::Entity as MenuCate;
-pub use super::menu_commodity::Entity as MenuCommodity;
-pub use super::menu_sku::Entity as MenuSku;
-pub use super::menu_sku_spec::Entity as MenuSkuSpec;
-pub use super::menu_spec::Entity as MenuSpec;

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно