Skip to content

Commit

Permalink
부정한 접근 감지 알고리즘
Browse files Browse the repository at this point in the history
  • Loading branch information
GulSauce committed Aug 14, 2024
1 parent 3e76763 commit c3b6ffb
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.sbl.sulmun2yong.global.fingerprint

import com.fingerprint.api.FingerprintApi
import com.fingerprint.model.BotdDetectionResult
import com.fingerprint.model.EventResponse
import com.fingerprint.model.ProductsResponse
import com.fingerprint.model.Response
import com.fingerprint.model.ResponseVisits
import com.fingerprint.sdk.ApiClient
Expand Down Expand Up @@ -30,11 +33,17 @@ class FingerprintApi(

private fun getVisits(visitorId: String): MutableList<ResponseVisits>? {
val response: Response = api.getVisits(visitorId, null, null, 1, null, null)
val product = getEvent(response.visits[0].requestId)
if (product.tampering.data.result == true ||
product.botd.data.bot.result !== BotdDetectionResult.ResultEnum.NOT_DETECTED
) {
throw Exception("부정한 접근이 감지되었습니다")
}
return response.visits
}

// fun getEvent(requestId: String) {
// val response: EventResponse = api.getEvent(requestId)
// println(response.products.toString())
// }
fun getEvent(requestId: String): ProductsResponse {
val response: EventResponse = api.getEvent(requestId)
return response.products
}
}

0 comments on commit c3b6ffb

Please sign in to comment.