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

Add rooms #2

Merged
merged 55 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
7b0ce38
Merge pull request #1 from CGI-FR/main
lucas-mrq Feb 27, 2024
0d7f9c5
Fix command issue
lucas-mrq Mar 12, 2024
639d5ab
Add Rooms, Planning & Schedule
lucas-mrq Mar 12, 2024
836c52b
Add GetLists, Update and Post methods
lucas-mrq Mar 13, 2024
1a6abf0
Update Room to level
lucas-mrq Mar 18, 2024
d97da64
Change Level to Layer
lucas-mrq Mar 21, 2024
84dc481
Update Planning & Schedule
lucas-mrq Mar 22, 2024
f626e16
Add Planning Management
lucas-mrq Apr 5, 2024
5a2b4b0
Merge branch 'fix-command' into add-rooms
lucas-mrq Apr 5, 2024
d56214b
feature/add-rooms-change-LayerId default
lucas-mrq Apr 11, 2024
b26872b
feature/add-room-Add-command-regular-sending
lucas-mrq Apr 11, 2024
89a7a58
feature/add-rooms-postgree-migration-layer-planning-rooms
lucas-mrq Apr 11, 2024
f165036
Fix Command frame encoding
lucas-mrq Apr 12, 2024
fbdd32f
Merge branch 'fix-command' into add-rooms
lucas-mrq Apr 12, 2024
ad37db0
Merge branch 'main' into fix-command
lucas-mrq Apr 12, 2024
3d2d213
fix-command/update unit test
lucas-mrq Apr 12, 2024
b4c3a1d
Merge branch 'fix-command' of https://github.com/lucas-mrq/IoT-Hub-Po…
lucas-mrq Apr 12, 2024
09fae6f
fix-command/add KeyManagementApiVersion
lucas-mrq Apr 15, 2024
b9a974f
add-rooms/delete unused file and variable
lucas-mrq Apr 16, 2024
0d8a430
fix-command/Delete Http issue
lucas-mrq Apr 16, 2024
9513aa7
Merge branch 'CGI-FR:main' into fix-command
lucas-mrq Apr 16, 2024
3a037a8
fix-command/change-public to internal
lucas-mrq Apr 16, 2024
2be7135
Merge branch 'CGI-FR:main' into main
lucas-mrq Apr 16, 2024
c942f64
Merge branch 'CGI-FR:main' into fix-command
lucas-mrq Apr 16, 2024
4094bca
Merge branch 'fix-command' into add-rooms
lucas-mrq Apr 16, 2024
76e8b80
Add unit test on API call
lucas-mrq Apr 17, 2024
f08f665
Merge branch 'CGI-FR:main' into main
lucas-mrq Apr 18, 2024
835e132
Add tests for layer pages
lucas-mrq Apr 22, 2024
9539e94
Update previous test to match update
lucas-mrq Apr 22, 2024
2d15ace
Add Repo Tests
lucas-mrq Apr 22, 2024
6ea5de5
Merge branch 'CGI-FR:main' into main
lucas-mrq Apr 23, 2024
d5e91ec
Update publish.yml
lucas-mrq Apr 23, 2024
7c5c03d
Update publish.yml to change username
lucas-mrq Apr 23, 2024
71e342b
Update publish.yml change meta
lucas-mrq Apr 23, 2024
1463698
Merge branch 'add-rooms' of https://github.com/lucas-mrq/IoT-Hub-Port…
lucas-mrq Apr 23, 2024
41052cd
change device LayerId to nullable
lucas-mrq Apr 23, 2024
5e100ec
change IDevice LayerId
lucas-mrq Apr 23, 2024
79de7ad
change required LayerId
lucas-mrq Apr 23, 2024
c1e7ce4
Add nullable Layer Id to all LayerId
lucas-mrq Apr 24, 2024
1042f7d
Command SendCommand to test deployment
lucas-mrq Apr 24, 2024
9dd5e9d
Add null LayerId to Device Dialog
lucas-mrq Apr 25, 2024
6d90c97
Comment out SendDeviceCommand
lucas-mrq Apr 25, 2024
83c704d
Reload auto migration file to solve migration issue
lucas-mrq Apr 25, 2024
914a58f
Add Device Detail LayerId
lucas-mrq Apr 26, 2024
2215050
Add Layer and Planning tests
lucas-mrq May 3, 2024
719ad03
Merge branch 'main' of https://github.com/lucas-mrq/IoT-Hub-Portal
lucas-mrq May 5, 2024
86b98d2
Add EditPlanningTest & DeleteLayerDialog
lucas-mrq May 5, 2024
db54928
Add Controller tests
lucas-mrq May 5, 2024
fbf4f78
Merge with 5.3.1
lucas-mrq May 5, 2024
c5044e4
delete unused using
lucas-mrq May 5, 2024
9bba687
Upgrade functions and make more comments
lucas-mrq May 6, 2024
ae8075b
Add multiple level of layer
lucas-mrq May 6, 2024
7461cc3
Update Review Changes
lucas-mrq May 7, 2024
9bdcece
Code review changes
lucas-mrq May 16, 2024
28796f6
Add 4.13 Changes
lucas-mrq May 23, 2024
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
16 changes: 0 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ jobs:
- id: docker-tag
uses: yuya-takeyama/docker-tag-from-github-ref-action@v1

