Ignore:
Timestamp:
10/27/25 15:20:33 (11 months ago)
Author:
stefansaveski <stefansaveski19@…>
Branches:
master
Children:
b38c39c
Parents:
e49c3ed
Message:

Add user-related models, services, and JWT validation

Added ContactInfo, EnrollmentInfo, and HighSchool models with relationships to the User entity. Updated AppDbContext and migrations to reflect these changes. Introduced UserService and IUserService for handling user data retrieval via JWT validation. Added UserController with a getUser endpoint to fetch user data based on JWT.

Enhanced IUserRepository and UserRepository with a method to fetch users by ID. Registered UserService in the DI container. Defined enums for EnrollmentInfo and HighSchool. Removed outdated migration files and performed general refactoring and cleanup.

Location:
iknow-api/Repository
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • iknow-api/Repository/Implementations/UserRepository.cs

    re49c3ed rcab02ad  
    2424            return await _context.User.FirstOrDefaultAsync(u => u.Email == username);
    2525        }
     26       
     27        public async Task<User> GetUserByIdAsync(int id)
     28        {
     29            return await _context.User.FirstOrDefaultAsync(u => u.Id == id);
     30        }
     31
    2632
    2733        public async Task AddUserAsync(User user)
  • iknow-api/Repository/Interface/IUserRepository.cs

    re49c3ed rcab02ad  
    88        Task AddUserAsync(User user);
    99        Task<int> GetUsersCountAsync();
     10        Task<User> GetUserByIdAsync(int id);
    1011    }
    1112}
Note: See TracChangeset for help on using the changeset viewer.