Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import java.math.BigDecimal

data class PriceChange(
var symbol: String,
var base: String? = null,
var quote: String? = null,
val priceChange: BigDecimal = BigDecimal.ZERO,
val priceChangePercent: BigDecimal = BigDecimal.ZERO,
val weightedAvgPrice: BigDecimal = BigDecimal.ZERO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class SecurityConfig(private val webClient: WebClient) {
.pathMatchers("/v3/trades").permitAll()
.pathMatchers("/v3/ticker/**").permitAll()
.pathMatchers("/v3/exchangeInfo").permitAll()
.pathMatchers("/v3/currencyInfo").permitAll()
.pathMatchers("/v3/currencyInfo/**").permitAll()
.pathMatchers("/v3/klines").permitAll()
.pathMatchers("/socket").permitAll()
.pathMatchers("/v1/landing/**").permitAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ class MarketController(
@GetMapping("/v3/ticker/{duration:24h|7d|1M}")
suspend fun priceChange(
@PathVariable duration: String,
@RequestParam(required = false) symbol: String?
@RequestParam(required = false) symbol: String?,
@RequestParam(required = false) quote: String?
): List<PriceChange> {
val localSymbol = if (symbol.isNullOrEmpty())
null
Expand All @@ -124,13 +125,19 @@ class MarketController(

symbolMapper.symbolToAliasMap().entries.forEach { map ->
val price = result.find { it.symbol == map.key }
val symbolBase = map.key.split("_")[0].uppercase()
val symbolQuote = map.key.split("_")[1].uppercase()

if (price == null && symbol.isNullOrEmpty())
result.add(PriceChange(map.value))
else
result.add(PriceChange(map.value, symbolBase, symbolQuote))
else {
price?.symbol = map.value
price?.base = symbolBase
price?.quote = symbolQuote
}
}

return result
return if (quote.isNullOrEmpty()) result else result.filter { it.quote.equals(quote, true) }
}

// Weight
Expand Down Expand Up @@ -194,6 +201,14 @@ class MarketController(
}
}

// Custom service
@GetMapping("/v3/currencyInfo/quotes")
suspend fun getQuoteCurrencies(): List<String> {
return accountantProxy.getPairConfigs()
.map { it.rightSideWalletSymbol }
.distinct()
}

// Weight(IP): 1
@GetMapping("/v3/klines")
suspend fun klines(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@ package co.nilin.opex.auth.gateway.data

class UserProfileInfo {

var firstNameEn: String? = null
var lastNameEn: String? = null
var firstName: String? = null
var lastName: String? = null
var birthdayJ: String? = null
var birthdayG: String? = null
var nationalId: String? = null
var passportNumber: String? = null
var birthday: String? = null
var idNumber: String? = null
var mobile: String? = null
var telephone: String? = null
var postalCode: String? = null
var residence: String? = null
var nationality: String? = null
Expand All @@ -20,31 +15,21 @@ class UserProfileInfo {
constructor()

constructor(
firstNameEn: String?,
lastNameEn: String?,
firstName: String?,
lastName: String?,
birthdayG: String?,
birthdayJ: String?,
nationalID: String?,
passport: String?,
birthday: String?,
idNumber: String?,
phoneNumber: String?,
homeNumber: String?,
postalCode: String?,
residence: String?,
nationality: String?,
address: String?
) {
this.firstNameEn = firstNameEn
this.lastNameEn = lastNameEn
this.firstName = firstName
this.lastName = lastName
this.birthdayJ = birthdayJ
this.birthdayG = birthdayG
this.nationalId = nationalID
this.passportNumber = passport
this.birthday = birthday
this.idNumber = idNumber
this.mobile = phoneNumber
this.telephone = homeNumber
this.postalCode = postalCode
this.residence = residence
this.nationality = nationality
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,11 @@ class UserProfileResource(private val session: KeycloakSession) : RealmResourceP
val user = session.users().getUserById(auth.getUserId(), opexRealm) ?: return ErrorHandler.userNotFound()

with(request) {
firstNameEn?.let { user.setSingleAttribute("firstNameEn", it) }
lastNameEn?.let { user.setSingleAttribute("lastNameEn", it) }
firstName?.let { user.setSingleAttribute("firstName", it) }
lastName?.let { user.setSingleAttribute("lastName", it) }
birthdayJ?.let { user.setSingleAttribute("birthdayJ", it) }
birthdayG?.let { user.setSingleAttribute("birthdayG", it) }
nationalId?.let { user.setSingleAttribute("nationalId", it) }
passportNumber?.let { user.setSingleAttribute("passportNumber", it) }
birthday?.let { user.setSingleAttribute("birthday", it) }
idNumber?.let { user.setSingleAttribute("idNumber", it) }
mobile?.let { user.setSingleAttribute("mobile", it) }
telephone?.let { user.setSingleAttribute("telephone", it) }
postalCode?.let { user.setSingleAttribute("postalCode", it) }
residence?.let { user.setSingleAttribute("residence", it) }
nationality?.let { user.setSingleAttribute("nationality", it) }
Expand Down