package com.yd.rmi.n22;

import com.yd.rmi.n22.organization.pojo.GetOrganizationRequestVO;
import com.yd.rmi.n22.organization.pojo.GetOrganizationResponseVO;
import com.yd.rmi.n22.policy.pojo.policydetail.PolicyDetailQueryRequestVO;
import com.yd.rmi.n22.policy.pojo.policylist.PolicyListQueryRequestVO;
import com.yd.rmi.n22.policy.pojo.policylist.PolicyListQueryResponseVO;
import com.yd.util.JsonUtil;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;

public class Test {
    public static void main(String[] args) {
        Test test = new Test();
//        test.organization();

        test.messageTest();
    }
    private void organization() {

    }

    private void messageTest() {
        String responseJson = null;
        StringBuffer stringBuffer = new StringBuffer();
        try {
            File file = new File("/Users/water/Desktop/request.txt");//   c:\Users\water\Desktop\pingan.txt
            if (file.isFile() && file.exists()) {
                InputStreamReader reader = new InputStreamReader(new FileInputStream(file), "UTF-8");
                BufferedReader bufferedReader = new BufferedReader(reader);
                String line;
                while ((line = bufferedReader.readLine()) != null) {
                    stringBuffer.append(line);
                }
                responseJson = stringBuffer.toString();
                reader.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        PolicyDetailQueryRequestVO response = (PolicyDetailQueryRequestVO) JsonUtil.jsonToObj(responseJson, PolicyDetailQueryRequestVO.class);
        System.out.println(JsonUtil.format(responseJson));
//        System.out.println(response.getResponseBody().getPolicyList().get(0).getPolNameChn());
        System.out.println(response.getRequestHead().getSourceCode());
//		System.out.println("【totalAgreePremium】："+response.getData().getResultCode());
        }
    }
