Skip to content

Commit

Permalink
Add APIs (#74)
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
  • Loading branch information
Valentin Stoev authored Feb 13, 2020
1 parent 534a634 commit 509ea35
Show file tree
Hide file tree
Showing 16 changed files with 343 additions and 0 deletions.
15 changes: 15 additions & 0 deletions AJS.Services/Implementations/AdsApiService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using AJS.Services.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Implementations
{
class AdsApiService : IAdsApiService
{
public AdsApiService()
{

}
}
}
4 changes: 4 additions & 0 deletions AJS.Services/Implementations/AdsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ namespace AJS.Services.Implementations
{
public class AdsService : IAdsService
{
public AdsService()
{

}
}
}
15 changes: 15 additions & 0 deletions AJS.Services/Implementations/JobsApiService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using AJS.Services.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Implementations
{
class JobsApiService :IJobsApiService
{
public JobsApiService()
{

}
}
}
4 changes: 4 additions & 0 deletions AJS.Services/Implementations/JobsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ namespace AJS.Services.Implementations
{
public class JobsService : IJobsService
{
public JobsService()
{

}
}
}
15 changes: 15 additions & 0 deletions AJS.Services/Implementations/NewsApiService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using AJS.Services.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Implementations
{
class NewsApiService : INewsApiService
{
public NewsApiService()
{

}
}
}
4 changes: 4 additions & 0 deletions AJS.Services/Implementations/NewsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ namespace AJS.Services.Implementations
{
public class NewsService : INewsService
{
public NewsService()
{

}
}
}
15 changes: 15 additions & 0 deletions AJS.Services/Implementations/ServiceApiService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using AJS.Services.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Implementations
{
class ServiceApiService : IServiceApiService
{
public ServiceApiService()
{

}
}
}
4 changes: 4 additions & 0 deletions AJS.Services/Implementations/ServicesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ namespace AJS.Services.Implementations
{
public class ServicesService : IServicesService
{
public ServicesService()
{

}
}
}
10 changes: 10 additions & 0 deletions AJS.Services/Interfaces/IAdsApiService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Interfaces
{
public interface IAdsApiService
{
}
}
10 changes: 10 additions & 0 deletions AJS.Services/Interfaces/IJobsApiService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Interfaces
{
public interface IJobsApiService
{
}
}
10 changes: 10 additions & 0 deletions AJS.Services/Interfaces/INewsApiService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Interfaces
{
public interface INewsApiService
{
}
}
10 changes: 10 additions & 0 deletions AJS.Services/Interfaces/IServiceApiService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace AJS.Services.Interfaces
{
public interface IServiceApiService
{
}
}
56 changes: 56 additions & 0 deletions AJS.Web/Areas/Api/AdsController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AJS.Services.Interfaces;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace AJS.Web.Areas.Api
{
[Route("api/Ads")]
[ApiController]
public class AdsController : ControllerBase
{
private readonly IAdsApiService adsApiService;

public AdsController(IAdsApiService adsApiService)
{
this.adsApiService = adsApiService;
}
[HttpGet]
[Route("Get")]
public IActionResult Get()
{
return new JsonResult("Implement me");
}

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

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

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

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

namespace AJS.Web.Areas.Api
{
[Route("api/Jobs")]
[ApiController]
public class JobsController : ControllerBase
{
private readonly IJobsApiService jobsApiService;

public JobsController(IJobsApiService jobsApiService)
{
this.jobsApiService = jobsApiService;
}

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

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

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

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

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

namespace AJS.Web.Areas.Api
{
[Route("api/News")]
[ApiController]
public class NewsController : ControllerBase
{
private readonly INewsApiService newsApiService;

public NewsController(INewsApiService newsApiService)
{
this.newsApiService = newsApiService;
}

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

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

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

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

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

namespace AJS.Web.Areas.Api
{
[Route("api/Services")]
[ApiController]
public class ServicesController : ControllerBase
{
private readonly IServiceApiService servicesApiService;

public ServicesController(IServiceApiService servicesApiService)
{
this.servicesApiService = servicesApiService;
}

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

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

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

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

[HttpGet]
[Route("GetByLastDateSync")]
public IActionResult GetByLastDateSync()
{
return new JsonResult("Implement me");
}
}
}

0 comments on commit 509ea35

Please sign in to comment.