-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from EspadaKomanda/additions-since-semifinal
Added changes since semifinal
- Loading branch information
Showing
541 changed files
with
25,276 additions
and
19,707 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,13 @@ | ||
{ | ||
"sqltools.connections": [ | ||
{ | ||
"previewLimit": 50, | ||
"server": "212.109.196.0", | ||
"port": 5432, | ||
"driver": "PostgreSQL", | ||
"name": "5432", | ||
"database": "tourdb", | ||
"username": "postgres" | ||
} | ||
] | ||
} |
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 @@ | ||
6 |
14 changes: 0 additions & 14 deletions
14
ApiGatewayService/Controllers/AuthService/AccessDataCacheController.cs
This file was deleted.
Oops, something went wrong.
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
51 changes: 45 additions & 6 deletions
51
ApiGatewayService/Controllers/EntertainmentService/BenefitController.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 |
---|---|---|
@@ -1,17 +1,56 @@ | ||
using ApiGatewayService.Services.EntertaimentService.Benefits; | ||
using EntertaimentService.Models.Benefits; | ||
using Microsoft.AspNetCore.Mvc; | ||
using TourService.KafkaException; | ||
|
||
namespace ApiGatewayService.Controllers.EntertainmentService; | ||
|
||
[ApiController] | ||
[Route("api/[controller]")] | ||
public class BenefitController : ControllerBase | ||
[Route("api/[controller]/ent")] | ||
public class BenefitController(IEntertaimentBenefitService entertainmentBenefitsService, ILogger<BenefitController> logger) : ControllerBase | ||
{ | ||
public Task<IActionResult> GetBenefit() | ||
private readonly IEntertaimentBenefitService _entertainmentBenefitsService = entertainmentBenefitsService; | ||
private readonly ILogger<BenefitController> _logger = logger; | ||
|
||
[HttpGet] | ||
[Route("benefits/{benefitId}")] | ||
public IActionResult GetBenefit([FromRoute] long benefitId) | ||
{ | ||
throw new NotImplementedException(); | ||
GetBenefitRequest request = new(){BenefitId = benefitId}; | ||
|
||
try | ||
{ | ||
var result = _entertainmentBenefitsService.GetBenefit(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
public IQueryable<IActionResult> GetBenefits() | ||
|
||
[HttpGet] | ||
[Route("benefits/page/{pageId}")] | ||
public IActionResult GetBenefits([FromRoute] int pageId) | ||
{ | ||
throw new NotImplementedException(); | ||
GetBenefitsRequest request = new(){Page = pageId}; | ||
|
||
try | ||
{ | ||
var result = _entertainmentBenefitsService.GetBenefits(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
} |
49 changes: 43 additions & 6 deletions
49
ApiGatewayService/Controllers/EntertainmentService/CategoryController.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 |
---|---|---|
@@ -1,18 +1,55 @@ | ||
using ApiGatewayService.Services.EntertaimentService.Categories; | ||
using EntertaimentService.Models.Category.Requests; | ||
using Microsoft.AspNetCore.Mvc; | ||
using TourService.KafkaException; | ||
|
||
namespace ApiGatewayService.Controllers.EntertainmentService; | ||
|
||
[ApiController] | ||
[Route("api/[controller]")] | ||
public class CategoryController : ControllerBase | ||
[Route("api/[controller]/ent")] | ||
public class CategoryController(ILogger<CategoryController> logger, IEntertaimentCategoryService entertainmentCategoryService) : ControllerBase | ||
{ | ||
public Task<IActionResult> GetCategory() | ||
private readonly ILogger<CategoryController> _logger = logger; | ||
private readonly IEntertaimentCategoryService _tourCategoryService = entertainmentCategoryService; | ||
|
||
[HttpGet] | ||
[Route("categories/{categoryId}")] | ||
public async Task<IActionResult> GetCategory([FromRoute] long categoryId) | ||
{ | ||
throw new NotImplementedException(); | ||
GetCategoryRequest request = new(){CategoryId = categoryId}; | ||
try | ||
{ | ||
var result = await _tourCategoryService.GetCategory(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
|
||
public IQueryable<IActionResult> GetCategories() | ||
[HttpGet] | ||
[Route("categories/page/{pageId}")] | ||
public async Task<IActionResult> GetCategories([FromRoute] int pageId) | ||
{ | ||
throw new NotImplementedException(); | ||
GetCategoriesRequest request = new(){Page = pageId}; | ||
|
||
try | ||
{ | ||
var result = await _tourCategoryService.GetCategories(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
} |
178 changes: 172 additions & 6 deletions
178
ApiGatewayService/Controllers/EntertainmentService/EntertainmentController.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 |
---|---|---|
@@ -1,17 +1,183 @@ | ||
using ApiGatewayService.Services.EntertaimentService.Entertaiments; | ||
using EntertaimentService.Models.Entertaiment.Requests; | ||
using EntertaimentService.Models.Tour.Requests; | ||
using Microsoft.AspNetCore.Mvc; | ||
using TourService.KafkaException; | ||
|
||
namespace ApiGatewayService.Controllers.EntertainmentService; | ||
|
||
[ApiController] | ||
[Route("api/[controller]")] | ||
public class TourController : ControllerBase | ||
[Route("api/[controller]/ent")] | ||
public class EntertaimentController(ILogger<EntertaimentController> logger, IEntertaimentService entertainmentService) : ControllerBase | ||
{ | ||
public Task<IActionResult> GetEntertainment() | ||
private readonly ILogger<EntertaimentController> _logger = logger; | ||
private readonly IEntertaimentService _entertainmentService = entertainmentService; | ||
[HttpPost] | ||
[Route("entertainments")] | ||
public async Task<IActionResult> AddEntertainment(AddEntertaimentRequest request) | ||
{ | ||
throw new NotImplementedException(); | ||
try | ||
{ | ||
var result = await _entertainmentService.AddEntertaiment(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
public Task<IActionResult> GetEntertainments() | ||
[HttpGet] | ||
[Route("entertainments/{entertainmentId}")] | ||
public async Task<IActionResult> GetEntertainment([FromRoute] long entertainmentId) | ||
{ | ||
throw new NotImplementedException(); | ||
GetEntertaimentRequest request = new() { Id = entertainmentId }; | ||
try | ||
{ | ||
var result = await _entertainmentService.GetEntertaiment(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
[HttpPatch] | ||
[Route("entertainments")] | ||
public async Task<IActionResult> UpdateEntertainment(UpdateEntertaimentRequest request) | ||
{ | ||
try | ||
{ | ||
var result = await _entertainmentService.UpdateEntertaiment(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
[HttpDelete] | ||
[Route("entertainments")] | ||
public async Task<IActionResult> RemoveEntertainment(RemoveEntertaimentRequest request) | ||
{ | ||
try | ||
{ | ||
var result = await _entertainmentService.RemoveEntertaiment(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
[HttpGet] | ||
[Route("entertainments/page/{pageId}")] | ||
public async Task<IActionResult> GetEntertainments([FromRoute] int pageId) | ||
{ | ||
GetEntertaimentsRequest request = new() { Page = pageId }; | ||
try | ||
{ | ||
var result = await _entertainmentService.GetEntertaiments(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
|
||
[HttpPost] | ||
[Route("linkCategories")] | ||
public async Task<IActionResult> LinkCategories(LinkCategoriesEntertaimentRequests request) | ||
{ | ||
try | ||
{ | ||
var result = await _entertainmentService.LinkCategories(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
|
||
[HttpDelete] | ||
[Route("unlinkCategory")] | ||
public async Task<IActionResult> UnlinkCategory(UnlinkCategoryEntertaimentRequest request) | ||
{ | ||
try | ||
{ | ||
var result = await _entertainmentService.UnlinkCategory(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
|
||
[HttpPost] | ||
[Route("linkPaymentMethods")] | ||
public async Task<IActionResult> LinkPaymentMethods(LinkPaymentMethodsEntertaimentRequest request) | ||
{ | ||
try | ||
{ | ||
var result = await _entertainmentService.LinkPaymentMethods(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
|
||
[HttpDelete] | ||
[Route("unlinkPaymentMethods")] | ||
public async Task<IActionResult> UnlinkPaymentMethod(UnlinkPaymentMethodEntertaimentRequest request) | ||
{ | ||
try | ||
{ | ||
var result = await _entertainmentService.UnlinkPaymentMethod(request); | ||
return Ok(result); | ||
} | ||
catch(Exception ex) | ||
{ | ||
if(ex is MyKafkaException) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
return BadRequest(ex.Message); | ||
} | ||
} | ||
} |
Oops, something went wrong.