import {
    QUICK_MD5_KEY,
    QUICK_CALLBACK_KEY,
    QUICK_PRODUCT_CODE,
    QUICK_H5_CALLBACK_KEY,
    QUICK_H5_PRODUCT_CODE,
    QUICK_H5_MD5_KEY,
    QUICK_IOS_PRODUCT_CODE,
    QUICK_IOS_CALLBACK_KEY,
    QUICK_IOS_MD5_KEY,
    AppSecret360,
    AppKey360,
    MuziIosLoginKey,
    MuziIosPayKey,
    CALLBACK_KEY_4399,
    SECRET_KEY_4399,
    CALLBACK_KEY_4399_V2,
    SECRET_KEY_4399_V2,
    APP_ID_4399,
    APP_ID_4399_V2,
    SECRET_KEY_QIHU,
    QIAI_QUICK_H5_CALLBACK_KEY,
    QIAI_QUICK_H5_PRODUCT_CODE,
    QIAI_QUICK_H5_MD5_KEY,
    MINI_APP_PRIVATE_KEY,
    MINI_APP_GAME_ID,
    SY_IOS_PRIVATE_KEY,
    SY_IOS_GAME_ID,
    MIANYOU_LOGIN_KEY,
    MIANYOU_PAYMENT_KEY,
    MIANYOU_GAME_ID,
    MIANYOU_SDK_DOMAIN,
    HUPU_QUICK_MD5_KEY,
    HUPU_QUICK_CALLBACK_KEY,
    HUPU_QUICK_PRODUCT_CODE,
    SEVEN_TWO_ZERO_QUICK_MD5_KEY,
    SEVEN_TWO_ZERO_QUICK_CALLBACK_KEY,
    SEVEN_TWO_ZERO_QUICK_PRODUCT_CODE,
    MINI_APP_DOMAIN,
    MINI_APP_API_KEY,
    MEITUAN_APP_ID,
    MEITUAN_APP_SECRET,
    HUAWEI_APP_ID,
    HUAWEI_APP_SECRET,
    HUAWEI_CALLBACK_SECRET,
    HKT_ANDROID_PRODUCT_CODE,
    HKT_ANDROID_CALLBACK_KEY,
    HKT_IOS_PRODUCT_CODE,
    HKT_IOS_CALLBACK_KEY,
    HKT_DOMAIN, TAOBAO_CALLBACK_SECRET, TAOBAO_APP_ID, TAOBAO_APP_SECRET,
    ZERO_ONE_QUICK_MD5_KEY, ZERO_ONE_QUICK_CALLBACK_KEY, ZERO_ONE_QUICK_PRODUCT_CODE,
    QINGTIAN_MD5_KEY, QINGTIAN_CALLBACK_KEY, QINGTIAN_PRODUCT_CODE,
    XIAOYAO_QUICK_MD5_KEY, XIAOYAO_QUICK_CALLBACK_KEY, XIAOYAO_QUICK_PRODUCT_CODE,
    XIAOYAO50_QUICK_MD5_KEY, XIAOYAO50_QUICK_CALLBACK_KEY, XIAOYAO50_QUICK_PRODUCT_CODE, WEBGAME_LOGIN_KEY,
    WEBGAME_PAY_KEY, WEBGAME_APP_ID,
    ONEZHE_SJJM_QUICK_MD5_KEY,
    ONEZHE_SJJM_QUICK_CALLBACK_KEY,
    ONEZHE_SJJM_QUICK_PRODUCT_CODE
} from "./thirdParams";

// 渠道配置接口定义
export interface ChannelConfig {
    channelId: number; // 渠道ID
    name: string; // 渠道名称
    platform: string; // 平台标识
    paymentConfig: {
        // 支付相关配置
        signKey?: string; // 签名密钥
        callbackKey?: string; // 回调密钥
        appSecret?: string; // 应用密钥
        apiUrl?: string; // API地址
        clientSecret?: string; // 客户端密钥
        ClientId?: string; // 客户端id
        gameId?: string; // 游戏ID
    };
    loginConfig?: {
        // 登录相关配置
        productCode?: string; // 产品代码
        appId?: string; // 应用ID
        appSecret?: string; // 应用密钥
        signKey?: string; // 签名密钥
        callKey?: string; // 签名密钥
        apiKey?: string; // API密钥
        statApiKey?: string; // 统计API密钥
    };
}

