diff --git a/controllers/grouping.js b/controllers/grouping.js index 28019b4..1b0b1e7 100644 --- a/controllers/grouping.js +++ b/controllers/grouping.js @@ -1,9 +1,12 @@ //添加分组 +//groupname:分组名 fuid :父分组 +// 父分组=0时是一级分组 var groupadd = async (ctx, next) => { await dbs.add("group", { groupname: ctx.query.groupname, fuid: ctx.query.fuid == null ? '0' : ctx.query.fuid }) ctx.body = "添加成功" } // 删除分组 +// num_key 操作使用的id var groupdel = async (ctx, next) => { await dbs.remove("group", { num_key: parseInt(ctx.query.key) }) ctx.body = "删除成功" diff --git a/controllers/label.js b/controllers/label.js index 59ae797..3771281 100644 --- a/controllers/label.js +++ b/controllers/label.js @@ -1,6 +1,17 @@ // 获取标签 var getlabel = async (ctx,next)=>{ - await IDBOpenDBRequest.find('label').then((res)=>{ - + await dbs.find("label").then((res) => { + console.log(res) }) -} \ No newline at end of file + +} + +//添加标签 +var addlabel=async(ctx,next)=>{ + await dbs.add("label", {labelname:ctx.query.labelname}) + ctx.body = "添加成功" +} +module.exports = { + 'GET /addlabel': addlabel, + 'GET /getlabel': getlabel, +}; \ No newline at end of file