Skip to content

Commit d3612c6

Browse files
committed
Merge branch 'master' into feature/state-management
2 parents 9f69a8f + a5dfa50 commit d3612c6

132 files changed

Lines changed: 3319 additions & 965 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10+
- name: Knock-knock-knock
11+
shell: bash
12+
env:
13+
KNOCK_HOST: ${{ secrets.SSH_HOST }}
14+
KNOCK_SEQ: ${{ secrets.KNOCK_SEQ }}
15+
run: |
16+
echo "::add-mask::$KNOCK_HOST"
17+
echo "::add-mask::$KNOCK_SEQ"
18+
19+
for s in $KNOCK_SEQ; do
20+
nc -w 1 "$KNOCK_HOST" "$s" &>/dev/null < /dev/null
21+
done
22+
23+
sleep 1
24+
1025
- name: Run script on remote server
1126
uses: appleboy/ssh-action@master
1227
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,3 +362,4 @@ StyleCop.Cache
362362
swagger-codegen
363363
hwproj.front/static_dist/
364364
hwproj.front/dist/
365+
.DS_Store

.vscode/tasks.json

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Start All",
6+
"dependsOn": ["Start Backend", "Start Frontend"],
7+
"dependsOrder": "parallel",
8+
"problemMatcher": []
9+
},
10+
{
11+
"label": "Start Backend",
12+
"dependsOn": [
13+
"Start AuthService.API",
14+
"Start CoursesService.API",
15+
"Start SolutionsService.API",
16+
"Start NotificationsService.API",
17+
"Start ContentService.API",
18+
"Start APIGateway.API"
19+
],
20+
"dependsOrder": "parallel",
21+
"problemMatcher": []
22+
},
23+
{
24+
"label": "Start APIGateway.API",
25+
"type": "process",
26+
"command": "dotnet",
27+
"args": [
28+
"run",
29+
"--project",
30+
"${workspaceFolder}/HwProj.APIGateway/HwProj.APIGateway.API/HwProj.APIGateway.API.csproj"
31+
],
32+
"isBackground": true,
33+
"presentation": {
34+
"reveal": "always",
35+
"panel": "new",
36+
"clear": false
37+
},
38+
"problemMatcher": {
39+
"owner": "aspnetcore",
40+
"pattern": [{ "regexp": ".+" }],
41+
"background": {
42+
"activeOnStart": true,
43+
"beginsPattern": ".+",
44+
"endsPattern": "Now listening on:|Application started\\."
45+
}
46+
}
47+
},
48+
{
49+
"label": "Start AuthService.API",
50+
"type": "process",
51+
"command": "dotnet",
52+
"args": [
53+
"run",
54+
"--project",
55+
"${workspaceFolder}/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj"
56+
],
57+
"isBackground": true,
58+
"presentation": {
59+
"reveal": "always",
60+
"panel": "new",
61+
"clear": false
62+
},
63+
"problemMatcher": {
64+
"owner": "aspnetcore",
65+
"pattern": [{ "regexp": ".+" }],
66+
"background": {
67+
"activeOnStart": true,
68+
"beginsPattern": ".+",
69+
"endsPattern": "Now listening on:|Application started\\."
70+
}
71+
}
72+
},
73+
{
74+
"label": "Start CoursesService.API",
75+
"type": "process",
76+
"command": "dotnet",
77+
"args": [
78+
"run",
79+
"--project",
80+
"${workspaceFolder}/HwProj.CoursesService/HwProj.CoursesService.API/HwProj.CoursesService.API.csproj"
81+
],
82+
"isBackground": true,
83+
"presentation": {
84+
"reveal": "always",
85+
"panel": "new",
86+
"clear": false
87+
},
88+
"problemMatcher": {
89+
"owner": "aspnetcore",
90+
"pattern": [{ "regexp": ".+" }],
91+
"background": {
92+
"activeOnStart": true,
93+
"beginsPattern": ".+",
94+
"endsPattern": "Now listening on:|Application started\\."
95+
}
96+
}
97+
},
98+
{
99+
"label": "Start SolutionsService.API",
100+
"type": "process",
101+
"command": "dotnet",
102+
"args": [
103+
"run",
104+
"--project",
105+
"${workspaceFolder}/HwProj.SolutionsService/HwProj.SolutionsService.API/HwProj.SolutionsService.API.csproj"
106+
],
107+
"isBackground": true,
108+
"presentation": {
109+
"reveal": "always",
110+
"panel": "new",
111+
"clear": false
112+
},
113+
"problemMatcher": {
114+
"owner": "aspnetcore",
115+
"pattern": [{ "regexp": ".+" }],
116+
"background": {
117+
"activeOnStart": true,
118+
"beginsPattern": ".+",
119+
"endsPattern": "Now listening on:|Application started\\."
120+
}
121+
}
122+
},
123+
{
124+
"label": "Start NotificationsService.API",
125+
"type": "process",
126+
"command": "dotnet",
127+
"args": [
128+
"run",
129+
"--project",
130+
"${workspaceFolder}/HwProj.NotificationsService/HwProj.NotificationsService.API/HwProj.NotificationsService.API.csproj"
131+
],
132+
"isBackground": true,
133+
"presentation": {
134+
"reveal": "always",
135+
"panel": "new",
136+
"clear": false
137+
},
138+
"problemMatcher": {
139+
"owner": "aspnetcore",
140+
"pattern": [{ "regexp": ".+" }],
141+
"background": {
142+
"activeOnStart": true,
143+
"beginsPattern": ".+",
144+
"endsPattern": "Now listening on:|Application started\\."
145+
}
146+
}
147+
},
148+
{
149+
"label": "Start ContentService.API",
150+
"type": "process",
151+
"command": "dotnet",
152+
"args": [
153+
"run",
154+
"--project",
155+
"${workspaceFolder}/HwProj.ContentService/HwProj.ContentService.API/HwProj.ContentService.API.csproj"
156+
],
157+
"isBackground": true,
158+
"presentation": {
159+
"reveal": "always",
160+
"panel": "new",
161+
"clear": false
162+
},
163+
"problemMatcher": {
164+
"owner": "aspnetcore",
165+
"pattern": [{ "regexp": ".+" }],
166+
"background": {
167+
"activeOnStart": true,
168+
"beginsPattern": ".+",
169+
"endsPattern": "Now listening on:|Application started\\."
170+
}
171+
}
172+
},
173+
{
174+
"label": "Start Frontend",
175+
"type": "process",
176+
"command": "npm",
177+
"args": ["run", "dev"],
178+
"options": {
179+
"cwd": "${workspaceFolder}/hwproj.front"
180+
},
181+
"isBackground": true,
182+
"presentation": {
183+
"reveal": "always",
184+
"panel": "new",
185+
"clear": false
186+
},
187+
"problemMatcher": {
188+
"owner": "vite",
189+
"pattern": [{ "regexp": ".+" }],
190+
"background": {
191+
"activeOnStart": true,
192+
"beginsPattern": ".+",
193+
"endsPattern": "Local:|ready in"
194+
}
195+
}
196+
}
197+
]
198+
}

