ruwebframe 0.1.7

a simple webframe for rust actix-web, based on rudi and rbatis.
Documentation
use displaydoc::Display;
use serde::{Deserialize, Serialize};
use crate::rubase::BaseEntity; 
use crate::rubase::rutils::str_utils;

#[derive(Debug, Display,   Default, Clone, Deserialize, Serialize)]
pub struct RedisDto {
    pub addr: String,   
    pub password: String,
    pub db: i32,
    pub enable: bool,
}

impl BaseEntity for RedisDto {}

impl RedisDto {
    pub fn new(host: String ,password: String, db: i32) -> Self {
        Self {
            addr: host,
            password: password,
            db: db,
            enable: true,
        }
    }
    pub fn build_url(&self) -> String { 
        format!("redis://:{}@{}/{}", self.password, self.addr,self.db )
    }
    
    pub fn default( ) -> Self {
        Self {
            addr: "192.168.1.153:26379".to_string(),
            password: "223456".to_string(),
            db: 0,
            enable: true,
        }
    }
    pub fn parse_env_var(&mut self)   {
        self.addr= str_utils::parse_env_var(std::mem::take(&mut self.addr));
        self.password= str_utils::parse_env_var(std::mem::take(&mut self.password));

    }
}