[Enhance] [Refactor] Add API about characters

- Add API endpoints about characters
- Some small changes in refactoring
This commit is contained in:
Lost-MSth
2023-03-22 22:27:21 +08:00
parent 8d856696ca
commit 1672d337ff
45 changed files with 575 additions and 375 deletions

View File

@@ -96,7 +96,7 @@ class Course:
'''select * from course where course_id = ?''', (self.course_id,))
x = self.c.fetchone()
if x is None:
raise NoData('The course `%s` is not found.' % self.course_id)
raise NoData(f'The course `{self.course_id}` is not found.')
return self.from_list(x)
def select_course_chart(self) -> None:
@@ -151,7 +151,8 @@ class Course:
class UserCourse(Course):
'''
用户课题类\
用户课题类
parameter: `user` - `User`类或子类的实例
'''
@@ -200,7 +201,8 @@ class UserCourse(Course):
class UserCourseList:
'''
用户课题列表类\
用户课题列表类
parameter: `user` - `User`类或子类的实例
'''
@@ -237,8 +239,9 @@ class UserCourseList:
class CoursePlay(UserCourse):
'''
课题模式打歌类联动UserPlay\
parameter: `user` - `UserOnline`类或子类的实例\
课题模式打歌类联动UserPlay
parameter: `user` - `UserOnline`类或子类的实例
'user_play` - `UserPlay`类的实例
'''