package com.zm.order.tool.server.cipher;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 源数据需要进行加解密的字段
 *
 * <p>
 *      数据结构：
 *      单层级：
 *          perfList:["mobile", "xxx"]
 *      双层级：
 *          extMap: {userInfo: userInfoList}， userInfoList:["mobile"]
 *          上游通过遍历extMap，拿到的数据结构为：userInfo: userInfoList["mobile", "XXX"]
 * </p>
 *
 * @author nianchang
 * @date 2023/12/19 5:09 下午
 */
public class ExtEncryptFieldDefineConst {

    public static class OrderEncryptField {

        public static Map<String, List<String>> EXT_ENCIPHER_DEFINE = new HashMap<>(8);

        static List<String> userInfoList = new ArrayList<>();

        static List<String> shopInfoList = new ArrayList<>();

        static List<String> takeOutInfoList = new ArrayList<>();

        static List<String> pickUpInfoList = new ArrayList<>();

        static List<String> sourceShopInfoList = new ArrayList<>();

        public static List<String> PERFORMANCE_INFO_LIST = new ArrayList<>();

        static {
            {
                userInfoList.add("phone");
                EXT_ENCIPHER_DEFINE.put("userInfo", userInfoList);
            }
            {
                shopInfoList.add("contactPhone");
                shopInfoList.add("managerPhone");
                shopInfoList.add("contactTel");
                EXT_ENCIPHER_DEFINE.put("shopInfo", shopInfoList);
            }
            {
                takeOutInfoList.add("driverPhone");
                EXT_ENCIPHER_DEFINE.put("pickUpInfo", takeOutInfoList);
            }
            {
                pickUpInfoList.add("mobile");
                EXT_ENCIPHER_DEFINE.put("pickUpInfo", pickUpInfoList);
            }
            {
                sourceShopInfoList.add("contactPhone");
                EXT_ENCIPHER_DEFINE.put("sourceShopInfo", sourceShopInfoList);
            }
            {
                PERFORMANCE_INFO_LIST.add("carrierPhone");
                PERFORMANCE_INFO_LIST.add("receiverMobile");
            }
            {
                EXT_ENCIPHER_DEFINE.put("sellerMobile", null);
                EXT_ENCIPHER_DEFINE.put("virtualMobile", null);
            }
        }
    }

    public static class RefundEncryptField {

        public static Map<String, List<String>> EXT_ENCIPHER_DEFINE = new HashMap<>(8);

        static List<String> userInfoList = new ArrayList<>();

        static List<String> shopInfoList = new ArrayList<>();

        static {
            {
                userInfoList.add("phone");
                EXT_ENCIPHER_DEFINE.put("userInfo", userInfoList);
            }
            {
                shopInfoList.add("contactPhone");
                shopInfoList.add("managerPhone");
                shopInfoList.add("contactTel");
                EXT_ENCIPHER_DEFINE.put("shopInfo", shopInfoList);
            }
        }
    }


}

