File tree Expand file tree Collapse file tree
src/Mobile/eShopOnContainers/eShopOnContainers.Core Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ namespace eShopOnContainers . Core . Models . Location
2+ {
3+ public class LocationRequest
4+ {
5+ public double Longitude { get ; set ; }
6+ public double Latitude { get ; set ; }
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ namespace eShopOnContainers . Core . Services . Location
2+ {
3+ using System . Threading . Tasks ;
4+ using eShopOnContainers . Core . Models . Location ;
5+
6+ public interface ILocationService
7+ {
8+ Task UpdateUserLocation ( LocationRequest newLocReq ) ;
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ namespace eShopOnContainers . Core . Services . Location
2+ {
3+ using eShopOnContainers . Core . Models . Location ;
4+ using eShopOnContainers . Core . Services . RequestProvider ;
5+ using System ;
6+ using System . Threading . Tasks ;
7+
8+ public class LocationService : ILocationService
9+ {
10+ private readonly IRequestProvider _requestProvider ;
11+
12+ public LocationService ( IRequestProvider requestProvider )
13+ {
14+ _requestProvider = requestProvider ;
15+ }
16+
17+ public async Task UpdateUserLocation ( LocationRequest newLocReq )
18+ {
19+ UriBuilder builder = new UriBuilder ( GlobalSetting . Instance . LocationEndpoint ) ;
20+
21+ builder . Path = "api/v1/locations" ;
22+
23+ string uri = builder . ToString ( ) ;
24+
25+ var result = await _requestProvider . PostAsync ( uri , newLocReq ) ;
26+ }
27+ }
28+ }
Original file line number Diff line number Diff line change 1- <?xml version =" 1.0" encoding =" utf-8" ?>
1+ <?xml version =" 1.0" encoding =" utf-8" ?>
22<Project ToolsVersion =" 12.0" DefaultTargets =" Build" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
33 <Import Project =" $(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition =" Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44 <PropertyGroup >
7070 <Compile Include =" Models\Catalog\CatalogItem.cs" />
7171 <Compile Include =" Models\Catalog\CatalogRoot.cs" />
7272 <Compile Include =" Models\Catalog\CatalogType.cs" />
73+ <Compile Include =" Models\Location\LocationRequest.cs" />
7374 <Compile Include =" Models\Navigation\TabParameter.cs" />
7475 <Compile Include =" Models\Orders\CardType.CS" />
7576 <Compile Include =" Models\Orders\Order.cs" />
9192 <Compile Include =" Services\Dialog\IDialogService.cs" />
9293 <Compile Include =" Services\Identity\IdentityService.cs" />
9394 <Compile Include =" Services\Identity\IIdentityService.cs" />
95+ <Compile Include =" Services\Location\ILocationService.cs" />
96+ <Compile Include =" Services\Location\LocationService.cs" />
9497 <Compile Include =" Services\Navigation\INavigationService.cs" />
9598 <Compile Include =" Services\Navigation\NavigationService.cs" />
9699 <Compile Include =" Services\OpenUrl\IOpenUrlService.cs" />
You can’t perform that action at this time.
0 commit comments