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>
|
<GradleProjectSettings>
|
||||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
<option name="gradleJvm" value="jbr-21" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.example.nto_2024_client.register
|
package com.example.nto_2024_client.register
|
||||||
|
|
||||||
|
import android.icu.text.Transliterator.Position
|
||||||
import com.example.nto_2024_client.register.models.RegisterDTO
|
import com.example.nto_2024_client.register.models.RegisterDTO
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.engine.cio.CIO
|
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 {
|
runCatching {
|
||||||
val result = client.post(""){
|
val result = client.post("http://10.6.66.81:8080/api/registration"){
|
||||||
basicAuth(login,password)
|
basicAuth(login,password)
|
||||||
setBody(RegisterDTO(
|
setBody(RegisterDTO(
|
||||||
name = name,
|
name = name,
|
||||||
password = password,
|
password = password,
|
||||||
username = login
|
username = login,
|
||||||
|
position = position
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.example.nto_2024_client.register.models
|
package com.example.nto_2024_client.register.models
|
||||||
|
|
||||||
|
import android.icu.text.Transliterator.Position
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.Serializer
|
import kotlinx.serialization.Serializer
|
||||||
@ -11,5 +12,7 @@ data class RegisterDTO (
|
|||||||
@SerialName("username")
|
@SerialName("username")
|
||||||
val username:String,
|
val username:String,
|
||||||
@SerialName("password")
|
@SerialName("password")
|
||||||
val password:String
|
val password:String,
|
||||||
|
@SerialName("position")
|
||||||
|
val position: String
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user