HwProj.APIGateway/HwProj.APIGateway.API/Controllers/CourseGroupsController.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,6 @@ public async Task<IActionResult> AddStudentInGroup(long courseId, long groupId,
7474
return Ok();
7575
}
7676

77-
[HttpPost("{courseId}/removeStudentFromGroup/{groupId}")]
78-
[Authorize(Roles = Roles.LecturerRole)]
79-
public async Task<IActionResult> RemoveStudentFromGroup(long courseId, long groupId, [FromQuery] string userId)
80-
{
81-
await _coursesClient.RemoveStudentFromGroup(courseId, groupId, userId);
82-
return Ok();
83-
}
84-
8577
[HttpGet("get/{groupId}")]
8678
[ProducesResponseType(typeof(GroupViewModel), (int)HttpStatusCode.OK)]
8779
public async Task<IActionResult> GetGroup(long groupId)

HwProj.APIGateway/HwProj.APIGateway.API/Controllers/CoursesController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public async Task<IActionResult> EditMentorWorkspace(
243243
return BadRequest("Пользователь с такой почтой не является преподавателем или экспертом");
244244

245245
var courseFilterModel = _mapper.Map<CreateCourseFilterDTO>(editMentorWorkspaceDto);
246-
courseFilterModel.UserId = mentorId;
246+
courseFilterModel.Id = mentorId;
247247

248248
var courseFilterCreationResult =
249249
await _coursesClient.CreateOrUpdateCourseFilter(courseId, courseFilterModel);
@@ -308,6 +308,7 @@ private async Task<CourseViewModel> ToCourseViewModel(CourseDTO course)
308308
AcceptedStudents = acceptedStudents.ToArray(),
309309
NewStudents = newStudents.ToArray(),
310310
Homeworks = course.Homeworks,
311+
Groups = course.Groups,
311312
IsCompleted = course.IsCompleted,
312313
IsOpen = course.IsOpen
313314
};

HwProj.APIGateway/HwProj.APIGateway.API/Controllers/SolutionsController.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using HwProj.APIGateway.API.Models.Solutions;
88
using HwProj.AuthService.Client;
99
using HwProj.CoursesService.Client;
10-
using HwProj.Models.AuthService.DTO;
1110
using HwProj.Models.CoursesService;
1211
using HwProj.Models.CoursesService.DTO;
1312
using HwProj.Models.CoursesService.ViewModels;
@@ -38,7 +37,7 @@ public SolutionsController(ISolutionsServiceClient solutionsClient, IAuthService
3837
}
3938

