Esempio n. 1
0
 public GetConfigDetailsResponse GetConfigDetails(GetConfigDetailsRequest Request)
 {
     return GetClient().GetConfigDetails(Request);
 }
Esempio n. 2
0
 public void send_GetConfigDetails(GetConfigDetailsRequest Request)
 {
     oprot_.WriteMessageBegin(new TMessage("GetConfigDetails", TMessageType.Call, seqid_));
     GetConfigDetails_args args = new GetConfigDetails_args();
     args.Request = Request;
     args.Write(oprot_);
     oprot_.WriteMessageEnd();
     oprot_.Transport.Flush();
 }
Esempio n. 3
0
 public void Read(TProtocol iprot)
 {
     TField field;
     iprot.ReadStructBegin();
     while (true)
     {
       field = iprot.ReadFieldBegin();
       if (field.Type == TType.Stop) {
     break;
       }
       switch (field.ID)
       {
     case 1:
       if (field.Type == TType.Struct) {
     Request = new GetConfigDetailsRequest();
     Request.Read(iprot);
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     default:
       TProtocolUtil.Skip(iprot, field.Type);
       break;
       }
       iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
 }
Esempio n. 4
0
 public GetConfigDetailsResponse GetConfigDetails(GetConfigDetailsRequest Request)
 {
     send_GetConfigDetails(Request);
     return recv_GetConfigDetails();
 }
Esempio n. 5
0
        public ConfigeBaySettings SettingsParseJSON(int siteId)
        {
            var req = new GetConfigDetailsRequest
            {
                SiteID = siteId
            };
            GetConfigDetailsRequest request = new GetConfigDetailsRequest();
            request.SiteID = siteId;
            var res = new ItemService(UrlConst.Instance.CBT_GEPAPI_URL + "/api/Outbound_ItemService").GetConfigDetails(req);

            string SettingsJson = Encoding.ASCII.GetString(Convert.FromBase64String(res.Response));

            ConfigeBaySettings settings = new ConfigeBaySettings();
            List<ConfigeBaySettingsDetail> listSettingsDetail = new List<ConfigeBaySettingsDetail>();

            JSONObject jsonObject = JSONObject.CreateFromString(SettingsJson);
            JSONObject jsonCurrency = jsonObject.Dictionary["currency"];
            JSONObject jsonDetails = jsonObject.Dictionary["details"];

            settings.site = jsonObject.Dictionary["site"].String;
            settings.buy = jsonCurrency.Dictionary["buy"].String;
            settings.change_val = jsonCurrency.Dictionary["change_val"].String;
            settings.hname = jsonCurrency.Dictionary["hname"].String;
            settings.receive = jsonCurrency.Dictionary["receive"].String;
            settings.sell = jsonCurrency.Dictionary["sell"].String;
            settings.send = jsonCurrency.Dictionary["send"].String;
            settings.sign = jsonCurrency.Dictionary["sign"].String;
            settings.standard = jsonCurrency.Dictionary["standard"].String;

            //Controll 부분
            List<JSONObject> detailObject = new List<JSONObject>();
            foreach (var data in jsonDetails.Array)
            {
                ConfigeBaySettingsDetail settingsDetail = new ConfigeBaySettingsDetail();
                settingsDetail.fieldName = data.Dictionary["field_name"].String;
                settingsDetail.fieldNameKr = data.Dictionary["field_name_kr"].String;
                settingsDetail.type = data.Dictionary["type"].String;
                settingsDetail.isrequire = data.Dictionary.Keys.Contains("isrequire") == true ? data.Dictionary["isrequire"].String : "";
                settingsDetail.length = data.Dictionary.Keys.Contains("length") == true ? Util.GetSafeInt(data.Dictionary["length"].String) : 900;

                //Value 부분
                List<ConfigeBaySettingsValues> listSettingsValues = new List<ConfigeBaySettingsValues>();
                if (data.Dictionary.Keys.Contains("values") && settingsDetail.type != "CUSTOM" && settingsDetail.fieldName != "ListingDuration")
                {
                    foreach (var valuesData in data.Dictionary["values"].Array)
                    {
                        ConfigeBaySettingsValues settingsValues = new ConfigeBaySettingsValues();
                        settingsValues.key = valuesData.Dictionary["key"].String;
                        settingsValues.value = valuesData.Dictionary["value"].String;
                        if (valuesData.Dictionary.ContainsKey("show_value"))
                        {
                            settingsValues.show_value = valuesData.Dictionary["show_value"].String;
                        }
                        listSettingsValues.Add(settingsValues);
                    }
                    settingsDetail.values = listSettingsValues;
                }
                // value안에 depth가 있는 특이부분
                else if (data.Dictionary.Keys.Contains("values") && settingsDetail.type != "CUSTOM" && settingsDetail.fieldName == "ListingDuration")
                {
                    foreach (var valuesData in data.Dictionary["values"].Dictionary)
                    {
                        ConfigeBaySettingsValues settingsValues = new ConfigeBaySettingsValues();
                        settingsValues.key = valuesData.Key;
                        List<ConfigeBaySettingsValuesDepth1> listDepth = new List<ConfigeBaySettingsValuesDepth1>();
                        foreach (var valuesDataDepth1 in valuesData.Value.Array)
                        {
                            ConfigeBaySettingsValuesDepth1 depth1 = new ConfigeBaySettingsValuesDepth1();
                            depth1.key = valuesDataDepth1.Dictionary["key"].String;
                            depth1.value = valuesDataDepth1.Dictionary["value"].String;
                            if (valuesDataDepth1.Dictionary.ContainsKey("show_value"))
                            {
                                depth1.show_value = valuesDataDepth1.Dictionary["show_value"].String;
                            }
                            listDepth.Add(depth1);
                        }
                        settingsValues.settingsValuesDepth1 = listDepth;
                        listSettingsValues.Add(settingsValues);
                    }
                    settingsDetail.values = listSettingsValues;
                }
                //List 국가 코드 부분
                if (data.Dictionary.Keys.Contains("values") && settingsDetail.type == "CUSTOM")
                {
                    foreach (var valuesData in data.Dictionary["values"].Array)
                    {
                        ConfigeBaySettingsValues settingsValues = new ConfigeBaySettingsValues();
                        settingsValues.description = valuesData.Dictionary["Description"].String;
                        settingsValues.location = valuesData.Dictionary["Location"].String;
                        settingsValues.region = valuesData.Dictionary["Region"].String;
                        listSettingsValues.Add(settingsValues);
                    }
                    settingsDetail.values = listSettingsValues;
                }

                listSettingsDetail.Add(settingsDetail);
            }

            settings.details = listSettingsDetail;
            return settings;
        }