添加README
This commit is contained in:
@@ -4,7 +4,7 @@ import re
|
||||
class CourseList:
|
||||
def __init__(self, db_file='db/data/course/course_list.json'):
|
||||
self.db_file = db_file
|
||||
with open(self.db_file, 'r') as f:
|
||||
with open(self.db_file, 'r', encoding='utf-8') as f:
|
||||
self.db = json.load(f)
|
||||
|
||||
def add_course(self, course_id, course_name, course_create_date, course_update_data, course_img_path):
|
||||
@@ -17,7 +17,7 @@ class CourseList:
|
||||
self.db[course_id]['course_update_data'] = course_update_data
|
||||
self.db[course_id]['course_img_path'] = course_img_path
|
||||
|
||||
with open(self.db_file, 'w') as f:
|
||||
with open(self.db_file, 'w', encoding='utf-8') as f:
|
||||
json.dump(self.db, f, indent=4)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class CourseList:
|
||||
self.db[course_id]['course_update_data'] = course_update_data
|
||||
self.db[course_id]['course_img_path'] = course_img_path
|
||||
|
||||
with open(self.db_file, 'w') as f:
|
||||
with open(self.db_file, 'w', encoding='utf-8') as f:
|
||||
json.dump(self.db, f, indent=4)
|
||||
|
||||
def delete_course(self, course_id):
|
||||
|
||||
Reference in New Issue
Block a user