assigonmentDto
This commit is contained in:
@@ -29,8 +29,8 @@
|
||||
Console.WriteLine($"ExamId 字符串成功解析为 Guid: {parsedExamId}");
|
||||
try
|
||||
{
|
||||
// var result = await ExamService.GetExam(parsedExamId);
|
||||
// if (result.Status) ExamDto = result.Result as ExamDto ?? new ExamDto();
|
||||
var result = await ExamService.GetExam(parsedExamId);
|
||||
if (result.Status) ExamDto = result.Result as AssignmentDto ?? new AssignmentDto();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@@ -21,7 +21,7 @@ else
|
||||
<MudPaper Class="d-flex flex-wrap flex-grow-0 gap-4" Height="100%" Width="100%">
|
||||
@foreach (var item in examDtos)
|
||||
{
|
||||
<ExamPreview examDto="item" Width="256px" Height="256px"> </ExamPreview>
|
||||
<ExamPreview AssignmentDto="item" Width="256px" Height="256px"> </ExamPreview>
|
||||
}
|
||||
</MudPaper>
|
||||
|
||||
@@ -35,7 +35,7 @@ else
|
||||
[CascadingParameter]
|
||||
private Task<AuthenticationState> authenticationStateTask { get; set; }
|
||||
|
||||
private List<ExamDto> examDtos = new List<ExamDto>();
|
||||
private List<AssignmentDto> examDtos = new List<AssignmentDto>();
|
||||
|
||||
private bool isloding = true;
|
||||
|
||||
@@ -50,7 +50,7 @@ else
|
||||
isloding = true;
|
||||
Snackbar.Add("正在加载", Severity.Info);
|
||||
var result = await ExamService.GetAllExam(authenticationStateTask.Result.User.Identity.Name);
|
||||
examDtos = result.Result as List<ExamDto> ?? new List<ExamDto>();
|
||||
examDtos = result.Result as List<AssignmentDto> ?? new List<AssignmentDto>();
|
||||
isloding = false;
|
||||
Snackbar.Add("加载成功", Severity.Info);
|
||||
StateHasChanged();
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<MudPaper Class="overflow-hidden " Style="background-color:pink" Width="@Width" Height="@Height" MaxHeight="@MaxHeight" MaxWidth="@MaxWidth">
|
||||
<MudPaper Class="d-flex flex-column flex-grow-1 justify-content-between" Height="100%" Style="background-color:green">
|
||||
|
||||
<MudText Typo="Typo.body2"> @examDto.AssignmentTitle </MudText>
|
||||
<MudText Typo="Typo.body2"> @AssignmentDto.Title </MudText>
|
||||
|
||||
|
||||
<MudPaper>
|
||||
@@ -26,7 +26,7 @@
|
||||
public NavigationManager navigationManager { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public ExamDto examDto { get; set; }
|
||||
public AssignmentDto AssignmentDto { get; set; }
|
||||
|
||||
|
||||
[Parameter]
|
||||
@@ -47,11 +47,11 @@
|
||||
|
||||
private void ExamClick()
|
||||
{
|
||||
navigationManager.NavigateTo($"exam/edit/{examDto.AssignmentId}");
|
||||
navigationManager.NavigateTo($"exam/edit/{AssignmentDto.Id}");
|
||||
}
|
||||
|
||||
private void CheckExam()
|
||||
{
|
||||
navigationManager.NavigateTo($"exam/check/{examDto.AssignmentId}");
|
||||
navigationManager.NavigateTo($"exam/check/{AssignmentDto.Id}");
|
||||
}
|
||||
}
|
||||
|
@@ -88,13 +88,12 @@ namespace TechHelper.Client.Services
|
||||
|
||||
public async Task<ApiResponse> GetAllExam(string user)
|
||||
{
|
||||
// 直接使用注入的 _client 实例
|
||||
var response = await _client.GetAsync($"exam/getAllPreview?user={user}");
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = JsonConvert.DeserializeObject<List<ExamDto>>(content);
|
||||
var result = JsonConvert.DeserializeObject<List<AssignmentDto>>(content);
|
||||
return ApiResponse.Success(result: result);
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user