fn table_columns() -> String {
        let bean: serde_json::Result<Self> = serde_json::from_str("{}");
        if bean.is_err() {
            //if json decode fail,return '*'
            return " * ".to_string();
        }
        let v = serde_json::to_value(&bean.unwrap()).unwrap_or(serde_json::Value::Null);
        if !v.is_object() {
            //if json decode fail,return '*'
            return " * ".to_string();
        }
        let m = v.as_object().unwrap();
        let mut fields = String::new();
        for (k, _) in m {
            fields.push_str(k);
            fields.push_str(",");
        }
        fields.pop();
        return format!("{}", fields);
    }
/// get table fields string
///
/// for Example:
///   "create_time,delete_flag,h5_banner_img,h5_link,id,name,pc_banner_img,pc_link,remark,sort,status,version"
///
/// you also can impl this method for static string
///


you also can impl this method for static string
you also can impl this method for static string
fn table_columns() -> String {
        let bean: serde_json::Result<Self> = serde_json::from_str("{}");
        if bean.is_err() {
            //if json decode fail,return '*'
            return " * ".to_string();
        }
        let v = serde_json::to_value(&bean.unwrap()).unwrap_or(serde_json::Value::Null);
        if !v.is_object() {
            //if json decode fail,return '*'
            return " * ".to_string();
        }
        let m = v.as_object().unwrap();
        let mut fields = String::new();
        for (k, _) in m {
            fields.push_str(k);
            fields.push_str(",");
        }
        fields.pop();
        return format!("{}", fields);
    }
fn table_columns ( ) -> String { let bean : serde_json :: Result < Self > = serde_json :: from_str ( " " ) ; if bean . is_err ( ) { //if json decode fail,return '*' return " " . to_string ( ) ; } let v = serde_json :: to_value ( & bean . unwrap ( ) ) . unwrap_or ( serde_json :: Value :: Null ) ; if ! v . is_object ( ) { //if json decode fail,return '*' return " " . to_string ( ) ; } let m = v . as_object ( ) . unwrap ( ) ; let mut fields = String :: new ( ) ; for ( k , _ ) in m { fields . push_str ( k ) ; fields . push_str ( " " ) ; } fields . pop ( ) ; return format ! ( " " fields ) ; }
get table fields string
for Example:
"create_time,delete_flag,h5_banner_img,h5_link,id,name,pc_banner_img,pc_link,remark,sort,status,version"
get table fields string for Example : " create_time delete_flag h5_banner_img h5_link id name pc_banner_img pc_link remark sort status version "