4039
[HttpGet("{solutionId}")]
41-
[ProducesResponseType(typeof(Solution), (int)HttpStatusCode.OK)]
40+
[ProducesResponseType(typeof(SolutionDto), (int)HttpStatusCode.OK)]
4241
public async Task<IActionResult> GetSolutionById(long solutionId)
4342
{
4443
var result = await _solutionsClient.GetSolutionById(solutionId);
@@ -78,7 +77,7 @@ public async Task<IActionResult> GetStudentSolution(long taskId, string studentI
7877

7978
var mentorIds = studentSolutions.Values
8079
.SelectMany(t => t.Tasks)
81-
.SelectMany(t => t.Solution)
80+
.SelectMany(t => t.Solutions)
8281
.Select(t => t.LecturerId ?? "")
8382
.Where(x => x != "")
8483
.Distinct()
@@ -88,7 +87,7 @@ public async Task<IActionResult> GetStudentSolution(long taskId, string studentI
8887

8988
var solutionsGroupsIds = studentSolutions.Values
9089
.SelectMany(t => t.Tasks)
91-
.First(x => x.Id == taskId).Solution
90+
.First(x => x.Id == taskId).Solutions
9291
.Select(s => s.GroupId)
9392
.Distinct()
9493
.ToList();
@@ -120,7 +119,7 @@ public async Task<IActionResult> GetStudentSolution(long taskId, string studentI
120119
Title = task.Title,
121120
Tags = task.Tags,
122121
TaskId = task.Id.ToString(),
123-
Solutions = t.Solution.Select(s => new GetSolutionModel(s,
122+
Solutions = t.Solutions.Select(s => new GetSolutionModel(s,
124123
s.TaskId == taskId && s.GroupId is { } groupId
125124
? solutionsGroups[groupId].StudentsIds
126125
.Select(x => accountsCache[x])

HwProj.APIGateway/HwProj.APIGateway.API/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ COPY ["Directory.Build.props", "Directory.Build.props"]
66
COPY ["HwProj.APIGateway/HwProj.APIGateway.API/", "HwProj.APIGateway/HwProj.APIGateway.API/"]
77
COPY ["HwProj.NotificationsService/HwProj.NotificationsService.Client/", "HwProj.NotificationsService/HwProj.NotificationsService.Client/"]
88
COPY ["HwProj.Common/HwProj.Models/", "HwProj.Common/HwProj.Models/"]
9-
COPY ["HwProj.Common/HwProj.Repositories/", "HwProj.Common/HwProj.Repositories/"]
109
COPY ["HwProj.Common/HwProj.HttpUtils/", "HwProj.Common/HwProj.HttpUtils/"]
1110
COPY ["HwProj.Common/HwProj.Utils/", "HwProj.Common/HwProj.Utils/"]
1211
COPY ["HwProj.EventBus/HwProj.EventBus.Client/", "HwProj.EventBus/HwProj.EventBus.Client/"]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using HwProj.Models.AuthService.DTO;
4-
using HwProj.Models.StatisticsService;
4+
using HwProj.Models.SolutionsService;
55

66
namespace HwProj.APIGateway.API.Models.Statistics;
77

@@ -11,5 +11,5 @@ public class StatisticsCourseMatesModel
1111
public string Name { get; set; }
1212
public string Surname { get; set; }
1313
public AccountDataDto[] Reviewers { get; set; } = Array.Empty<AccountDataDto>();
14-
public List<StatisticsCourseHomeworksModel> Homeworks { get; set; } = new();
14+
public List<StudentSolutionsTableHomeworkDto> Homeworks { get; set; } = new();
1515
}

HwProj.AuthService/HwProj.AuthService.API/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ COPY ["Directory.Build.props", "Directory.Build.props"]
66
COPY ["HwProj.AuthService/HwProj.AuthService.API/", "HwProj.AuthService/HwProj.AuthService.API/"]
77
COPY ["HwProj.Common/HwProj.Common.Net8/", "HwProj.Common/HwProj.Common.Net8/"]
88
COPY ["HwProj.Common/HwProj.Models/", "HwProj.Common/HwProj.Models/"]
9-
COPY ["HwProj.Common/HwProj.Repositories/", "HwProj.Common/HwProj.Repositories/"]
109
COPY ["HwProj.Common/HwProj.Repositories.Net8/", "HwProj.Common/HwProj.Repositories.Net8/"]
1110
COPY ["HwProj.EventBus/HwProj.EventBus.Client/", "HwProj.EventBus/HwProj.EventBus.Client/"]
1211
COPY ["HwProj.NotificationsService/HwProj.NotificationService.Events/", "HwProj.NotificationsService/HwProj.NotificationService.Events/"]

HwProj.AuthService/HwProj.AuthService.API/RoleInitializer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static async Task InitializeAsync(UserManager<User> userManager, RoleMana
3838
var admin = new User {
3939
Email = email,
4040
Name = "Admin",
41+
Surname = "Adminov",
4142
UserName = "Admin"
4243
};
4344

0 commit comments

Comments
 (0)