feat: 我的、设置、打印指南页面开发完成
This commit is contained in:
@@ -29,6 +29,8 @@ exports.main = async (event) => {
|
||||
return await handleRemove(userId, event);
|
||||
case 'list':
|
||||
return await handleList(userId, event);
|
||||
case 'count':
|
||||
return await handleCount(userId);
|
||||
case 'check':
|
||||
return await handleCheck(userId, event);
|
||||
case 'batchCheck':
|
||||
@@ -153,6 +155,12 @@ async function handleList(userId, event) {
|
||||
return { code: 0, data: result };
|
||||
}
|
||||
|
||||
async function handleCount(userId) {
|
||||
const collection = db.collection('favorites');
|
||||
const res = await collection.where({ userId }).count();
|
||||
return { code: 0, data: { count: res.total || 0 } };
|
||||
}
|
||||
|
||||
async function handleCheck(userId, event) {
|
||||
const { worksheetId } = event;
|
||||
if (!worksheetId) return { code: -1, message: 'worksheetId 不能为空' };
|
||||
|
||||
Reference in New Issue
Block a user