package com.nokia.domainb.capability;

import java.util.HashMap;
import java.util.Map;

import cn.chinaunicom.open.common.Const;
import cn.chinaunicom.open.nlgxptconnection.COMPConnection;
import cn.chinaunicom.open.nlgxptconnection.COMPConnectionContext;
import cn.chinaunicom.open.nlgxptconnection.impl.COMPJsonConnection;

/*
 * 垃圾短信黑名单一键解封接口
 * json_chinaUnicom_hb18_complaintManagement_blacklistApiRemove
 */
public class BlacklistApiRemove extends AbstractQuery {
    private static final String url = "";
    private static final String urlTest = "http://10.124.150.230:8000/api/chinaUnicom/hb18/complaintManagement/blacklistApiRemove/v1";

    public COMPConnectionContext query(String phoneNumber, boolean test) {
        String realAppSecret = test ? appSecretTest : appSecret;
        String realUrl = test ? urlTest : url;
        COMPConnection compConnection = new COMPJsonConnection(appId, realAppSecret);

        // REQ
        Map<String, Object> req = new HashMap<>();

        Map<String, Object> blacklistApiRemoveReq = new HashMap<>();
        req.put("BLACKLIST_API_REMOVE_REQ", blacklistApiRemoveReq);

        blacklistApiRemoveReq.put("fromSystem", "test");
        blacklistApiRemoveReq.put("operator", "test01");
        blacklistApiRemoveReq.put("phone", phoneNumber);

        return compConnection.excute(Const.HttpMethodType.POST, realUrl, req, false);
    }
}
