Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teste-frontend-v4-Ray-Oliveira #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .vs/ProjectEvaluation/aiko.metadata.v7.bin
Binary file not shown.
Binary file added .vs/ProjectEvaluation/aiko.projects.v7.bin
Binary file not shown.
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
6 changes: 6 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
Binary file added .vs/aiko/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
1,016 changes: 1,016 additions & 0 deletions .vs/aiko/config/applicationhost.config

Large diffs are not rendered by default.

Binary file added .vs/aiko/v17/.futdcache.v2
Binary file not shown.
Binary file added .vs/aiko/v17/.suo
Binary file not shown.
67 changes: 67 additions & 0 deletions .vs/aiko/v17/DocumentLayout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\ray.oliveira\\source\\repos\\teste-frontend-v4-Ray-Felipe-Nascimento-Oliveira\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:130:0:{75188d03-9892-4ae2-abf1-207126247ce5}"
},
{
"$type": "Bookmark",
"Name": "ST:129:0:{75188d03-9892-4ae2-abf1-207126247ce5}"
},
{
"$type": "Bookmark",
"Name": "ST:130:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:131:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:132:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:133:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:134:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:135:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:136:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:132:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
}
]
}
]
}
]
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\ray.oliveira\\source\\repos\\teste-frontend-v4-Ray-Felipe-Nascimento-Oliveira\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:130:0:{75188d03-9892-4ae2-abf1-207126247ce5}"
},
{
"$type": "Bookmark",
"Name": "ST:129:0:{75188d03-9892-4ae2-abf1-207126247ce5}"
},
{
"$type": "Bookmark",
"Name": "ST:130:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:131:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:132:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:133:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:134:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:135:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:136:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:132:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Bookmark",
"Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
}
]
}
]
}
]
}
25 changes: 25 additions & 0 deletions aiko.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "aiko", "aiko\aiko.csproj", "{4514D925-75D6-43FB-BC56-A99539A1AC7F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4514D925-75D6-43FB-BC56-A99539A1AC7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4514D925-75D6-43FB-BC56-A99539A1AC7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4514D925-75D6-43FB-BC56-A99539A1AC7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4514D925-75D6-43FB-BC56-A99539A1AC7F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {948CDA00-67AE-4487-8321-A7F7ACD02F0C}
EndGlobalSection
EndGlobal
43 changes: 43 additions & 0 deletions aiko/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using Microsoft.AspNetCore.Mvc;
using aiko.Services;
using aiko.Models;
using System.Diagnostics;

