assigonmentDto
This commit is contained in:
@@ -75,10 +75,11 @@ namespace TechHelper.Server.Services
|
||||
return _mapper.Map<AssignmentDto>(assignment);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<AssignmentDto>> GetAllExamPreviewsAsync(Guid userId)
|
||||
public async Task<ApiResponse> GetAllExamPreviewsAsync(Guid userId)
|
||||
{
|
||||
var assignments = await _examRepository.GetExamPreviewsByUserAsync(userId);
|
||||
return _mapper.Map<IEnumerable<AssignmentDto>>(assignments);
|
||||
var result = _mapper.Map<List<AssignmentDto>>(assignments);
|
||||
return ApiResponse.Success(result: result);
|
||||
}
|
||||
|
||||
|
||||
@@ -87,9 +88,15 @@ namespace TechHelper.Server.Services
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<ApiResponse> GetAsync(Guid id)
|
||||
public async Task<ApiResponse> GetAsync(Guid id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var assignment = await _examRepository.GetFullExamByIdAsync(id);
|
||||
if (assignment == null)
|
||||
{
|
||||
return ApiResponse.Error("获取失败");
|
||||
}
|
||||
var result = _mapper.Map<AssignmentDto>(assignment);
|
||||
return ApiResponse.Success(result: result);
|
||||
}
|
||||
|
||||
public Task<ApiResponse> AddAsync(AssignmentDto model)
|
||||
@@ -107,10 +114,6 @@ namespace TechHelper.Server.Services
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
Task<ApiResponse> IExamService.GetAllExamPreviewsAsync(Guid userId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user