private static List <string> GetAll()
        {
            var resp = HttpWebResponseUtility.HttpGet("http://inapi.inquant.cn/appmanager/InnerUser/getall");
            var ret  = JsonHelper.Deserialize <ResultInfo <List <string> > >(resp);

            if (ret.IsError())
            {
                return(null);
            }
            return(ret.Data);
        }
Example #2
0
 private static List <ProductInfo> GetAllProductInfo()
 {
     try
     {
         var resp = HttpWebResponseUtility.HttpGet("http://inapi.inquant.cn/appmanager/appinfo/getallproductinfo");
         var ret  = JsonHelper.Deserialize <ResultInfo <List <ProductInfo> > >(resp);
         if (ret.IsError())
         {
             return(null);
         }
         return(ret.Data);
     }
     catch (System.Exception ex)
     {
         LogRecord.writeLogsingle("PackManagerError", ex.ToString());
         return(null);
     }
 }
        /// <summary>
        /// 根据A股内码获取行情数据
        /// </summary>
        /// <param name="innerCodeList">股票内码集合</param>
        /// <returns></returns>
        public static List <AStockQuoteDetail> GetAStockQuoteByCode(List <long> innerCodeList)
        {
            if (innerCodeList == null || innerCodeList.Count <= 0)
            {
                return(null);
            }
            var        apiUrl = string.Format("{0}/basicInfo/GetAStockQuoteByCode.ashx?innerCodeList={1}", ApiHost, string.Join(",", innerCodeList));
            var        resp   = HttpWebResponseUtility.HttpGet(apiUrl);
            JsonString js     = new JsonString(resp);

            if (js.GetInt("code") != 0)
            {
                return(null);
            }
            var arrData   = js.GetArray("data");
            var allDetail = new List <AStockQuoteDetail>();

            foreach (var item in arrData)
            {
                var detail = new AStockQuoteDetail();
                detail.Innercode          = item.Get("innercode");
                detail.Stockcode          = item.Get("stockcode");
                detail.Stockname          = item.Get("stockname");
                detail.Nowv               = item.Get("nowv");
                detail.updown             = item.Get("updown");
                detail.updownrate         = item.Get("updownrate");
                detail.ask1p              = item.Get("ask1p");
                detail.bid1p              = item.Get("bid1p");
                detail.litotalvolumetrade = item.Get("litotalvolumetrade");
                detail.litotalvaluetrade  = item.Get("litotalvaluetrade");
                detail.highp              = item.Get("highp");
                detail.lowp               = item.Get("lowp");
                detail.openp              = item.Get("openp");
                detail.preclose           = item.Get("preclose");
                detail.turnoverrate       = item.Get("turnoverrate");
                detail.qratio             = item.Get("qratio");
                detail.innervol           = item.Get("innervol");
                detail.outervol           = item.Get("outervol");
                detail.market             = item.Get("market");
                allDetail.Add(detail);
            }

            return(allDetail);
        }
Example #4
0
        /// <summary>
        /// 获取验证码
        /// </summary>
        /// <param name="mobile">手机号</param>
        /// <param name="verifyCodeType">验证码类型</param>
        /// <returns></returns>
        public static ResultInfo <string> GetVerifyCode(string mobile, VerifyCodeType verifyCodeType)
        {
            if (string.IsNullOrEmpty(BaseUrl))
            {
                throw new ApplicationException("fundationApiDomain配置不能为空");
            }
            if (string.IsNullOrWhiteSpace(mobile))
            {
                return(new ResultInfo <string>(-1, "手机号不能为空"));
            }

            var url  = string.Format("http://{0}/fundationapi/sendsms/GetVerifyCode?mobile={1}&verifyCodeType={2}", BaseUrl, mobile, (int)verifyCodeType);
            var resp = HttpWebResponseUtility.HttpGet(url);

            var jsonString = new JsonString(resp);

            var result = new ResultInfo <string>();

            result.Error_no   = jsonString.GetInt("error_no");
            result.Error_info = jsonString.Get("error_info").SafeToString();
            result.Data       = jsonString.Get("data").SafeToString();

            return(result);
        }