package com.jianshui.invoiceall.utils;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

import java.util.Map;

/**
 * Vo生成
 * @author kk
 * @date 2022年12月09日 17:41
 */
public class GenVoCodeTest {


    public static void main(String[] args) {

        String json  = "{\n" +
                "                \"dw\": \"单位\",\n" +
                "                \"ggxh\": \"规格型号\",\n" +
                "                \"je\": \"金额\",\n" +
                "                \"lzmxxh\": \"蓝字明细序号\",\n" +
                "                \"se\": \"税额\",\n" +
                "                \"slv\": \"税率\",\n" +
                "                \"spbm\": \"商品编码\",\n" +
                "                \"spdj\": \"商品单价\",\n" +
                "                \"spmc\": \"商品名称\",\n" +
                "                \"spsl\": \"商品数量\",\n" +
                "                \"tdzsfsdm\": \"特定征税方式代码\",\n" +
                "                \"xh\": \"序号\"\n" +
                "            }";

        JSONObject jsonObject = JSONUtil.parseObj(json);

        String result = "";

        for (Map.Entry<String, Object> objectEntry : jsonObject) {
            result = result + " @NotEmpty\n@ApiModelProperty(value = \""+objectEntry.getValue()+"\") \n private String "+objectEntry.getKey()+";\n\n";
        }

        System.out.println(result);
    }


}
