1
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user