mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 19:04:23 +08:00
feat(kv-storage): 实现 KV 存储服务及管理界面
- 重构 KV 存储服务,遵循 SECTL-One-Stop SDK 规范 - 新增 KV 存储管理组件,支持增删改查操作 - 优化 setKV 接口,移除冗余参数 - 添加类型定义和列表查询选项
This commit is contained in:
@@ -60,9 +60,7 @@ class ScoreSyncService {
|
||||
}))
|
||||
|
||||
// 保存到云端
|
||||
await sectlKVStorage.setKV(DATA_KEYS.STUDENTS, scoreData, {
|
||||
is_json: true,
|
||||
})
|
||||
await sectlKVStorage.setKV(DATA_KEYS.STUDENTS, scoreData)
|
||||
|
||||
console.log("学生数据同步成功")
|
||||
} catch (error: any) {
|
||||
@@ -107,9 +105,7 @@ class ScoreSyncService {
|
||||
createdAt: event.created_at,
|
||||
}))
|
||||
|
||||
await sectlKVStorage.setKV(DATA_KEYS.EVENTS, scoreEvents, {
|
||||
is_json: true,
|
||||
})
|
||||
await sectlKVStorage.setKV(DATA_KEYS.EVENTS, scoreEvents)
|
||||
|
||||
console.log("积分事件同步成功")
|
||||
} catch (error: any) {
|
||||
@@ -146,9 +142,7 @@ class ScoreSyncService {
|
||||
}
|
||||
|
||||
try {
|
||||
await sectlKVStorage.setKV(DATA_KEYS.SETTINGS, settings, {
|
||||
is_json: true,
|
||||
})
|
||||
await sectlKVStorage.setKV(DATA_KEYS.SETTINGS, settings)
|
||||
|
||||
console.log("设置数据同步成功")
|
||||
} catch (error: any) {
|
||||
@@ -186,9 +180,7 @@ class ScoreSyncService {
|
||||
platform: "secscore",
|
||||
}
|
||||
|
||||
await sectlKVStorage.setKV(DATA_KEYS.SYNC_META, metadata, {
|
||||
is_json: true,
|
||||
})
|
||||
await sectlKVStorage.setKV(DATA_KEYS.SYNC_META, metadata)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user