コード例 #1
0
        private SongVO RequestSongVO(long songId, out string errorMsg)
        {
            SongUrls     songUrls     = api.GetSongsUrl(new long[] { songId });
            DetailResult detailResult = api.GetDetail(songId);

            return(NeteaseMusicUtils.GetSongVO(songUrls, detailResult, out errorMsg));
        }
コード例 #2
0
        public ActionResult Detail(int id = 0)
        {
            ViewBag.NewUserList      = base.GetNewUserList;
            ViewBag.ForList          = base.GetForumsList;
            ViewBag.ForumsStatistics = base.GetForumsStatistics();
            ViewBag.IsLogin          = base.IsLogin;
            ViewBag.User             = base._userInfo;
            DetailResult model = new DetailResult();

            _service.Command <MainOutsourcing, ResultModel <DetailResult> >((db, o, api) =>
            {
                model = api.Get(Url.Action("GetItem"), new { tid = id }).ResultInfo;
                db.Update <BBS_Topics>(new { Views = model.TopItem.Views.TryToInt() + 1 }, it => it.Tid == model.TopItem.Tid);
            });
            return(View(model));
        }
コード例 #3
0
        public void InitializeGoogleLocations()
        {
            // Getting the place_id list and finding the details about each restaurant
            foreach (var placesId in _placesService.GetPlacesList())
            {
                // Getting the details of the information with the place_id
                DetailResult result = _placesService.GetDetailResult(placesId);

                // Creating new restaurant object with the information from Places API
                Restaurant newRestaurant = new Restaurant
                {
                    Name          = result.Name,
                    Phone         = result.FormattedPhoneNumber,
                    Address1      = result.FormattedAddress,
                    City          = result.FormattedAddress.Split(',')[1],
                    State         = result.FormattedAddress.Split(',')[2].Split(' ')[1],
                    ZipCode       = result.FormattedAddress.Split(',')[2].Split(' ')[2],
                    DateUpdated   = DateTime.Now,
                    GooglePlaceId = result.PlaceId
                };

                // Adding new restaurant
                _restaurantRepository.AddRestaurant(newRestaurant);

                // Creating a location object with the result
                Location newLocation = new Location
                {
                    Latitude     = result.Geometry.Location.Lat,
                    Longitude    = result.Geometry.Location.Lng,
                    RestaurantId = newRestaurant.RestaurantId
                };

                // Adding new location for the restaurant
                _locationRepository.AddLocation(newLocation);

                // Initializing status of the restaurant
                Status newStatus = new Status
                {
                    RestaurantId = newRestaurant.RestaurantId,
                    DriveThru    = 0,
                    InStore      = 0
                };

                // Adding the Status to Db
                _statusRepository.AddStatus(newStatus);
            }
        }
コード例 #4
0
        public Task AddRange(List <ResultDetailRequest> resultDetailRequests)
        {
            var list = new List <DetailResult>();

            for (int i = 0; i < resultDetailRequests.Count(); i++)
            {
                var detailResult = new DetailResult
                {
                    ResultId    = resultDetailRequests[i].ResultId,
                    SelectedAns = resultDetailRequests[i].SelectedAns,
                    QuestionId  = resultDetailRequests[i].QuestionId,
                    Ok          = resultDetailRequests[i].Ok
                };

                list.Add(detailResult);
            }

            return(_baseRepository.AddRange(list));
        }
