info
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
const db = uniCloud.database();
|
||||
const _ =db.command;
|
||||
module.exports = {
|
||||
_before: function () { // 通用预处理器
|
||||
|
||||
},
|
||||
async getHistoryList(query) {
|
||||
try {
|
||||
let user_id = query.user_id;
|
||||
|
||||
let data = await db.collection("cms-articles-log")
|
||||
.get();
|
||||
|
||||
return {
|
||||
code: 200,
|
||||
data: data
|
||||
}
|
||||
} catch(e) {
|
||||
return {
|
||||
code: 500,
|
||||
msg: e.message
|
||||
}
|
||||
}
|
||||
},
|
||||
async getHistory(user_id) {
|
||||
try {
|
||||
let count = await db.collection("cms-articles-log").where({
|
||||
user_id: user_id
|
||||
}).count();
|
||||
|
||||
return {
|
||||
code: 200,
|
||||
total: count
|
||||
}
|
||||
} catch(e) {
|
||||
return {
|
||||
code: 500,
|
||||
msg: e.message
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "cms-article-log",
|
||||
"dependencies": {},
|
||||
"extensions": {
|
||||
"uni-cloud-jql": {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user