Skip to content

Commit bd236aa

Browse files
committed
refactor(core): rename CacheUtility -> BotEntityCache
[skip ci]
1 parent 010d9ed commit bd236aa

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

acidify-core/src/commonMain/kotlin/org/ntqqrev/acidify/AbstractBot.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import org.ntqqrev.acidify.common.SsoResponse
1616
import org.ntqqrev.acidify.common.UnsafeAcidifyApi
1717
import org.ntqqrev.acidify.entity.BotFriend
1818
import org.ntqqrev.acidify.entity.BotGroup
19-
import org.ntqqrev.acidify.entity.internal.CacheUtility
19+
import org.ntqqrev.acidify.entity.internal.BotEntityCache
2020
import org.ntqqrev.acidify.event.AcidifyEvent
2121
import org.ntqqrev.acidify.event.internal.KickSignal
2222
import org.ntqqrev.acidify.event.internal.MsgPushSignal
@@ -46,12 +46,12 @@ sealed class AbstractBot(
4646
).associateBy { it.cmd }
4747
internal lateinit var faceDetailMapMut: Map<String, BotFaceDetail>
4848
internal var eventCollectJob: Job? = null
49-
internal val friendCache = CacheUtility(
49+
internal val friendCache = BotEntityCache(
5050
bot = this,
5151
updateCache = { bot -> bot.fetchFriends().associateBy { it.uin } },
5252
entityFactory = ::BotFriend
5353
)
54-
internal val groupCache = CacheUtility(
54+
internal val groupCache = BotEntityCache(
5555
bot = this,
5656
updateCache = { bot -> bot.fetchGroups().associateBy { it.uin } },
5757
entityFactory = ::BotGroup

acidify-core/src/commonMain/kotlin/org/ntqqrev/acidify/entity/BotGroup.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.ntqqrev.acidify.entity
22

33
import org.ntqqrev.acidify.AbstractBot
4-
import org.ntqqrev.acidify.entity.internal.CacheUtility
4+
import org.ntqqrev.acidify.entity.internal.BotEntityCache
55
import org.ntqqrev.acidify.fetchGroupMembers
66
import org.ntqqrev.acidify.struct.BotGroupData
77
import org.ntqqrev.acidify.struct.GroupMemberRole
@@ -15,7 +15,7 @@ class BotGroup internal constructor(
1515
bot: AbstractBot,
1616
data: BotGroupData,
1717
) : BotEntity<BotGroupData>(bot, data) {
18-
private val memberCache = CacheUtility(
18+
private val memberCache = BotEntityCache(
1919
bot = bot,
2020
updateCache = { bot -> bot.fetchGroupMembers(uin).associateBy { it.uin } },
2121
entityFactory = { bot, data ->

acidify-core/src/commonMain/kotlin/org/ntqqrev/acidify/entity/internal/CacheUtility.kt renamed to acidify-core/src/commonMain/kotlin/org/ntqqrev/acidify/entity/internal/BotEntityCache.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import kotlinx.coroutines.sync.withLock
66
import org.ntqqrev.acidify.AbstractBot
77
import org.ntqqrev.acidify.entity.BotEntity
88

9-
internal class CacheUtility<K, V : BotEntity<D>, D>(
9+
internal class BotEntityCache<K, V : BotEntity<D>, D>(
1010
val bot: AbstractBot,
1111
private val updateCache: suspend (bot: AbstractBot) -> Map<K, D>,
1212
private val entityFactory: (bot: AbstractBot, data: D) -> V,

0 commit comments

Comments
 (0)