Skip to content

Commit

Permalink
mod:fixedProjStruct
Browse files Browse the repository at this point in the history
  • Loading branch information
moshdev2213 committed Sep 21, 2024
1 parent 9db917d commit 72f5247
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Controllers/TestController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using apekade.Dto;
using apekade.Models.Dto;
using Microsoft.AspNetCore.Authorization;

namespace apekade.Controllers;
Expand Down
2 changes: 1 addition & 1 deletion Controllers/UserController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using apekade.Enums;
using apekade.Services;
using apekade.Dto.UserDto;
using apekade.Models.Dto.UserDto;

namespace apekade.Controllers;

Expand Down
1 change: 1 addition & 0 deletions Helpers/GenerateJwtToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public string GenerateJwt(User user)
Subject = new ClaimsIdentity(new[]
{
new Claim(ClaimTypes.NameIdentifier, user.Id),
new Claim(ClaimTypes.Email, user.Email),
new Claim(ClaimTypes.Role, user.Role.ToString())
}),
Expires = DateTime.UtcNow.AddHours(1),
Expand Down
2 changes: 1 addition & 1 deletion dto/ApiRes.cs → Models/Dto/ApiRes.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace apekade.Dto;
namespace apekade.Models.Dto;

public class ApiRes<T>{
public Boolean? Status {get;set;}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using apekade.Enums;

namespace apekade.Dto.UserDto;
namespace apekade.Models.Dto.UserDto;

public class UserReqtDto
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using apekade.Enums;

namespace apekade.Dto.UserDto;
namespace apekade.Models.Dto.UserDto;

public class UserResDto
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace apekade.Dto.UserDto;
namespace apekade.Models.Dto.UserDto;

public class UserTokenResDto
{
Expand Down
4 changes: 2 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using apekade.Configuration;
using apekade.Dto;
using apekade.Models.Dto;

var builder = WebApplication.CreateBuilder(args);

Expand Down Expand Up @@ -30,7 +30,7 @@
{
Status = true,
Code = 200,
Data = new { Message = "Server Online" }
Data = new { Message = "server_online" }
});

app.Run();
2 changes: 1 addition & 1 deletion Repositories/UserRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public UserRepository(IMongoDatabase database)
_usersCollection = database.GetCollection<User>("Users");
}

public async Task save(User user)
public async Task Save(User user)
{
await _usersCollection.InsertOneAsync(user);
}
Expand Down
4 changes: 2 additions & 2 deletions Services/IUserService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using apekade.Dto;
using apekade.Dto.UserDto;
using apekade.Models.Dto;
using apekade.Models.Dto.UserDto;

namespace apekade.Services;

Expand Down
6 changes: 3 additions & 3 deletions Services/Impl/UserService.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using AutoMapper;
using apekade.Models;
using apekade.Dto;
using apekade.Models.Dto;
using apekade.Repositories;
using apekade.Helpers;
using apekade.Services.Impl;
using apekade.Dto.UserDto;
using apekade.Models.Dto.UserDto;

namespace apekade.Services.Impl;

Expand Down Expand Up @@ -34,7 +34,7 @@ public async Task<ApiRes<UserTokenResDto>> CreateNewUser(UserReqtDto userRequest
newUser.PasswordHash = passwordHash;
newUser.PasswordSalt = passwordSalt;

await _userRepository.save(newUser);
await _userRepository.Save(newUser);

var token = _generateJwtToken.GenerateJwt(newUser);

Expand Down
2 changes: 1 addition & 1 deletion configuration/MapperConfig.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using AutoMapper;
using apekade.Models;
using apekade.Dto.UserDto;
using apekade.Models.Dto.UserDto;

namespace apekade.Configuration;

Expand Down
2 changes: 1 addition & 1 deletion configuration/ServiceConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Reflection;
using apekade.Dto.UserDto;
using apekade.Models.Dto.UserDto;
using apekade.Helpers;
using apekade.Repositories;
using apekade.Services;
Expand Down

0 comments on commit 72f5247

Please sign in to comment.