refactor(bill): 重构 bank card 路由删除逻辑以支持 ID 参数
- 修改 DELETE 路由以接收 ID 参数 - 移除了冗余的 HTTP 请求示例文件 - 将 bill 包从主应用中解耦为库模块 - 更新 Cargo.toml 依赖关系以包含 bill 模块 - 升级多个工作区依赖版本 - 移除了已弃用的 docker-watcher 包及相关测试代码 - 修正数据库执行语句引用方式 - 添加 EntityTrait 引用以支持模型操作
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::utils::time::get_current_time;
|
||||
use sea_orm::EntityTrait;
|
||||
use sea_orm::prelude::DeriveEntityModel;
|
||||
use sea_orm::{ActiveModelBehavior, DeriveRelation, EnumIter};
|
||||
use sea_orm::{DerivePrimaryKey, PrimaryKeyTrait};
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
use crate::model::ssh_connection::{ActiveModel, Entity};
|
||||
use log::{info, warn};
|
||||
use sea_orm::{
|
||||
ActiveModelTrait, ConnectionTrait, Database, DatabaseBackend, DatabaseConnection, Schema,
|
||||
};
|
||||
use sea_orm::{ActiveModelTrait, ConnectionTrait, Database, DatabaseBackend, DatabaseConnection, Schema};
|
||||
use std::sync::OnceLock;
|
||||
|
||||
static DB: OnceLock<Option<DatabaseConnection>> = OnceLock::new();
|
||||
@@ -31,7 +29,7 @@ pub async fn create_ssh_connection_table() -> bool {
|
||||
let statement = Schema::new(DatabaseBackend::Sqlite).create_table_from_entity(Entity);
|
||||
let sql = db.get_database_backend().build(&statement);
|
||||
|
||||
match db.execute(sql).await {
|
||||
match db.execute(&sql).await {
|
||||
Ok(_) => {
|
||||
info!("创建表成功!");
|
||||
true
|
||||
|
||||
Reference in New Issue
Block a user