This repository has been archived by the owner on Jan 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from fictadvisor/registration
Login and Registration
- Loading branch information
Showing
62 changed files
with
2,829 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/fictadvisor/android/data/dto/BaseResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
import okhttp3.ResponseBody | ||
|
||
sealed class BaseResponse<out T> { | ||
data class Success<out T>(val data: T? = null) : BaseResponse<T>() | ||
data class Loading(val nothing: Nothing? = null) : BaseResponse<Nothing>() | ||
data class Error(val error: ErrorResponse? = null) : BaseResponse<Nothing>() | ||
} |
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/fictadvisor/android/data/dto/CheckRegisterTelegramResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class CheckRegisterTelegramResponse( | ||
val isRegistered: Boolean | ||
) |
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/fictadvisor/android/data/dto/CheckResetTokenResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class CheckResetTokenResponse( | ||
val isAvailable: Boolean | ||
) |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/fictadvisor/android/data/dto/ErrorResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
import java.sql.Timestamp | ||
|
||
data class ErrorResponse( | ||
val status: Long, | ||
val timestamp: String, | ||
val error: String, | ||
val message: String, | ||
) |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/com/fictadvisor/android/data/dto/ExtendedGroupResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class ExtendedGroupResponse( | ||
val id: String, | ||
val code: String, | ||
val state: String, | ||
val role: String, | ||
) |
2 changes: 1 addition & 1 deletion
2
...android/data/dto/ForgotPasswordRequest.kt → ...sor/android/data/dto/ForgotPasswordDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class ForgotPasswordRequest( | ||
data class ForgotPasswordDTO( | ||
val email: String, | ||
) |
3 changes: 3 additions & 0 deletions
3
app/src/main/java/com/fictadvisor/android/data/dto/GetAllGroupsResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class GetAllGroupsResponse(val groups: List<GroupDTO>) |
3 changes: 3 additions & 0 deletions
3
app/src/main/java/com/fictadvisor/android/data/dto/GroupDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class GroupDTO(val id: String, val code: String) |
5 changes: 2 additions & 3 deletions
5
.../com/fictadvisor/android/data/dto/User.kt → ...tadvisor/android/data/dto/LoginRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class User( | ||
data class LoginRequest ( | ||
val username: String, | ||
val email: String, | ||
val password: String | ||
val password: String, | ||
) |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/fictadvisor/android/data/dto/OrdinaryStudentResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class OrdinaryStudentResponse( | ||
val firstName: String, | ||
val middleName: String, | ||
val lastName: String, | ||
val id: String, | ||
val username: String, | ||
val email: String, | ||
val avatar: String, | ||
val telegramId: Long, | ||
val group: ExtendedGroupResponse, | ||
) |
2 changes: 1 addition & 1 deletion
2
...d/data/dto/RegistrationTelegramRequest.kt → ...r/android/data/dto/RegisterTelegramDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class RegistrationTelegramRequest( | ||
data class RegisterTelegramDTO( | ||
val token: String, | ||
val telegramId: Long | ||
) |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/fictadvisor/android/data/dto/RegistrationDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class RegistrationDTO( | ||
val student: StudentDTO, | ||
val user: UserDTO, | ||
val telegram: TelegramDTO? = null // not required | ||
) |
7 changes: 0 additions & 7 deletions
7
app/src/main/java/com/fictadvisor/android/data/dto/RegistrationRequest.kt
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/fictadvisor/android/data/dto/ResetPasswordDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class ResetPasswordDTO( | ||
val password: String | ||
) |
8 changes: 6 additions & 2 deletions
8
...m/fictadvisor/android/data/dto/Student.kt → ...ictadvisor/android/data/dto/StudentDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class Student( | ||
data class StudentDTO( | ||
val groupId: String, | ||
val firstName: String, | ||
val middleName: String, | ||
val lastName: String, | ||
val isCaptain: Boolean, | ||
) | ||
){ | ||
fun isEmpty(): Boolean { | ||
return groupId.isEmpty() || firstName.isEmpty() || middleName.isEmpty() || lastName.isEmpty() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/fictadvisor/android/data/dto/TokensDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class TokensDTO ( | ||
val accessToken: String, | ||
val refreshToken: String | ||
) |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/fictadvisor/android/data/dto/UpdatePasswordDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class UpdatePasswordDTO ( | ||
val oldPassword: String, | ||
val newPassword: String | ||
) |
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/fictadvisor/android/data/dto/UserDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class UserDTO( | ||
val username: String, | ||
val email: String, | ||
val password: String | ||
) { | ||
fun isEmpty(): Boolean { | ||
return username.isEmpty() || email.isEmpty() || password.isEmpty() | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...or/android/data/dto/VerifyEmailRequest.kt → .../android/data/dto/VerificationEmailDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.fictadvisor.android.data.dto | ||
|
||
data class VerifyEmailRequest( | ||
data class VerificationEmailDTO( | ||
val email: String | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.