This commit is contained in:
SpecialX
2025-06-27 19:03:10 +08:00
parent 14fbe6397a
commit a21ca80782
57 changed files with 3872 additions and 611 deletions

View File

@@ -1,6 +1,9 @@
using Entities.DTO;
using Entities.Contracts;
using Entities.DTO;
using Newtonsoft.Json;
using System.Net.Http.Json;
using TechHelper.Client.HttpRepository;
using TechHelper.Services;
namespace TechHelper.Client.Services
{
@@ -20,6 +23,21 @@ namespace TechHelper.Client.Services
throw new NotImplementedException();
}
public async Task<ApiResponse> GetClassStudents()
{
try
{
var result = await _client.PostAsJsonAsync("class/getClassStudents","");
var content = await result.Content.ReadAsStringAsync();
var users = JsonConvert.DeserializeObject<List<StudentDto>>(content);
return ApiResponse.Success(result: users);
}
catch(Exception ex)
{
return ApiResponse.Error($"获取失败,{ex.Message}, InnerException: {ex.InnerException}");
}
}
public async Task<ResponseDto> UserRegister(UserRegistrationToClassDto userRegistrationToClassDto)
{
try