This commit is contained in:
2026-02-06 17:53:17 +09:00
parent 0b855188a9
commit aa1f3817bb
9 changed files with 274 additions and 316 deletions
+24 -8
View File
@@ -147,13 +147,13 @@ object KisTradeService {
// RankingType.BEFORE -> {
// parameter("FID_MKOP_CLS_CODE", type.sortCode)
// }
RankingType.FOREIGNER_BUY, RankingType.INSTITUTION_BUY -> {
parameter("FID_BLNG_CLS_CODE", type.sortCode) // 순매수용
parameter("FID_INPUT_CNT_1", "5") // 5일 누적 등 조정 가능
}
RankingType.PER_RANK, RankingType.PBR_RANK -> {
parameter("FID_FINCL_CLS_CODE", type.sortCode) // 재무비율용
}
// RankingType.FOREIGNER_BUY, RankingType.INSTITUTION_BUY -> {
// parameter("FID_BLNG_CLS_CODE", type.sortCode) // 순매수용
// parameter("FID_INPUT_CNT_1", "5") // 5일 누적 등 조정 가능
// }
// RankingType.PER_RANK, RankingType.PBR_RANK -> {
// parameter("FID_FINCL_CLS_CODE", type.sortCode) // 재무비율용
// }
RankingType.AFTER_HOURS_VOLUME -> {
parameter("FID_TIME_OUT_CLS_CODE", "1") // 시간외 구분
}
@@ -188,8 +188,24 @@ object KisTradeService {
}
}
val body = response.body<RankingResponse>()
if (listOf(
RankingType.VOLUME_POWER,
RankingType.EXPECTED_RISE,
RankingType.COMPANY_TRADE
).contains(type)) {
println("${type.name} , ${body}" )
}
if (body.rt_cd == "0") Result.success(body.list) else Result.failure(Exception(body.msg1))
} catch (e: Exception) { Result.failure(e) }
} catch (e: Exception) {
if (listOf(
RankingType.VOLUME_POWER,
RankingType.EXPECTED_RISE,
RankingType.COMPANY_TRADE
).contains(type)) {
println("${type.name} , ${e.message}" )
}
Result.failure(e)
}
}
/**