Skip to content

Commit 7361b28

Browse files
authored
Update assignAddress api response
1 parent 08656b2 commit 7361b28

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
package co.nilin.opex.api.core.inout
22

3+
import java.time.LocalDateTime
4+
35
data class AddressType(val id: Long, val type: String, val addressRegex: String, val memoRegex: String?)
46
data class Chain(val name: String, val addressTypes: List<AddressType>)
57
data class AssignedAddress(
68
val uuid: String,
79
val address: String,
810
val memo: String?,
911
val type: AddressType,
10-
val chains: MutableList<Chain>
12+
val chains: MutableList<Chain>,
13+
var expTime: LocalDateTime? = null,
14+
var assignedDate: LocalDateTime? = null,
1115
)

api/api-ports/api-opex-rest/src/main/kotlin/co/nilin/opex/api/ports/opex/controller/WalletController.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import co.nilin.opex.api.ports.opex.util.tokenValue
1111
import co.nilin.opex.common.OpexError
1212
import org.springframework.security.core.annotation.CurrentSecurityContext
1313
import org.springframework.security.core.context.SecurityContext
14-
import org.springframework.web.bind.annotation.*
14+
import org.springframework.web.bind.annotation.GetMapping
15+
import org.springframework.web.bind.annotation.RequestMapping
16+
import org.springframework.web.bind.annotation.RequestParam
17+
import org.springframework.web.bind.annotation.RestController
1518

1619
@RestController("walletOpexController")
1720
@RequestMapping("/opex/v1/wallet")
@@ -50,8 +53,8 @@ class WalletController(
5053

5154
@GetMapping("/deposit/address")
5255
fun assignAddress(
53-
@RequestParam currency: String,
54-
@RequestParam gatewayUuid: String,
56+
@RequestParam currency: String,
57+
@RequestParam gatewayUuid: String,
5558
@CurrentSecurityContext securityContext: SecurityContext
5659
): AssignAddressResponse {
5760

@@ -64,6 +67,6 @@ class WalletController(
6467
)
6568
val address = response?.addresses
6669
if (address.isNullOrEmpty()) throw OpexError.InternalServerError.exception()
67-
return AssignAddressResponse(address[0].address, currency)
70+
return AssignAddressResponse(address[0].address, currency, address[0].expTime, address[0].assignedDate)
6871
}
6972
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package co.nilin.opex.api.ports.opex.data
22

3+
import java.time.LocalDateTime
4+
35
data class AssignAddressResponse(
46
val address: String,
5-
val coin: String
7+
val currency: String,
8+
var expTime: LocalDateTime? = null,
9+
var assignedDate: LocalDateTime? = null,
610
)

0 commit comments

Comments
 (0)