package com.liquidnet.common.third.zxlnft.test;

/**
 * @author AnJiabin <anjiabin@zhengzai.tv>
 * @version V1.0
 * @Description: TODO
 * @class: TestJavaBeanToMap
 * @Package com.liquidnet.common.third.zxlnft.test
 * @Copyright: LightNet @ Copyright (c) 2021
 * @date 2022/2/24 18:40
 */

import com.liquidnet.common.third.zxlnft.dto.nft.Nft034PublishReq;
import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.JsonUtils;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;

/**
 *
 */
public class TestJavaBeanToMap {
    public static void main(String[] args) {
        Nft034PublishReq req = Nft034PublishReq.getNew();
        req.setPubKey("11222");
        req.setPlatformPubKey("2222222");
        try {
            Map<String,Object> map = BeanUtil.convertBeanToMap(req,false);
            System.out.println(JsonUtils.toJson(map));
        } catch (IntrospectionException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
    }
}
