-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from Star-Academy/feature/save-graph
fix: miner changes
- Loading branch information
Showing
1 changed file
with
13 additions
and
27 deletions.
There are no files selected for viewing
40 changes: 13 additions & 27 deletions
40
mohaymen-codestar-Team02/Controllers/AnalystController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,42 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using mohaymen_codestar_Team02.Dto; | ||
using mohaymen_codestar_Team02.Dto.GraphDTO; | ||
using mohaymen_codestar_Team02.Models; | ||
using mohaymen_codestar_Team02.Services.AnalystService; | ||
using mohaymen_codestar_Team02.Services.DataAdminService; | ||
|
||
namespace mohaymen_codestar_Team02.Controllers; | ||
|
||
public class AnalystController : ControllerBase | ||
{ | ||
private readonly IAnalystService AnalystService; | ||
|
||
public AnalystController(IAnalystService analystService, IDataAdminService dataAdminService) | ||
{ | ||
AnalystService = analystService; | ||
} | ||
|
||
[HttpGet("Analyst")] | ||
public Task<IActionResult> SearchGraph([FromQuery] GraphQueryInfoDto graphQueryInfoDto, | ||
[FromQuery] Dictionary<string, string> vertexAttributeValues) | ||
{ | ||
return null; | ||
} | ||
private readonly IAnalystService _analystService; | ||
|
||
[HttpGet("Analyst/{vertexId}")] | ||
public async Task<IActionResult> ExpandVertex([FromQuery] GraphQueryInfoDto graphQueryInfoDto, string vertexId) | ||
{ | ||
var Response = await AnalystService.GetTheVertexNeighbor(graphQueryInfoDto, vertexId); | ||
var Response = await _analystService.GetTheVertexNeighbor(graphQueryInfoDto, vertexId); | ||
return StatusCode((int)Response.Type, Response); | ||
} | ||
|
||
[HttpPost("Analyst")] | ||
public async Task<IActionResult> DisplayDataSetAsGraph([FromBody]FilterGraphDto filterGraphDto) | ||
public async Task<IActionResult> DisplayDataSetAsGraph([FromBody] FilterGraphDto filterGraphDto) | ||
{ | ||
ServiceResponse<DisplayGraphDto> response = | ||
await AnalystService.DisplayGeraphData(filterGraphDto.DatasetId, filterGraphDto.SourceIdentifier, | ||
filterGraphDto.TargetIdentifier, filterGraphDto.VertexIdentifier, filterGraphDto.VertexAttributeValues, filterGraphDto.EdgeAttributeValues); | ||
var response = | ||
await _analystService.DisplayGeraphData(filterGraphDto.DatasetId, filterGraphDto.SourceIdentifier, | ||
filterGraphDto.TargetIdentifier, filterGraphDto.VertexIdentifier, filterGraphDto.VertexAttributeValues, | ||
filterGraphDto.EdgeAttributeValues); | ||
response.Data.GraphId = filterGraphDto.DatasetId; | ||
return StatusCode((int)response.Type, response); | ||
} | ||
|
||
[HttpGet("Analyst/Vertex/{id}")] | ||
public async Task<IActionResult> DisplayVertexAttributes(long id) | ||
public IActionResult DisplayVertexAttributes(long id) | ||
{ | ||
var response = AnalystService.GetVertexAttributes(id); | ||
var response = _analystService.GetVertexAttributes(id); | ||
return StatusCode((int)response.Type, response); | ||
} | ||
|
||
[HttpGet("Analyst/Edge/{id}")] | ||
public async Task<IActionResult> DisplayEdgeAttributes(long id) | ||
public IActionResult DisplayEdgeAttributes(long id) | ||
{ | ||
var response = AnalystService.GetEdgeAttributes(id); | ||
var response = _analystService.GetEdgeAttributes(id); | ||
return StatusCode((int)response.Type, response); | ||
} | ||
} |