-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
16 changed files
with
343 additions
and
0 deletions.
There are no files selected for viewing
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,15 @@ | ||
using AJS.Services.Interfaces; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace AJS.Services.Implementations | ||
{ | ||
class AdsApiService : IAdsApiService | ||
{ | ||
public AdsApiService() | ||
{ | ||
|
||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,5 +4,9 @@ namespace AJS.Services.Implementations | |
{ | ||
public class AdsService : IAdsService | ||
{ | ||
public AdsService() | ||
{ | ||
|
||
} | ||
} | ||
} |
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,15 @@ | ||
using AJS.Services.Interfaces; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace AJS.Services.Implementations | ||
{ | ||
class JobsApiService :IJobsApiService | ||
{ | ||
public JobsApiService() | ||
{ | ||
|
||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,5 +4,9 @@ namespace AJS.Services.Implementations | |
{ | ||
public class JobsService : IJobsService | ||
{ | ||
public JobsService() | ||
{ | ||
|
||
} | ||
} | ||
} |
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,15 @@ | ||
using AJS.Services.Interfaces; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace AJS.Services.Implementations | ||
{ | ||
class NewsApiService : INewsApiService | ||
{ | ||
public NewsApiService() | ||
{ | ||
|
||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,5 +4,9 @@ namespace AJS.Services.Implementations | |
{ | ||
public class NewsService : INewsService | ||
{ | ||
public NewsService() | ||
{ | ||
|
||
} | ||
} | ||
} |
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,15 @@ | ||
using AJS.Services.Interfaces; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace AJS.Services.Implementations | ||
{ | ||
class ServiceApiService : IServiceApiService | ||
{ | ||
public ServiceApiService() | ||
{ | ||
|
||
} | ||
} | ||
} |
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
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 | ||
{ | ||
} | ||
} |
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,10 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace AJS.Services.Interfaces | ||
{ | ||
public interface IJobsApiService | ||
{ | ||
} | ||
} |
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,10 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace AJS.Services.Interfaces | ||
{ | ||
public interface INewsApiService | ||
{ | ||
} | ||
} |
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,10 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace AJS.Services.Interfaces | ||
{ | ||
public interface IServiceApiService | ||
{ | ||
} | ||
} |
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,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"); | ||
} | ||
} | ||
} |
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,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"); | ||
} | ||
} | ||
} |
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,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"); | ||
} | ||
} | ||
} |
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,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"); | ||
} | ||
} | ||
} |