Changeset 3592476
- Timestamp:
- 10/30/25 14:24:10 (11 months ago)
- Branches:
- master
- Children:
- a92a2a4
- Parents:
- f8af32b
- Location:
- iknow-api
- Files:
-
- 5 edited
- 2 moved
-
DTOs/UserDTO.cs (modified) (4 diffs)
-
Migrations/20251030124902_new.Designer.cs (moved) (moved from iknow-api/Migrations/20251029131316_InitialCreate.Designer.cs ) (2 diffs)
-
Migrations/20251030124902_new.cs (moved) (moved from iknow-api/Migrations/20251029131316_InitialCreate.cs ) (2 diffs)
-
Migrations/AppDbContextModelSnapshot.cs (modified) (1 diff)
-
Models/ContactInfo.cs (modified) (1 diff)
-
Models/EnrollmentInfo.cs (modified) (2 diffs)
-
Services/Implementations/AuthService.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
iknow-api/DTOs/UserDTO.cs
rf8af32b r3592476 10 10 public class GetUserDataDto 11 11 { 12 public string JWT { get; set; }12 public string? JWT { get; set; } 13 13 } 14 14 … … 25 25 public UserRole Role { get; set; } 26 26 public float gpa { get; set; } 27 public type tip { get; set; }27 public Type tip { get; set; } 28 28 public string city { get; set; } = string.Empty; 29 29 public string address { get; set; } = string.Empty; … … 32 32 public string microsoftEmail { get; set; } = string.Empty; 33 33 public int enrollmentYear { get; set; } 34 public quota quotaType { get; set; }35 public major majorType { get; set; }34 public Quota quotaType { get; set; } 35 public Major majorType { get; set; } 36 36 37 37 } … … 57 57 Student 58 58 } 59 public enum type59 public enum Type 60 60 { 61 61 strucen, gimnazija 62 62 } 63 public enum quota63 public enum Quota 64 64 { 65 65 drzavna, privatna, stipendija 66 66 } 67 public enum major67 public enum Major 68 68 { 69 69 SIIS, PIT, KN, KI, IMB, IE, SSP, SEIS -
iknow-api/Migrations/20251030124902_new.Designer.cs
rf8af32b r3592476 13 13 { 14 14 [DbContext(typeof(AppDbContext))] 15 [Migration("202510 29131316_InitialCreate")]16 partial class InitialCreate15 [Migration("20251030124902_new")] 16 partial class @new 17 17 { 18 18 /// <inheritdoc /> … … 151 151 .HasColumnType("timestamp with time zone"); 152 152 153 b.Property<string>("EMBG") 154 .HasColumnType("text"); 155 153 156 b.Property<string>("Email") 154 157 .HasColumnType("text"); -
iknow-api/Migrations/20251030124902_new.cs
rf8af32b r3592476 8 8 { 9 9 /// <inheritdoc /> 10 public partial class InitialCreate: Migration10 public partial class @new : Migration 11 11 { 12 12 /// <inheritdoc /> … … 20 20 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 21 21 Name = table.Column<string>(type: "text", nullable: true), 22 EMBG = table.Column<string>(type: "text", nullable: true), 22 23 Surname = table.Column<string>(type: "text", nullable: true), 23 24 Index = table.Column<string>(type: "text", nullable: true), -
iknow-api/Migrations/AppDbContextModelSnapshot.cs
rf8af32b r3592476 148 148 .HasColumnType("timestamp with time zone"); 149 149 150 b.Property<string>("EMBG") 151 .HasColumnType("text"); 152 150 153 b.Property<string>("Email") 151 154 .HasColumnType("text"); -
iknow-api/Models/ContactInfo.cs
rf8af32b r3592476 13 13 14 14 public int UserId { get; set; } 15 public User User { get; set; }15 public User? User { get; set; } 16 16 } 17 17 } -
iknow-api/Models/EnrollmentInfo.cs
rf8af32b r3592476 3 3 namespace iknow_api.Models 4 4 { 5 public enum quota5 public enum Quota 6 6 { 7 7 drzavna, privatna, stipendija 8 8 } 9 public enum major9 public enum Major 10 10 { 11 11 SIIS, PIT, KN, KI, IMB, IE, SSP, SEIS … … 15 15 public int Id { get; set; } 16 16 public int enrollmentYear { get; set; } 17 public quota quota;18 public major major { get; set; }17 public Quota quota; 18 public Major major { get; set; } 19 19 public int UserId { get; set; } 20 public User User { get; set; }20 public User? User { get; set; } 21 21 } 22 22 } -
iknow-api/Services/Implementations/AuthService.cs
rf8af32b r3592476 41 41 Bday = DateTime.SpecifyKind(registerDto.Bday, DateTimeKind.Utc), 42 42 CreatedAt = DateTime.UtcNow, 43 Role = (Models.UserRole)registerDto.Role 43 Role = (Models.UserRole)registerDto.Role, 44 EMBG = registerDto.EMBG 44 45 }; 45 46 … … 60 61 UserId = userId, 61 62 enrollmentYear = registerDto.enrollmentYear, 62 quota = (Models. quota)registerDto.quotaType,63 major = (Models. major)registerDto.majorType63 quota = (Models.Quota)registerDto.quotaType, 64 major = (Models.Major)registerDto.majorType 64 65 }; 65 66 await _userRepository.AddEnrollmentAsync(enrollmentInfo); … … 101 102 { 102 103 int userid = await _refreshTokenRepository.GetUserId(token.token) ?? 0; 103 User user = await _userRepository.GetOnlyUserByIdAsync(userid);104 User ?user = await _userRepository.GetOnlyUserByIdAsync(userid); 104 105 105 106 var result = new AuthResultDto 106 107 { 107 AccessToken = CreateToken(user) 108 AccessToken = CreateToken(user) 108 109 }; 109 110
Note:
See TracChangeset
for help on using the changeset viewer.
