feat: base panel

This commit is contained in:
bietiaop 2024-07-12 02:43:32 +08:00
parent cbef7478c2
commit ac0c3d0d6c
12 changed files with 361 additions and 149 deletions

View file

@ -4,13 +4,14 @@ import { checkFolderExistAndCreate } from '../utils/file.js';
import { dataPath } from './path.js';
const dbPath = {
gacha: 'gacha',
panel: 'panel',
};
/**
*
* @param {string} dbName
* @param {string} dbFile
* @returns {object}
* @returns {object | Array<object> | null}
*/
export function getDB(dbName, dbFile) {
const db = dbPath[dbName];
@ -57,3 +58,19 @@ export function getGachaLog(uid) {
export function saveGachaLog(uid, data) {
setDB('gacha', uid, data);
}
/**
* @param {string} uid
* @returns {Array<object>}
*/
export function getPanelData(uid) {
return getDB('panel', uid) || [];
}
/**
* @param {string} uid
* @param {Array<object>} data
*/
export function savePanelData(uid, data) {
setDB('panel', uid, data);
}