Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Juno committed Mar 10, 2023
1 parent d4c24ec commit 9b8ce99
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ data class ApplicationDto(
) {

companion object {
fun from(applicationEntity: ApplicationEntity): ApplicationDto {
return ApplicationDto(applicationEntity.id, applicationEntity.name)
fun from(entity: ApplicationEntity): ApplicationDto {
return ApplicationDto(entity.id, entity.name)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ data class CustomerDto(
val name: String
) {
companion object {
fun from(customerEntity: CustomerEntity): CustomerDto {
return CustomerDto(
id = requireNotNull(customerEntity.id),
name = customerEntity.name
)
fun from(entity: CustomerEntity): CustomerDto {
return CustomerDto(id = entity.id, name = entity.name)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ data class EnvironmentDto(
) {

companion object {
fun from(environmentEntity: EnvironmentEntity): EnvironmentDto {
return EnvironmentDto(environmentEntity.id, environmentEntity.name)
fun from(entity: EnvironmentEntity): EnvironmentDto {
return EnvironmentDto(entity.id, entity.name)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ data class GithubMappingDto(
val url: String
) {
companion object {
fun from(githubMappingEntity: GithubMappingEntity): GithubMappingDto {
return githubMappingEntity.run {
GithubMappingDto(checkNotNull(id), customerId, basePackage, url)
}
fun from(entity: GithubMappingEntity): GithubMappingDto {
return GithubMappingDto(entity.id, entity.customerId, entity.basePackage, entity.url)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ data class MethodInvocationDto(
) {

companion object {
fun from(methodInvocationEntity: MethodInvocationEntity): MethodInvocationDto {
return MethodInvocationDto(
methodInvocationEntity.signature,
methodInvocationEntity.invokedAtMillis
)
fun from(entity: MethodInvocationEntity): MethodInvocationDto {
return MethodInvocationDto(entity.signature, entity.invokedAtMillis)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.navercorp.scavenger.dto

import com.navercorp.scavenger.entity.ApplicationRefEntity
import com.navercorp.scavenger.entity.EnvironmentRefEntity
import com.navercorp.scavenger.entity.SnapshotEntity
import java.time.Instant

Expand All @@ -17,19 +15,17 @@ data class SnapshotDto(
) {

companion object {
fun from(snapshotEntity: SnapshotEntity): SnapshotDto {
return snapshotEntity.run {
SnapshotDto(
checkNotNull(id),
customerId,
name,
createdAt,
applications.map { obj: ApplicationRefEntity -> obj.applicationId },
environments.map { obj: EnvironmentRefEntity -> obj.environmentId },
filterInvokedAtMillis,
packages
)
}
fun from(entity: SnapshotEntity): SnapshotDto {
return SnapshotDto(
entity.id,
entity.customerId,
entity.name,
entity.createdAt,
entity.applications.map { it.applicationId },
entity.environments.map { it.environmentId },
entity.filterInvokedAtMillis,
entity.packages
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class SqlRayQueryLogEntryCreator : QueryLogEntryCreator {
writeDataSourceName: Boolean,
writeConnectionId: Boolean
): String {
val list = listOf<String>()
list.iterator()
val result = StringBuilder()
for (queryInfo in queryInfoList) {
val query = queryInfo.query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ data class JvmEntity(
@Column("uuid")
val uuid: String,

@Column("hostname")
val hostname: String,

@Column("codeBaseFingerprint")
val codeBaseFingerprint: String?,

Expand All @@ -32,6 +35,4 @@ data class JvmEntity(
@Column("publishedAt")
val publishedAt: Instant,

@Column("hostname")
val hostname: String,
)

0 comments on commit 9b8ce99

Please sign in to comment.