ruwebframe 0.1.7

a simple webframe for rust actix-web, based on rudi and rbatis.
Documentation
use crate::rubase::BaseEntity;
use crate::rubase::ruresult::RuResult;
use serde::{Deserialize, Serialize};
use std::fmt::Display;
use displaydoc::Display;
use serde_json::Value;
use crate::rubase::get_self::GetSelf;

#[derive(Debug, Default, Serialize,Display, Deserialize, Clone)]
pub struct PageResult {
    pub result: RuResult,
    pub Data: Option<Value>,
    //每页记录数
    pub PageSize: i32,
    //当前页码
    pub PageCurrent: i32,
    //总记录数
    pub Total: i64,
    //总页数
    pub TotalPages: i32,
}

impl BaseEntity for PageResult {}
impl GetSelf for PageResult {}

impl Display for PageResult {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(f, "{}", self.to_json().unwrap())
    }
}
impl PageResult {
    pub fn new() -> Self {
        Self {
            result: RuResult::new(),
            PageSize: 10,
            PageCurrent: 1,
            Data: None,
            Total: 0,
            TotalPages: 0,
        }
    }
    pub fn new_data(data: Value) -> Self {
        Self {
            result: RuResult::new(),
            PageSize: 10,
            PageCurrent: 1,
            Data: None,
            Total: 0,
            TotalPages: 0,
        }
    }
}