Skip to content

Commit

Permalink
Format code with ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
CristianMG committed Dec 10, 2022
1 parent 281db80 commit 00a837e
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ class TempAuthEntity(id: EntityID<UUID>) : UUIDEntity(id) {

fun toModel(): TempAuthModel =
TempAuthModel(id.toString(), expiration, user.toModel())

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import org.jetbrains.exposed.dao.UUIDEntity
import org.jetbrains.exposed.dao.UUIDEntityClass
import org.jetbrains.exposed.dao.id.EntityID
import org.jetbrains.exposed.dao.id.UUIDTable
import org.jetbrains.exposed.sql.booleanParam
import org.jetbrains.exposed.sql.javatime.date
import org.jetbrains.exposed.sql.javatime.timestamp
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class MailRepository(
private val mainGunMessagesApi: com.mailgun.api.v3.MailgunMessagesApi
) {


fun sendMessageConfirmMail(tempAuth:TempAuthModel){
mainGunMessagesApi.sendMessage(environmentVar.emailApi,
fun sendMessageConfirmMail(tempAuth: TempAuthModel) {
mainGunMessagesApi.sendMessage(
environmentVar.emailApi,
Message.builder()
.from("Test <${environmentVar.emailApi}>")
.to(tempAuth.user.email)
Expand All @@ -46,5 +46,4 @@ class MailRepository(
.build()
)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import com.example.data.entity.TempAuthEntity
import com.example.data.entity.UserEntity
import com.example.domain.model.UserModel
import com.example.server.environment.EnvironmentVar
import com.mailgun.model.message.Message
import org.jetbrains.exposed.sql.transactions.transaction
import java.time.Instant
import java.util.*
Expand All @@ -42,5 +41,4 @@ class TempAuthRepository(
transaction {
TempAuthEntity.findById(UUID.fromString(id))?.toModel()
}

}
2 changes: 1 addition & 1 deletion backend/src/main/kotlin/com/example/di/DatabaseModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ val databaseModule = module {
single<MailgunMessagesApi> {
val environmentVar = get<EnvironmentVar>()
MailgunClient.config(environmentVar.mailgunApi)
.createAsyncApi( com.mailgun.api.v3.MailgunMessagesApi::class.java)
.createAsyncApi(com.mailgun.api.v3.MailgunMessagesApi::class.java)
}
}
4 changes: 2 additions & 2 deletions backend/src/main/kotlin/com/example/di/RepositoryModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

package com.example.di

import com.example.data.repository.StorageRepository
import com.example.data.repository.UserRepository
import com.example.data.repository.MailRepository
import com.example.data.repository.StorageRepository
import com.example.data.repository.TempAuthRepository
import com.example.data.repository.UserRepository
import org.koin.core.module.dsl.singleOf
import org.koin.dsl.module

Expand Down
4 changes: 2 additions & 2 deletions backend/src/main/kotlin/com/example/domain/model/UserModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ data class UserModel(
val height: Int,
val birthday: LocalDate,
val country: String,
val role:RoleType,
val role: RoleType,
val refreshToken: String,
val expirationRefreshToken: Instant,
val isEmailValidated:Boolean,
val isEmailValidated: Boolean,
var profileImage: MultimediaModel?
) : Principal
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import com.example.data.repository.UserRepository
import com.example.domain.exception.EmailRegisteredException
import com.example.domain.model.GenderModel
import com.example.domain.model.SessionModel
import com.example.domain.model.TempAuthModel
import com.example.server.dto.request.RegisterRequestDTO
import com.example.server.environment.EnvironmentVar
import java.time.LocalDate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class EnvironmentVar {
val mailgunApi: String
get() = getString("MAIL_GUN_API")


/* This email will be used to send the confirmation email to the user. */
val emailApi: String
get() = getString("EMAIL_API")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class UserRoute(
}
}
}

}

companion object {
Expand Down
3 changes: 1 addition & 2 deletions backend/src/test/kotlin/com/example/utils/StringExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.example.utils
import java.util.regex.Matcher
import java.util.regex.Pattern


fun String.extractUrls(): List<String>? {
val containedUrls: MutableList<String> = ArrayList()
val urlRegex = "((https?|ftp|gopher|telnet|file):((//)|(\\\\))+[\\w\\d:#@%/;$()~_?\\+-=\\\\\\.&]*)"
Expand All @@ -18,4 +17,4 @@ fun String.extractUrls(): List<String>? {
)
}
return containedUrls
}
}

0 comments on commit 00a837e

Please sign in to comment.