コード例 #5
0
        private HiPOSDetailsListListModel GetDataList(string storeId, string deviceId, string orderId, DateTime from, DateTime to, bool isSystemOrder, int page, int pagesize)
        {
            HiPOSDetailsListListModel hiPOSDetailsListListModel = new HiPOSDetailsListListModel();

            hiPOSDetailsListListModel.rows = new List <Dictionary <string, object> >();
            SiteSettings currentSiteSetting = base.CurrentSiteSetting;
            string       format             = "yyyyMMdd";
            string       code = "";

            if (!string.IsNullOrWhiteSpace(orderId))
            {
                OrderInfo orderInfo = OrderHelper.GetOrderInfo(orderId);
                string    text      = (orderInfo == null) ? orderId : orderInfo.TakeCode;
                code = (string.IsNullOrEmpty(text) ? string.Empty : (Globals.HIPOSTAKECODEPREFIX + text));
            }
            HiPOSHelper hiPOSHelper = new HiPOSHelper();

            if (!string.IsNullOrEmpty(deviceId))
            {
                deviceId = (deviceId.Equals("0") ? string.Empty : deviceId);
            }
            DetailResult hishopTradesDetail = hiPOSHelper.GetHishopTradesDetail(currentSiteSetting.HiPOSAppId, currentSiteSetting.HiPOSMerchantId, storeId, deviceId, code, isSystemOrder, from.ToString(format), to.ToString(format), page, pagesize);

            if (hishopTradesDetail.error == null)
            {
                foreach (HiPOSResponse item in hishopTradesDetail.merchant_trades_detail_response.detail)
                {
                    Dictionary <string, object> dictionary = item.ToDictionary();
                    DateTime dateTime = default(DateTime);
                    if (!string.IsNullOrWhiteSpace(item.paid_at) && DateTime.TryParse(item.paid_at, out dateTime))
                    {
                        dictionary["paid_at"] = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
                    }
                    dictionary.Add("OrderId", this.GetOrderId(item.code));
                    dictionary.Add("Alias", this.GetAlias(item.device_id));
                    hiPOSDetailsListListModel.rows.Add(dictionary);
                }
                hiPOSDetailsListListModel.sum_amount = hishopTradesDetail.merchant_trades_detail_response.detail.Sum((HiPOSResponse c) => c.amount);
                hiPOSDetailsListListModel.total      = hishopTradesDetail.merchant_trades_detail_response.items_count;
            }
            return(hiPOSDetailsListListModel);
        }
コード例 #6
0
        private static PopularityInfo GetPopularityTimesByDetails(DetailResult details)
        {
            // get the detail address from the specified place, if the formatted address is null or empty use the vicinity
            string address = !string.IsNullOrEmpty(details.formatted_address) ? details.formatted_address : details.vicinity;

            // get the place id
            var placeId = $"{details.name} {address}";

            JObject detailJson = new JObject(
                new JProperty("id", details.place_id),
                new JProperty("name", details.name),
                new JProperty("address", address),
                new JProperty("types", details.types),
                new JProperty("coordinates",
                              new JObject(
                                  new JProperty("lat", details.geometry.location.lat),
                                  new JProperty("lng", details.geometry.location.lng)
                                  )
                              )
                );

            return(GetPopulartimesFromSearch(placeId, details.name));
        }
コード例 #7
0
ファイル: ApiDocument.cs プロジェクト: mccj/AlibabaSDKFor1688
        private NJsonSchema.JsonSchema getSchemaResponse(System.Collections.Generic.IDictionary <string, JsonSchema> definitions, DetailResult apiDetail, ModelInfoResult item)
        {
            var ss = getSchema(definitions, apiDetail.Namespace, apiDetail.Name, apiDetail.Version, item.Name, item.Type, item.Description);

            var 排除OceanApiId = new[] {
                "cn.alibaba.open:system.time.get-1"
            };
            var 包含OceanApiId = new[] {
                "cn.alibaba.open:push.query.messageList-1",
                "cn.alibaba.open:push.cursor.messageList-1",
                "com.alibaba.product.push:alibaba.cross.syncProductListPushed-1"
            };

            if (!排除OceanApiId.Contains(apiDetail.OceanApiId) && (ss.Reference == null || 包含OceanApiId.Contains(apiDetail.OceanApiId)))
            {
                var ssssss = new NJsonSchema.JsonSchema
                {
                    AllowAdditionalProperties = false,
                    Description = item.Description,
                    Properties  =
                    {
                        { item.Name?.类名过滤特殊字符(), ss.ToJsonSchemaProperty() }
                    }
                };

                var key = string.Join("", ssssss.Properties.Select(f => f.Key + f.Value.Type + f.Value.Title));
                if (keyValuePairstModelInfo.ContainsKey(key))
                {
                    return(keyValuePairstModelInfo[key]);
                }
                else
                {
                    keyValuePairstModelInfo.Add(key, ssssss);
                    return(ssssss);
                }
            }
            else
            {
                return(ss);
            }
        }