-
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 branch 'master' of https://github.com/Tohirjon-Odilov/Exam.Stoc…
- Loading branch information
Showing
61 changed files
with
1,381 additions
and
90 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
This file was deleted.
Oops, something went wrong.
37 changes: 33 additions & 4 deletions
37
Exam.StockManagement.API/Controllers/Identity/AuthController.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
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,10 +1,17 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Exam.StockManagement.API.Controllers | ||
{ | ||
[Route("api/[controller]/[action]")] | ||
[ApiController] | ||
public class ProductController | ||
[Authorize] | ||
public class ProductController : ControllerBase | ||
{ | ||
[HttpPost] | ||
public async Task<IActionResult> GetById(int id) | ||
{ | ||
return Ok("Salom"); | ||
} | ||
} | ||
} |
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,10 +1,17 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Exam.StockManagement.API.Controllers | ||
{ | ||
[Route("api/[controller]/[action]")] | ||
[ApiController] | ||
public class StatsController | ||
[Authorize] | ||
public class StatsController : ControllerBase | ||
{ | ||
[HttpPost] | ||
public async Task<IActionResult> GetById(int id) | ||
{ | ||
return Ok("Salom"); | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -14,5 +14,12 @@ | |
"ValidIssuer": "127.0.0.1", | ||
"Secret": "TohirjonOdilovImtihonUchunTayyorlaganSecretKey03.02.2024", | ||
"ExpireDate": "1000" | ||
}, | ||
"EmailSettings": { | ||
"MailServer": "smtp.gmail.com", | ||
"MailPort": 587, | ||
"SenderName": "Najot Ta'lim", | ||
"Sender": "[email protected]", | ||
"Password": "wcyz cueo vuiv tcku" | ||
} | ||
} |
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 @@ | ||
9430 |
5 changes: 3 additions & 2 deletions
5
...plication/Abstractions/IBaseRepository.cs → ...stractions/IRepository/IBaseRepository.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
8 changes: 8 additions & 0 deletions
8
Exam.StockManagement.Application/Abstractions/IRepository/ICategoryRepository.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Exam.StockManagement.Domain.Entities.Models; | ||
|
||
namespace Exam.StockManagement.Application.Abstractions.IRepository | ||
{ | ||
public interface ICategoryRepository : IBaseRepository<Category> | ||
{ | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Exam.StockManagement.Application/Abstractions/IRepository/IProductRepository.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Exam.StockManagement.Domain.Entities.Models; | ||
|
||
namespace Exam.StockManagement.Application.Abstractions.IRepository | ||
{ | ||
public interface IProductRepository : IBaseRepository<Product> | ||
{ | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Exam.StockManagement.Application/Abstractions/IRepository/IStatsRepository.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Exam.StockManagement.Domain.Entities.Models; | ||
|
||
namespace Exam.StockManagement.Application.Abstractions.IRepository | ||
{ | ||
public interface IStatsService : IBaseRepository<Stats> | ||
{ | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...plication/Abstractions/IUserRepository.cs → ...stractions/IRepository/IUserRepository.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
6 changes: 5 additions & 1 deletion
6
Exam.StockManagement.Application/Abstractions/IServices/IAuthService.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,9 +1,13 @@ | ||
using Exam.StockManagement.Domain.Entities.DTOs; | ||
using Exam.StockManagement.Domain.Entities.Models; | ||
|
||
namespace Exam.StockManagement.Application.Abstractions.IServices | ||
{ | ||
public interface IAuthService | ||
{ | ||
public Task<ResponseLogin> GenerateToken(RequestLogin user); | ||
public Task<ResponseLogin> GenerateToken(CheckEmail model, string path); | ||
public Task<bool> UserExist(RequestLogin user); | ||
public Task<string> CorrectEmail(RegisterLogin user); | ||
public Task<User> RegisterUser(RequestSignUp signUp); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
Exam.StockManagement.Application/Abstractions/IServices/ICategoryService.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Exam.StockManagement.Application.Abstractions.IServices | ||
{ | ||
public interface ICategoryService | ||
{ | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Exam.StockManagement.Application/Abstractions/IServices/IEmailSenderService.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Exam.StockManagement.Application.Abstractions.IServices | ||
{ | ||
public interface IEmailSenderService | ||
{ | ||
public Task<string> SendEmailAsync(string email, string path); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
Exam.StockManagement.Application/Abstractions/IServices/IProductService.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Exam.StockManagement.Domain.Entities.DTOs; | ||
using Exam.StockManagement.Domain.Entities.Models; | ||
using Exam.StockManagement.Domain.Entities.ViewModels; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Linq.Expressions; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Exam.StockManagement.Application.Abstractions.IServices | ||
{ | ||
public interface IProductService | ||
{ | ||
public Task<Product> Create(ProductDTO userDTO); | ||
public Task<Product> GetByName(string name); | ||
public Task<Product> GetById(int Id); | ||
public Task<Product> GetByEmail(string email); | ||
public Task<Product> GetByLogin(string email); | ||
public Task<IEnumerable<ProductViewModel>> GetAll(); | ||
public Task<bool> Delete(Expression<Func<Product, bool>> expression); | ||
public Task<Product> Update(int Id, ProductDTO userDTO); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
Exam.StockManagement.Application/Abstractions/IServices/IStatsService.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Exam.StockManagement.Application.Abstractions.IServices | ||
{ | ||
public interface IStatsService | ||
{ | ||
} | ||
} |
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
Oops, something went wrong.