重构项目结构,移除Assignment相关功能,优化Submission模块
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
This commit is contained in:
@@ -3,8 +3,7 @@ using Entities.DTO;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using TechHelper.Server.Services;
|
||||
using System.Security.Claims;
|
||||
using TechHelper.Services.Beta;
|
||||
|
||||
namespace TechHelper.Server.Controllers
|
||||
{
|
||||
@@ -13,11 +12,11 @@ namespace TechHelper.Server.Controllers
|
||||
[Authorize]
|
||||
public class StudentSubmissionController : ControllerBase
|
||||
{
|
||||
private readonly IStudentSubmissionService _studentSubmissionService;
|
||||
private readonly ISubmissionService _studentSubmissionService;
|
||||
private readonly UserManager<User> _userManager;
|
||||
|
||||
public StudentSubmissionController(
|
||||
IStudentSubmissionService studentSubmissionService,
|
||||
ISubmissionService studentSubmissionService,
|
||||
UserManager<User> userManager)
|
||||
{
|
||||
_studentSubmissionService = studentSubmissionService;
|
||||
@@ -35,7 +34,7 @@ namespace TechHelper.Server.Controllers
|
||||
if (user == null)
|
||||
return NotFound("未找到用户信息");
|
||||
|
||||
var result = await _studentSubmissionService.GetStudentSubmissionsAsync(user.Id);
|
||||
var result = await _studentSubmissionService.GetStudentSubmissionDetailAsync(user.Id);
|
||||
|
||||
if (result.Status)
|
||||
{
|
||||
@@ -64,7 +63,7 @@ namespace TechHelper.Server.Controllers
|
||||
if (user == null)
|
||||
return NotFound("未找到用户信息");
|
||||
|
||||
var result = await _studentSubmissionService.GetStudentSubmissionsPagedAsync(user.Id, pageNumber, pageSize);
|
||||
var result = await _studentSubmissionService.GetStudentSubmissionSummariesAsync(user.Id);
|
||||
|
||||
if (result.Status)
|
||||
{
|
||||
@@ -85,7 +84,7 @@ namespace TechHelper.Server.Controllers
|
||||
[Authorize(Roles = "Teacher")]
|
||||
public async Task<IActionResult> GetStudentSubmissions(Guid studentId)
|
||||
{
|
||||
var result = await _studentSubmissionService.GetStudentSubmissionsAsync(studentId);
|
||||
var result = await _studentSubmissionService.GetStudentSubmissionSummariesAsync(studentId);
|
||||
|
||||
if (result.Status)
|
||||
{
|
||||
@@ -112,7 +111,7 @@ namespace TechHelper.Server.Controllers
|
||||
if (pageSize < 1) pageSize = 10;
|
||||
if (pageSize > 100) pageSize = 100; // 限制最大页面大小
|
||||
|
||||
var result = await _studentSubmissionService.GetStudentSubmissionsPagedAsync(studentId, pageNumber, pageSize);
|
||||
var result = await _studentSubmissionService.GetStudentSubmissionSummariesAsync(studentId);
|
||||
|
||||
if (result.Status)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user