Skip to content

Commit

Permalink
Merge pull request #31 from Star-Academy/feature/save-graph
Browse files Browse the repository at this point in the history
fix: miner changes
  • Loading branch information
Ftm-Sayadzadeh authored Sep 7, 2024
2 parents e6163bd + 3c1346c commit 52a2713
Showing 1 changed file with 13 additions and 27 deletions.
40 changes: 13 additions & 27 deletions mohaymen-codestar-Team02/Controllers/AnalystController.cs
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);
}
}

0 comments on commit 52a2713

Please sign in to comment.