package com.gyee.common.util;

import java.lang.reflect.Field;
import java.util.UUID;

/**
 * @ClassName : CommonUtils
 * @Author : xieshengjie
 * @Date: 2021/10/5 17:51
 * @Description : 通用工具类
 */
public class CommonUtils {

    public static String getUUID() {
        String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
        return uuid;
    }

    /**
     * 获取对象所有属性
     *
     * @param o
     * @return
     */
    public static String[] getFileName(Object o) {
        Field[] fields = o.getClass().getDeclaredFields();
        String[] fieldNames = new String[fields.length];
        for (int i = 0; i < fields.length; i++) {
            fieldNames[i] = fields[i].getName();
        }
        return fieldNames;

    }
}
