struct&&assiQues

This commit is contained in:
SpecialX
2025-06-20 15:37:39 +08:00
parent f37262d72e
commit d20c051c51
68 changed files with 1927 additions and 2869 deletions

View File

@@ -28,9 +28,13 @@ namespace TechHelper.Server.Controllers
[HttpPost("add")]
public async Task<IActionResult> AddExam(
[FromBody] ExamDto examDto)
[FromBody] AssignmentDto examDto)
{
var result = await _examService.AddAsync(examDto);
var user = await _userManager.FindByEmailAsync(User.Identity?.Name ?? "");
if(user == null) return BadRequest("无效的用户");
examDto.CreatorId = user.Id;
var result = await _examService.CreateExamAsync(examDto);
if (result.Status)
{
return Ok(result);
@@ -63,7 +67,7 @@ namespace TechHelper.Server.Controllers
var result = await _examService.GetAllExamPreview(userid.Id);
var result = await _examService.GetAllExamPreviewsAsync(userid.Id);
if (result.Status)
{