- Timestamp:
- 10/27/25 15:20:33 (11 months ago)
- Branches:
- master
- Children:
- b38c39c
- Parents:
- e49c3ed
- Location:
- iknow-api
- Files:
-
- 8 added
- 2 deleted
- 6 edited
-
Controllers/UserController.cs (added)
-
DTOs/UserDTO.cs (modified) (1 diff)
-
Data/AppDbContext.cs (modified) (1 diff)
-
Migrations/20251022202014_InitialCreate.Designer.cs (deleted)
-
Migrations/20251022202014_InitialCreate.cs (deleted)
-
Migrations/20251027140655_InitialCreate.Designer.cs (added)
-
Migrations/20251027140655_InitialCreate.cs (added)
-
Migrations/AppDbContextModelSnapshot.cs (modified) (2 diffs)
-
Models/ContactInfo.cs (added)
-
Models/EnrollmentInfo.cs (added)
-
Models/HighSchool.cs (added)
-
Program.cs (modified) (1 diff)
-
Repository/Implementations/UserRepository.cs (modified) (1 diff)
-
Repository/Interface/IUserRepository.cs (modified) (1 diff)
-
Services/Implementations/UserService.cs (added)
-
Services/Interfaces/IUserService.cs (added)
Legend:
- Unmodified
- Added
- Removed
-
iknow-api/DTOs/UserDTO.cs
re49c3ed rcab02ad 6 6 public string Email { get; set; } = string.Empty; 7 7 public string Password { get; set; } = string.Empty; 8 } 9 public class GetUserDataDto 10 { 11 public string JWT { get; set; } 8 12 } 9 13 -
iknow-api/Data/AppDbContext.cs
re49c3ed rcab02ad 10 10 11 11 public DbSet<User> User { get; set; } 12 public DbSet<ContactInfo> ContactInfo { get; set; } 13 public DbSet<HighSchool> HighSchool { get; set; } 14 public DbSet<EnrollmentInfo> EnrollmentInfo { get; set; } 12 15 } 13 16 } -
iknow-api/Migrations/AppDbContextModelSnapshot.cs
re49c3ed rcab02ad 23 23 NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); 24 24 25 modelBuilder.Entity("iknow_api.Core.Models.User", b => 25 modelBuilder.Entity("iknow_api.Models.ContactInfo", b => 26 { 27 b.Property<int>("Id") 28 .ValueGeneratedOnAdd() 29 .HasColumnType("integer"); 30 31 NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); 32 33 b.Property<int>("UserId") 34 .HasColumnType("integer"); 35 36 b.Property<string>("address") 37 .HasColumnType("text"); 38 39 b.Property<string>("city") 40 .HasColumnType("text"); 41 42 b.Property<string>("microsoftEmail") 43 .HasColumnType("text"); 44 45 b.Property<string>("municipality") 46 .HasColumnType("text"); 47 48 b.Property<string>("phoneNumber") 49 .HasColumnType("text"); 50 51 b.HasKey("Id"); 52 53 b.HasIndex("UserId"); 54 55 b.ToTable("ContactInfo"); 56 }); 57 58 modelBuilder.Entity("iknow_api.Models.EnrollmentInfo", b => 59 { 60 b.Property<int>("Id") 61 .ValueGeneratedOnAdd() 62 .HasColumnType("integer"); 63 64 NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); 65 66 b.Property<int>("UserId") 67 .HasColumnType("integer"); 68 69 b.Property<int>("enrollmentYear") 70 .HasColumnType("integer"); 71 72 b.Property<int>("major") 73 .HasColumnType("integer"); 74 75 b.HasKey("Id"); 76 77 b.HasIndex("UserId"); 78 79 b.ToTable("EnrollmentInfo"); 80 }); 81 82 modelBuilder.Entity("iknow_api.Models.HighSchool", b => 83 { 84 b.Property<int>("Id") 85 .ValueGeneratedOnAdd() 86 .HasColumnType("integer"); 87 88 NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); 89 90 b.Property<float>("GPA") 91 .HasColumnType("real"); 92 93 b.Property<int>("UserId") 94 .HasColumnType("integer"); 95 96 b.Property<int>("tip") 97 .HasColumnType("integer"); 98 99 b.HasKey("Id"); 100 101 b.HasIndex("UserId"); 102 103 b.ToTable("HighSchool"); 104 }); 105 106 modelBuilder.Entity("iknow_api.Models.User", b => 26 107 { 27 108 b.Property<int>("Id") … … 59 140 b.ToTable("User"); 60 141 }); 142 143 modelBuilder.Entity("iknow_api.Models.ContactInfo", b => 144 { 145 b.HasOne("iknow_api.Models.User", "User") 146 .WithMany() 147 .HasForeignKey("UserId") 148 .OnDelete(DeleteBehavior.Cascade) 149 .IsRequired(); 150 151 b.Navigation("User"); 152 }); 153 154 modelBuilder.Entity("iknow_api.Models.EnrollmentInfo", b => 155 { 156 b.HasOne("iknow_api.Models.User", "User") 157 .WithMany() 158 .HasForeignKey("UserId") 159 .OnDelete(DeleteBehavior.Cascade) 160 .IsRequired(); 161 162 b.Navigation("User"); 163 }); 164 165 modelBuilder.Entity("iknow_api.Models.HighSchool", b => 166 { 167 b.HasOne("iknow_api.Models.User", "User") 168 .WithMany() 169 .HasForeignKey("UserId") 170 .OnDelete(DeleteBehavior.Cascade) 171 .IsRequired(); 172 173 b.Navigation("User"); 174 }); 61 175 #pragma warning restore 612, 618 62 176 } -
iknow-api/Program.cs
re49c3ed rcab02ad 43 43 builder.Services.AddScoped<IAuthService, AuthService>(); 44 44 builder.Services.AddScoped<IUserRepository, UserRepository>(); // You'll need to add the UserRepository implementation 45 builder.Services.AddScoped<IUserService, UserService>(); 46 45 47 builder.Services.AddAuthorization(); 46 48 var app = builder.Build(); -
iknow-api/Repository/Implementations/UserRepository.cs
re49c3ed rcab02ad 24 24 return await _context.User.FirstOrDefaultAsync(u => u.Email == username); 25 25 } 26 27 public async Task<User> GetUserByIdAsync(int id) 28 { 29 return await _context.User.FirstOrDefaultAsync(u => u.Id == id); 30 } 31 26 32 27 33 public async Task AddUserAsync(User user) -
iknow-api/Repository/Interface/IUserRepository.cs
re49c3ed rcab02ad 8 8 Task AddUserAsync(User user); 9 9 Task<int> GetUsersCountAsync(); 10 Task<User> GetUserByIdAsync(int id); 10 11 } 11 12 }
Note:
See TracChangeset
for help on using the changeset viewer.
