Skip to content

Commit b3a3286

Browse files
authored
Merge pull request #329 from opexdev/dev
Release v1.0.1-beta.6
2 parents bbd0193 + 97d95f0 commit b3a3286

5 files changed

Lines changed: 30 additions & 33 deletions

File tree

api/api-core/src/main/kotlin/co/nilin/opex/api/core/inout/PriceChange.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import java.math.BigDecimal
44

55
data class PriceChange(
66
var symbol: String,
7+
var base: String? = null,
8+
var quote: String? = null,
79
val priceChange: BigDecimal = BigDecimal.ZERO,
810
val priceChangePercent: BigDecimal = BigDecimal.ZERO,
911
val weightedAvgPrice: BigDecimal = BigDecimal.ZERO,

api/api-ports/api-binance-rest/src/main/kotlin/co/nilin/opex/api/ports/binance/config/SecurityConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SecurityConfig(private val webClient: WebClient) {
2727
.pathMatchers("/v3/trades").permitAll()
2828
.pathMatchers("/v3/ticker/**").permitAll()
2929
.pathMatchers("/v3/exchangeInfo").permitAll()
30-
.pathMatchers("/v3/currencyInfo").permitAll()
30+
.pathMatchers("/v3/currencyInfo/**").permitAll()
3131
.pathMatchers("/v3/klines").permitAll()
3232
.pathMatchers("/socket").permitAll()
3333
.pathMatchers("/v1/landing/**").permitAll()

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

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ class MarketController(
105105
@GetMapping("/v3/ticker/{duration:24h|7d|1M}")
106106
suspend fun priceChange(
107107
@PathVariable duration: String,
108-
@RequestParam(required = false) symbol: String?
108+
@RequestParam(required = false) symbol: String?,
109+
@RequestParam(required = false) quote: String?
109110
): List<PriceChange> {
110111
val localSymbol = if (symbol.isNullOrEmpty())
111112
null
@@ -124,13 +125,19 @@ class MarketController(
124125

125126
symbolMapper.symbolToAliasMap().entries.forEach { map ->
126127
val price = result.find { it.symbol == map.key }
128+
val symbolBase = map.key.split("_")[0].uppercase()
129+
val symbolQuote = map.key.split("_")[1].uppercase()
130+
127131
if (price == null && symbol.isNullOrEmpty())
128-
result.add(PriceChange(map.value))
129-
else
132+
result.add(PriceChange(map.value, symbolBase, symbolQuote))
133+
else {
130134
price?.symbol = map.value
135+
price?.base = symbolBase
136+
price?.quote = symbolQuote
137+
}
131138
}
132139

133-
return result
140+
return if (quote.isNullOrEmpty()) result else result.filter { it.quote.equals(quote, true) }
134141
}
135142

136143
// Weight
@@ -194,6 +201,14 @@ class MarketController(
194201
}
195202
}
196203

204+
// Custom service
205+
@GetMapping("/v3/currencyInfo/quotes")
206+
suspend fun getQuoteCurrencies(): List<String> {
207+
return accountantProxy.getPairConfigs()
208+
.map { it.rightSideWalletSymbol }
209+
.distinct()
210+
}
211+
197212
// Weight(IP): 1
198213
@GetMapping("/v3/klines")
199214
suspend fun klines(

user-management/keycloak-gateway/src/main/kotlin/co/nilin/opex/auth/gateway/data/UserProfileInfo.kt

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@ package co.nilin.opex.auth.gateway.data
22

33
class UserProfileInfo {
44

5-
var firstNameEn: String? = null
6-
var lastNameEn: String? = null
75
var firstName: String? = null
86
var lastName: String? = null
9-
var birthdayJ: String? = null
10-
var birthdayG: String? = null
11-
var nationalId: String? = null
12-
var passportNumber: String? = null
7+
var birthday: String? = null
8+
var idNumber: String? = null
139
var mobile: String? = null
14-
var telephone: String? = null
1510
var postalCode: String? = null
1611
var residence: String? = null
1712
var nationality: String? = null
@@ -20,31 +15,21 @@ class UserProfileInfo {
2015
constructor()
2116

2217
constructor(
23-
firstNameEn: String?,
24-
lastNameEn: String?,
2518
firstName: String?,
2619
lastName: String?,
27-
birthdayG: String?,
28-
birthdayJ: String?,
29-
nationalID: String?,
30-
passport: String?,
20+
birthday: String?,
21+
idNumber: String?,
3122
phoneNumber: String?,
32-
homeNumber: String?,
3323
postalCode: String?,
3424
residence: String?,
3525
nationality: String?,
3626
address: String?
3727
) {
38-
this.firstNameEn = firstNameEn
39-
this.lastNameEn = lastNameEn
4028
this.firstName = firstName
4129
this.lastName = lastName
42-
this.birthdayJ = birthdayJ
43-
this.birthdayG = birthdayG
44-
this.nationalId = nationalID
45-
this.passportNumber = passport
30+
this.birthday = birthday
31+
this.idNumber = idNumber
4632
this.mobile = phoneNumber
47-
this.telephone = homeNumber
4833
this.postalCode = postalCode
4934
this.residence = residence
5035
this.nationality = nationality

user-management/keycloak-gateway/src/main/kotlin/co/nilin/opex/auth/gateway/extension/UserProfileResource.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,11 @@ class UserProfileResource(private val session: KeycloakSession) : RealmResourceP
6868
val user = session.users().getUserById(auth.getUserId(), opexRealm) ?: return ErrorHandler.userNotFound()
6969

7070
with(request) {
71-
firstNameEn?.let { user.setSingleAttribute("firstNameEn", it) }
72-
lastNameEn?.let { user.setSingleAttribute("lastNameEn", it) }
7371
firstName?.let { user.setSingleAttribute("firstName", it) }
7472
lastName?.let { user.setSingleAttribute("lastName", it) }
75-
birthdayJ?.let { user.setSingleAttribute("birthdayJ", it) }
76-
birthdayG?.let { user.setSingleAttribute("birthdayG", it) }
77-
nationalId?.let { user.setSingleAttribute("nationalId", it) }
78-
passportNumber?.let { user.setSingleAttribute("passportNumber", it) }
73+
birthday?.let { user.setSingleAttribute("birthday", it) }
74+
idNumber?.let { user.setSingleAttribute("idNumber", it) }
7975
mobile?.let { user.setSingleAttribute("mobile", it) }
80-
telephone?.let { user.setSingleAttribute("telephone", it) }
8176
postalCode?.let { user.setSingleAttribute("postalCode", it) }
8277
residence?.let { user.setSingleAttribute("residence", it) }
8378
nationality?.let { user.setSingleAttribute("nationality", it) }

0 commit comments

Comments
 (0)