use crate::module::user; use crate::module::user::model::User; // use chrono::Local; /** * 测试接口: 查 列表 */ pub async fn list() -> Vec { let user = user::dao::list().await; return user } /** * 测试接口: 增 */ pub async fn create(user: User) -> u64 { // user.created_at = Some(Local::now().naive_utc()); user::dao::create(user).await } /** * 测试接口: 查 */ pub async fn show(id: i32) -> User { user::dao::show(id).await } /** * 测试接口: 改 */ pub async fn update(id: i32, user: User) -> u64 { user::dao::update(id, user).await } /** * 测试接口: 删 */ pub async fn delete(id: i32) -> u64 { user::dao::delete(id).await }