struct&&assiQues
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user