// 渠道配置对象
export const channelConfigs: Record<number, ChannelConfig> = {
    1: {
        // 木子
        channelId: 1,
        name: "木子",
        platform: "木子",
        paymentConfig: {
            signKey: AppSecret360,
        },
        loginConfig: {
            signKey: AppKey360,
        },
    },
    2: {
        // 三狸安卓
        channelId: 2,
        name: "三狸安卓",
        platform: "quick",
        paymentConfig: {
            signKey: QUICK_MD5_KEY,
            callbackKey: QUICK_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: QUICK_PRODUCT_CODE,
        },
    },
    3: {
        // 三狸iOS
        channelId: 3,
        name: "三狸iOS",
        platform: "quickIos",
        paymentConfig: {
            signKey: QUICK_IOS_MD5_KEY,
            callbackKey: QUICK_IOS_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: QUICK_IOS_PRODUCT_CODE,
        },
    },
    4: {
        // QQ大厅
        channelId: 4,
        name: "QQ大厅",
        platform: "qqgame",
        paymentConfig: {},
    },
    5: {
        // 三狸H5
        channelId: 5,
        name: "三狸H5",
        platform: "quickH5",
        paymentConfig: {
            signKey: QUICK_H5_MD5_KEY,
            callbackKey: QUICK_H5_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: QUICK_H5_PRODUCT_CODE,
        },
    },
    6: {
        // 4399
        channelId: 6,
        name: "4399",
        platform: "4399h5",
        paymentConfig: {
            signKey: CALLBACK_KEY_4399,
        },
        loginConfig: {
            signKey: SECRET_KEY_4399,
            callKey: CALLBACK_KEY_4399,
            appId: APP_ID_4399
        },
    },
    7: {
        // 360
        channelId: 7,
        name: "360",
        platform: "360",
        paymentConfig: {
            signKey: SECRET_KEY_QIHU,
        },
        loginConfig: {
            signKey: SECRET_KEY_QIHU,
        },
    },
    999: {
        // 4399
        channelId: 6,
        name: "4399new",
        platform: "4399h5new",
        paymentConfig: {
            signKey: CALLBACK_KEY_4399_V2,
        },
        loginConfig: {
            signKey: SECRET_KEY_4399_V2,
            callKey: CALLBACK_KEY_4399_V2,
            appId: APP_ID_4399_V2
        },
    },
    8: {
        // 七艾H5
        channelId: 8,
        name: "七艾",
        platform: "qiaiH5",
        paymentConfig: {
            signKey: QIAI_QUICK_H5_MD5_KEY,
            callbackKey: QIAI_QUICK_H5_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: QIAI_QUICK_H5_PRODUCT_CODE,
        },
    },
    9: {
        // 木子
        channelId: 9,
        name: "木子ios",
        platform: "木子ios",
        paymentConfig: {
            signKey: MuziIosPayKey,
        },
        loginConfig: {
            signKey: MuziIosLoginKey,
        },
    },
    10: {
        // 三狸安卓
        channelId: 10,
        name: "互视",
        platform: "quick",
        paymentConfig: {
            signKey: QUICK_MD5_KEY,
            callbackKey: QUICK_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: QUICK_PRODUCT_CODE,
        },
    },
    11: {
        // 小程序/抖音小程序（根据platform参数动态选择配置）
        // platform="miniapp" 使用小程序参数，platform="ttminiapp" 使用抖音参数
        channelId: 11,
        name: "小程序",
        platform: "miniapp",
        paymentConfig: {
            signKey: MINI_APP_PRIVATE_KEY,
            gameId: MINI_APP_GAME_ID,
            apiUrl: MINI_APP_DOMAIN,
        },
        loginConfig: {
            apiKey: MINI_APP_API_KEY,
        }
    },
    12: {
        // ios
        channelId: 12,
        name: "ios",
        platform: "sy_ios",
        paymentConfig: {
            signKey: SY_IOS_PRIVATE_KEY,
            gameId: SY_IOS_GAME_ID,
        },
        loginConfig: {
            signKey: SY_IOS_PRIVATE_KEY,
        },
    },
    13: {
        // 勉游渠道
        channelId: 13,
        name: "勉游",
        platform: "mianyou",
        paymentConfig: {
            signKey: MIANYOU_PAYMENT_KEY,
            gameId: MIANYOU_GAME_ID,
            apiUrl: MIANYOU_SDK_DOMAIN,
        },
        loginConfig: {
            signKey: MIANYOU_LOGIN_KEY,
        },
    },
    14: {
        // Hupu QuickSDK
        channelId: 14,
        name: "虎扑",
        platform: "hupu",
        paymentConfig: {
            signKey: HUPU_QUICK_MD5_KEY,
            callbackKey: HUPU_QUICK_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: HUPU_QUICK_PRODUCT_CODE,
        },
    },
    15: {
        // 720 QuickSDK
        channelId: 15,
        name: "720",
        platform: "720",
        paymentConfig: {
            signKey: SEVEN_TWO_ZERO_QUICK_MD5_KEY,
            callbackKey: SEVEN_TWO_ZERO_QUICK_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: SEVEN_TWO_ZERO_QUICK_PRODUCT_CODE,
        },
    },
    16: {
        // 美团
        channelId: 16,
        name: "美团",
        platform: "mtminiapp",
        paymentConfig: {},
        loginConfig: {
            appId: MEITUAN_APP_ID,
            appSecret: MEITUAN_APP_SECRET,
        },
    },
    17: {
        // 华为渠道
        channelId: 17,
        name: "华为",
        platform: "hwminiapp",
        paymentConfig: {
            callbackKey: HUAWEI_CALLBACK_SECRET,
        },
        loginConfig: {
            appId: HUAWEI_APP_ID,
            appSecret: HUAWEI_APP_SECRET,
        },
    },
    18: {
        // 港台渠道（Quick海外SDK）
        channelId: 18,
        name: "港台",
        platform: "hkt",
        paymentConfig: {
            // 回调密钥会根据platform参数动态选择（android/ios）
            callbackKey: HKT_ANDROID_CALLBACK_KEY, // 默认使用安卓的
        },
        loginConfig: {
            // ProductCode会根据platform参数动态选择（android/ios）
            productCode: HKT_ANDROID_PRODUCT_CODE, // 默认使用安卓的
        },
    },
    19: {
        // 淘宝渠道
        channelId: 17,
        name: "淘宝",
        platform: "tbminiapp",
        paymentConfig: {
            callbackKey: TAOBAO_CALLBACK_SECRET,
        },
        loginConfig: {
            appId: TAOBAO_APP_ID,
            appSecret: TAOBAO_APP_SECRET ,
        },
    },
    20: {
        // 0.1渠道 QuickSDK
        channelId: 20,
        name: "0.1",
        platform: "",
        paymentConfig: {
            signKey: ZERO_ONE_QUICK_MD5_KEY,
            callbackKey: ZERO_ONE_QUICK_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: ZERO_ONE_QUICK_PRODUCT_CODE,
        },
    },
    21: {
        // 晴天SDK
        channelId: 21,
        name: "晴天",
        platform: "qingtian",
        paymentConfig: {
            signKey: QINGTIAN_MD5_KEY,
            callbackKey: QINGTIAN_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: QINGTIAN_PRODUCT_CODE,
        },
    },
    22: {
        // 0.1渠道 QuickSDK
        channelId: 22,
        name: "1zhe",
        platform: "",
        paymentConfig: {
            signKey: ZERO_ONE_QUICK_MD5_KEY,
            callbackKey: ZERO_ONE_QUICK_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: ZERO_ONE_QUICK_PRODUCT_CODE,
        },
    },
    23: {
        // 逍遥浪人 QuickSDK
        channelId: 23,
        name: "逍遥浪人",
        platform: "",
        paymentConfig: {
            signKey: XIAOYAO_QUICK_MD5_KEY,
            callbackKey: XIAOYAO_QUICK_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: XIAOYAO_QUICK_PRODUCT_CODE,
        },
    },
    24: {
        // 逍遥浪人50倍返利 QuickSDK
        channelId: 24,
        name: "逍遥浪人50倍",
        platform: "",
        paymentConfig: {
            signKey: XIAOYAO50_QUICK_MD5_KEY,
            callbackKey: XIAOYAO50_QUICK_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: XIAOYAO50_QUICK_PRODUCT_CODE,
        },
    },
    25: {
        channelId: 25,
        name: "WebGame",
        platform: "",
        paymentConfig: {
            callbackKey: WEBGAME_PAY_KEY,
        },
        loginConfig: {
            appId: WEBGAME_APP_ID,
            signKey: WEBGAME_LOGIN_KEY,
        },
    },
    26: {
        // 1折-神将降魔（QuickSDK）
        channelId: 26,
        name: "1折-神将降魔",
        platform: "quick",
        paymentConfig: {
            signKey: ONEZHE_SJJM_QUICK_MD5_KEY,
            callbackKey: ONEZHE_SJJM_QUICK_CALLBACK_KEY,
        },
        loginConfig: {
            productCode: ONEZHE_SJJM_QUICK_PRODUCT_CODE,
        },
    },
};
