-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Murat OĞUZ
committed
Aug 16, 2020
1 parent
4efe301
commit 5803a42
Showing
91 changed files
with
1,421 additions
and
183 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
NetCore-Trendyol-Entegrasyon/Controllers/Product/BrandsController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
using System.Net.Http; | ||
using System.Net.Http.Headers; | ||
using NetCore_Trendyol_Entegrasyon.Models.Product; | ||
using System.Text.Json; | ||
|
||
namespace NetCore_Trendyol_Entegrasyon.Controllers.Product | ||
{ | ||
[ApiController] | ||
[Route("[controller]")] | ||
public class BrandsController : ControllerBase | ||
{ | ||
|
||
|
||
|
||
|
||
/// <summary> | ||
/// Get BrandListFrom Trendyol | ||
/// </summary> | ||
/// <returns></returns> | ||
/// <remarks> | ||
/// Sample request: | ||
/// | ||
/// GET /Brands | ||
/// | ||
/// </remarks> | ||
/// <returns>List of Brands</returns> | ||
[HttpGet] | ||
public async Task<List<BrandsModel>> GetBrands() | ||
{ | ||
var brandList = new List<BrandsModel>(); | ||
using (var client = new HttpClient()) | ||
{ | ||
client.BaseAddress = new Uri("https://api.trendyol.com/"); | ||
client.DefaultRequestHeaders.Accept.Clear(); | ||
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); | ||
var response = await client.GetAsync("sapigw/brands"); | ||
if (response.IsSuccessStatusCode) | ||
{ | ||
var content = await response.Content.ReadAsStringAsync(); | ||
brandList = JsonSerializer.Deserialize<BrandsList>(content).brands; | ||
} | ||
|
||
} | ||
|
||
return brandList; | ||
} | ||
|
||
} | ||
|
||
} |
39 changes: 0 additions & 39 deletions
39
NetCore-Trendyol-Entegrasyon/Controllers/WeatherForecastController.cs
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
NetCore-Trendyol-Entegrasyon/Models/Product/BrandsModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
using System.Collections.Generic; | ||
|
||
namespace NetCore_Trendyol_Entegrasyon.Models.Product | ||
{ | ||
|
||
public class BrandsList{ | ||
|
||
public List<BrandsModel> brands { get; set; } | ||
|
||
} | ||
public class BrandsModel{ | ||
|
||
|
||
public int id { get; set; } | ||
public string name { get; set; } | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+915 KB
NetCore-Trendyol-Entegrasyon/bin/Debug/netcoreapp3.1/Microsoft.AspNetCore.Razor.Language.dll
Binary file not shown.
Binary file added
BIN
+743 KB
...Trendyol-Entegrasyon/bin/Debug/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.Workspaces.dll
Binary file not shown.
Binary file added
BIN
+4.98 MB
NetCore-Trendyol-Entegrasyon/bin/Debug/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.dll
Binary file not shown.
Binary file added
BIN
+82.1 KB
NetCore-Trendyol-Entegrasyon/bin/Debug/netcoreapp3.1/Microsoft.CodeAnalysis.Razor.dll
Binary file not shown.
Binary file added
BIN
+2.78 MB
NetCore-Trendyol-Entegrasyon/bin/Debug/netcoreapp3.1/Microsoft.CodeAnalysis.Workspaces.dll
Binary file not shown.
Binary file added
BIN
+2.38 MB
NetCore-Trendyol-Entegrasyon/bin/Debug/netcoreapp3.1/Microsoft.CodeAnalysis.dll
Binary file not shown.
Binary file added
BIN
+22.9 KB
...tegrasyon/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGeneration.Contracts.dll
Binary file not shown.
Binary file added
BIN
+71.4 KB
...ol-Entegrasyon/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGeneration.Core.dll
Binary file not shown.
Binary file added
BIN
+67.9 KB
...bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.dll
Binary file not shown.
Binary file added
BIN
+28.4 KB
...egrasyon/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGeneration.Templating.dll
Binary file not shown.
Binary file added
BIN
+33.4 KB
...l-Entegrasyon/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGeneration.Utils.dll
Binary file not shown.
Binary file added
BIN
+34.9 KB
...rendyol-Entegrasyon/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGeneration.dll
Binary file not shown.
Binary file added
BIN
+184 KB
...yol-Entegrasyon/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGenerators.Mvc.dll
Binary file not shown.
Oops, something went wrong.