|
@@ -107,6 +107,9 @@ class Email_tag(BaseModel):
|
|
|
email:str
|
|
|
tags:str
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@app.post("/get_courses_by_cid")
|
|
|
async def get_courses(cids:List[int]):
|
|
|
db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/openTalk?charset=utf8mb4')
|
|
@@ -169,6 +172,15 @@ async def delete_course(course_id:int):
|
|
|
db.query(sqls)
|
|
|
return {'msg':'新增成功'}
|
|
|
|
|
|
+@app.post("/update_course")
|
|
|
+async def update_course(cid:int,tags:List[int])
|
|
|
+ db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/openTalk?charset=utf8mb4')
|
|
|
+ sqls = 'DELETE FROM course_tag WHERE tag_id = '+str(tag_id)
|
|
|
+ db.query(sqls)
|
|
|
+ for tag in tags:
|
|
|
+ course_tag_table.insert({'course_id':course.id,'tag_id':tag})
|
|
|
+ return {'msg':'ok'}
|
|
|
+
|
|
|
@app.get("/course_click/{course_id}")
|
|
|
async def delete_course(course_id:int):
|
|
|
db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/openTalk?charset=utf8mb4')
|