Skip to content

Commit

Permalink
Add APIs (#81)
Browse files Browse the repository at this point in the history
* Add API

* Refactoring

* Add Services For APIs

* Add Services with DI in API Controllers

* Add APIs and services for them

* Add APIs

* no message

* no message

* Refactoring

* no message

* no message
  • Loading branch information
Valentin Stoev authored Feb 13, 2020
1 parent 509ea35 commit 52306eb
Show file tree
Hide file tree
Showing 20 changed files with 129 additions and 96 deletions.
8 changes: 4 additions & 4 deletions AJS.Services/Implementations/AdsApiService.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using AJS.Services.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Implementations
{
class AdsApiService : IAdsApiService
/// <summary>
/// Ads API Service
/// </summary>
public class AdsApiService : IAdsApiService
{
public AdsApiService()
{
Expand Down
3 changes: 3 additions & 0 deletions AJS.Services/Implementations/AdsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace AJS.Services.Implementations
{
/// <summary>
/// Ads Service
/// </summary>
public class AdsService : IAdsService
{
public AdsService()
Expand Down
8 changes: 4 additions & 4 deletions AJS.Services/Implementations/JobsApiService.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using AJS.Services.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Implementations
{
class JobsApiService :IJobsApiService
/// <summary>
/// Jobs API Service
/// </summary>
public class JobsApiService :IJobsApiService
{
public JobsApiService()
{
Expand Down
3 changes: 3 additions & 0 deletions AJS.Services/Implementations/JobsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace AJS.Services.Implementations
{
/// <summary>
/// Jobs Service
/// </summary>
public class JobsService : IJobsService
{
public JobsService()
Expand Down
8 changes: 4 additions & 4 deletions AJS.Services/Implementations/NewsApiService.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using AJS.Services.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Implementations
{
class NewsApiService : INewsApiService
/// <summary>
/// News Api Service
/// </summary>
public class NewsApiService : INewsApiService
{
public NewsApiService()
{
Expand Down
3 changes: 3 additions & 0 deletions AJS.Services/Implementations/NewsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace AJS.Services.Implementations
{
/// <summary>
/// News Service
/// </summary>
public class NewsService : INewsService
{
public NewsService()
Expand Down
8 changes: 4 additions & 4 deletions AJS.Services/Implementations/ServiceApiService.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using AJS.Services.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Implementations
{
class ServiceApiService : IServiceApiService
/// <summary>
/// Services API Service
/// </summary>
public class ServiceApiService : IServicesApiService
{
public ServiceApiService()
{
Expand Down
3 changes: 3 additions & 0 deletions AJS.Services/Implementations/ServicesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace AJS.Services.Implementations
{
/// <summary>
/// Services Service
/// </summary>
public class ServicesService : IServicesService
{
public ServicesService()
Expand Down
10 changes: 5 additions & 5 deletions AJS.Services/Interfaces/IAdsApiService.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Interfaces
namespace AJS.Services.Interfaces
{
/// <summary>
/// Ads API Service Interface
/// </summary>

public interface IAdsApiService
{
}
Expand Down
3 changes: 3 additions & 0 deletions AJS.Services/Interfaces/IAdsService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace AJS.Services.Interfaces
{
/// <summary>
/// Ads Service Interface
/// </summary>
public interface IAdsService
{
}
Expand Down
9 changes: 4 additions & 5 deletions AJS.Services/Interfaces/IJobsApiService.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Interfaces
namespace AJS.Services.Interfaces
{
/// <summary>
/// Jobs API Service Interface
/// </summary>
public interface IJobsApiService
{
}
Expand Down
3 changes: 3 additions & 0 deletions AJS.Services/Interfaces/IJobsService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace AJS.Services.Interfaces
{
/// <summary>
/// Jobs Service Interface
/// </summary>
public interface IJobsService
{
}
Expand Down
9 changes: 4 additions & 5 deletions AJS.Services/Interfaces/INewsApiService.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Interfaces
namespace AJS.Services.Interfaces
{
/// <summary>
/// News API Service Interface
/// </summary>
public interface INewsApiService
{
}
Expand Down
3 changes: 3 additions & 0 deletions AJS.Services/Interfaces/INewsService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace AJS.Services.Interfaces
{
/// <summary>
/// News Service Interface
/// </summary>
public interface INewsService
{
}
Expand Down
9 changes: 9 additions & 0 deletions AJS.Services/Interfaces/IServicesApiService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace AJS.Services.Interfaces
{
/// <summary>
/// Services API Service Interface
/// </summary>
public interface IServicesApiService
{
}
}
3 changes: 3 additions & 0 deletions AJS.Services/Interfaces/IServicesService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace AJS.Services.Interfaces
{
/// <summary>
/// Services Service Interface
/// </summary>
public interface IServicesService
{
}
Expand Down
33 changes: 17 additions & 16 deletions AJS.Web/Areas/Api/AdsController.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AJS.Services.Interfaces;
using Microsoft.AspNetCore.Http;
using AJS.Services.Interfaces;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace AJS.Web.Areas.Api
{
/// <summary>
/// Ads API Controller
/// </summary>

[Route("api/Ads")]
[ApiController]
public class AdsController : ControllerBase
Expand All @@ -18,39 +18,40 @@ public AdsController(IAdsApiService adsApiService)
{
this.adsApiService = adsApiService;
}

[HttpGet]
[Route("Get")]
public IActionResult Get()
public async Task<IActionResult> Get()
{
return new JsonResult("Implement me");
return new JsonResult("");
}

[HttpGet]
[Route("GetById")]
public IActionResult GetById()
public async Task<IActionResult> GetById()
{
return new JsonResult("Implement me");
return new JsonResult("");
}

[HttpGet]
[Route("GetByCategory")]
public IActionResult GetByCategory()
public async Task<IActionResult> GetByCategory()
{
return new JsonResult("Implement me");
return new JsonResult("");
}

[HttpGet]
[Route("GetByDate")]
public IActionResult GetByDate()
public async Task<IActionResult> GetByDate()
{
return new JsonResult("Implement me");
return new JsonResult("");
}

[HttpGet]
[Route("GetByLastDateSync")]
public IActionResult GetByLastDateSync()
public async Task<IActionResult> GetByLastDateSync()
{
return new JsonResult("Implement me");
return new JsonResult("");
}
}
}
33 changes: 17 additions & 16 deletions AJS.Web/Areas/Api/JobsController.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AJS.Services.Interfaces;
using Microsoft.AspNetCore.Http;
using AJS.Services.Interfaces;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace AJS.Web.Areas.Api
{
/// <summary>
/// Jobs API Controller
/// </summary>

[Route("api/Jobs")]
[ApiController]
public class JobsController : ControllerBase
Expand All @@ -21,37 +21,38 @@ public JobsController(IJobsApiService jobsApiService)

[HttpGet]
[Route("Get")]
public IActionResult Get()
public async Task<IActionResult> Get()
{
return new JsonResult("Implement me");
return new JsonResult("");
}

[HttpGet]
[Route("GetById")]
public IActionResult GetById()
public async Task<IActionResult> GetById()
{
return new JsonResult("Implement me");
return new JsonResult("");

}

[HttpGet]
[Route("GetByCategory")]
public IActionResult GetByCategory()
public async Task<IActionResult> GetByCategory()
{
return new JsonResult("Implement me");
return new JsonResult("");
}

[HttpGet]
[Route("GetByDate")]
public IActionResult GetByDate()
public async Task<IActionResult> GetByDate()
{
return new JsonResult("Implement me");
return new JsonResult("");
}

[HttpGet]
[Route("GetByLastDateSync")]
public IActionResult GetByLastDateSync()
public async Task<IActionResult> GetByLastDateSync()
{
return new JsonResult("Implement me");
return new JsonResult("");
}
}
}
Loading

0 comments on commit 52306eb

Please sign in to comment.