|
Last change
on this file since 70a9f6d was 691f152, checked in by Stefan-Saveski <stefansaveski19@…>, 10 months ago |
|
Add getSemesters endpoint and related data access
Introduce a new getSemesters endpoint in UserController.cs to retrieve user semester data using JWT authentication.
Add DbSet<EnrolledSemesters> to AppDbContext.cs for database interaction.
Implement GetUserSemestersAsync in UserRepository.cs to fetch semesters by user ID, and update IUserRepository.cs to declare this method.
Add GetUserSemesters method in UserService.cs to extract user ID from JWT and retrieve semesters, updating IUserService.cs accordingly.
|
-
Property mode
set to
100644
|
|
File size:
642 bytes
|
| Line | |
|---|
| 1 | using iknow_api.Models;
|
|---|
| 2 | namespace iknow_api.Repositories
|
|---|
| 3 | {
|
|---|
| 4 | public interface IUserRepository
|
|---|
| 5 | {
|
|---|
| 6 | Task<bool> UserExistsAsync(string username);
|
|---|
| 7 | Task<User?> GetUserByUsernameAsync(string username);
|
|---|
| 8 | Task AddUserAsync(User user);
|
|---|
| 9 | Task AddContactAsync(ContactInfo contactInfo);
|
|---|
| 10 | Task AddEnrollmentAsync(EnrollmentInfo enrollment);
|
|---|
| 11 | Task AddHighSchoolAsync(HighSchool highSchool);
|
|---|
| 12 | Task<int> GetUsersCountAsync();
|
|---|
| 13 | Task<User?> GetUserByIdAsync(int id);
|
|---|
| 14 | Task<List<EnrolledSemesters>?> GetUserSemestersAsync(int id);
|
|---|
| 15 | Task<User?> GetOnlyUserByIdAsync(int id);
|
|---|
| 16 |
|
|---|
| 17 | }
|
|---|
| 18 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.