Сделал третью страницу
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 24s
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 24s
This commit is contained in:
@ -8,6 +8,8 @@ public interface IUniversityService
|
||||
public Task<List<University>> GetAllUniversity();
|
||||
public Task<List<Direction>> GetDirectionsByUniversityId(long universityId);
|
||||
public Task<University> GetUniversityById(long id);
|
||||
public Task<IEnumerable<Offer>> GetOffers(long directionId);
|
||||
public Task<Direction> GetDirectionsById(long directionId);
|
||||
}
|
||||
|
||||
public class UniversityService : IUniversityService
|
||||
@ -42,6 +44,17 @@ public class UniversityService : IUniversityService
|
||||
return directions;
|
||||
}
|
||||
|
||||
public async Task<Direction> GetDirectionsById(long directionId)
|
||||
{
|
||||
var response = await _httpClient.GetAsync("v1/public/direction/" + directionId);
|
||||
var result = await response.Content.ReadAsStringAsync();
|
||||
var direction = JsonSerializer.Deserialize<Direction>(result, new JsonSerializerOptions
|
||||
{
|
||||
PropertyNameCaseInsensitive = true
|
||||
});
|
||||
return direction;
|
||||
}
|
||||
|
||||
public async Task<University> GetUniversityById(long id)
|
||||
{
|
||||
var response = await _httpClient.GetAsync("v1/public/university/" + id);
|
||||
@ -52,4 +65,15 @@ public class UniversityService : IUniversityService
|
||||
});
|
||||
return university;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Offer>> GetOffers(long directionId)
|
||||
{
|
||||
var response = await _httpClient.GetAsync("v1/public/credit/direction/" + directionId);
|
||||
var result = await response.Content.ReadAsStringAsync();
|
||||
var offers = JsonSerializer.Deserialize<IEnumerable<Offer>>(result, new JsonSerializerOptions
|
||||
{
|
||||
PropertyNameCaseInsensitive = true
|
||||
});
|
||||
return offers;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user