feat(health): 新增 media_folder/media_item/banner 实体 + image/hmac/sha2 依赖
This commit is contained in:
@@ -27,3 +27,4 @@ zeroize = { version = "1", features = ["derive"] }
|
|||||||
argon2.workspace = true
|
argon2.workspace = true
|
||||||
jsonwebtoken.workspace = true
|
jsonwebtoken.workspace = true
|
||||||
rand_core = "0.6"
|
rand_core = "0.6"
|
||||||
|
image = { version = "0.25", default-features = false, features = ["jpeg", "png", "webp"] }
|
||||||
|
|||||||
39
crates/erp-health/src/entity/banner.rs
Normal file
39
crates/erp-health/src/entity/banner.rs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
use sea_orm::entity::prelude::*;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||||
|
#[sea_orm(table_name = "banner")]
|
||||||
|
pub struct Model {
|
||||||
|
#[sea_orm(primary_key, auto_increment = false)]
|
||||||
|
pub id: Uuid,
|
||||||
|
pub tenant_id: Uuid,
|
||||||
|
pub media_item_id: Uuid,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub title: Option<String>,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub subtitle: Option<String>,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub link_type: Option<String>,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub link_target: Option<String>,
|
||||||
|
pub sort_order: i32,
|
||||||
|
pub status: String,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub start_time: Option<DateTimeUtc>,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub end_time: Option<DateTimeUtc>,
|
||||||
|
pub created_at: DateTimeUtc,
|
||||||
|
pub updated_at: DateTimeUtc,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub created_by: Option<Uuid>,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub updated_by: Option<Uuid>,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub deleted_at: Option<DateTimeUtc>,
|
||||||
|
pub version: i32,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||||
|
pub enum Relation {}
|
||||||
|
|
||||||
|
impl ActiveModelBehavior for ActiveModel {}
|
||||||
28
crates/erp-health/src/entity/media_folder.rs
Normal file
28
crates/erp-health/src/entity/media_folder.rs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
use sea_orm::entity::prelude::*;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||||
|
#[sea_orm(table_name = "media_folder")]
|
||||||
|
pub struct Model {
|
||||||
|
#[sea_orm(primary_key, auto_increment = false)]
|
||||||
|
pub id: Uuid,
|
||||||
|
pub tenant_id: Uuid,
|
||||||
|
pub name: String,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub parent_id: Option<Uuid>,
|
||||||
|
pub sort_order: i32,
|
||||||
|
pub created_at: DateTimeUtc,
|
||||||
|
pub updated_at: DateTimeUtc,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub created_by: Option<Uuid>,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub updated_by: Option<Uuid>,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub deleted_at: Option<DateTimeUtc>,
|
||||||
|
pub version: i32,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||||
|
pub enum Relation {}
|
||||||
|
|
||||||
|
impl ActiveModelBehavior for ActiveModel {}
|
||||||
39
crates/erp-health/src/entity/media_item.rs
Normal file
39
crates/erp-health/src/entity/media_item.rs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
use sea_orm::entity::prelude::*;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||||
|
#[sea_orm(table_name = "media_item")]
|
||||||
|
pub struct Model {
|
||||||
|
#[sea_orm(primary_key, auto_increment = false)]
|
||||||
|
pub id: Uuid,
|
||||||
|
pub tenant_id: Uuid,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub folder_id: Option<Uuid>,
|
||||||
|
pub filename: String,
|
||||||
|
pub storage_path: String,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub thumbnail_path: Option<String>,
|
||||||
|
pub content_type: String,
|
||||||
|
pub file_size: i64,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub width: Option<i32>,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub height: Option<i32>,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub alt_text: Option<String>,
|
||||||
|
pub is_public: bool,
|
||||||
|
pub created_at: DateTimeUtc,
|
||||||
|
pub updated_at: DateTimeUtc,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub created_by: Option<Uuid>,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub updated_by: Option<Uuid>,
|
||||||
|
#[sea_orm(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub deleted_at: Option<DateTimeUtc>,
|
||||||
|
pub version: i32,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||||
|
pub enum Relation {}
|
||||||
|
|
||||||
|
impl ActiveModelBehavior for ActiveModel {}
|
||||||
@@ -7,6 +7,7 @@ pub mod article_article_tag;
|
|||||||
pub mod article_category;
|
pub mod article_category;
|
||||||
pub mod article_revision;
|
pub mod article_revision;
|
||||||
pub mod article_tag;
|
pub mod article_tag;
|
||||||
|
pub mod banner;
|
||||||
pub mod ble_gateway;
|
pub mod ble_gateway;
|
||||||
pub mod blind_index;
|
pub mod blind_index;
|
||||||
pub mod care_plan;
|
pub mod care_plan;
|
||||||
@@ -32,6 +33,8 @@ pub mod handoff_log;
|
|||||||
pub mod health_record;
|
pub mod health_record;
|
||||||
pub mod health_trend;
|
pub mod health_trend;
|
||||||
pub mod lab_report;
|
pub mod lab_report;
|
||||||
|
pub mod media_folder;
|
||||||
|
pub mod media_item;
|
||||||
pub mod medication_record;
|
pub mod medication_record;
|
||||||
pub mod medication_reminder;
|
pub mod medication_reminder;
|
||||||
pub mod offline_event;
|
pub mod offline_event;
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ chrono.workspace = true
|
|||||||
moka = { version = "0.12", features = ["sync"] }
|
moka = { version = "0.12", features = ["sync"] }
|
||||||
metrics.workspace = true
|
metrics.workspace = true
|
||||||
metrics-exporter-prometheus.workspace = true
|
metrics-exporter-prometheus.workspace = true
|
||||||
|
hmac = "0.12"
|
||||||
|
sha2 = "0.10"
|
||||||
|
hex = "0.4"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
erp-auth = { workspace = true }
|
erp-auth = { workspace = true }
|
||||||
|
|||||||
Reference in New Issue
Block a user