package com.fzm.mall.server.front.util;

import com.fzm.mall.server.front.user.model.User;

import java.lang.reflect.Field;

public class CheckUtil {

    public static boolean checkObjAllFieldsIsNull(Object object) {
        if (null == object) {
            return true;
        }

        try {
            for (Field f : object.getClass().getDeclaredFields()) {
                f.setAccessible(true);

                System.out.print(f.getName() + ":");
                System.out.println(f.get(object));
                if(f.getName().equals("id")){
                    continue;
                }
                if (f.get(object) == null) {
                    return false;
                }

            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return true;
    }

}
