Browse Source

终于能回家了

NandHyf 1 year ago
parent
commit
3d436fd8e7
2 changed files with 55 additions and 11 deletions
  1. 24 11
      WithSqlite.py
  2. 31 0
      dev_config.toml

+ 24 - 11
WithSqlite.py

@@ -56,23 +56,28 @@ def Secondary_response():
     pass
 
 
-class Sqls():
-    objType = ""
-    
-    def select():
-        # DISTINCT
-        sqls = "SELECT FROM {table}".format(table=tableName)
+class objBoard():
+    def __init__(self, boardName) -> None:
+        self.name = boardName
 
-    def add():
-        pass
+    def select_board(self, aliveOnly=True):# 不太对劲, 应该在IsExist的时候就已经可以得到结果了
+        if aliveOnly == False:
+            sqls = "SELECT name FROM {boardName}".format(boardName=self.name)
+        elif aliveOnly == True:
+            sqls = "SELECT name FROM {boardName} WHERE status='alive';".format(boardName=self.name)
+
+        return sqls
 
-    def delete():
+    def add_board():
+        sqls = "INSERT INTO"
+
+    def delete_board():
         pass
 
-    def edit():
+    def edit_board():
         pass
 
-    def move():
+    def move_board():
         pass
 
     def bp():
@@ -82,6 +87,14 @@ class Sqls():
         pass
 
 
+class objClass():
+    pass
+
+
+class objevent():
+    pass
+
+
 # Regular Start
 def Regular(dbPath, exec_commands):
     

+ 31 - 0
dev_config.toml

@@ -1,4 +1,35 @@
 # ----- init Configuration -----
+[Board]
+# VALUES(?, ?, ?, ...)
+c1_p-k = ""
+c2 = "name"
+c1 = "status" # alive/deleted
+
+[Class]
+# VALUES(?, ?, ?, ...)
+c1_p-k = ""
+c2 = "name"
+c3 = "usingBoard"
+c4 = "status" # alive/deleted
+
+[Event]
+# VALUES(?, ?, ?, ...)
+c1_p-k = ""
+c2 = "name"
+c3 = "dscrp"
+c4 = "creator"
+c5 = "createdTime"
+c6 = "classCreated"
+c7 = "classCurrent"
+c8 = "status" # alive/deleted
+
+[Stucked]
+c1_pk = ""
+c2 = "boardId"
+c3 = "eventId"
+c4 = "stuckedTime"
+c5 = "solvedTime"
+c6 = "status" # alive/deleted
 
 # ----- App Configuration -----
 DBType = "sqlite3"