package com.ag.util;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Created by yangxh on 2021/4/2.
 */
public class WbStoreJsonTest {

    public static void main(String[] args) {

        WbStoreJson.RedisJsonStr bc1 = new WbStoreJson.RedisJsonStr();
        bc1.setId(UUIDUtil.getUUID()+"\",");
        bc1.setKeyName("keyName");
        bc1.setCname("cName");
        WbStoreJson.RedisJsonStr bc2 = new WbStoreJson.RedisJsonStr();
        BeanUtil.copyProperties(bc1, bc2);
        bc2.setId(UUIDUtil.getUUID());
        List<WbStoreJson.RedisJsonStr> bcs = CollectionUtil.newArrayList(bc1, bc2);

        WbStoreJson wb = new WbStoreJson();
        wb.generate(bcs, WbStoreJson.RedisJsonStr.class);
        //所有属性
        System.out.println(wb.getJsonStr(wb));
        //非null属性
        //System.out.println(JSON.toJSONString(wb));

        /*List<CBerth> aa = new ArrayList<>();
        wb.generate(aa, CBerth.class);
        System.out.println(wb.getJsonStr(wb));*/

    }
}
