Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Twinki14 committed Sep 23, 2021
1 parent a05f80b commit d4004df
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 6 deletions.
29 changes: 25 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ bld/

# Visual Studio 2015/2017 cache/options directory
.vs/
# Visual Studio code directory
.vscode/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

Expand Down Expand Up @@ -92,6 +90,7 @@ StyleCopReport.xml
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
Expand Down Expand Up @@ -207,6 +206,9 @@ PublishScripts/
*.nuget.props
*.nuget.targets

# Nuget personal access tokens and Credentials
nuget.config

# Microsoft Azure Build Output
csx/
*.build.csdef
Expand Down Expand Up @@ -363,5 +365,24 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd

#IDE metadata
**.idea/**
# VS Code files for those working on multiple tools
.vscode/*
#!.vscode/settings.json
#!.vscode/tasks.json
#!.vscode/launch.json
#!.vscode/extensions.json
#*.code-workspace

# Local History for Visual Studio Code
.history/

# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp

# JetBrains Rider
.idea/
*.sln.iml
7 changes: 7 additions & 0 deletions src/OSItemIndex.API/Controllers/CompositeController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace OSItemIndex.API.Controllers
{
public class CompositeController
{

}
}
11 changes: 11 additions & 0 deletions src/OSItemIndex.API/Controllers/PricesController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Mvc;

namespace OSItemIndex.API.Controllers
{
[ApiController]
[Route("prices")]
public class PricesController : Controller
{

}
}
23 changes: 23 additions & 0 deletions src/OSItemIndex.API/Controllers/RealtimePricesController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using OSItemIndex.API.Models;
using OSItemIndex.Data;

namespace OSItemIndex.API.Controllers
{
[ApiController]
[Route("prices/realtime")]
public class PricesRealtimeController : Controller
{

[HttpGet(Name = "GetPrices")]
[Produces("application/json")]
[ResponseCache(VaryByHeader = "Accept-Encoding", Duration = 30)]
public async Task<ActionResult<IEnumerable<RealtimeItemPrice>>> GetPrices()
{
return Json(await _itemsService.GetItemsAsync(Request.QueryString.HasValue ? query : null));
}

}
}
2 changes: 1 addition & 1 deletion src/OSItemIndex.API/Repositories/EntityRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace OSItemIndex.API.Repositories
{
public abstract class EntityRepository<T> : IEntityRepository<T> where T : ItemEntity
public abstract class EntityRepository<T> : IEntityRepository<T> where T : Entity
{
private readonly IDbContextHelper _context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace OSItemIndex.API.Repositories
{
public interface IEntityRepository<T> where T : ItemEntity
public interface IEntityRepository<T> where T : Entity
{
Task<int> CountAsync();
Task<T> GetAsync(int id);
Expand Down
7 changes: 7 additions & 0 deletions src/OSItemIndex.API/Repositories/PricesRepository.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace OSItemIndex.API.Repositories
{
public class PricesRepository : EntityRepository<Real>
{
public ItemsRepository(IDbContextHelper context) : base(context) { }
}
}
7 changes: 7 additions & 0 deletions src/OSItemIndex.API/Services/Interfaces/IPricesService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace OSItemIndex.API.Services
{
public interface IPricesService
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace OSItemIndex.API.Services
{
public interface IPricesRealtimeService
{

}
}

0 comments on commit d4004df

Please sign in to comment.