Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Paysafe Interns Valentin-Martin
Student Managment
tsvetina-kalcheva-student-management-2023
Commits
05429a8b
Commit
05429a8b
authored
1 year ago
by
Tsvetina Kalcheva
Browse files
Options
Download
Email Patches
Plain Diff
Added new classes for Angular
parent
2f0bcc3b
No related merge requests found
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
cli/src/main/java/org/api/admin/AdminInitializer.java
+2
-0
cli/src/main/java/org/api/admin/AdminInitializer.java
cli/src/main/java/org/api/config/BeanConfiguration.java
+17
-0
cli/src/main/java/org/api/config/BeanConfiguration.java
cli/src/main/java/org/api/config/SecurityConfig.java
+25
-4
cli/src/main/java/org/api/config/SecurityConfig.java
cli/src/main/java/org/api/controllers/CourseRestController.java
+103
-33
...c/main/java/org/api/controllers/CourseRestController.java
cli/src/main/java/org/api/controllers/UserRestController.java
+34
-15
...src/main/java/org/api/controllers/UserRestController.java
cli/src/main/java/org/api/util/JwtUtil.java
+10
-0
cli/src/main/java/org/api/util/JwtUtil.java
cli/src/main/resources/application.yml
+3
-3
cli/src/main/resources/application.yml
core/src/main/java/org/service/AdministratorService.java
+31
-27
core/src/main/java/org/service/AdministratorService.java
core/src/main/java/org/service/CourseService.java
+12
-1
core/src/main/java/org/service/CourseService.java
core/src/main/java/org/service/UserService.java
+41
-0
core/src/main/java/org/service/UserService.java
data/src/main/java/org/data/CourseRepository.java
+8
-0
data/src/main/java/org/data/CourseRepository.java
entities/src/main/java/dto/CourseAverageGradeDTO.java
+9
-0
entities/src/main/java/dto/CourseAverageGradeDTO.java
entities/src/main/java/org/entity/Course.java
+2
-2
entities/src/main/java/org/entity/Course.java
entities/src/main/java/org/entity/Student.java
+3
-0
entities/src/main/java/org/entity/Student.java
entities/src/main/java/org/entity/Teacher.java
+4
-1
entities/src/main/java/org/entity/Teacher.java
entities/src/main/java/org/entity/admin/Administrator.java
+12
-0
entities/src/main/java/org/entity/admin/Administrator.java
entities/src/main/java/requests/AddGradeToStudentRequest.java
+40
-0
...ties/src/main/java/requests/AddGradeToStudentRequest.java
entities/src/main/java/requests/AddStudentRequest.java
+30
-0
entities/src/main/java/requests/AddStudentRequest.java
entities/src/main/java/requests/AddTeacherRequest.java
+30
-0
entities/src/main/java/requests/AddTeacherRequest.java
entities/src/main/java/requests/ChangeRoleRequest.java
+42
-0
entities/src/main/java/requests/ChangeRoleRequest.java
with
458 additions
and
86 deletions
+458
-86
cli/src/main/java/org/api/admin/AdminInitializer.java
+
2
-
0
View file @
05429a8b
...
...
@@ -14,6 +14,7 @@ public class AdminInitializer implements ApplicationListener<ApplicationReadyEve
private
final
PasswordEncoder
passwordEncoder
;
private
final
String
ADMIN_USERNAME
=
"admin"
;
private
final
String
ADMIN_PASSWORD
=
"admin12345"
;
private
final
String
ADMIN_NAME
=
"Tsvetina"
;
@Autowired
public
AdminInitializer
(
AdministratorService
administratorService
,
PasswordEncoder
passwordEncoder
)
{
...
...
@@ -27,6 +28,7 @@ public class AdminInitializer implements ApplicationListener<ApplicationReadyEve
Administrator
admin
=
new
Administrator
();
admin
.
setUsername
(
ADMIN_USERNAME
);
admin
.
setPassword
(
passwordEncoder
.
encode
(
ADMIN_PASSWORD
));
admin
.
setName
(
ADMIN_NAME
);
administratorService
.
saveAdmin
(
admin
);
}
}
...
...
This diff is collapsed.
Click to expand it.
cli/src/main/java/org/api/config/BeanConfiguration.java
+
17
-
0
View file @
05429a8b
...
...
@@ -6,6 +6,11 @@ import org.springframework.security.authentication.AuthenticationManager;
import
org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.CorsConfigurationSource
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
java.util.Arrays
;
@Configuration
public
class
BeanConfiguration
{
...
...
@@ -17,4 +22,16 @@ public class BeanConfiguration {
public
AuthenticationManager
authenticationManager
(
AuthenticationConfiguration
authenticationConfiguration
)
throws
Exception
{
return
authenticationConfiguration
.
getAuthenticationManager
();
}
/* @Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Arrays.asList("http://localhost:4200")); // Add your frontend origin
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE"));
configuration.setAllowCredentials(true);
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
return source;
}*/
}
This diff is collapsed.
Click to expand it.
cli/src/main/java/org/api/config/SecurityConfig.java
+
25
-
4
View file @
05429a8b
...
...
@@ -11,6 +11,11 @@ import org.springframework.security.config.annotation.web.configurers.AbstractHt
import
org.springframework.security.config.http.SessionCreationPolicy
;
import
org.springframework.security.web.SecurityFilterChain
;
import
org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.CorsConfigurationSource
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
static
org
.
springframework
.
security
.
config
.
Customizer
.
withDefaults
;
@Configuration
...
...
@@ -25,17 +30,25 @@ public class SecurityConfig {
@Bean
public
SecurityFilterChain
filterChain
(
HttpSecurity
http
)
throws
Exception
{
http
.
csrf
(
AbstractHttpConfigurer:
:
disable
)
http
.
csrf
(
AbstractHttpConfigurer:
:
disable
)
.
cors
(
withDefaults
())
.
authorizeHttpRequests
(
config
->
config
.
requestMatchers
(
"api/v1/courses/{studentId}/average-student"
,
"api/v1/courses/{courseId}/average-course"
,
"api/v1/courses/{courseName}/average-course"
,
//grouped-students
"api/v1/courses/grouped-students"
,
"api/v1/courses/all"
).
hasAuthority
(
Role
.
STUDENT
.
name
())
.
requestMatchers
(
"api/v1/courses/add-student"
,
"api/v1/courses/add-grade-to-student"
,
"api/v1/courses/grouped-students"
).
hasAuthority
(
Role
.
TEACHER
.
name
())
.
requestMatchers
(
"api/v1/courses/**"
,
"api/v1/user/change-role"
).
hasAuthority
(
Role
.
ADMIN
.
name
())
"api/v1/courses/grouped-students"
,
"api/v1/courses/show-with-teachers"
,
"api/v1/courses/{courseName}/average-course"
,
"api/v1/courses/{teacherId}/info"
).
hasAuthority
(
Role
.
TEACHER
.
name
())
.
requestMatchers
(
"api/v1/courses/**"
,
"api/v1/user/change-role"
,
"api/v1/courses/remove-teacher"
).
hasAuthority
(
Role
.
ADMIN
.
name
())
.
requestMatchers
(
"api/v1/user/logout"
).
authenticated
()
.
requestMatchers
(
"api/v1/user/register**"
,
"api/v1/user/login"
).
anonymous
()
.
anyRequest
().
denyAll
()
...
...
@@ -45,4 +58,12 @@ public class SecurityConfig {
return
http
.
build
();
}
@Bean
public
CorsConfigurationSource
corsConfigurationSource
()
{
CorsConfiguration
configuration
=
new
CorsConfiguration
();
configuration
.
applyPermitDefaultValues
();
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
source
.
registerCorsConfiguration
(
"/**"
,
configuration
);
return
source
;
}
}
This diff is collapsed.
Click to expand it.
cli/src/main/java/org/api/controllers/CourseRestController.java
+
103
-
33
View file @
05429a8b
...
...
@@ -3,23 +3,26 @@ package org.api.controllers;
import
dto.CourseAverageGradeDTO
;
import
dto.CourseDTO
;
import
dto.CourseInfoDTO
;
import
org.data.GradeRepository
;
import
org.entity.Course
;
import
org.entity.Grade
;
import
org.entity.Student
;
import
org.entity.Teacher
;
import
org.service.CourseService
;
import
org.service.GradeService
;
import
org.service.StudentService
;
import
org.service.TeacherService
;
import
org.service.exceptions.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
requests.CourseRequest
;
import
requests.*
;
import
responses.CourseAvgResponse
;
import
responses.CourseInfoResponse
;
import
responses.StudentAvgResponse
;
import
responses.TeacherInfoResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@RestController
...
...
@@ -27,68 +30,96 @@ import java.util.stream.Collectors;
public
class
CourseRestController
{
private
final
CourseService
courseService
;
private
final
StudentService
studentService
;
private
final
GradeRepository
gradeRepository
;
private
final
GradeService
gradeService
;
private
final
TeacherService
teacherService
;
@Autowired
public
CourseRestController
(
CourseService
courseService
,
StudentService
studentService
,
Grade
Repository
gradeRepository
)
{
public
CourseRestController
(
CourseService
courseService
,
StudentService
studentService
,
Grade
Service
gradeService
,
TeacherService
teacherService
)
{
this
.
courseService
=
courseService
;
this
.
studentService
=
studentService
;
this
.
gradeRepository
=
gradeRepository
;
this
.
gradeService
=
gradeService
;
this
.
teacherService
=
teacherService
;
}
@PostMapping
(
"add"
)
@PostMapping
(
"add
-course
"
)
public
ResponseEntity
<
String
>
createCourse
(
@RequestBody
CourseRequest
courseRequest
)
throws
ObjectAlreadyExistsException
,
IllegalArgumentException
{
throws
ObjectAlreadyExistsException
,
IllegalArgumentException
{
courseService
.
addCourse
(
courseRequest
.
getName
(),
courseRequest
.
getHours
());
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
"Course added successfully"
);
}
@PostMapping
(
"add-teacher"
)
public
ResponseEntity
<
String
>
addTeacherToCourse
(
@RequestParam
Long
teacherId
,
@RequestParam
Long
courseId
)
throws
CourseNotFoundException
,
TeacherNotFoundException
{
courseService
.
addTeacherToCourse
(
teacherId
,
courseId
);
public
ResponseEntity
<
String
>
addTeacherToCourse
(
@RequestBody
AddTeacherRequest
request
/* @RequestParam Long teacherId, @RequestParam Long courseId*/
)
throws
CourseNotFoundException
,
TeacherNotFoundException
{
Optional
<
Teacher
>
teacher
=
teacherService
.
findByUsername
(
request
.
getTeacherName
());
Optional
<
Course
>
course
=
courseService
.
findCourseByName
(
request
.
getCourseName
());
courseService
.
addTeacherToCourse
(
teacher
.
get
().
getId
(),
course
.
get
().
getId
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
"Teacher added to course successfully!"
);
}
@
Delete
Mapping
(
"teacher"
)
public
ResponseEntity
<
String
>
removeTeacherFromCourse
(
@Request
Param
Long
t
eacher
Id
,
@
Request
Param
Long
courseId
)
throws
@
Post
Mapping
(
"
remove-
teacher"
)
public
ResponseEntity
<
String
>
removeTeacherFromCourse
(
@Request
Body
RemoveT
eacherRequest
request
)
throws
TeacherNotFoundException
,
CourseNotFoundException
,
NoTeacherForCourseException
,
TeacherMismatchException
{
courseService
.
removeTeacherFromCourse
(
teacherId
,
courseId
);
Optional
<
Teacher
>
teacher
=
teacherService
.
findByUsername
(
request
.
getTeacherName
());
Optional
<
Course
>
course
=
courseService
.
findCourseByName
(
request
.
getCourseName
());
courseService
.
removeTeacherFromCourse
(
teacher
.
get
().
getId
(),
course
.
get
().
getId
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
"Teacher removed from course successfully!"
);
}
@PostMapping
(
"add-student"
)
public
ResponseEntity
<
String
>
addStudentToCourse
(
@Request
Param
Long
s
tudent
Id
,
@
Request
Param
Long
courseId
)
throws
public
ResponseEntity
<
String
>
addStudentToCourse
(
@Request
Body
AddS
tudentRequest
request
)
throws
StudentNotFoundException
,
CourseNotFoundException
,
StudentAlreadyEnrolledException
{
courseService
.
addStudentToCourse
(
studentId
,
courseId
);
Optional
<
Student
>
student
=
studentService
.
findByUsername
(
request
.
getStudentName
());
Optional
<
Course
>
course
=
courseService
.
findCourseByName
(
request
.
getCourseName
());
courseService
.
addStudentToCourse
(
student
.
get
().
getId
(),
course
.
get
().
getId
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
"Student added to course successfully!"
);
}
@PostMapping
(
"add-grade-to-student"
)
public
ResponseEntity
<
String
>
addGradeToStudentInCourse
(
@RequestParam
Long
studentId
,
@RequestParam
Long
courseId
,
@RequestParam
double
grade
)
throws
public
ResponseEntity
<
String
>
addGradeToStudentInCourse
(
@RequestBody
AddGradeToStudentRequest
request
)
throws
StudentNotFoundException
,
CourseNotFoundException
,
StudentNotEnrolledException
,
IllegalArgumentException
{
courseService
.
addGradeToStudentInCourse
(
studentId
,
courseId
,
grade
);
Optional
<
Student
>
student
=
studentService
.
findByUsername
(
request
.
getStudentName
());
Optional
<
Course
>
course
=
courseService
.
findCourseByName
(
request
.
getCourseName
());
courseService
.
addGradeToStudentInCourse
(
student
.
get
().
getId
(),
course
.
get
().
getId
(),
request
.
getGrade
());
return
ResponseEntity
.
ok
(
"Grade added to student in course successfully!"
);
}
@GetMapping
(
"grouped-students"
)
public
ResponseEntity
<
List
<
CourseAverageGradeDTO
>>
getAllStudentsGroupedByCourseAlphabeticallyAndByAverageGrade
()
{
List
<
CourseAverageGradeDTO
>
result
=
courseService
.
getAllStudentsGroupedByCourseAlphabeticallyAndByAverageGrade
()
.
entrySet
()
Map
<
String
,
Map
<
String
,
Double
>>
groupedStudents
=
courseService
.
getAllStudentsGroupedByCourseAlphabeticallyAndByAverageGrade
()
;
List
<
CourseAverageGradeDTO
>
result
=
groupedStudents
.
entrySet
()
.
stream
()
.
map
(
entry
->
{
CourseAverageGradeDTO
dto
=
new
CourseAverageGradeDTO
();
dto
.
setCourseName
(
entry
.
getKey
());
dto
.
setStudentGradesMap
(
entry
.
getValue
());
String
courseName
=
entry
.
getKey
();
String
teacherName
=
getTeacherNameForCourse
(
courseName
);
dto
.
setTeacherName
(
teacherName
);
return
dto
;
})
.
collect
(
Collectors
.
toList
());
return
ResponseEntity
.
ok
(
result
);
}
private
String
getTeacherNameForCourse
(
String
courseName
)
{
Optional
<
Course
>
course
=
courseService
.
findCourseByName
(
courseName
);
if
(
course
.
isPresent
())
{
Teacher
teacher
=
course
.
get
().
getTeacher
();
if
(
teacher
!=
null
)
{
return
teacher
.
getName
();
}
}
return
"No teacher"
;
}
@GetMapping
(
"all"
)
public
ResponseEntity
<
List
<
CourseInfoDTO
>>
showAllCoursesWithTeachersAndStudents
()
{
List
<
Course
>
courses
=
courseService
.
findAll
();
...
...
@@ -103,7 +134,7 @@ public class CourseRestController {
dto
.
setTeacherName
(
"No teacher has been added for this course"
);
dto
.
setTeacherDegree
(
""
);
}
Set
<
Student
>
students
=
grade
Repository
.
findByCourseId
(
course
.
getId
())
Set
<
Student
>
students
=
grade
Service
.
findByCourseId
(
course
.
getId
())
.
stream
()
.
map
(
Grade:
:
getStudent
)
.
collect
(
Collectors
.
toSet
());
...
...
@@ -116,19 +147,58 @@ public class CourseRestController {
return
ResponseEntity
.
ok
(
courseInfoDTOs
);
}
@GetMapping
(
"{courseId}/average-course"
)
public
ResponseEntity
<
String
>
getAverageGradeForCourse
(
@PathVariable
Long
courseId
)
throws
CourseNotFoundException
{
Course
course
=
courseService
.
existsById
(
courseId
).
get
();
double
averageGrade
=
courseService
.
getAverageGradeForCourse
(
courseId
);
return
ResponseEntity
.
ok
(
String
.
format
(
"For the course %s, the GPA is %.2f"
,
course
.
getName
(),
averageGrade
));
@GetMapping
(
"show-with-teachers"
)
public
ResponseEntity
<
List
<
CourseInfoResponse
>>
showAllCoursesWithTeachers
()
{
List
<
Course
>
courses
=
courseService
.
findAll
();
List
<
CourseInfoResponse
>
courseInfoDTOs
=
new
ArrayList
<>();
for
(
Course
course
:
courses
)
{
CourseInfoResponse
dto
=
new
CourseInfoResponse
();
dto
.
setCourseName
(
course
.
getName
());
if
(
course
.
getTeacher
()
!=
null
)
{
dto
.
setTeacherName
(
course
.
getTeacher
().
getName
());
}
else
{
dto
.
setTeacherName
(
"No teacher has been added for this course"
);
}
courseInfoDTOs
.
add
(
dto
);
}
return
ResponseEntity
.
ok
(
courseInfoDTOs
);
}
@GetMapping
(
"{studentId}/average-student"
)
public
ResponseEntity
<
St
ring
>
getAverageGradeForStudent
(
@PathVariable
Long
studentId
)
throws
StudentNotFoundException
{
public
ResponseEntity
<
St
udentAvgResponse
>
getAverageGradeForStudent
(
@PathVariable
Long
studentId
)
throws
StudentNotFoundException
{
Student
student
=
studentService
.
existsById
(
studentId
).
get
();
double
averageGrade
=
courseService
.
getTotalAverageGradeForStudent
(
studentId
);
return
ResponseEntity
.
ok
(
String
.
format
(
"Student %s has a GPA of %.2f"
,
student
.
getName
(),
averageGrade
));
StudentAvgResponse
response
=
new
StudentAvgResponse
();
response
.
setName
(
student
.
getName
());
response
.
setGrade
(
averageGrade
);
// return ResponseEntity.ok(String.format("Student %s has a GPA of %.2f", student.getName(), averageGrade));
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
response
);
}
@GetMapping
(
"{teacherId}/info"
)
public
ResponseEntity
<
TeacherInfoResponse
>
getInfoForTeacher
(
@PathVariable
Long
teacherId
)
throws
StudentNotFoundException
{
Optional
<
Teacher
>
teacher
=
teacherService
.
existsById
(
teacherId
);
List
<
String
>
courseNames
=
courseService
.
getCourseNamesByTeacherId
(
teacherId
);
TeacherInfoResponse
response
=
new
TeacherInfoResponse
();
response
.
setName
(
teacher
.
get
().
getName
());
response
.
setDegree
(
teacher
.
get
().
getDegree
());
response
.
setCourses
(
courseNames
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
response
);
}
@GetMapping
(
"{courseName}/average-course"
)
public
ResponseEntity
<
CourseAvgResponse
>
getAverageGradeForCourse
(
@PathVariable
String
courseName
)
throws
CourseNotFoundException
{
Optional
<
Course
>
course
=
courseService
.
findCourseByName
(
courseName
);
CourseAvgResponse
response
=
new
CourseAvgResponse
();
response
.
setName
(
course
.
get
().
getName
());
double
averageGrade
=
courseService
.
getAverageGradeForCourse
(
course
.
get
().
getId
());
response
.
setGrade
(
averageGrade
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
response
);
}
@GetMapping
(
"search/{name}"
)
public
ResponseEntity
<
CourseDTO
>
findCourseByName
(
@PathVariable
(
name
=
"name"
)
String
courseName
)
{
Optional
<
Course
>
optionalCourse
=
courseService
.
findCourseByName
(
courseName
);
...
...
This diff is collapsed.
Click to expand it.
cli/src/main/java/org/api/controllers/UserRestController.java
+
34
-
15
View file @
05429a8b
...
...
@@ -12,18 +12,26 @@ import org.springframework.http.HttpStatus;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.authentication.AuthenticationManager
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.web.bind.annotation.*
;
import
requests.ChangeRoleRequest
;
import
requests.LoginRequest
;
import
requests.StudentRequest
;
import
requests.TeacherRequest
;
import
responses.AuthenticationResponse
;
import
responses.StudentCreatedResponse
;
import
responses.TeacherCreatedResponse
;
import
responses.TokenResponse
;
import
java.util.Collection
;
import
java.util.Optional
;
@RestController
@RequestMapping
(
"api/v1/user"
)
@CrossOrigin
(
"http://localhost:4200/"
)
//@CrossOrigin("*")
public
class
UserRestController
{
private
final
UserService
userService
;
private
final
PasswordEncoder
passwordEncoder
;
...
...
@@ -44,22 +52,33 @@ public class UserRestController {
}
@PostMapping
(
"register-student"
)
public
ResponseEntity
<
St
ring
>
registerStudent
(
@RequestBody
StudentRequest
studentRequest
)
throws
IllegalArgumentException
,
ObjectAlreadyExistsException
{
public
ResponseEntity
<
St
udentCreatedResponse
>
registerStudent
(
@RequestBody
StudentRequest
studentRequest
)
throws
IllegalArgumentException
,
ObjectAlreadyExistsException
{
userService
.
createStudent
(
studentRequest
.
getUsername
(),
studentRequest
.
getPassword
(),
studentRequest
.
getName
(),
studentRequest
.
getAge
());
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
"Student added successfully"
);
StudentCreatedResponse
response
=
new
StudentCreatedResponse
();
response
.
setUsername
(
studentRequest
.
getUsername
());
response
.
setName
(
studentRequest
.
getName
());
response
.
setAge
(
studentRequest
.
getAge
());
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
response
);
}
@PostMapping
(
"register-teacher"
)
public
ResponseEntity
<
String
>
registerTeacher
(
@RequestBody
TeacherRequest
teacherRequest
)
public
ResponseEntity
<
TeacherCreatedResponse
>
registerTeacher
(
@RequestBody
TeacherRequest
teacherRequest
)
throws
ObjectAlreadyExistsException
,
IllegalArgumentException
{
userService
.
createTeacher
(
teacherRequest
.
getUsername
(),
teacherRequest
.
getPassword
(),
teacherRequest
.
getName
(),
teacherRequest
.
getDegree
());
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
"Teacher added successfully"
);
TeacherCreatedResponse
response
=
new
TeacherCreatedResponse
();
response
.
setUsername
(
teacherRequest
.
getUsername
());
response
.
setName
(
teacherRequest
.
getName
());
response
.
setDegree
(
teacherRequest
.
getDegree
());
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
response
);
}
@PostMapping
(
"login"
)
public
ResponseEntity
<
String
>
login
(
@RequestBody
LoginRequest
loginRequest
)
throws
IllegalArgumentException
,
ObjectAlreadyExistsException
{
public
ResponseEntity
<?>
login
(
@RequestBody
LoginRequest
loginRequest
)
throws
IllegalArgumentException
,
ObjectAlreadyExistsException
{
currentSessionService
.
deleteSession
();
authenticationManager
.
authenticate
(
new
UsernamePasswordAuthenticationToken
(
loginRequest
.
getUsername
(),
loginRequest
.
getPassword
())
new
UsernamePasswordAuthenticationToken
(
loginRequest
.
getUsername
(),
loginRequest
.
getPassword
())
);
UserDetails
userDetails
=
userService
...
...
@@ -68,13 +87,14 @@ public class UserRestController {
if
(
currentSessionService
.
hasSession
())
{
throw
new
AlreadyLoggedUserException
(
"There is already logged user and you cannot perform this action!"
);
}
String
roleName
=
userService
.
getRole
(
userDetails
.
getUsername
());
String
token
=
jwtUtil
.
generateToken
(
userDetails
.
getUsername
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"Authorization"
,
"Bearer "
+
token
)
.
body
(
"Login successful"
);
Long
userId
=
userService
.
getUserId
(
userDetails
.
getUsername
());
return
ResponseEntity
.
ok
(
new
TokenResponse
(
token
,
roleName
,
userId
));
}
@PostMapping
(
"/logout"
)
@PostMapping
(
"logout"
)
public
ResponseEntity
<?>
logout
()
{
if
(
currentSessionService
.
hasSession
())
{
currentSessionService
.
deleteSession
();
...
...
@@ -82,13 +102,12 @@ public class UserRestController {
}
return
ResponseEntity
.
ok
(
new
AuthenticationResponse
(
"No session!"
));
}
@PostMapping
(
"change-role"
)
public
ResponseEntity
<
String
>
changeRole
(
@Request
Param
String
username
,
@RequestParam
Role
role
)
{
public
ResponseEntity
<
String
>
changeRole
(
@Request
Body
ChangeRoleRequest
changeRoleRequest
)
{
Optional
<
UserDetails
>
userDetails
=
userService
.
getUserByUsername
(
u
sername
);
this
.
administratorService
.
changeUserRoles
(
username
,
role
);
.
getUserByUsername
(
changeRoleRequest
.
getU
sername
()
);
this
.
administratorService
.
changeUserRoles
(
changeRoleRequest
.
getUsername
(),
changeRoleRequest
.
getRole
(),
changeRoleRequest
.
getAdditionalParameter
()
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
"The role of user is changed successfully!"
);
}
//TokenResponse
}
This diff is collapsed.
Click to expand it.
cli/src/main/java/org/api/util/JwtUtil.java
+
10
-
0
View file @
05429a8b
...
...
@@ -7,11 +7,15 @@ import org.entity.CurrentSession;
import
org.service.CurrentSessionService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.stereotype.Component
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
@Component
public
class
JwtUtil
{
...
...
@@ -38,6 +42,12 @@ public class JwtUtil {
.
setExpiration
(
validity
)
.
signWith
(
SignatureAlgorithm
.
HS256
,
secret
)
.
compact
();
/* String token = Jwts.builder()
.setClaims(claims)
.setIssuedAt(now)
.setExpiration(validity)
.signWith(SignatureAlgorithm.HS256, secret)
.compact();*/
currentSessionService
.
saveToken
(
new
CurrentSession
(
token
,
true
));
return
token
;
}
...
...
This diff is collapsed.
Click to expand it.
cli/src/main/resources/application.yml
+
3
-
3
View file @
05429a8b
...
...
@@ -15,7 +15,7 @@ spring:
jwt
:
secret
:
your-secret-key
access-token-validity
:
3600000
# access-token-validity: 30000
access-token-validity
:
600000
# access-token-validity: 300000
# access-token-validity: 3600000
\ No newline at end of file
# access-token-validity: 600000
# access-token-validity: 300000
\ No newline at end of file
This diff is collapsed.
Click to expand it.
core/src/main/java/org/service/AdministratorService.java
+
31
-
27
View file @
05429a8b
...
...
@@ -49,60 +49,63 @@ public class AdministratorService {
administratorRepository
.
deleteById
(
admin
.
getId
());
}
public
void
changeUserRoles
(
String
username
,
Role
newRole
)
{
public
void
changeUserRoles
(
String
username
,
Role
newRole
,
String
additionalParameter
)
{
String
s
=
newRole
.
toString
().
toUpperCase
();
Optional
<
Student
>
studentOptional
=
studentService
.
findByUsername
(
username
);
Optional
<
Teacher
>
teacherOptional
=
teacherService
.
findByUsername
(
username
);
Optional
<
Administrator
>
administratorOptional
=
administratorRepository
.
findByUsername
(
username
);
if
(
newRole
==
Role
.
TEACHER
)
{
studentOptional
.
ifPresent
(
this
::
convertStudentToTeacher
);
administratorOptional
.
ifPresent
(
this
::
convertAdminToTeacher
);
}
else
if
(
newRole
==
Role
.
STUDENT
)
{
teacherOptional
.
ifPresent
(
this
::
convertTeacherToStudent
);
administratorOptional
.
ifPresent
(
this
::
convertAdminToStudent
);
}
else
if
(
newRole
==
Role
.
ADMIN
)
{
studentOptional
.
ifPresent
(
this
::
convertStudentToAdmin
);
teacherOptional
.
ifPresent
(
this
::
convertTeacherToAdmin
);
studentOptional
.
ifPresent
(
student
->
convertStudentToTeacher
(
student
,
additionalParameter
));
administratorOptional
.
ifPresent
(
administrator
->
convertAdminToTeacher
(
administrator
,
additionalParameter
));
}
else
if
(
newRole
==
Role
.
STUDENT
)
{
teacherOptional
.
ifPresent
(
teacher
->
convertTeacherToStudent
(
teacher
,
additionalParameter
));
administratorOptional
.
ifPresent
(
administrator
->
convertAdminToStudent
(
administrator
,
additionalParameter
));
}
else
if
(
newRole
==
Role
.
ADMIN
)
{
studentOptional
.
ifPresent
(
student
->
convertStudentToAdmin
(
student
,
additionalParameter
));
teacherOptional
.
ifPresent
(
teacher
->
convertTeacherToAdmin
(
teacher
,
additionalParameter
));
}
}
private
void
convertAdminToStudent
(
Administrator
administratorOptional
)
{
private
void
convertAdminToStudent
(
Administrator
administratorOptional
,
String
parameter
)
{
Administrator
administrator
=
administratorOptional
;
Student
student
=
new
Student
();
student
.
setUsername
(
administrator
.
getUsername
());
student
.
setPassword
(
administrator
.
getPassword
());
student
.
setName
(
"Default n
ame
"
);
student
.
setAge
(
25
);
student
.
setName
(
administratorOptional
.
getN
ame
()
);
student
.
setAge
(
Integer
.
parseInt
(
parameter
)
);
studentService
.
addStudent
(
student
);
deleteAndFlush
(
administrator
);
}
private
void
convertAdminToTeacher
(
Administrator
administratorOptional
)
{
private
void
convertAdminToTeacher
(
Administrator
administratorOptional
,
String
parameter
)
{
Administrator
administrator
=
administratorOptional
;
Teacher
teacher
=
new
Teacher
();
teacher
.
setUsername
(
administrator
.
getUsername
());
teacher
.
setPassword
(
administrator
.
getPassword
());
teacher
.
setName
(
"Default n
ame
"
);
teacher
.
setDegree
(
Degree
.
BSc
);
teacher
.
setName
(
administratorOptional
.
getN
ame
()
);
teacher
.
setDegree
(
Degree
.
valueOf
(
parameter
)
);
deleteAndFlush
(
administrator
);
teacherService
.
addTeacher
(
teacher
);
}
private
void
convertTeacherToAdmin
(
Teacher
teacherOptional
)
{
private
void
convertTeacherToAdmin
(
Teacher
teacherOptional
,
String
parameter
)
{
Teacher
teacher
=
teacherOptional
;
for
(
Course
course
:
teacher
.
getCourses
())
{
course
.
setTeacher
(
null
);
courseService
.
saveCourse
(
course
);
Administrator
administrator
=
new
Administrator
();
administrator
.
setUsername
(
teacher
.
getUsername
());
administrator
.
setPassword
(
teacher
.
getPassword
());
teacherService
.
deleteTeacher
(
teacher
);
administratorRepository
.
save
(
administrator
);
}
Administrator
administrator
=
new
Administrator
();
administrator
.
setUsername
(
teacher
.
getUsername
());
administrator
.
setPassword
(
teacher
.
getPassword
());
administrator
.
setName
(
teacher
.
getName
());
teacherService
.
deleteTeacher
(
teacher
);
administratorRepository
.
save
(
administrator
);
}
private
void
convertTeacherToStudent
(
Teacher
teacherOptional
)
{
private
void
convertTeacherToStudent
(
Teacher
teacherOptional
,
String
parameter
)
{
Teacher
teacher
=
teacherOptional
;
for
(
Course
course
:
teacher
.
getCourses
())
{
course
.
setTeacher
(
null
);
...
...
@@ -112,12 +115,12 @@ public class AdministratorService {
student
.
setUsername
(
teacher
.
getUsername
());
student
.
setPassword
(
teacher
.
getPassword
());
student
.
setName
(
teacher
.
getName
());
student
.
setAge
(
25
);
student
.
setAge
(
Integer
.
parseInt
(
parameter
)
);
studentService
.
addStudent
(
student
);
teacherService
.
deleteTeacher
(
teacher
);
}
private
void
convertStudentToTeacher
(
Student
studentOptional
)
{
private
void
convertStudentToTeacher
(
Student
studentOptional
,
String
parameter
)
{
Student
student
=
studentOptional
;
List
<
Grade
>
studentGrades
=
gradeService
.
findByStudentId
(
student
.
getId
());
for
(
Grade
grade
:
studentGrades
)
{
...
...
@@ -127,12 +130,12 @@ public class AdministratorService {
teacher
.
setUsername
(
student
.
getUsername
());
teacher
.
setPassword
(
student
.
getPassword
());
teacher
.
setName
(
student
.
getName
());
teacher
.
setDegree
(
Degree
.
BSc
);
teacher
.
setDegree
(
Degree
.
valueOf
(
parameter
)
);
studentService
.
deleteStudent
(
student
);
teacherService
.
addTeacher
(
teacher
);
}
private
void
convertStudentToAdmin
(
Student
studentOptional
)
{
private
void
convertStudentToAdmin
(
Student
studentOptional
,
String
parameter
)
{
Student
student
=
studentOptional
;
List
<
Grade
>
studentGrades
=
gradeService
.
findByStudentId
(
student
.
getId
());
for
(
Grade
grade
:
studentGrades
)
{
...
...
@@ -141,6 +144,7 @@ public class AdministratorService {
Administrator
administrator
=
new
Administrator
();
administrator
.
setUsername
(
student
.
getUsername
());
administrator
.
setPassword
(
student
.
getPassword
());
administrator
.
setName
(
student
.
getName
());
studentService
.
deleteStudent
(
student
);
administratorRepository
.
save
(
administrator
);
}
...
...
This diff is collapsed.
Click to expand it.
core/src/main/java/org/service/CourseService.java
+
12
-
1
View file @
05429a8b
...
...
@@ -50,6 +50,9 @@ public class CourseService {
throw
new
IllegalArgumentException
(
"Course already has e teacher"
);
}
course
.
get
().
setTeacher
(
teacher
.
get
());
HashSet
<
Course
>
courses
=
new
HashSet
<>();
courses
.
add
(
course
.
get
());
teacher
.
get
().
setCourses
(
courses
);
courseRepository
.
save
(
course
.
get
());
}
...
...
@@ -133,7 +136,7 @@ public class CourseService {
.
append
(
cours
.
getName
())
.
append
(
"\n"
)
.
append
(
"Teacher: "
)
.
append
(
cours
.
getTeacher
()
==
null
?
"No teacher
has been added for this course
"
.
append
(
cours
.
getTeacher
()
==
null
?
"No teacher"
:
cours
.
getTeacher
().
getName
())
.
append
(
" "
)
.
append
(
cours
.
getTeacher
()
==
null
?
" "
...
...
@@ -222,4 +225,12 @@ public class CourseService {
public
void
saveCourse
(
Course
course
)
{
courseRepository
.
saveAndFlush
(
course
);
}
public
List
<
Course
>
findCoursesByTeacherId
(
Long
teacherId
)
{
return
courseRepository
.
findByTeacherId
(
teacherId
);
}
public
List
<
String
>
getCourseNamesByTeacherId
(
Long
teacherId
)
{
return
courseRepository
.
findCourseNamesByTeacherId
(
teacherId
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
core/src/main/java/org/service/UserService.java
+
41
-
0
View file @
05429a8b
...
...
@@ -84,4 +84,45 @@ public class UserService implements UserDetailsService {
}
throw
new
UsernameNotFoundException
(
"User not found with username: "
+
username
);
}
public
String
getRole
(
String
username
){
Optional
<
Student
>
studentOptional
=
studentService
.
findByUsername
(
username
);
Optional
<
Teacher
>
teacherOptional
=
teacherService
.
findByUsername
(
username
);
Optional
<
Administrator
>
administratorOptional
=
administratorService
.
findByUsername
(
username
);
if
(
studentOptional
.
isPresent
())
{
Student
student
=
studentOptional
.
get
();
return
student
.
getRoleName
();
}
if
(
teacherOptional
.
isPresent
())
{
Teacher
teacher
=
teacherOptional
.
get
();
return
teacher
.
getRoleName
();
}
if
(
administratorOptional
.
isPresent
())
{
Administrator
administrator
=
administratorOptional
.
get
();
return
administrator
.
getRoleName
();
}
throw
new
UsernameNotFoundException
(
"User not found with username: "
+
username
);
}
public
Long
getUserId
(
String
username
)
{
Optional
<
Student
>
studentOptional
=
studentService
.
findByUsername
(
username
);
Optional
<
Teacher
>
teacherOptional
=
teacherService
.
findByUsername
(
username
);
Optional
<
Administrator
>
administratorOptional
=
administratorService
.
findByUsername
(
username
);
if
(
studentOptional
.
isPresent
())
{
Student
student
=
studentOptional
.
get
();
return
student
.
getId
();
}
if
(
teacherOptional
.
isPresent
())
{
Teacher
teacher
=
teacherOptional
.
get
();
return
teacher
.
getId
();
}
if
(
administratorOptional
.
isPresent
())
{
Administrator
administrator
=
administratorOptional
.
get
();
return
administrator
.
getId
();
}
throw
new
UsernameNotFoundException
(
"User not found with username: "
+
username
);
}
}
This diff is collapsed.
Click to expand it.
data/src/main/java/org/data/CourseRepository.java
+
8
-
0
View file @
05429a8b
...
...
@@ -2,6 +2,8 @@ package org.data;
import
org.entity.Course
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Optional
;
...
...
@@ -12,4 +14,10 @@ public interface CourseRepository extends JpaRepository<Course, Long> {
List
<
Course
>
findByGradesStudentId
(
Long
studentId
);
@Query
(
"SELECT c FROM Course c JOIN FETCH c.teacher WHERE c.teacher.id = :teacherId"
)
// @Query("SELECT c FROM Course c JOIN FETCH c.teacher t WHERE t.id = :teacherId")
List
<
Course
>
findByTeacherId
(
@Param
(
"teacherId"
)
Long
teacherId
);
@Query
(
"SELECT c.name FROM Course c WHERE c.teacher.id = :teacherId"
)
List
<
String
>
findCourseNamesByTeacherId
(
@Param
(
"teacherId"
)
Long
teacherId
);
}
This diff is collapsed.
Click to expand it.
entities/src/main/java/dto/CourseAverageGradeDTO.java
+
9
-
0
View file @
05429a8b
...
...
@@ -4,8 +4,17 @@ import java.util.Map;
public
class
CourseAverageGradeDTO
{
private
String
courseName
;
private
String
teacherName
;
private
Map
<
String
,
Double
>
studentGradesMap
;
public
String
getTeacherName
()
{
return
teacherName
;
}
public
void
setTeacherName
(
String
teacherName
)
{
this
.
teacherName
=
teacherName
;
}
public
String
getCourseName
()
{
return
courseName
;
}
...
...
This diff is collapsed.
Click to expand it.
entities/src/main/java/org/entity/Course.java
+
2
-
2
View file @
05429a8b
...
...
@@ -10,12 +10,12 @@ import java.util.List;
@Entity
@Table
(
name
=
"courses"
)
public
class
Course
extends
BaseEntity
{
@Column
(
name
=
"name"
,
nullable
=
false
)
@Column
(
name
=
"name"
)
private
String
name
;
@Column
(
name
=
"total_hours"
,
nullable
=
false
)
@Min
(
10
)
private
int
totalHours
;
@ManyToOne
(
cascade
=
CascadeType
.
ALL
)
@ManyToOne
(
cascade
=
CascadeType
.
ALL
,
fetch
=
FetchType
.
LAZY
)
@JoinColumn
(
name
=
"teacher_id"
,
referencedColumnName
=
"id"
)
private
Teacher
teacher
;
...
...
This diff is collapsed.
Click to expand it.
entities/src/main/java/org/entity/Student.java
+
3
-
0
View file @
05429a8b
...
...
@@ -49,4 +49,7 @@ public class Student extends SchoolUser {
public
void
setAge
(
int
age
)
{
this
.
age
=
age
;
}
public
String
getRoleName
()
{
return
"Student"
;
}
}
This diff is collapsed.
Click to expand it.
entities/src/main/java/org/entity/Teacher.java
+
4
-
1
View file @
05429a8b
...
...
@@ -20,7 +20,7 @@ public class Teacher extends SchoolUser {
@Enumerated
(
EnumType
.
STRING
)
private
Degree
degree
;
@OneToMany
(
mappedBy
=
"teacher"
,
fetch
=
FetchType
.
EAGER
)
@OneToMany
(
mappedBy
=
"teacher"
)
private
Set
<
Course
>
courses
;
public
Teacher
()
{
...
...
@@ -58,6 +58,9 @@ public class Teacher extends SchoolUser {
return
courses
;
}
public
String
getRoleName
()
{
return
"Teacher"
;
}
public
void
setCourses
(
Set
<
Course
>
courses
)
{
this
.
courses
=
courses
;
}
...
...
This diff is collapsed.
Click to expand it.
entities/src/main/java/org/entity/admin/Administrator.java
+
12
-
0
View file @
05429a8b
...
...
@@ -12,8 +12,20 @@ import java.util.List;
@Entity
@Table
(
name
=
"admins"
)
public
class
Administrator
extends
SchoolUser
{
private
String
name
;
@Override
public
Collection
<?
extends
GrantedAuthority
>
getAuthorities
()
{
return
List
.
of
(
Role
.
STUDENT
,
Role
.
TEACHER
,
Role
.
ADMIN
);
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getRoleName
()
{
return
"Administrator"
;
}
}
This diff is collapsed.
Click to expand it.
entities/src/main/java/requests/AddGradeToStudentRequest.java
0 → 100644
+
40
-
0
View file @
05429a8b
package
requests
;
public
class
AddGradeToStudentRequest
{
private
String
studentName
;
private
String
courseName
;
private
double
grade
;
public
AddGradeToStudentRequest
()
{
}
public
AddGradeToStudentRequest
(
String
studentName
,
String
courseName
,
double
grade
)
{
this
.
studentName
=
studentName
;
this
.
courseName
=
courseName
;
this
.
grade
=
grade
;
}
public
String
getStudentName
()
{
return
studentName
;
}
public
void
setStudentName
(
String
studentName
)
{
this
.
studentName
=
studentName
;
}
public
String
getCourseName
()
{
return
courseName
;
}
public
void
setCourseName
(
String
courseName
)
{
this
.
courseName
=
courseName
;
}
public
double
getGrade
()
{
return
grade
;
}
public
void
setGrade
(
double
grade
)
{
this
.
grade
=
grade
;
}
}
This diff is collapsed.
Click to expand it.
entities/src/main/java/requests/AddStudentRequest.java
0 → 100644
+
30
-
0
View file @
05429a8b
package
requests
;
public
class
AddStudentRequest
{
private
String
studentName
;
private
String
courseName
;
public
AddStudentRequest
()
{
}
public
AddStudentRequest
(
String
studentName
,
String
courseName
)
{
this
.
studentName
=
studentName
;
this
.
courseName
=
courseName
;
}
public
String
getStudentName
()
{
return
studentName
;
}
public
void
setStudentName
(
String
studentName
)
{
this
.
studentName
=
studentName
;
}
public
String
getCourseName
()
{
return
courseName
;
}
public
void
setCourseName
(
String
courseName
)
{
this
.
courseName
=
courseName
;
}
}
This diff is collapsed.
Click to expand it.
entities/src/main/java/requests/AddTeacherRequest.java
0 → 100644
+
30
-
0
View file @
05429a8b
package
requests
;
public
class
AddTeacherRequest
{
private
String
teacherName
;
private
String
courseName
;
public
AddTeacherRequest
()
{
}
public
AddTeacherRequest
(
String
teacherName
,
String
courseName
)
{
this
.
teacherName
=
teacherName
;
this
.
courseName
=
courseName
;
}
public
String
getTeacherName
()
{
return
teacherName
;
}
public
void
setTeacherName
(
String
teacherName
)
{
this
.
teacherName
=
teacherName
;
}
public
String
getCourseName
()
{
return
courseName
;
}
public
void
setCourseName
(
String
courseName
)
{
this
.
courseName
=
courseName
;
}
}
This diff is collapsed.
Click to expand it.
entities/src/main/java/requests/ChangeRoleRequest.java
0 → 100644
+
42
-
0
View file @
05429a8b
package
requests
;
import
org.entity.enums.Role
;
public
class
ChangeRoleRequest
{
private
String
username
;
private
Role
role
;
private
String
additionalParameter
;
public
ChangeRoleRequest
()
{
}
public
ChangeRoleRequest
(
String
username
,
Role
role
,
String
additionalParameter
)
{
this
.
username
=
username
;
this
.
role
=
role
;
this
.
additionalParameter
=
additionalParameter
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
Role
getRole
()
{
return
role
;
}
public
void
setRole
(
Role
role
)
{
this
.
role
=
role
;
}
public
String
getAdditionalParameter
()
{
return
additionalParameter
;
}
public
void
setAdditionalParameter
(
String
additionalParameter
)
{
this
.
additionalParameter
=
additionalParameter
;
}
}
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help