Command = ['add', 'board', ''] tablePath = Command[2].uper() is_exist(tablePath, name=None) if name SELECT * FROM {tablePath} WHERE name={name} add event EV1 to KB4/CL2 add event EV1 to KB4 / CL2 [dev.init] CREATE TABLE Board(id INTEGER PRIMARY KEY AUTOINCREMENT, name, status) CREATE TABLE Class(id INTEGER PRIMARY KEY AUTOINCREMENT, name, usingBoard, status) CREATE TABLE Event(id INTEGER PRIMARY KEY AUTOINCREMENT, name, dscrp, creator, createdTime, classCreated, classCurrent, status) CREATE TABLE Stucked(id INTEGER PRIMARY KEY AUTOINCREMENT, boardId, eventId, stuckedTime, solvedTime, status) [type == board] /, /KB, /KB/CL, KB/CL/EV: add board -> ok [type == class] /: add class -> err (功能上可行但逻辑上不允许) /: add class to -> ok /KB: add class -> ok /KB, /KB/CL, /KB/CL/EV: add class to KB2 ie -> ok KB2 ie false, add KB2, add CL -> ok sec: KB2 not ie, create/cancel?[y/n] [type == event] /: add event -> err /: add event to -> ok sec: no class, class in KB, choose, input() /: add event to / -> ok /KB: add event -> ok /KB: add event to -> ok KB2 ie, sec: no class, class in KB, choose, input() -> ok KB2 ne, add KB2, sec: no class, class in KB, choose, input() -> ok # maybe a safe/strick mode = true in config.toml /KB: add event to -> ok /KB: add event to / -> ok /KB: add event to / -> ok /KB: add event to //, // -> err /KB/CL: add event -> ok /KB/CL: add event to CL2 ie in KB, -> ok CL2 ne in KB, -> err /KB/CL/EV: add event -> err /KB/CL/EV: add event to -> okz /KB/CL/EV: add event to -> ok /KB/CL/EV: add event to -> ok /KB/CL/EV: add event to whereis CL2 /KB/CL/EV: add event to / /: any thing /KB: KB -> ok CL -> ok EV -> ok /KB/CL: KB -> ok CL -> ok EV -> ok /KB/CL/EV: KB -> ok CL -> ok EV -> ok 等等, 后端的add不需要检查这些啊?! add board , , ,