- name: Configure AWS credentials
id: aws-credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# Should use us-east-1 region to push to ECR public registry
aws-region: us-east-1

- name: Docker Login to ACR
# You may pin to the exact commit or the version.
uses: docker/login-action@v3.1.0
Expand All @@ -45,20 +36,13 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ env.registry_name }}/${{ github.repository_owner }}/${{ env.image_name }}
${{ steps.login-ecr.outputs.registry }}/cgi-fr/${{ env.image_name }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
Expand Down
56 changes: 28 additions & 28 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_VERSION=1.2.3
ARG GITHUB_RUN_NUMBER=4
WORKDIR /src
RUN ls
COPY ["IoTHub.Portal.Server/IoTHub.Portal.Server.csproj", "IoTHub.Portal.Server/"]
COPY ["IoTHub.Portal.Shared/IoTHub.Portal.Shared.csproj", "IoTHub.Portal.Shared/"]
COPY ["IoTHub.Portal.Client/IoTHub.Portal.Client.csproj", "IoTHub.Portal.Client/"]
RUN dotnet restore "IoTHub.Portal.Server/IoTHub.Portal.Server.csproj"
COPY . .
WORKDIR "/src/IoTHub.Portal.Server"
RUN dotnet build "IoTHub.Portal.Server.csproj" -c Release -o /app/build -p:Version="${BUILD_VERSION}.${GITHUB_RUN_NUMBER}"
FROM build AS publish
ARG BUILD_VERSION=1.2.3
ARG GITHUB_RUN_NUMBER=4
RUN dotnet publish "IoTHub.Portal.Server.csproj" -c Release -o /app/publish -p:Version="${BUILD_VERSION}.${GITHUB_RUN_NUMBER}"
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "IoTHub.Portal.Server.dll"]
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_VERSION=1.2.3
ARG GITHUB_RUN_NUMBER=4
WORKDIR /src
RUN ls
COPY ["IoTHub.Portal.Server/IoTHub.Portal.Server.csproj", "IoTHub.Portal.Server/"]
COPY ["IoTHub.Portal.Shared/IoTHub.Portal.Shared.csproj", "IoTHub.Portal.Shared/"]
COPY ["IoTHub.Portal.Client/IoTHub.Portal.Client.csproj", "IoTHub.Portal.Client/"]
RUN dotnet restore "IoTHub.Portal.Server/IoTHub.Portal.Server.csproj"
COPY . .
WORKDIR "/src/IoTHub.Portal.Server"
RUN dotnet build "IoTHub.Portal.Server.csproj" -c Release -o /app/build -p:Version="${BUILD_VERSION}.${GITHUB_RUN_NUMBER}"

