forked from Cookies_Github_mirror/AquaDX
[F] Data import fix (#153)
This commit is contained in:
@@ -17,6 +17,7 @@ import kotlin.reflect.full.declaredMemberProperties
|
||||
import icu.samnyan.aqua.net.Fedy
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.context.annotation.Lazy
|
||||
import org.springframework.beans.factory.ObjectProvider
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
@@ -40,7 +41,7 @@ class Maimai2ServletController(
|
||||
val net: Maimai2,
|
||||
): MeowApi(serialize = { _, resp -> if (resp is String) resp else resp.toJson() }) {
|
||||
|
||||
@Autowired(required = false) @Lazy var fedy: Fedy? = null
|
||||
@Autowired @Lazy lateinit var fedy: Fedy
|
||||
|
||||
companion object {
|
||||
private val log = logger()
|
||||
@@ -94,9 +95,7 @@ class Maimai2ServletController(
|
||||
val ctx = RequestContext(req, data.mut)
|
||||
serialize(api, handlers[api]!!(ctx) ?: noop).also {
|
||||
log.info("$token : $api > ${it.truncate(500)}")
|
||||
if (api == "UpsertUserAllApi") {
|
||||
fedy?.onUpserted("mai2", data["userId"])
|
||||
}
|
||||
if (api == "UpsertUserAllApi") { fedy.onUpserted("mai2", data["userId"]) }
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
|
||||
Reference in New Issue
Block a user