bs.rs 699 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. use crate::module::user;
  2. use crate::module::user::model::User;
  3. // use chrono::Local;
  4. /**
  5. * 测试接口: 查 列表
  6. */
  7. pub async fn list() -> Vec<User> {
  8. let user = user::dao::list().await;
  9. return user
  10. }
  11. /**
  12. * 测试接口: 增
  13. */
  14. pub async fn create(user: User) -> u64 {
  15. // user.created_at = Some(Local::now().naive_utc());
  16. user::dao::create(user).await
  17. }
  18. /**
  19. * 测试接口: 查
  20. */
  21. pub async fn show(id: i32) -> User {
  22. user::dao::show(id).await
  23. }
  24. /**
  25. * 测试接口: 改
  26. */
  27. pub async fn update(id: i32, user: User) -> u64 {
  28. user::dao::update(id, user).await
  29. }
  30. /**
  31. * 测试接口: 删
  32. */
  33. pub async fn delete(id: i32) -> u64 {
  34. user::dao::delete(id).await
  35. }