FROM build AS publish
ARG BUILD_VERSION=1.2.3
ARG GITHUB_RUN_NUMBER=4
RUN dotnet publish "IoTHub.Portal.Server.csproj" -c Release -o /app/publish -p:Version="${BUILD_VERSION}.${GITHUB_RUN_NUMBER}"

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "IoTHub.Portal.Server.dll"]
18 changes: 18 additions & 0 deletions src/IoTHub.Portal.Application/Mappers/LayerProfile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) CGI France. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace IoTHub.Portal.Infrastructure.Mappers
{
using AutoMapper;
using IoTHub.Portal.Domain.Entities;
using IoTHub.Portal.Shared.Models.v10;

public class LayerProfile : Profile
{
public LayerProfile()
{
_ = CreateMap<LayerDto, Layer>()
.ReverseMap();
}
}
}
18 changes: 18 additions & 0 deletions src/IoTHub.Portal.Application/Mappers/PlanningProfile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) CGI France. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace IoTHub.Portal.Infrastructure.Mappers
{
using AutoMapper;
using IoTHub.Portal.Domain.Entities;
using IoTHub.Portal.Shared.Models.v10;

public class PlanningProfile : Profile
{
public PlanningProfile()
{
_ = CreateMap<PlanningDto, Planning>()
.ReverseMap();
}
}
}
18 changes: 18 additions & 0 deletions src/IoTHub.Portal.Application/Mappers/ScheduleProfile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) CGI France. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace IoTHub.Portal.Infrastructure.Mappers
{
using AutoMapper;
using IoTHub.Portal.Domain.Entities;
using IoTHub.Portal.Shared.Models.v10;

public class ScheduleProfile : Profile
{
public ScheduleProfile()
{
_ = CreateMap<ScheduleDto, Schedule>()
.ReverseMap();
}
}
}
3 changes: 2 additions & 1 deletion src/IoTHub.Portal.Application/Services/IDeviceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Task<PaginatedResult<DeviceListItem>> GetDevices(
string[]? orderBy = null,
Dictionary<string, string>? tags = default,
string? modelId = null,
List<string>? labels = default);
List<string>? labels = default,
string? layerId = null);

Task<TDto> GetDevice(string deviceId);

Expand Down
18 changes: 18 additions & 0 deletions src/IoTHub.Portal.Application/Services/ILayerService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) CGI France. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace IoTHub.Portal.Application.Services
{
using System.Threading.Tasks;
using IoTHub.Portal.Domain.Entities;
using IoTHub.Portal.Shared.Models.v10;

public interface ILayerService
{
Task<LayerDto> CreateLayer(LayerDto level);
Task UpdateLayer(LayerDto level);
Task DeleteLayer(string levelId);
Task<Layer> GetLayer(string levelId);
Task<IEnumerable<LayerDto>> GetLayers();
}
}
18 changes: 18 additions & 0 deletions src/IoTHub.Portal.Application/Services/IPlanningService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) CGI France. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace IoTHub.Portal.Application.Services
{
using System.Threading.Tasks;
using IoTHub.Portal.Domain.Entities;
using IoTHub.Portal.Shared.Models.v10;

public interface IPlanningService
{
Task<PlanningDto> CreatePlanning(PlanningDto planning);
Task UpdatePlanning(PlanningDto planning);
Task DeletePlanning(string planningId);
Task<Planning> GetPlanning(string planningId);
Task<IEnumerable<PlanningDto>> GetPlannings();
}
}
18 changes: 18 additions & 0 deletions src/IoTHub.Portal.Application/Services/IScheduleService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) CGI France. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace IoTHub.Portal.Application.Services
{
using System.Threading.Tasks;
using IoTHub.Portal.Domain.Entities;
using IoTHub.Portal.Shared.Models.v10;

public interface IScheduleService
{
Task<ScheduleDto> CreateSchedule(ScheduleDto schedule);
Task UpdateSchedule(ScheduleDto schedule);
Task DeleteSchedule(string scheduleId);
Task<Schedule> GetSchedule(string scheduleId);
Task<IEnumerable<ScheduleDto>> GetSchedules();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) CGI France. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace IoTHub.Portal.Application.Services
{
public interface ISendPlanningCommandService
{
}
}
Loading
Loading