it checkout masterMerge branch 'master' of https://gitnto.innovationcampus.ru/BROMO365/BROMO365-front
profile.
This commit is contained in:
commit
c5c3948181
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
@ -6,7 +6,7 @@
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="gradleJvm" value="jbr-21" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.example.nto_2024_client.register
|
||||
|
||||
import android.icu.text.Transliterator.Position
|
||||
import com.example.nto_2024_client.register.models.RegisterDTO
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.engine.cio.CIO
|
||||
@ -24,14 +25,15 @@ class RegisterNetwork {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun register(name:String,password:String,login:String):Result<Unit> = withContext(Dispatchers.IO){
|
||||
suspend fun register(name:String,password:String,login:String,position:String,):Result<Unit> = withContext(Dispatchers.IO){
|
||||
runCatching {
|
||||
val result = client.post(""){
|
||||
val result = client.post("http://10.6.66.81:8080/api/registration"){
|
||||
basicAuth(login,password)
|
||||
setBody(RegisterDTO(
|
||||
name = name,
|
||||
password = password,
|
||||
username = login
|
||||
username = login,
|
||||
position = position
|
||||
))
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.example.nto_2024_client.register.models
|
||||
|
||||
import android.icu.text.Transliterator.Position
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.Serializer
|
||||
@ -11,5 +12,7 @@ data class RegisterDTO (
|
||||
@SerialName("username")
|
||||
val username:String,
|
||||
@SerialName("password")
|
||||
val password:String
|
||||
|
||||
val password:String,
|
||||
@SerialName("position")
|
||||
val position: String
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user