namespace aiko.Controllers
{
public class HomeController : Controller
{
private readonly DataService _dataService;

public HomeController(DataService dataService)
{
_dataService = dataService;
}

public IActionResult Index()
{
var equipments = _dataService.GetEquipments();
var equipmentPositionHistories = _dataService.GetEquipmentPositionHistories();
var equipmentStates = _dataService.GetEquipmentStates();
var equipmentStateHistories = _dataService.GetEquipmentStateHistories();

ViewBag.Equipments = equipments;
ViewBag.EquipmentPositionHistories = equipmentPositionHistories;
ViewBag.EquipmentStates = equipmentStates;
ViewBag.EquipmentStateHistories = equipmentStateHistories;

return View();
}

public IActionResult Privacy()
{
return View();
}

[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}
12 changes: 12 additions & 0 deletions aiko/Data/equipment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"id": "a7c53eb1-4f5e-4eba-9764-ad205d0891f9",
"equipmentModelId": "a3540227-2f0e-4362-9517-92f41dabbfdf",
"name": "CA-0001"
},
{
"id": "b7d53eb1-4f5e-4eba-9764-ad205d0891f9",
"equipmentModelId": "b2540227-2f0e-4362-9517-92f41dabbfdf",
"name": "CA-0002"
}
]
30 changes: 30 additions & 0 deletions aiko/Data/equipmentModel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[
{
"id": "a3540227-2f0e-4362-9517-92f41dabbfdf",
"name": "Caminhão de carga",
"hourlyEarnings": [
{
"equipmentStateId": "0808344c-454b-4c36-89e8-d7687e692d57",
"value": 100
},
{
"equipmentStateId": "03b2d446-e3ba-4c82-8dc2-a5611fea6e1f",
"value": 50
}
]
},
{
"id": "b2540227-2f0e-4362-9517-92f41dabbfdf",
"name": "Trator",
"hourlyEarnings": [
{
"equipmentStateId": "0808344c-454b-4c36-89e8-d7687e692d57",
"value": 120
},
{
"equipmentStateId": "03b2d446-e3ba-4c82-8dc2-a5611fea6e1f",
"value": 60
}
]
}
]
32 changes: 32 additions & 0 deletions aiko/Data/equipmentPositionHistory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"equipmentId": "a7c53eb1-4f5e-4eba-9764-ad205d0891f9",
"positions": [
{
"date": "2021-02-01T03:00:00.000Z",
"lat": -19.126536,
"lon": -45.947756
},
{
"date": "2021-02-01T08:00:00.000Z",
"lat": -19.126540,
"lon": -45.947760
}
]
},
{
"equipmentId": "b7d53eb1-4f5e-4eba-9764-ad205d0891f9",
"positions": [
{
"date": "2021-03-01T03:00:00.000Z",
"lat": -20.126536,
"lon": -44.947756
},
{
"date": "2021-03-01T08:00:00.000Z",
"lat": -20.126540,
"lon": -44.947760
}
]
}
]
12 changes: 12 additions & 0 deletions aiko/Data/equipmentState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"id": "0808344c-454b-4c36-89e8-d7687e692d57",
"name": "Operando",
"color": "#2ecc71"
},
{
"id": "03b2d446-e3ba-4c82-8dc2-a5611fea6e1f",
"name": "Parado",
"color": "#e74c3c"
}
]
28 changes: 28 additions & 0 deletions aiko/Data/equipmentStateHistory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"equipmentId": "a7c53eb1-4f5e-4eba-9764-ad205d0891f9",
"states": [
{
"date": "2021-02-01T03:00:00.000Z",
"equipmentStateId": "0808344c-454b-4c36-89e8-d7687e692d57"
},
{
"date": "2021-02-01T08:00:00.000Z",
"equipmentStateId": "03b2d446-e3ba-4c82-8dc2-a5611fea6e1f"
}
]
},
{
"equipmentId": "b7d53eb1-4f5e-4eba-9764-ad205d0891f9",
"states": [
{
"date": "2021-03-01T03:00:00.000Z",
"equipmentStateId": "0808344c-454b-4c36-89e8-d7687e692d57"
},
{
"date": "2021-03-01T08:00:00.000Z",
"equipmentStateId": "03b2d446-e3ba-4c82-8dc2-a5611fea6e1f"
}
]
}
]
11 changes: 11 additions & 0 deletions aiko/Models/Equipment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;

namespace aiko.Models
{
public class Equipment
{
public string Id { get; set; }
public string EquipmentModelId { get; set; }
public string Name { get; set; }
}
}
17 changes: 17 additions & 0 deletions aiko/Models/EquipmentModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Collections.Generic;

namespace aiko.Models
{
public class EquipmentModel
{
public string Id { get; set; }
public string Name { get; set; }
public List<HourlyEarnings> HourlyEarnings { get; set; }
}

public class HourlyEarnings
{
public string EquipmentStateId { get; set; }
public decimal Value { get; set; }
}
}
17 changes: 17 additions & 0 deletions aiko/Models/EquipmentPositionHistory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Collections.Generic;

namespace aiko.Models
{
public class EquipmentPositionHistory
{
public string EquipmentId { get; set; }
public List<Position> Positions { get; set; }
}

public class Position
{
public DateTime Date { get; set; }
public double Lat { get; set; }
public double Lon { get; set; }
}
}
Loading