feat: add student video and profile experience

This commit is contained in:
2026-07-28 15:23:42 +08:00
parent 5e993298e7
commit 7a3cf09a99
31 changed files with 19821 additions and 170 deletions

View File

@@ -156,6 +156,16 @@ public sealed class ExceptionHandlingMiddleware(
return;
}
if (exception is VideoPlaybackException videoPlaybackException)
{
await WriteProblemAsync(
context,
videoPlaybackException.Message,
VideoPlaybackStatusCode(videoPlaybackException.Code),
videoPlaybackException.Code);
return;
}
if (exception is ContentManagementException contentManagementException)
{
await WriteProblemAsync(
@@ -436,12 +446,22 @@ public sealed class ExceptionHandlingMiddleware(
return code switch
{
"profile_access_denied" => StatusCodes.Status403Forbidden,
"profile_user_not_found" => StatusCodes.Status404NotFound,
"profile_user_not_found" or "check_in_task_not_found" => StatusCodes.Status404NotFound,
"region_not_found" or "school_not_found" or "major_not_found" => StatusCodes.Status404NotFound,
_ => StatusCodes.Status400BadRequest
};
}
private static int VideoPlaybackStatusCode(string code)
{
return code switch
{
"video_access_denied" => StatusCodes.Status403Forbidden,
"video_not_found" or "question_video_not_found" => StatusCodes.Status404NotFound,
_ => StatusCodes.Status400BadRequest
};
}
private static int TenantAdminDirectStatusCode(string code)
{
return code switch