package com.zcloud.util.docking;

import com.alibaba.fastjson.JSONObject;
import com.zcloud.entity.PageData;

/**
 * 说明：日期处理(临时处理时间) 作者：zhangyue 官网：www.qdkjchina.com
 */
public class ConstCorpsUtil {

    public static String getTokenByCorpId(PageData pd) throws Exception {
        JSONObject token = new JSONObject();
        // todo 上线前删除
        token.put("appid", pd.getString("APPID"));
        token.put("secret", pd.getString("SECRET"));
        String KEY = pd.getString("DOCKING_KEY");
        String IV = pd.getString("DOCKING_IV");
        return AesGcm256Util.encrypt(token.toString(), AesGcm256Util.hexToByte(KEY), AesGcm256Util.hexToByte(IV));
    }

}
