ruwebframe 0.1.4

a simple webframe for rust actix-web, based on rudi and rbatis.
Documentation

use crate::rubase::BaseEntity;
use crate::rulog;
use serde::{Deserialize, Serialize};
use std::fmt::Display;
use displaydoc::Display;
use crate::rubase::getself::GetSelf;

#[derive(Serialize, Default, Display,Deserialize, Debug, Clone)]
pub struct Person {
    pub id: i64,
    pub name: String,
    pub age: u16,
    pub active: bool,
}
// 普通实体
//impl_base_entity!(Person);
impl BaseEntity for Person {}
impl GetSelf for Person {}

 impl Display for Person {
     fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(f, "{}", self.to_json().as_str())
     }
 }

impl Person {
    pub fn log(&self) -> &Person {

        rulog::info(self.to_json().as_str());
        self
    }

    pub fn new() -> Person {
        Person::default()
    }
    pub fn new_as(id: i64, name: String, age: u16, active: bool) -> Person {
        Person {
            //rustEntity: RustEntity {},
            id,
            name,
            age,
            active,
        }
    }
}